Re: How to enumerate object's properties in javascript under SpiderMonkey?

Boris Zbarsky <[email protected]> Mon, 9 Jan 2017 12:43:25 -0500
Newsgroups gmane.comp.mozilla.devel.jseng
Message-ID <[email protected]>
On 1/8/17 2:32 PM, Mihai Dobrescu wrote:
> I've tried Object.getOwnPropertyNames(obj) or Object.keys(obj), but nothing was returned

Those plus Object.getOwnPropertySymbols and Reflect.ownKeys are the 
normal ways to do this, depending on which sorts of properties you want.

> however, the code of the embedded object defines some properties and these could be used.
> I have used JS_PSG macro with JSPROP_PERMANENT | JSPROP_ENUMERATE flags set.

Are the properties defined on the _object_ or on the _prototype_?  All 
the above return own props only, not things off the proto chain.

-Boris