Repository navigation
fix: allow parenthesized assignment target in arrow initializer - #18442
Merged
Merged
Conversation
Collaborator
Author
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/62674 |
|
commit: |
JLHwung
approved these changes
Oct 29, 2026
This was referenced Nov 6, 2026
1 task
This was referenced Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #18372 to 7.x
Cherry-picked commits:
Conflicts: Resolved.
packages/babel-parser/src/parser/statement.ts:parseFunctiondiffers on 7.x (function expression ids are parsed without thetokenIsIdentifierguard and expression scope wrapper). Kept the 7.x code; only thesharedExpressionScope/parameterDeclarationScoperenames are applied.packages/babel-parser/src/util/expression-scope.ts: 7.x usesPositionlocations (origin,loc.index) instead of numeric offsets. Applied the!scope.isInitializer()boundary logic inrecordParameterInitializerErrorandvalidateAsPatternusing the 7.x variables.Fix commits:
Fix TS type names after backporting #18372: the newtsIsTypeCasthelper usedN.TSAsExpressionetc.; on 7.x the types are namedN.TsAsExpression,N.TsSatisfiesExpression,N.TsNonNullExpression,N.TsTypeAssertion, which broketscheck.Regenerate parser fixtures for 7.x AST after backporting #18372: regenerated 4 new fixtures'output.json(withOVERWRITE=true) whose expected output used the Babel 8 AST (e.g.TSMappedType.key/constraint, noTSParenthesizedType,TSTypeParameter.nameas Identifier, noextra.shorthand).Checks:
tscheckpasses and prettier passes on changed files.check-compat-datacould not run (needs network to clone compat-table) and ESLint could not run in the sandbox (missingjiti), so neither was verified.packages/babel-code-frame/test/color-detection.js, which is environment-related (terminal color detection) and unrelated to this PR.Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
github.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.