开发者

Enumerate all properties in Mozilla JSAPI

开发者 https://www.devze.com 2023-04-06 00:26 出处:网络
I want to programmatically list all properties of JS object from C++ code (I am using Mozilla\'s JSAPI). I know I can go up the prototype chain 开发者_如何学运维with JS_GetPrototype, then enumerate ea

I want to programmatically list all properties of JS object from C++ code (I am using Mozilla's JSAPI). I know I can go up the prototype chain 开发者_如何学运维with JS_GetPrototype, then enumerate each object's own properties with JS_Enumerate. Is there a simpler way to do this?


I don't think there is. The code implementing property enumeration for JavaScript (function js_ValueToIterator()) uses highly optimized iterators. I don't see these iterators being made accessible to JSAPI anywhere.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号