forked from jquery/esprima
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Duplicated proto should be checked only for PropertyDefinition with P…
…ropertyName. Other PropertyDefinition productions, such as MethodDefinition and IdentifierReference, should be excluded from duplicated __proto_ checks. Fixes jquery#1225 Closes jquerygh-1228
- Loading branch information
Showing
43 changed files
with
1,814 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
test/fixtures/ES6/object-initialiser/invalid-proto-getter-literal-identifier.failure.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"index":48,"lineNumber":1,"column":49,"message":"Error: Line 1: Duplicate __proto__ fields are not allowed in object literals","description":"Duplicate __proto__ fields are not allowed in object literals"} |
1 change: 1 addition & 0 deletions
1
test/fixtures/ES6/object-initialiser/invalid-proto-getter-literal-identifier.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
({ get __proto(){}, "__proto__": null, __proto__: null, }) |
1 change: 1 addition & 0 deletions
1
test/fixtures/ES6/object-initialiser/invalid-proto-identifier-literal.failure.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"index":31,"lineNumber":1,"column":32,"message":"Error: Line 1: Duplicate __proto__ fields are not allowed in object literals","description":"Duplicate __proto__ fields are not allowed in object literals"} |
1 change: 1 addition & 0 deletions
1
test/fixtures/ES6/object-initialiser/invalid-proto-identifier-literal.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
({ __proto__: null, "__proto__": null }) |
1 change: 1 addition & 0 deletions
1
test/fixtures/ES6/object-initialiser/invalid-proto-identifier-shorthand.failure.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"index":29,"lineNumber":1,"column":30,"message":"Error: Line 1: Duplicate __proto__ fields are not allowed in object literals","description":"Duplicate __proto__ fields are not allowed in object literals"} |
1 change: 1 addition & 0 deletions
1
test/fixtures/ES6/object-initialiser/invalid-proto-identifier-shorthand.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
({ __proto__: null, __proto__ }) |
1 change: 1 addition & 0 deletions
1
test/fixtures/ES6/object-initialiser/invalid-proto-identifiers.failure.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"index":29,"lineNumber":1,"column":30,"message":"Error: Line 1: Duplicate __proto__ fields are not allowed in object literals","description":"Duplicate __proto__ fields are not allowed in object literals"} |
1 change: 1 addition & 0 deletions
1
test/fixtures/ES6/object-initialiser/invalid-proto-identifiers.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
({ __proto__: null, __proto__: null }) |
1 change: 1 addition & 0 deletions
1
test/fixtures/ES6/object-initialiser/invalid-proto-literal-identifier.failure.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"index":31,"lineNumber":1,"column":32,"message":"Error: Line 1: Duplicate __proto__ fields are not allowed in object literals","description":"Duplicate __proto__ fields are not allowed in object literals"} |
1 change: 1 addition & 0 deletions
1
test/fixtures/ES6/object-initialiser/invalid-proto-literal-identifier.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
({ "__proto__": null, __proto__: null }) |
1 change: 1 addition & 0 deletions
1
test/fixtures/ES6/object-initialiser/invalid-proto-literal-shorthand.failure.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"index":31,"lineNumber":1,"column":32,"message":"Error: Line 1: Duplicate __proto__ fields are not allowed in object literals","description":"Duplicate __proto__ fields are not allowed in object literals"} |
1 change: 1 addition & 0 deletions
1
test/fixtures/ES6/object-initialiser/invalid-proto-literal-shorthand.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
({ "__proto__": null, __proto__ }) |
1 change: 1 addition & 0 deletions
1
test/fixtures/ES6/object-initialiser/invalid-proto-literals.failure.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"index":33,"lineNumber":1,"column":34,"message":"Error: Line 1: Duplicate __proto__ fields are not allowed in object literals","description":"Duplicate __proto__ fields are not allowed in object literals"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
({ "__proto__": null, '__proto__': null }) |
1 change: 1 addition & 0 deletions
1
test/fixtures/ES6/object-initialiser/invalid-proto-setter-literal-identifier.failure.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"index":51,"lineNumber":1,"column":52,"message":"Error: Line 1: Duplicate __proto__ fields are not allowed in object literals","description":"Duplicate __proto__ fields are not allowed in object literals"} |
1 change: 1 addition & 0 deletions
1
test/fixtures/ES6/object-initialiser/invalid-proto-setter-literal-identifier.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
({ set __proto__(x){}, "__proto__": null, __proto__: null, }) |
1 change: 1 addition & 0 deletions
1
test/fixtures/ES6/object-initialiser/invalid-proto-shorthand-identifier.failure.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"index":23,"lineNumber":1,"column":24,"message":"Error: Line 1: Duplicate __proto__ fields are not allowed in object literals","description":"Duplicate __proto__ fields are not allowed in object literals"} |
1 change: 1 addition & 0 deletions
1
test/fixtures/ES6/object-initialiser/invalid-proto-shorthand-identifier.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
({ __proto__, __proto__: null }) |
1 change: 1 addition & 0 deletions
1
test/fixtures/ES6/object-initialiser/invalid-proto-shorthand-literal.failure.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"index":25,"lineNumber":1,"column":26,"message":"Error: Line 1: Duplicate __proto__ fields are not allowed in object literals","description":"Duplicate __proto__ fields are not allowed in object literals"} |
1 change: 1 addition & 0 deletions
1
test/fixtures/ES6/object-initialiser/invalid-proto-shorthand-literal.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
({ __proto__, "__proto__": null }) |
1 change: 1 addition & 0 deletions
1
test/fixtures/ES6/object-initialiser/invalid-proto-shorthands.failure.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"index":23,"lineNumber":1,"column":24,"message":"Error: Line 1: Duplicate __proto__ fields are not allowed in object literals","description":"Duplicate __proto__ fields are not allowed in object literals"} |
1 change: 1 addition & 0 deletions
1
test/fixtures/ES6/object-initialiser/invalid-proto-shorthands.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
({ __proto__, __proto__ }) |
1 change: 1 addition & 0 deletions
1
test/fixtures/ES6/object-initialiser/proto-identifier-getter-setter.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
({ __proto__: null, get __proto__(){}, set __proto__(x){} }) |
290 changes: 290 additions & 0 deletions
290
test/fixtures/ES6/object-initialiser/proto-identifier-getter-setter.tree.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,290 @@ | ||
{ | ||
"range": [ | ||
0, | ||
60 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 60 | ||
} | ||
}, | ||
"type": "Program", | ||
"body": [ | ||
{ | ||
"range": [ | ||
0, | ||
60 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 60 | ||
} | ||
}, | ||
"type": "ExpressionStatement", | ||
"expression": { | ||
"range": [ | ||
1, | ||
59 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 1 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 59 | ||
} | ||
}, | ||
"type": "ObjectExpression", | ||
"properties": [ | ||
{ | ||
"range": [ | ||
3, | ||
18 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 3 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 18 | ||
} | ||
}, | ||
"type": "Property", | ||
"key": { | ||
"range": [ | ||
3, | ||
12 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 3 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 12 | ||
} | ||
}, | ||
"type": "Identifier", | ||
"name": "__proto__" | ||
}, | ||
"computed": false, | ||
"value": { | ||
"range": [ | ||
14, | ||
18 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 14 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 18 | ||
} | ||
}, | ||
"type": "Literal", | ||
"value": null, | ||
"raw": "null" | ||
}, | ||
"kind": "init", | ||
"method": false, | ||
"shorthand": false | ||
}, | ||
{ | ||
"range": [ | ||
20, | ||
37 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 20 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 37 | ||
} | ||
}, | ||
"type": "Property", | ||
"key": { | ||
"range": [ | ||
24, | ||
33 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 24 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 33 | ||
} | ||
}, | ||
"type": "Identifier", | ||
"name": "__proto__" | ||
}, | ||
"computed": false, | ||
"value": { | ||
"range": [ | ||
33, | ||
37 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 33 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 37 | ||
} | ||
}, | ||
"type": "FunctionExpression", | ||
"id": null, | ||
"params": [], | ||
"defaults": [], | ||
"body": { | ||
"range": [ | ||
35, | ||
37 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 35 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 37 | ||
} | ||
}, | ||
"type": "BlockStatement", | ||
"body": [] | ||
}, | ||
"generator": false, | ||
"expression": false | ||
}, | ||
"kind": "get", | ||
"method": false, | ||
"shorthand": false | ||
}, | ||
{ | ||
"range": [ | ||
39, | ||
57 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 39 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 57 | ||
} | ||
}, | ||
"type": "Property", | ||
"key": { | ||
"range": [ | ||
43, | ||
52 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 43 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 52 | ||
} | ||
}, | ||
"type": "Identifier", | ||
"name": "__proto__" | ||
}, | ||
"computed": false, | ||
"value": { | ||
"range": [ | ||
52, | ||
57 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 52 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 57 | ||
} | ||
}, | ||
"type": "FunctionExpression", | ||
"id": null, | ||
"params": [ | ||
{ | ||
"range": [ | ||
53, | ||
54 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 53 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 54 | ||
} | ||
}, | ||
"type": "Identifier", | ||
"name": "x" | ||
} | ||
], | ||
"defaults": [], | ||
"body": { | ||
"range": [ | ||
55, | ||
57 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 55 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 57 | ||
} | ||
}, | ||
"type": "BlockStatement", | ||
"body": [] | ||
}, | ||
"generator": false, | ||
"expression": false | ||
}, | ||
"kind": "set", | ||
"method": false, | ||
"shorthand": false | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.