Skip to content

Commit

Permalink
Additional for-of tests with array pattern and object pattern.
Browse files Browse the repository at this point in the history
  • Loading branch information
ariya committed Jun 25, 2015
1 parent 2199b84 commit 750c66c
Show file tree
Hide file tree
Showing 8 changed files with 740 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/fixtures/ES6/for-of/for-of-array-pattern-let.js
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 test/fixtures/ES6/for-of/for-of-array-pattern-let.tree.json
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"
}
}
]
}
1 change: 1 addition & 0 deletions test/fixtures/ES6/for-of/for-of-array-pattern.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
for ([p, q] of r);
126 changes: 126 additions & 0 deletions test/fixtures/ES6/for-of/for-of-array-pattern.tree.json
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"
}
}
]
}
1 change: 1 addition & 0 deletions test/fixtures/ES6/for-of/for-of-object-pattern-const.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
for (const {x, y} of z);
Loading

0 comments on commit 750c66c

Please sign in to comment.