Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object rest syntax not transpiling correctly with dynamic properties #9834

Closed
noahgrant opened this issue Apr 8, 2019 · 4 comments · Fixed by #10013
Closed

Object rest syntax not transpiling correctly with dynamic properties #9834

noahgrant opened this issue Apr 8, 2019 · 4 comments · Fixed by #10013
Labels
i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@noahgrant
Copy link

Bug Report

Current Behavior
Assigning object values to dynamic variables while using object rest syntax results in transpiling code that looks like:

// dynamic properties to be omitted from initialObject are simply undefined
_objectWithoutProperties(initialObject, ["undefined"]);

Input Code

Expected behavior/code
As you can see at the REPL link above, babel tries to remove 'undefined' properties from the initialObject, resulting in rest containing all of the initialObject's properties. If you were to paste that code into chrome devtools, rest would correctly only contain familyGuy.

Babel Configuration (.babelrc, package.json, cli command)

The config is built-in to the REPL at the link above, but the preset-env is using the following browsers:

Chrome >= 67, Firefox >= 63, Edge >= 17, Opera >= 57, Safari >= 11.1

Environment

  • Babel version(s): 7.4
  • How you are using Babel: REPL

image

@babel-bot
Copy link
Collaborator

Hey @noahgrant! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community
that typically always has someone willing to help. You can sign-up here
for an invite.

@noahgrant
Copy link
Author

I'd just like to add that I changed my Edge requirements to >= 18 and it was transpiled correctly.

@noahgrant
Copy link
Author

related question—using Edge 17 also transpiled default function parameters, but I thought Edge 17 was supposed to be fully ES2015-compliant?

@nicolo-ribaudo
Copy link
Member

related question—using Edge 17 also transpiled default function parameters, but I thought Edge 17 was supposed to be fully ES2015-compliant?

Yeah, it is fixed by #9902

@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Aug 22, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
i: bug outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants