Raise error on duplicate definition of __proto__ (#183)
Spec: http://www.ecma-international.org/ecma-262/6.0/#sec-__proto__-property-names-in-object-initializers This brings back to life a bit of dead code in Parser.prototype.checkPropClash, and enables several tests that were previously disabled.
This commit is contained in:
parent
7c18bf83cc
commit
9b6e243736
@ -50,7 +50,7 @@ pp.checkPropClash = function (prop, propHash) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (name === "__proto__" && prop.kind === "init") {
|
||||
if (name === "__proto__" && !prop.kind) {
|
||||
if (propHash.proto) this.raise(key.start, "Redefinition of __proto__ property");
|
||||
propHash.proto = true;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user