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.
Additional for-of tests with array pattern and object pattern.
Refs jquery#1060 Refs jquery#1047 Closes jquerygh-1196
- Loading branch information
Showing
8 changed files
with
740 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
for (let [p, q] of r); |
164 changes: 164 additions & 0 deletions
164
test/fixtures/ES6/for-of/for-of-array-pattern-let.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,164 @@ | ||
{ | ||
"range": [ | ||
0, | ||
22 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 22 | ||
} | ||
}, | ||
"type": "Program", | ||
"body": [ | ||
{ | ||
"range": [ | ||
0, | ||
22 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 22 | ||
} | ||
}, | ||
"type": "ForOfStatement", | ||
"left": { | ||
"range": [ | ||
5, | ||
15 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 5 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 15 | ||
} | ||
}, | ||
"type": "VariableDeclaration", | ||
"declarations": [ | ||
{ | ||
"range": [ | ||
9, | ||
15 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 9 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 15 | ||
} | ||
}, | ||
"type": "VariableDeclarator", | ||
"id": { | ||
"range": [ | ||
9, | ||
15 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 9 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 15 | ||
} | ||
}, | ||
"type": "ArrayPattern", | ||
"elements": [ | ||
{ | ||
"range": [ | ||
10, | ||
11 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 10 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 11 | ||
} | ||
}, | ||
"type": "Identifier", | ||
"name": "p" | ||
}, | ||
{ | ||
"range": [ | ||
13, | ||
14 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 13 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 14 | ||
} | ||
}, | ||
"type": "Identifier", | ||
"name": "q" | ||
} | ||
] | ||
}, | ||
"init": null | ||
} | ||
], | ||
"kind": "let" | ||
}, | ||
"right": { | ||
"range": [ | ||
19, | ||
20 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 19 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 20 | ||
} | ||
}, | ||
"type": "Identifier", | ||
"name": "r" | ||
}, | ||
"body": { | ||
"range": [ | ||
21, | ||
22 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 21 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 22 | ||
} | ||
}, | ||
"type": "EmptyStatement" | ||
} | ||
} | ||
] | ||
} |
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 @@ | ||
for ([p, q] of r); |
126 changes: 126 additions & 0 deletions
126
test/fixtures/ES6/for-of/for-of-array-pattern.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,126 @@ | ||
{ | ||
"range": [ | ||
0, | ||
18 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 18 | ||
} | ||
}, | ||
"type": "Program", | ||
"body": [ | ||
{ | ||
"range": [ | ||
0, | ||
18 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 18 | ||
} | ||
}, | ||
"type": "ForOfStatement", | ||
"left": { | ||
"range": [ | ||
5, | ||
11 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 5 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 11 | ||
} | ||
}, | ||
"type": "ArrayPattern", | ||
"elements": [ | ||
{ | ||
"range": [ | ||
6, | ||
7 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 6 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 7 | ||
} | ||
}, | ||
"type": "Identifier", | ||
"name": "p" | ||
}, | ||
{ | ||
"range": [ | ||
9, | ||
10 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 9 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 10 | ||
} | ||
}, | ||
"type": "Identifier", | ||
"name": "q" | ||
} | ||
] | ||
}, | ||
"right": { | ||
"range": [ | ||
15, | ||
16 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 15 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 16 | ||
} | ||
}, | ||
"type": "Identifier", | ||
"name": "r" | ||
}, | ||
"body": { | ||
"range": [ | ||
17, | ||
18 | ||
], | ||
"loc": { | ||
"start": { | ||
"line": 1, | ||
"column": 17 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 18 | ||
} | ||
}, | ||
"type": "EmptyStatement" | ||
} | ||
} | ||
] | ||
} |
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 @@ | ||
for (const {x, y} of z); |
Oops, something went wrong.