Re: How to enumerate object's properties in javascript under SpiderMonkey?
Mihai Dobrescu <[email protected]> Mon, 9 Jan 2017 11:29:44 -0800 (PST)
| Newsgroups | gmane.comp.mozilla.devel.jseng |
|---|---|
| Message-ID | <[email protected]> |
On Monday, January 9, 2017 at 7:43:31 PM UTC+2, Boris Zbarsky wrote: > 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 On the prototype.