Skip to content

Conversation

@JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Sep 8, 2025

Q                       A
Fixed Issues?
Patch: Bug Fix?
Major: Breaking Change? Yes
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
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
Copy link
Collaborator

babel-bot commented Sep 8, 2025

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

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 8, 2025

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 PR: Needs Docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants