-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Labels
claimedgood first issueoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue
Description
Bug Report
Current Behavior
When using string templates in computed properties, the property name isn't correctly excluded from the rest properties object.
Looking at the compiled code, it puts 'undefined' instead of the actual property name. If you use string concatenation, this does work perfectly.
Input Code
REPL sample
const input = {};
// Extract all known attributes from the user
const {
given_name: givenName,
'last_name': lastName,
[`country`]: country,
[prefix + 'state']: state,
[`${prefix}consents`]: consents,
// All the rest
...otherAttributes
} = input;Expected behavior/code
All given computed properties should be excluded from the otherAttributes object, but the ones using template strings remain.
Environment
- Babel version(s): v7.3.3 (probably older versions too)
- Node/npm version: any
- OS: any
Possible Solution
Make sure the transpiler knows what a template string is and correctly copy it over to the exclusion list. Sound like something that is easy to fix, but I have no idea where to start :).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
claimedgood first issueoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue