Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Commit 7c00f16

Browse files
soda0289JamesHenry
authored andcommitted
Chore: Add tests for object spread and async generator (refs #236) (#237)
1 parent 7b69bc9 commit 7c00f16

File tree

6 files changed

+234
-8
lines changed

6 files changed

+234
-8
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
module.exports = {
2+
"type": "Program",
3+
"range": [
4+
0,
5+
26
6+
],
7+
"loc": {
8+
"start": {
9+
"line": 1,
10+
"column": 0
11+
},
12+
"end": {
13+
"line": 3,
14+
"column": 1
15+
}
16+
},
17+
"body": [
18+
{
19+
"type": "FunctionDeclaration",
20+
"range": [
21+
0,
22+
26
23+
],
24+
"loc": {
25+
"start": {
26+
"line": 1,
27+
"column": 0
28+
},
29+
"end": {
30+
"line": 3,
31+
"column": 1
32+
}
33+
},
34+
"id": {
35+
"type": "Identifier",
36+
"range": [
37+
16,
38+
19
39+
],
40+
"loc": {
41+
"start": {
42+
"line": 1,
43+
"column": 16
44+
},
45+
"end": {
46+
"line": 1,
47+
"column": 19
48+
}
49+
},
50+
"name": "foo"
51+
},
52+
"generator": true,
53+
"expression": false,
54+
"async": true,
55+
"params": [],
56+
"body": {
57+
"type": "BlockStatement",
58+
"range": [
59+
22,
60+
26
61+
],
62+
"loc": {
63+
"start": {
64+
"line": 1,
65+
"column": 22
66+
},
67+
"end": {
68+
"line": 3,
69+
"column": 1
70+
}
71+
},
72+
"body": []
73+
}
74+
}
75+
],
76+
"sourceType": "script",
77+
"tokens": [
78+
{
79+
"type": "Identifier",
80+
"value": "async",
81+
"range": [
82+
0,
83+
5
84+
],
85+
"loc": {
86+
"start": {
87+
"line": 1,
88+
"column": 0
89+
},
90+
"end": {
91+
"line": 1,
92+
"column": 5
93+
}
94+
}
95+
},
96+
{
97+
"type": "Keyword",
98+
"value": "function",
99+
"range": [
100+
6,
101+
14
102+
],
103+
"loc": {
104+
"start": {
105+
"line": 1,
106+
"column": 6
107+
},
108+
"end": {
109+
"line": 1,
110+
"column": 14
111+
}
112+
}
113+
},
114+
{
115+
"type": "Punctuator",
116+
"value": "*",
117+
"range": [
118+
14,
119+
15
120+
],
121+
"loc": {
122+
"start": {
123+
"line": 1,
124+
"column": 14
125+
},
126+
"end": {
127+
"line": 1,
128+
"column": 15
129+
}
130+
}
131+
},
132+
{
133+
"type": "Identifier",
134+
"value": "foo",
135+
"range": [
136+
16,
137+
19
138+
],
139+
"loc": {
140+
"start": {
141+
"line": 1,
142+
"column": 16
143+
},
144+
"end": {
145+
"line": 1,
146+
"column": 19
147+
}
148+
}
149+
},
150+
{
151+
"type": "Punctuator",
152+
"value": "(",
153+
"range": [
154+
19,
155+
20
156+
],
157+
"loc": {
158+
"start": {
159+
"line": 1,
160+
"column": 19
161+
},
162+
"end": {
163+
"line": 1,
164+
"column": 20
165+
}
166+
}
167+
},
168+
{
169+
"type": "Punctuator",
170+
"value": ")",
171+
"range": [
172+
20,
173+
21
174+
],
175+
"loc": {
176+
"start": {
177+
"line": 1,
178+
"column": 20
179+
},
180+
"end": {
181+
"line": 1,
182+
"column": 21
183+
}
184+
}
185+
},
186+
{
187+
"type": "Punctuator",
188+
"value": "{",
189+
"range": [
190+
22,
191+
23
192+
],
193+
"loc": {
194+
"start": {
195+
"line": 1,
196+
"column": 22
197+
},
198+
"end": {
199+
"line": 1,
200+
"column": 23
201+
}
202+
}
203+
},
204+
{
205+
"type": "Punctuator",
206+
"value": "}",
207+
"range": [
208+
25,
209+
26
210+
],
211+
"loc": {
212+
"start": {
213+
"line": 3,
214+
"column": 0
215+
},
216+
"end": {
217+
"line": 3,
218+
"column": 1
219+
}
220+
}
221+
}
222+
]
223+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
async function* foo() {
2+
3+
}

tests/fixtures/ecma-features/experimentalObjectRestSpread/property-spread.result.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ module.exports = {
326326
"kind": "init"
327327
},
328328
{
329-
"type": "ExperimentalSpreadProperty",
329+
"type": "SpreadElement",
330330
"loc": {
331331
"start": {
332332
"line": 8,
@@ -856,4 +856,4 @@ module.exports = {
856856
]
857857
}
858858
]
859-
};
859+
};

tests/fixtures/ecma-features/experimentalObjectRestSpread/single-spread.result.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ module.exports = {
326326
"kind": "init"
327327
},
328328
{
329-
"type": "ExperimentalSpreadProperty",
329+
"type": "SpreadElement",
330330
"loc": {
331331
"start": {
332332
"line": 8,
@@ -784,4 +784,4 @@ module.exports = {
784784
]
785785
}
786786
]
787-
};
787+
};

tests/fixtures/ecma-features/experimentalObjectRestSpread/two-spread.result.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ module.exports = {
269269
"kind": "init"
270270
},
271271
{
272-
"type": "ExperimentalSpreadProperty",
272+
"type": "SpreadElement",
273273
"loc": {
274274
"start": {
275275
"line": 7,
@@ -304,7 +304,7 @@ module.exports = {
304304
}
305305
},
306306
{
307-
"type": "ExperimentalSpreadProperty",
307+
"type": "SpreadElement",
308308
"loc": {
309309
"start": {
310310
"line": 8,
@@ -744,4 +744,4 @@ module.exports = {
744744
]
745745
}
746746
]
747-
};
747+
};

tests/lib/ecma-features.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var testFiles = shelljs.find(FIXTURES_DIR).filter(function(filename) {
4141
}).map(function(filename) {
4242
return filename.substring(FIXTURES_DIR.length - 1, filename.length - 7); // strip off ".src.js"
4343
}).filter(function(filename) {
44-
return !(/error\-|invalid\-|globalReturn|experimental/.test(filename));
44+
return !(/error\-|invalid\-|globalReturn/.test(filename));
4545
});
4646

4747
// var moduleTestFiles = testFiles.filter(function(filename) {

0 commit comments

Comments
 (0)