javascript - 像 "__proto__"这样的 javascript 属性名称在 ES5/6 中没有标准化吗?

标签 javascript syntax properties prototype standards

js 中有一些属性以双下划线开头/结尾,例如 __proto__。但我知道它等于 constructor.prototype,对吧?我想知道 ES5/ES6 标准是否包含这些 xxx_ 属性名称,或者它们只是特定于实现的关键字,在不同的实现中可能有不同的行为?

另外:我在哪里可以检查关键字是否是 ES 标准的一部分?

最佳答案

I know it equals to constructor.prototype, right?

No .

I wish to know whether ES5/ES6 standard included these __xxx__ property names, or they're just implementation specific keywords, might have different behavior in different implementations?

您可以在 MDN documentation 中找到概述, 有__count__, __noSuchMethod__, __parent__, __proto__, __defineGetter__, >__defineSetter____lookupGetter____lookupSetter__;并且所有这些都已弃用。 Gecko 以外的其他实现可能具有更多特色。

只有 getter/setter 方法和 __proto__ 在实现中是通用的,并且只有 __proto__ got into the compatibilty section of the ES6 standard .

where can I check if a keyword is part of ES stardard, any recommended web-sites?

刚刚阅读the standards themselves !

关于javascript - 像 "__proto__"这样的 javascript 属性名称在 ES5/6 中没有标准化吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38847471/

相关文章:

javascript - 在 QUnit 中使用 Mockjax?

JavaScript 函数调用语法

inheritance - Swift 中带有实例变量的 Swift 计算属性?

Grails 索引参数

javascript - grunt-newer 不使用 grunt-sass

javascript - 当表单验证为 false 时,停留在当前页面

javascript - "clicking"使用 javascript 没有 ID 的提交按钮

c - ANTLR C 语法,可选 init_declarator_list?

macos - 可以语法高亮差异文件的 Mac 原生文本编辑器?

c# - 更改基类属性 setter 行为