Skip to content
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(53204): Bug: __runInitializers(this) is emitted before super() call #53268

Merged
merged 2 commits into from Mar 15, 2023

Conversation

a-tarasyuk
Copy link
Contributor

Fixes #53204

@typescript-bot typescript-bot added the For Milestone Bug PRs that fix a bug with a specific milestone label Mar 15, 2023
@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Mar 15, 2023

Should we do one last cherry-pick/LKG if we can get the fix in today?

Copy link
Member

@jakebailey jakebailey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pattern of findSuperStatementIndex is already used by both the ts transform (see transformConstructorBody) and the classFields transform (see transformConstructorBody); it seems like it'd be best to be able to fix these in such a way that we don't have to fix this bug over and over again, but, I'm not sure what that looks like.

So, LGTM, but I don't think my +1 should be the determining factor in if this fix is final or backportable.

Copy link
Member

@DanielRosenwasser DanielRosenwasser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that we have an error if super() doesn't appear at the top level, I think we can bring this in.

@DanielRosenwasser
Copy link
Member

@typescript-bot pack this
@typescript-bot cherry-pick this to release-5.0

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 15, 2023

Heya @DanielRosenwasser, I've started to run the tarball bundle task on this PR at 9ce2780. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 15, 2023

Heya @DanielRosenwasser, I've started to run the task to cherry-pick this into release-5.0 on this PR at 9ce2780. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Mar 15, 2023

Hey @DanielRosenwasser, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/149571/artifacts?artifactName=tgz&fileId=BAD33F4D94019FD31A087C3F4114C21AF40D4C233685217E1C348C63055E473D02&fileName=/typescript-5.1.0-insiders.20230315.tgz"
    }
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/pr-build@5.1.0-pr-53268-4".;

@typescript-bot
Copy link
Collaborator

Hey @DanielRosenwasser, I've opened #53273 for you.

typescript-bot pushed a commit to typescript-bot/TypeScript that referenced this pull request Mar 15, 2023
Component commits:
71f24f3 fix(53204): call __runInitializers after super() call

9ce2780 call __runInitializers exclusively after super() call
@DanielRosenwasser DanielRosenwasser merged commit 7a65c34 into microsoft:main Mar 15, 2023
19 checks passed
DanielRosenwasser pushed a commit that referenced this pull request Mar 15, 2023
…e-5.0 (#53273)

Co-authored-by: Oleksandr T <oleksandr.tarasiuk@outlook.com>
drivron pushed a commit to scenari/typescript that referenced this pull request Sep 14, 2023
…to release-5.0 (microsoft#53273)

Co-authored-by: Oleksandr T <oleksandr.tarasiuk@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Milestone Bug PRs that fix a bug with a specific milestone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: __runInitializers(this) is emitted before super() call
5 participants