Open
Bug 643368
Opened 14 years ago
Updated 2 years ago
Need JSAPI to enumerate non-enumerable properties
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
NEW
People
(Reporter: robarnold, Unassigned)
References
(Blocks 1 open bug)
Details
To implement v8::Object::Clone, I think we need to include the non-enumerable properties of an object. Currently there is no API to get us these. JS_NewPropertyIterator and JS_Enumerate claim to only show properties with the JSPROP_ENUMERATE bit.
Comment 1•14 years ago
|
||
I have a patch for that. Search for JS_Enumerate2 in the title.
Comment 2•14 years ago
|
||
(In reply to comment #0)
> Currently there is no API to get us these. JS_NewPropertyIterator and
> JS_Enumerate claim to only show properties with the JSPROP_ENUMERATE bit.
Lies! Call JS_Enumerate with JSENUMERATE_INIT_ALL.
One caveat: enumeration hooks don't uniformly implement all the correct stuff for this to work fully. Global objects in the browser are one case where things fall apart. There might be others, but that's the biggest instance I'm aware of.
(...and not to say I'm opposed to JS_Enumerate2 or anything, just to say that it's not needed to serve the particular use case in this bug.)
Comment 3•14 years ago
|
||
(In reply to comment #2)
> Lies! Call JS_Enumerate with JSENUMERATE_INIT_ALL.
Could someone possibly add some docs for that then, by chance?
Reporter | ||
Comment 4•14 years ago
|
||
(In reply to comment #2)
> (In reply to comment #0)
> > Currently there is no API to get us these. JS_NewPropertyIterator and
> > JS_Enumerate claim to only show properties with the JSPROP_ENUMERATE bit.
>
> Lies! Call JS_Enumerate with JSENUMERATE_INIT_ALL.
I still do not see how this is exposed via the API. JS_Enumerate takes a JSContext* and a JSObject* but not a JSIterateOp.
Comment 5•14 years ago
|
||
Andreas is referring to bug 638347 in encouraging you to search for JS_Enumerate2.
/be
Comment 6•14 years ago
|
||
(In reply to comment #4)
> I still do not see how this is exposed via the API.
Hum, you're right. Yes, we should fix that. (And are, it seems.)
And what's this yolky-colored stuff on my face right now?
Comment 7•14 years ago
|
||
Waldo, feel free to steal 638347, in particular if you have a better idea for naming then JS_Enumerate2.
Assignee | ||
Updated•11 years ago
|
Assignee: general → nobody
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•