You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In ES2015, constructors which return a value (which is an object) implicitly substitute the value of this for any callers of super(). As a result, it is necessary to capture any potential return value of super() and replace it with this.
Some remaining work might be to do some refactoring on the emit code.
…eserved.
This came up when a `super()` call was nested in another constructor body.
Current logic in the transform says that if the last containing non-arrow
function body is non-static, and the current parent isn't a call expression,
the call target of a `super` call will become `_super.prototype` instead
of `super`.
If the state is not saved, the containing arrow function and parent
are not saved, and the information for this check won't be accurate.
Awesome work!
I have verified, that with this branch of TypeScript, I can now in fact create CustomElements entirely in TypeScript. Thank You
FYI: @justinfagnani@treshugart
I don't think our test harness gives an error for this right now.
@sandersn how have we been operating like this? In any case, it looks like GitHub just has a limitation and might not be showing that file. I seem to have it locally.
It's only been since we made the tests run faster by not writing output for passing tests.
I have the PR open in codeflow too or I would not have noticed the missing file at all. But maybe it's missing at the API level, not just the UI level.
When I check out the branch myself I see it, but I don't find it in the github list of files either. I guess it's a limitation of github proper, not just its UI.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes #7574.
In ES2015, constructors which return a value (which is an object) implicitly substitute the value of
this
for any callers ofsuper()
. As a result, it is necessary to capture any potential return value ofsuper()
and replace it withthis
.Some remaining work might be to do some refactoring on the emit code.
I'd suggest reading one commit at a time.