Skip to content

fix(@angular/build): prevent syntax corruption for Crockford-style enum IIFE - #33791

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:fix-oxc-crockford-enum-iife
Aug 6, 2026
Merged

fix(@angular/build): prevent syntax corruption for Crockford-style enum IIFE#33791
alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:fix-oxc-crockford-enum-iife

Conversation

@alan-agius4

Copy link
Copy Markdown
Collaborator

When transforming Crockford-style TypeScript enum IIFEs (e.g. (function (E) { ... }(E || (E = {})));), ensure all leading and trailing parentheses of the expression statement are removed when moving the IIFE call expression to the var initializer so no dangling parentheses remain before subsequent statements.

Fixes #33785

…um IIFE

When transforming Crockford-style TypeScript enum IIFEs, ensure all leading and trailing parentheses of the expression statement are removed when moving the IIFE call expression to the var initializer.

Fixes angular#33785
@alan-agius4 alan-agius4 added the target: minor This PR is targeted for the next minor release label Aug 6, 2026
@alan-agius4
alan-agius4 requested a review from clydin August 6, 2026 07:52
@alan-agius4 alan-agius4 added the action: review The PR is still awaiting reviews from at least one requested reviewer label Aug 6, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the OXC-based TypeScript enum transformation to correctly handle enums wrapped in parentheses, including Crockford-style IIFEs and nested parentheses, by removing leading/trailing characters and parentheses from the expression statement. It also adds comprehensive unit tests to verify these scenarios. I have no feedback to provide.

@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Aug 6, 2026
@alan-agius4
alan-agius4 merged commit 199a864 into angular:main Aug 6, 2026
43 checks passed
@alan-agius4

Copy link
Copy Markdown
Collaborator Author

This PR was merged into the repository. The changes were merged into the following branches:

@alan-agius4
alan-agius4 deleted the fix-oxc-crockford-enum-iife branch August 6, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/build target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ng build ts error unexpected const

2 participants