Don't hoist template literal keys in object-rest-spread (#13483)
* remove hoisting when using template strings in proposal-object-rest-spread * remove const from test
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
const example = () => {
|
||||
const input = {};
|
||||
const foo = 'foo';
|
||||
|
||||
({
|
||||
[`${foo}_bar`]: country,
|
||||
...rest
|
||||
} = input);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
const example = () => {
|
||||
const input = {};
|
||||
const foo = 'foo';
|
||||
var _input = input;
|
||||
({
|
||||
[`${foo}_bar`]: country
|
||||
} = _input);
|
||||
rest = babelHelpers.objectWithoutProperties(_input, [`${foo}_bar`]);
|
||||
_input;
|
||||
};
|
||||
Reference in New Issue
Block a user