【发布时间】:2010-10-13 18:53:00
【问题描述】:
有人问how to get the value of a JSObject property from c。这对我有点帮助。
但是,有人知道如何从 c 中获取对象的当前 JavaScript 名称吗?
示例:
var foo={prop:'bar'};
然后在某个地方,例如在 jsapi.cpp:
JS_somemethod(JSContext *cx, JSObject *obj){
//how do i get the name 'foo' (or the current alias) here if *obj points to the foo (or whatever alias name) object?
}
感谢提示和答案!
【问题讨论】:
标签: javascript c spidermonkey