Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Merged
nicolo-ribaudo merged 3 commits into
babel:mainbabel/babel:mainfrom
JLHwung:treat-allow-super-outside-method-as-toplevel-onlyJLHwung/babel:treat-allow-super-outside-method-as-toplevel-onlyCopy head branch name to clipboard
Sep 12, 2025
Merged

[Babel 8] Treat allowSuperOutsideMethod as top-level only#17505
nicolo-ribaudo merged 3 commits into
babel:mainbabel/babel:mainfrom
JLHwung:treat-allow-super-outside-method-as-toplevel-onlyJLHwung/babel:treat-allow-super-outside-method-as-toplevel-onlyCopy head branch name to clipboard

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
@nicolo-ribaudo
nicolo-ribaudo merged commit e7031b7 into babel:main Sep 12, 2025
76 checks passed
@nicolo-ribaudo
nicolo-ribaudo deleted the treat-allow-super-outside-method-as-toplevel-only branch September 12, 2025 11:44
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.