Move more class state out of replaceSupers#7750
Conversation
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/7675/ |
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/7624/ |
| environmentVisitor, | ||
| { | ||
| ReturnStatement(path, state) { | ||
| // TODO get this shit out of here |
There was a problem hiding this comment.
https://github.com/babel/babel/pull/7737/files#diff-74b3eb66512735b6b5013e5d41e33642R65. I've been planing this removal for the issues linked in OP.
| woops.super.test(); | ||
| _this = _Foo.call(this) || this; | ||
|
|
||
| _Foo.prototype.test.call(_this); |
There was a problem hiding this comment.
I would think loose mode doesn't need this assertion right? At least it wasn't there before
There was a problem hiding this comment.
It's closer to spec code, but this is only here because I haven't optimized any special cases yet.
| babelHelpers.classCallCheck(this, Outer); | ||
| _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Outer).call(this)); | ||
|
|
||
| var _babelHelpers$get$cal = babelHelpers.get(babelHelpers.getPrototypeOf(Outer.prototype), "toString", babelHelpers.assertThisInitialized(_this)).call(_this); |
There was a problem hiding this comment.
Didn't really look into it, but is it supposed to call assertThisInitialized multiple twice like this?
There was a problem hiding this comment.
No, but it won't hurt. Like I said in the OP, this output is worse because I'm not optimizing any special cases yet, I just need to refactor code out of here so I can work on access-to-function-calls so we can get Private props. Then I can start work on refactoring all of the classes transform.
Yes, the output is uglier. But, this is necessary for me to refactor `replaceSupers` for babel#7733, which is necessary for both babel#7555 and babel#7553 (comment). I'm still in the middle of cleaning up all this code. Don't expect `transformClass` to survive much longer as it's written currently.
7354d7f to
fbe6705
Compare
Yes, the output is uglier. But, this is necessary for me to refactor
replaceSupersfor #7733, which is necessary for both #7555 and#7553 (comment).
I'm still in the middle of cleaning up all this code. Don't expect
transformClassto survive much longer as it's written currently.