문제

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top