Visitar URL original
[Babel 8] Treat `allowSuperOutsideMethod` as top-level only by JLHwung · Pull Request #17505 · babel/babel · GitHub
Skip to content

[Babel 8] Treat allowSuperOutsideMethod as top-level only - #17505

Merged
nicolo-ribaudo merged 3 commits into
babel:mainfrom
JLHwung:treat-allow-super-outside-method-as-toplevel-only
Sep 12, 2025
Merged

nicolo-ribaudo merged 3 commits into
babel:mainfrom
JLHwung:treat-allow-super-outside-method-as-toplevel-only

Conversation

@JLHwung

@JLHwung JLHwung commented Sep 8, 2025 •

Copy link
Copy Markdown
Contributor
Q                       A
Fixed Issues?
Patch: Bug Fix?
Major: Breaking Change? Yes
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link babel/website#3182
Any Dependency Changes?
License MIT

As a follow-up to #17203 (comment), in this PR we treat allowSuperOutsideMethod as top-level only in Babel 8. If this option is enabled, super() and super.property will be allowed in the top level.

The following productions will be invalid in Babel 8 even if allowSuperOutsideMethod is true:

class C extends B { method() { super(); } }
class C extends B { static { super(); } }
class C extends B { property = super(); }
function f() { super(); super.property; }

@JLHwung JLHwung added PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release pkg: parser PR: Needs Docs labels Sep 8, 2025
@JLHwung JLHwung changed the title Treat allowSuperOutsideMethod as top-level only [Babel 8] Treat allowSuperOutsideMethod as top-level only Sep 8, 2025
@babel-bot

babel-bot commented Sep 8, 2025 •

Copy link
Copy Markdown
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/59917

@pkg-pr-new

pkg-pr-new Bot commented Sep 8, 2025 •

Copy link
Copy Markdown

Open in StackBlitz

commit: 08939f4

@JLHwung
JLHwung force-pushed the treat-allow-super-outside-method-as-toplevel-only branch from e6e3af3 to 08939f4 Compare September 8, 2025 16:21
This was referenced Nov 27, 2025
@github-actions github-actions Bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Dec 13, 2025
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Dec 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants