-
-
Notifications
You must be signed in to change notification settings - Fork 484
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(tasks/transform-conformance): support override to replace takeo…
…ver mode
- Loading branch information
Showing
119 changed files
with
1,003 additions
and
450 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
5 changes: 5 additions & 0 deletions
5
...in-transform-object-rest-spread/test/fixtures/object-rest/assignment-expression/output.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,5 @@ | ||
({a1} = c1); | ||
var _c; | ||
_c = c2, {a2} = _c, b2 = babelHelpers.objectWithoutProperties(_c, ["a2"]), _c; | ||
var _c2; | ||
console.log((_c2 = c3, {a3} = _c2, b3 = babelHelpers.objectWithoutProperties(_c2, ["a3"]), _c2)); |
15 changes: 15 additions & 0 deletions
15
...abel-plugin-transform-object-rest-spread/test/fixtures/object-rest/catch-clause/output.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,15 @@ | ||
const _excluded = ["a1"], _excluded2 = ["a2", "b2"], _excluded3 = ["c3"]; | ||
try {} catch (_ref) { | ||
let a34 = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref), _ref)); | ||
} | ||
try {} catch (_ref2) { | ||
let { a1 } = _ref2, b1 = babelHelpers.objectWithoutProperties(_ref2, _excluded); | ||
} | ||
try {} catch (_ref3) { | ||
let { a2, b2 } = _ref3, c2 = babelHelpers.objectWithoutProperties(_ref3, _excluded2); | ||
} | ||
try {} catch (_ref4) { | ||
let { a2, b2, c2: _ref5 } = _ref4, { c3 } = _ref5, c4 = babelHelpers.objectWithoutProperties(_ref5, _excluded3); | ||
} | ||
try {} catch (a) {} | ||
try {} catch ({ b }) {} |
7 changes: 7 additions & 0 deletions
7
...lugin-transform-object-rest-spread/test/fixtures/object-rest/duplicate-decl-bug/output.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,7 @@ | ||
it("es7.objectRestSpread", () => { | ||
let original = { | ||
a: 1, | ||
b: 2 | ||
}; | ||
let copy = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(original), original)); | ||
}); |
3 changes: 3 additions & 0 deletions
3
...des/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/export/output.mjs
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,3 @@ | ||
export var { b } = asdf2, c = babelHelpers.objectWithoutProperties(asdf2, ["b"]); | ||
export var { bb, cc } = ads; | ||
export var [dd, ee, ...ff] = ads; |
7 changes: 3 additions & 4 deletions
7
...object-rest/for-x-array-pattern/output.js → ...object-rest/for-x-array-pattern/output.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
5 changes: 5 additions & 0 deletions
5
...-transform-object-rest-spread/test/fixtures/object-rest/for-x-completion-record/output.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,5 @@ | ||
const _excluded = ["a"]; | ||
for (var _ref of []) { | ||
var _ref2; | ||
_ref2 = _ref, {a} = _ref2, b = babelHelpers.objectWithoutProperties(_ref2, _excluded), _ref2; | ||
} |
7 changes: 3 additions & 4 deletions
7
...test/fixtures/object-rest/for-x/output.js → ...test/fixtures/object-rest/for-x/output.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
25 changes: 25 additions & 0 deletions
25
...l-plugin-transform-object-rest-spread/test/fixtures/object-rest/impure-computed/output.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,25 @@ | ||
var key, x, y, z; | ||
key = 1; | ||
var _$a = { | ||
1: 1, | ||
a: 1 | ||
}, _key = key++, { [_key]: y } = _$a, x = babelHelpers.objectWithoutProperties(_$a, [_key].map(babelHelpers.toPropertyKey)); | ||
expect(x).toEqual({ a: 1 }); | ||
expect(key).toBe(2); | ||
expect(y).toBe(1); | ||
key = 1; | ||
var _$ = { | ||
2: 2, | ||
3: 3 | ||
}, _key2 = ++key, _key3 = ++key, { [_key2]: y, [_key3]: z } = _$, rest = babelHelpers.objectWithoutProperties(_$, [_key2, _key3].map(babelHelpers.toPropertyKey)); | ||
expect(y).toBe(2); | ||
expect(z).toBe(3); | ||
key = 2; | ||
var _$z; | ||
_$z = { | ||
2: "two", | ||
z: "zee" | ||
}, {[key]: y, z} = _$z, x = babelHelpers.objectWithoutProperties(_$z, [key, "z"].map(babelHelpers.toPropertyKey)), _$z; | ||
expect(y).toBe("two"); | ||
expect(x).toEqual({}); | ||
expect(z).toBe("zee"); |
6 changes: 6 additions & 0 deletions
6
...es/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested-2/output.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,6 @@ | ||
const test = { foo: { bar: { baz: { a: { | ||
x: 1, | ||
y: 2, | ||
z: 3 | ||
} } } } }; | ||
const { foo: { bar: { baz: { a: _ref } } } } = test, { x } = _ref, other = babelHelpers.objectWithoutProperties(_ref, ["x"]); |
1 change: 1 addition & 0 deletions
1
...el-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested-array-2/output.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
...abel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested-array/output.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,5 @@ | ||
const [a, _ref] = x, { b } = _ref, c = babelHelpers.objectWithoutProperties(_ref, ["b"]); | ||
let [d, _ref2] = x, { e } = _ref2, f = babelHelpers.objectWithoutProperties(_ref2, ["e"]); | ||
var _ref3; | ||
var _ref4; | ||
[g, _ref3] = x, _ref4 = _ref3, {h} = _ref4, i = babelHelpers.objectWithoutProperties(_ref4, ["h"]), _ref4; |
4 changes: 4 additions & 0 deletions
4
...ugin-transform-object-rest-spread/test/fixtures/object-rest/nested-computed-key/output.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,4 @@ | ||
const { [(_ref) => { | ||
let rest = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref), _ref)); | ||
let _ref2 = {}, b = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref2), _ref2)); | ||
}]: a, [(_ref3 = {}, {} = _ref3, d = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref3), _ref3)), _ref3)]: c } = {}; |
4 changes: 4 additions & 0 deletions
4
...gin-transform-object-rest-spread/test/fixtures/object-rest/nested-default-value/output.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,4 @@ | ||
const { a = (_ref) => { | ||
let rest = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref), _ref)); | ||
let _ref2 = {}, b = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref2), _ref2)); | ||
}, c = (_ref3 = {}, {} = _ref3, d = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref3), _ref3)), _ref3) } = {}; |
2 changes: 2 additions & 0 deletions
2
...-transform-object-rest-spread/test/fixtures/object-rest/nested-literal-property/output.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,2 @@ | ||
let useState = [{ some: 42 }, () => null]; | ||
let { 0: _ref, "2": _ref2, 1: setState } = useState, { numeric } = _ref, rest1 = babelHelpers.objectWithoutProperties(_ref, ["numeric"]), { str } = _ref2, rest2 = babelHelpers.objectWithoutProperties(_ref2, ["str"]); |
1 change: 1 addition & 0 deletions
1
...abel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested-order/output.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
...ides/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/nested/output.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,5 @@ | ||
const defunct = { outer: { inner: { | ||
three: "three", | ||
four: "four" | ||
} } }; | ||
const { outer: { inner: _ref } } = defunct, { three } = _ref, other = babelHelpers.objectWithoutProperties(_ref, ["three"]); |
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
7 changes: 7 additions & 0 deletions
7
...lugin-transform-object-rest-spread/test/fixtures/object-rest/null-destructuring/output.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,7 @@ | ||
const _excluded = ["x"]; | ||
expect(() => { | ||
var _ref = null, x = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref), _ref)); | ||
}).toThrow(/null/); | ||
expect(() => { | ||
var _ref2 = null, { x } = _ref2, y = babelHelpers.objectWithoutProperties(_ref2, _excluded); | ||
}).toThrow(/null/); |
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
26 changes: 26 additions & 0 deletions
26
...ct-rest-spread/test/fixtures/object-rest/parameters-object-rest-used-in-default/output.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,26 @@ | ||
const _excluded = ["X"]; | ||
(_ref, a = R) => { | ||
let R = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref), _ref)); | ||
}; | ||
(_ref2, { a = { Y } }) => { | ||
let { X: Y } = _ref2, R = babelHelpers.objectWithoutProperties(_ref2, _excluded); | ||
}; | ||
(a = R, _ref3) => { | ||
let R = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref3), _ref3)); | ||
}; | ||
(_ref4, e, c = 2, a = R, f = q) => { | ||
let R = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref4), _ref4)); | ||
let q; | ||
}; | ||
(_ref5, a = f(R)) => { | ||
let R = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref5), _ref5)); | ||
}; | ||
(_ref6, { [R.key]: a = 42 }) => { | ||
let R = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref6), _ref6)); | ||
}; | ||
(_ref7, { a = { R: b } }) => { | ||
let R = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref7), _ref7)); | ||
}; | ||
(_ref8, { a = (R) => R } = { b: (R) => R }) => { | ||
let R = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref8), _ref8)); | ||
}; |
35 changes: 35 additions & 0 deletions
35
.../babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/parameters/output.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,35 @@ | ||
const _excluded = ["a1"], _excluded2 = ["a2", "b2"], _excluded3 = ["a5"], _excluded4 = ["a3"], _excluded5 = ["ba1"], _excluded6 = ["a3", "b2"], _excluded7 = ["ba1"], _excluded8 = ["a1"], _excluded9 = ["a1"]; | ||
function a(_ref) { | ||
let a34 = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref), _ref)); | ||
} | ||
function a2(_ref2) { | ||
let { a1 } = _ref2, b1 = babelHelpers.objectWithoutProperties(_ref2, _excluded); | ||
} | ||
function a3(_ref3) { | ||
let { a2, b2 } = _ref3, c2 = babelHelpers.objectWithoutProperties(_ref3, _excluded2); | ||
} | ||
function a4(_ref4, _ref5) { | ||
let { a5 } = _ref5, c5 = babelHelpers.objectWithoutProperties(_ref5, _excluded3); | ||
let { a3 } = _ref4, c3 = babelHelpers.objectWithoutProperties(_ref4, _excluded4); | ||
} | ||
function a5(_ref6) { | ||
let { a3, b2: _ref7 } = _ref6, { ba1 } = _ref7, ba2 = babelHelpers.objectWithoutProperties(_ref7, _excluded5), c3 = babelHelpers.objectWithoutProperties(_ref6, _excluded6); | ||
} | ||
function a6(_ref8) { | ||
let { a3, b2: _ref9 } = _ref8, { ba1 } = _ref9, ba2 = babelHelpers.objectWithoutProperties(_ref9, _excluded7); | ||
} | ||
function a7(_ref10 = {}) { | ||
let { a1 = 1 } = _ref10, b1 = babelHelpers.objectWithoutProperties(_ref10, _excluded8); | ||
} | ||
function a8([_ref11]) { | ||
let a1 = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref11), _ref11)); | ||
} | ||
function a9([_ref12]) { | ||
let { a1 } = _ref12, a2 = babelHelpers.objectWithoutProperties(_ref12, _excluded9); | ||
} | ||
function a10([a1, _ref13]) { | ||
let a2 = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref13), _ref13)); | ||
} | ||
function b(a) {} | ||
function b2(a, ...b) {} | ||
function b3({ b }) {} |
4 changes: 4 additions & 0 deletions
4
...ides/babel-plugin-transform-object-rest-spread/test/fixtures/object-rest/symbol/output.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,4 @@ | ||
let _ref = {}, _Symbol$for = Symbol.for("foo"), { [_Symbol$for]: foo } = _ref, rest = babelHelpers.objectWithoutProperties(_ref, [_Symbol$for].map(babelHelpers.toPropertyKey)); | ||
var _ref2, _Symbol$for2 = Symbol.for("foo"); | ||
_ref2 = {}, {[_Symbol$for2]: foo} = _ref2, rest = babelHelpers.objectWithoutProperties(_ref2, [_Symbol$for2].map(babelHelpers.toPropertyKey)), _ref2; | ||
if (_ref3 = {}, {[_Symbol$for3]: foo} = _ref3, rest = babelHelpers.objectWithoutProperties(_ref3, [_Symbol$for3].map(babelHelpers.toPropertyKey)), _ref3) {} |
6 changes: 6 additions & 0 deletions
6
...-spread/test/fixtures/object-rest/template-literal-allLiterals-true-no-hoisting/output.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,6 @@ | ||
const example = () => { | ||
const input = {}; | ||
const foo = "foo"; | ||
var _input, _ref = `${foo}_bar`; | ||
_input = input, {[_ref]: country} = _input, rest = babelHelpers.objectWithoutProperties(_input, [_ref].map(babelHelpers.toPropertyKey)), _input; | ||
}; |
8 changes: 8 additions & 0 deletions
8
...st-spread/test/fixtures/object-rest/template-literal-property-allLiterals-false/output.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,8 @@ | ||
const input = {}; | ||
const _ref = prefix + "state", _ref2 = `${prefix}consents`, { given_name: givenName, "last_name": lastName, [`country`]: country, [_ref]: state, [_ref2]: consents } = input, rest = babelHelpers.objectWithoutProperties(input, [ | ||
"given_name", | ||
"last_name", | ||
`country`, | ||
_ref, | ||
_ref2 | ||
].map(babelHelpers.toPropertyKey)); |
6 changes: 6 additions & 0 deletions
6
...est-spread/test/fixtures/object-rest/template-literal-property-allLiterals-true/output.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,6 @@ | ||
const input = {}; | ||
const { given_name: givenName, "last_name": lastName, [`country`]: country } = input, rest = babelHelpers.objectWithoutProperties(input, [ | ||
"given_name", | ||
"last_name", | ||
`country` | ||
]); |
32 changes: 32 additions & 0 deletions
32
...n-transform-object-rest-spread/test/fixtures/object-rest/variable-destructuring/output.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,32 @@ | ||
const _z = z(), { x15: [ ...{ ...y15 }] } = _z; | ||
let { x: _ref, y: _ref2 } = complex, { a: xa, [d]: f } = _ref, asdf = babelHelpers.objectWithoutProperties(_ref, ["a", d].map(babelHelpers.toPropertyKey)), d = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref2), _ref2)), g = babelHelpers.objectWithoutProperties(complex, ["x", "y"]); | ||
let _z2 = z(), { x4: _ref3 } = _z2, y4 = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref3), _ref3)); | ||
let _z3 = z(), { x5: _ref4 } = _z3, { w5 } = _ref4, y5 = babelHelpers.objectWithoutProperties(_ref4, ["w5"]); | ||
let _z4 = z(), { x6: { w6: _ref5 } } = _z4, { a6 } = _ref5, y6 = babelHelpers.objectWithoutProperties(_ref5, ["a6"]); | ||
let _z5 = z(), { x7: { e7, r7 }, q7: { w7: _ref6 } } = _z5, { a7 } = _ref6, y7 = babelHelpers.objectWithoutProperties(_ref6, ["a7"]); | ||
let _z6 = z(), { x8 } = _z6, y8 = babelHelpers.objectWithoutProperties(_z6, ["x8"]); | ||
let _z7 = z(), { x9: { w9: _ref7 }, x10: _ref8 } = _z7, { a9 } = _ref7, y9 = babelHelpers.objectWithoutProperties(_ref7, ["a9"]), { a10 } = _ref8, y10 = babelHelpers.objectWithoutProperties(_ref8, ["a10"]); | ||
let _z8 = z(), { x11: [_ref9] } = _z8, { w11 } = _ref9, z11 = babelHelpers.objectWithoutProperties(_ref9, ["w11"]); | ||
let _z9 = z(), { x12: [{ a12, b12 }, _ref10] } = _z9, { c12 } = _ref10, d12 = babelHelpers.objectWithoutProperties(_ref10, ["c12"]); | ||
let _z10 = z(), { x13: [, _ref11] } = _z10, { c13 } = _ref11, d13 = babelHelpers.objectWithoutProperties(_ref11, ["c13"]); | ||
const _z11 = z(), { x14: [ ...{ q14,...y14 }] } = _z11; | ||
const _z12 = z(), { x15: [ ...{ ...y16 }] } = _z12; | ||
const { x16: [] } = z(); | ||
const [ ...[ ...y17]] = z(); | ||
const _z13 = z(), [ ...{ ...y18 }] = _z13; | ||
const _z14 = z(), [ ...{ a19,...y19 }] = _z14; | ||
const _z15 = z(), { x20: _ref12 = {} } = _z15, y20 = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref12), _ref12)); | ||
const _z16 = z(), { x22: _ref13 = {} } = _z16, { q22 } = _ref13, y22 = babelHelpers.objectWithoutProperties(_ref13, ["q22"]); | ||
const [[ ...y23] = []] = z(); | ||
const _z17 = z(), [_ref14 = []] = _z17, y24 = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref14), _ref14)); | ||
const { x25: [ ...y25] = [] } = z(); | ||
const { x26: [q26, ...y26] = [] } = z(); | ||
const {} = {}; | ||
const [, , x27] = z(); | ||
const _z18 = z(), { x28: [, , _ref15] } = _z18, y28 = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref15), _ref15)); | ||
const _z19 = z(), { x29: [, , _ref16] } = _z19, { q29 } = _ref16, y29 = babelHelpers.objectWithoutProperties(_ref16, ["q29"]); | ||
const _z20 = z(), [, , _ref17] = _z20, { y30 } = _ref17, x30 = babelHelpers.objectWithoutProperties(_ref17, ["y30"]); | ||
const _z21 = z(), [, , _ref18] = _z21, x31 = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref18), _ref18)); | ||
const _z22 = z(), { x32: {}, w32: _ref19 } = _z22, y32 = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref19), _ref19)); | ||
const _z23 = z(), [, , {}, _ref20] = _z23, q32 = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_ref20), _ref20)); | ||
const _z24 = z(), y33 = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(_z24), _z24)); |
9 changes: 9 additions & 0 deletions
9
...l-plugin-transform-object-rest-spread/test/fixtures/object-rest/with-array-rest/output.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,9 @@ | ||
let _a$d = { | ||
a: [ | ||
1, | ||
2, | ||
3, | ||
4 | ||
], | ||
d: "oyez" | ||
}, { a: [b, ...arrayRest], c = function(...functionRest) {} } = _a$d, objectRest = babelHelpers.objectWithoutProperties(_a$d, ["a", "c"]); |
8 changes: 8 additions & 0 deletions
8
...abel-plugin-transform-object-rest-spread/test/fixtures/object-spread/assignment/output.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,8 @@ | ||
var x; | ||
var y; | ||
var z; | ||
z = babelHelpers.objectSpread2({ x }, y); | ||
z = { | ||
x, | ||
w: babelHelpers.objectSpread2({}, y) | ||
}; |
13 changes: 13 additions & 0 deletions
13
...abel-plugin-transform-object-rest-spread/test/fixtures/object-spread/expression/output.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,13 @@ | ||
var a; | ||
var b; | ||
var c; | ||
var d; | ||
var x; | ||
var y; | ||
babelHelpers.objectSpread2(babelHelpers.objectSpread2(babelHelpers.objectSpread2({ x }, y), {}, { a }, b), {}, { c }); | ||
babelHelpers.objectSpread2({}, Object.prototype); | ||
babelHelpers.objectSpread2({}, { foo: "bar" }); | ||
babelHelpers.objectSpread2(babelHelpers.objectSpread2({}, { foo: "bar" }), { bar: "baz" }); | ||
babelHelpers.objectSpread2({}, { get foo() { | ||
return "foo"; | ||
} }); |
18 changes: 18 additions & 0 deletions
18
...bel-plugin-transform-object-rest-spread/test/fixtures/object-spread/side-effect/output.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,18 @@ | ||
var k = { | ||
a: 1, | ||
b: 2 | ||
}; | ||
var o = babelHelpers.objectSpread2(babelHelpers.objectSpread2({ a: 3 }, k), {}, { b: k.a++ }); | ||
var pureA = {}; | ||
var pureB = {}; | ||
var pureC = {}; | ||
var pureD = {}; | ||
var pureE = {}; | ||
function impureFunc() { | ||
console.log("hello"); | ||
} | ||
var output = babelHelpers.objectSpread2(babelHelpers.objectSpread2(babelHelpers.objectSpread2(babelHelpers.objectSpread2(babelHelpers.objectSpread2(babelHelpers.objectSpread2({}, pureA), {}, { | ||
get foo() {}, | ||
get bar() {} | ||
}, pureB), pureC), impureFunc()), pureD), {}, { pureD }); | ||
var simpleOutput = babelHelpers.objectSpread2(babelHelpers.objectSpread2({}, pureA), {}, { test: "1" }, pureB); |
1 change: 1 addition & 0 deletions
1
...n-transform-object-rest-spread/test/fixtures/object-spread/variable-declaration/output.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 @@ | ||
var z = babelHelpers.objectSpread2({}, x); |
7 changes: 7 additions & 0 deletions
7
...ides/babel-plugin-transform-object-rest-spread/test/fixtures/regression/gh-4904/output.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,7 @@ | ||
const _excluded = ["b"]; | ||
const _foo = foo(), { s } = _foo, t = babelHelpers.objectWithoutProperties(_foo, ["s"]); | ||
const _bar = bar(), { s: _ref } = _bar, { q1 } = _ref, q2 = babelHelpers.objectWithoutProperties(_ref, ["q1"]), q3 = babelHelpers.objectWithoutProperties(_bar, ["s"]); | ||
const { a } = foo((_ref2) => { | ||
let { b } = _ref2, c = babelHelpers.objectWithoutProperties(_ref2, _excluded); | ||
console.log(b, c); | ||
}); |
3 changes: 3 additions & 0 deletions
3
...ides/babel-plugin-transform-object-rest-spread/test/fixtures/regression/gh-5151/output.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,3 @@ | ||
const { x } = a, y = babelHelpers.objectWithoutProperties(a, ["x"]), z = foo(y); | ||
const s = babelHelpers.extends({}, (babelHelpers.objectDestructuringEmpty(r), r)), t = foo(s); | ||
var l = foo(), _bar = bar(), { m: _ref } = _bar, { n } = _ref, o = babelHelpers.objectWithoutProperties(_ref, ["n"]), p = babelHelpers.objectWithoutProperties(_bar, ["m"]), q = baz(); |
Oops, something went wrong.