Skip to content

Wrong super keyword async scope resolution #30192

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

Closed

Conversation

gabrielbiga
Copy link

Fix runtime error when calling the super methods class within nested async functions.

Fixes #30066

A simpler way to reproduce it:

class A {
    x() {
    }
}

class B extends A {
    // inner async super call
    async inner() {
        (async () => {
            super["x"]();
        })();
    }
}

new B().inner();

This patch already fixes the bug when you're calling directly a method inside an inner async function and the compiler does not generate the _super variable.

class A {
    x() {
    }
}

class B extends A {
    // inner async super call
    async inner() {
        (async () => {
            super.x();
        })();
    }
}

new B().inner();

@msftclas
Copy link

msftclas commented Mar 2, 2019

CLA assistant check
All CLA requirements met.

Fix runtime error when calling the super class within nested async
functions.
@gabrielbiga gabrielbiga force-pushed the fix/async-super-call branch from b793c83 to 76fe68d Compare March 9, 2019 19:31
@mmilbrath
Copy link

Any guess of when this may be integrated?

@rbuckton
Copy link
Contributor

rbuckton commented May 7, 2019

My apologies for not seeing this prior to merging #30497, which also fixed this issue. I am closing this PR as the issue has already been resolved.

@rbuckton rbuckton closed this May 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong async scope resolution
4 participants