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 a JSObjectOps. These are C/C++ hooks and metadata that govern various aspects of the object's behavior and describe its layout in memory.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:157 次

字数:2293

最后编辑:7年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文