I am trying to fetch properties of javascript objects from within my NPAPI plugin, but am having some trouble with NPN_HasProperty(), NPN_HasMethod() and NPN_Enumerate() and what they return, and don't return.
As an example, if I create an array with x=new Array; the Javascript x.hasOwnProperty('length') returns true, and NPN_HasProperty() for 'length' returns true, but NPN_Enumerate does not list this property, as I would expect.
In a related issue, I want to detect if an object is a Function. Any suggestions on how to do this in a NPAPI plugin? I am trying to call NPN_HasMethod('call') but this is returning false (as 'call' is defined on a prototype?) Is there any way for the plugin to follow inheritance, or execute the equivalent of "x instanceof Function".. ?
Any further info on how to enumerate over properties, and especially, how to follow the inheritance graph would be really welcome, thanks.