JS_GetGlobalForObject 编辑
Returns the global object for the given object.
Syntax
JSObject * JS_GetGlobalForObject(JSContext *cx, JSObject *obj);
Name | Type | Description |
---|---|---|
cx | JSContext * | A context. Requires request. In a JS_THREADSAFE build, the caller must be in a request on this JSContext . |
obj | JSObject * | A non-NULL JSObject. |
Description
JS_GetGlobalForObject
returns the last non-null object on the parent chain of the input object.
For function object inputs, the result is "the global object" as referred to in the ECMAScript specification. For example, if the function refers to a global variable foo
, then foo
is a property of the object returned by JS_GetGlobalForObject
.
See Also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论