> Currently ‘hop_typeof’ doesn’t work as expected for functions:
> 
> --8<---------------cut here---------------start------------->8---
> hop_typeof (function bar(){ return true; })
> => "object"
> --8<---------------cut here---------------end--------------->8---
> 
> This patch should fix it:
> 
> 
> diff -r 26d34667c401 share/hop-lib.js
> --- a/share/hop-lib.js        Mon Oct 07 16:12:16 2013 +0200
> +++ b/share/hop-lib.js        Tue Jan 07 15:44:38 2014 +0100
> @@@ -361,12 +361,16 @@@
>        if( obj instanceof RegExp ) {
>           return "regexp";
>        } else {
> +          if( obj instanceof Function ) {
> +              return "function";
> +          } else {
>           if( typeof obj.hop_typeof == "function" ) 
>              return obj.hop_typeof();
>           else
>              return "object";
>        }
>        }
> +      }
>     } else {
>        var tname = typeof obj;
> 
> OK to apply?
Absolutely. I have applied it. Thanks.

-- 
Manuel

Reply via email to