JS_GetPropertyDescriptor 编辑
Finds a specified property of an object and gets a detailed description of that property.
Syntax
bool
JS_GetPropertyDescriptor(JSContext *cx, JS::HandleObject obj, const char *name,
JS::MutableHandle<JSPropertyDescriptor> desc); // Added in SpiderMonkey 31
bool
JS_GetPropertyDescriptorById(JSContext *cx, JS::HandleObject obj, JS::HandleId id,
JS::MutableHandle<JSPropertyDescriptor> desc);
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 | JS::HandleObject | The object to search for the property. |
id | const char * or JS::HandleId | The name of the property to look up. |
desc | JS::MutableHandle<JSPropertyDescriptor> | Out parameter. On success, if no property is found, desc->obj is set to NULL . If a property is found, *desc receives a description of it. |
Description
JS_GetPropertyDescriptor
and JS_GetPropertyDescriptorById
find a specified property of an object and gets a detailed description of that property on the prototype chain (returned in desc->obj
). If desc->obj
is null, then this property was not found on the prototype chain.
See also
- MXR ID Search for
JS_GetPropertyDescriptor
- MXR ID Search for
JS_GetPropertyDescriptorById
JS_GetOwnPropertyDescriptor
JS_GetOwnPropertyDescriptorById
JSPropertyDescriptor
- bug 482381 - added
JS_GetPropertyDescriptorById
- bug 893186 - added
JS_GetPropertyDescriptor
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论