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
fix: correctly transform __proto__
properties
#12664
fix: correctly transform __proto__
properties
#12664
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/37981/ |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 0357fe1:
|
This can be put either in one plugin or in the other, we don't have a general rule for choosing where to put cross-plugin tests.
Imo we can leave it as |
packages/babel-plugin-transform-shorthand-properties/src/index.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Fixes #11882
Fixes #12647
This fixes the transform of
__proto__
to match the spec, where only the non‑computed, non‑shorthand form of__proto__
({ __proto__: prototype }
) is special. All other forms create an own enumerable__proto__
property.To do:
@babel/plugin‑transform‑computed‑properties
and@babel/plugin‑transform‑shorthand‑properties
are used.{ ["__proto__"]: anything }
as special (always use[[Define]]
) insetComputedProperties
mode.RESOLVED: Leave it as
[[Set]]
(fix: correctly transform__proto__
properties #12664 (comment))