-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
fix: Transform property mutators fails on computed property names #15234
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
Conversation
47ca865 to
f84fd25
Compare
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/53655/ |
JLHwung
left a comment
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.
Can you add a new test case for computed keys with side effect? In this case the key expression should be computed twice. I believe that's why the plugin ignored the computed key.
We could support those key expressions if scope.isStatic(expressionPath) is true.
25af72f to
e61fdbe
Compare
nicolo-ribaudo
left a comment
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.
Could you rebase this now that #15232 has been merged? There are no git conflicts, but just to make sure that the fixtures don't need to be updated.
338f5e3 to
299d733
Compare
|
I found a bug: with the property mutators plugin, this code: var obj = {
get [(() => "x")()]() { return 1 },
set [(() => "x")()](_) {}
};
console.log(obj.x);logs |
|
It seems that using merge would be more convenient in this case. |
|
I was thinking about this, and I'm not sure anymore that we should fix it. |
|
I forget why I did this, but apparently the original problem has been fixed. |
Uh oh!
There was an error while loading. Please reload this page.