Conversation
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/7571/ |
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/7504/ |
|
/to @nicolo-ribaudo, since you filled the bug. 😉 |
| @@ -16,19 +16,10 @@ | |||
| "cacheDir": ".changelog", | |||
There was a problem hiding this comment.
(Not related to this PR)
I think that we should exclude this file from prettier, since it clashes with the how lerna generates it (I suppose so because it has been prettified and reverted two times)
| * @example | ||
| * | ||
| * _get(CLASS.prototype.__proto__ || Object.getPrototypeOf(CLASS.prototype), "METHOD", this) | ||
| * _get(Object.getPrototypeOf(CLASS.prototype), "METHOD", this) |
There was a problem hiding this comment.
This should be _getPrototypeOf
There was a problem hiding this comment.
Illustrative, since Object.getPrototypeOf is a known algorithm.
| t.cloneNode(ref), | ||
| this.getSuperProperty(property, computed), | ||
| ), | ||
| setter, |
There was a problem hiding this comment.
Why do we need to store the _get result?
There was a problem hiding this comment.
We don't yet have a set algorithm that will do the get, too. So, we have to do the get, then pass it to the set.
And, given the codesize for the get/set algorithms, I didn't want in include yet another for this case.
| // super.foo += 1; | ||
| return this.specHandleAssignmentExpression(null, path, binary); | ||
| // _ref = super.foo, super.foo = _ref + 1 | ||
| nodes = this.specHandleAssignmentExpression(grandParentPath); |
There was a problem hiding this comment.
I think that we should convert super.foo to a number, like we do for super.foo++?
| }; | ||
|
|
||
| for (const bareSuper of classState.bareSupers) { | ||
| for (const bareSuper of new Set(classState.bareSupers)) { |
There was a problem hiding this comment.
Is this new Set to avoid duplicated paths? When can it happen? I think that you should add a comment.
There was a problem hiding this comment.
super[super().name]();
We find the original super, and transform it. But the MemberExpression super[NEXT] is still queued, so we find super() and add it. Then the transformed _get(PROTO, super().name) is traversed, finding super() again.
There was a problem hiding this comment.
Maybe the set would be better inside ReplaceSupers?
There was a problem hiding this comment.
Yeah, state.bareSupers should be a set since the beginning if possible.
There was a problem hiding this comment.
I think that you forgot to commit the file? In the last commit only some tests and comments are changed.
ed1f7bd to
0cfb265
Compare
Follows the plan laid out in babel#7553 (comment). With babel#7691, this closes babel#7553, closes babel#4312. /cc @danez.
Follows the plan laid out in babel#7553 (comment). With babel#7691, this closes babel#7553, closes babel#4312.
Follows the plan laid out in babel#7553 (comment). With babel#7691, this closes babel#7553, closes babel#4312.
Follows the plan laid out in babel#7553 (comment). With babel#7691, this closes babel#7553, closes babel#4312.
* Update super property get/set/call in loose mode Follows the plan laid out in #7553 (comment). With #7691, this closes #7553, closes #4312. * Post #7772 * Memoized property
The computed keys, and static field initializers (for classes) are evaluated in the outer scope's home environment, not the newly created environment.
Fixes #7682.