add support for spreads anywhere in list - fixes #73
This commit is contained in:
1
test/fixtures/syntax/spread/array-literal-first/actual.js
vendored
Normal file
1
test/fixtures/syntax/spread/array-literal-first/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
var lyrics = [...parts, "head", "and", "toes"];
|
||||
3
test/fixtures/syntax/spread/array-literal-first/expected.js
vendored
Normal file
3
test/fixtures/syntax/spread/array-literal-first/expected.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
var _slice = Array.prototype.slice;
|
||||
var lyrics = _slice.call(parts).concat(["head", "and", "toes"]);
|
||||
1
test/fixtures/syntax/spread/array-literal-middle/actual.js
vendored
Normal file
1
test/fixtures/syntax/spread/array-literal-middle/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
var a = [b, ...c, d];
|
||||
3
test/fixtures/syntax/spread/array-literal-middle/expected.js
vendored
Normal file
3
test/fixtures/syntax/spread/array-literal-middle/expected.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
var _slice = Array.prototype.slice;
|
||||
var a = [b].concat(_slice.call(c), [d]);
|
||||
1
test/fixtures/syntax/spread/array-literal-multiple/actual.js
vendored
Normal file
1
test/fixtures/syntax/spread/array-literal-multiple/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
var a = [b, ...c, d, e, ...f];
|
||||
3
test/fixtures/syntax/spread/array-literal-multiple/expected.js
vendored
Normal file
3
test/fixtures/syntax/spread/array-literal-multiple/expected.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
var _slice = Array.prototype.slice;
|
||||
var a = [b].concat(_slice.call(c), [d, e], _slice.call(f));
|
||||
1
test/fixtures/syntax/spread/method-call-first/actual.js
vendored
Normal file
1
test/fixtures/syntax/spread/method-call-first/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
add(...numbers, foo, bar);
|
||||
3
test/fixtures/syntax/spread/method-call-first/expected.js
vendored
Normal file
3
test/fixtures/syntax/spread/method-call-first/expected.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
var _slice = Array.prototype.slice;
|
||||
add.apply(null, _slice.call(numbers).concat([foo, bar]));
|
||||
1
test/fixtures/syntax/spread/method-call-middle/actual.js
vendored
Normal file
1
test/fixtures/syntax/spread/method-call-middle/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
add(foo, ...numbers, bar);
|
||||
3
test/fixtures/syntax/spread/method-call-middle/expected.js
vendored
Normal file
3
test/fixtures/syntax/spread/method-call-middle/expected.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
var _slice = Array.prototype.slice;
|
||||
add.apply(null, [foo].concat(_slice.call(numbers), [bar]));
|
||||
1
test/fixtures/syntax/spread/method-call-multiple/actual.js
vendored
Normal file
1
test/fixtures/syntax/spread/method-call-multiple/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
add(foo, ...numbers, bar, what, ...test);
|
||||
3
test/fixtures/syntax/spread/method-call-multiple/expected.js
vendored
Normal file
3
test/fixtures/syntax/spread/method-call-multiple/expected.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
var _slice = Array.prototype.slice;
|
||||
add.apply(null, [foo].concat(_slice.call(numbers), [bar, what], _slice.call(test)));
|
||||
Reference in New Issue
Block a user