JSObject 编辑
JSObject
is the type of JavaScript objects in the JSAPI.
Objects are made up of the following parts:
- Most objects have a prototype. See
JS_GetPrototype
. An object inherits properties, including methods, from its prototype (which is another object).
- Most objects have a parent. See
JS_GetParent
. An object's parent is another object, usually either the global object or an object that represents an activation record. The JavaScript engine sometimes uses this relationship to implement lexical scoping. Security-sensitive applications can use this relationship to make every object a member of some security domain.
- Almost every object can have any number of its own properties. The term own property refers to a property of an object that is not inherited from its prototype. Each property has a name, a getter, a setter, and property attributes. Most properties also have a stored value. See
JS_DefineProperty
.
- Every object is associated with a
JSClass
and aJSObjectOps
. These are C/C++ hooks and metadata that govern various aspects of the object's behavior and describe its layout in memory.
- Depending on the
JSClass
, an object may have a private data pointer and any number of reserved slots.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论