Skip to content
This repository has been archived by the owner on May 19, 2018. It is now read-only.

Commit

Permalink
Raise error on duplicate definition of __proto__ (#183)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
motiz88 authored and danez committed Oct 16, 2016
1 parent 7c18bf8 commit 9b6e243
Show file tree
Hide file tree
Showing 46 changed files with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parser/expression.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 9b6e243

Please sign in to comment.