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:
Lively
2021-06-22 05:48:12 +09:00
committed by GitHub
parent 5145c98a73
commit 8ae0efe98a
3 changed files with 25 additions and 3 deletions

View File

@@ -0,0 +1,9 @@
const example = () => {
const input = {};
const foo = 'foo';
({
[`${foo}_bar`]: country,
...rest
} = input);
}

View File

@@ -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;
};