typeof NPObject

Benjamin Smedberg benjamin at smedbergs.us
Fri Feb 25 07:10:17 PST 2011

Ref: https://bugzilla.mozilla.org/show_bug.cgi?id=636446

In Firefox 4 we made a change per the ECMA 262 spec which says that any 
JS native object which implements [[Call]] should be typeof "function". 
Currently this means that *all* NPObjects end up typeof "function" 
instead of "object". This is not something we are likely to change for 
Firefox 4 at this point, but I'd like some opinions on what the correct 
behavior should be, so that we can standardize it. It seems to me that 
the most reasonable behavior is: if the object's NPClass has a function 
pointer for .invokeDefault, then we give it typeof "function". If 
NPClass.invokeDefault is null, then we give it typeof "object".

Does this sound reasonable? I haven't checked what other browser 
currently implement.


More information about the plugin-futures mailing list