I'm using this code to iterate over the properties passed to a native function:
JSObject *iter = JS_NewPropertyIterator(cx, jsargs);
jsid id;
while(JS_NextProperty(cx, iter, &id) && id != JSID_VOID) {
jsval vp;
if(!JS_GetPropertyById(cx, jsargs, id, &vp)) {
continue;
}
// ...
}
This works fine to get the value of the property, however, I need the name of that property, too.
I couldn't find any of the various property-related ...ById()
functions which give me the property name.