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/