Question

What is the difference between JS_NewPropertyIterator() and JS_Enumerate() ?
Both seems to achieve the same task: iterate over own properties of an object.

Was it helpful?

Solution

JS_NewPropertyIterator returns an Iterative Code object.

JS_Enumerate returns an array of JSIDs

New property iterator is likely to be the code intended for use by applications and JS_Enumerate is more than likely to be the actual VM function (or an emulation of it) that is used to do enumerations in scripts.

It really doesn't matter what the difference is. what matters is what you understand about them and how useful they are to your application.

OTHER TIPS

As for now, JS_NewPropertyIterator/JS_NextProperty are obsolete since JSAPI 36 (bug 1081660).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top