Port ES2025 ScriptTargetFeatures and fix ES2025 transformer mapping#2808
Merged
DanielRosenwasser merged 3 commits intomainfrom Feb 17, 2026
Merged
Port ES2025 ScriptTargetFeatures and fix ES2025 transformer mapping#2808DanielRosenwasser merged 3 commits intomainfrom
DanielRosenwasser merged 3 commits intomainfrom
Conversation
- Add missing ScriptTargetFeatures entries in checker/utilities.go: - RegExpConstructor (es2025: escape) - Math (es2025: f16round) - Set methods moved from esnext to es2025 - PromiseConstructor (es2025: try) - Intl (es2020-es2025 entries) - DataView (es2025: setFloat16, getFloat16) - Float16Array (es2025) - ErrorConstructor (esnext: isError) - Uint8ArrayConstructor (esnext: fromBase64, fromHex) - DisposableStack (esnext) - AsyncDisposableStack (esnext) - Uncomment ES2025 in transformer definitions - Accept baseline changes Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Port ES2025 target and add missing ScriptTargetFeatures
Port ES2025 ScriptTargetFeatures and fix ES2025 transformer mapping
Feb 17, 2026
jakebailey
reviewed
Feb 17, 2026
| case core.ScriptTargetESNext: | ||
| return nil // no transforms needed | ||
| case /*core.ScriptTargetES2025,*/ core.ScriptTargetES2024, core.ScriptTargetES2023, core.ScriptTargetES2022: | ||
| case core.ScriptTargetES2025, core.ScriptTargetES2024, core.ScriptTargetES2023, core.ScriptTargetES2022: |
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request ports missing ScriptTargetFeatures entries and fixes the ES2025 transformer mapping to align with TypeScript's ES2025 support. It addresses an issue where ES2025 code was incorrectly being downleveled using ES2016-era transformations.
Changes:
- Added ES2025 and esnext ScriptTargetFeatures entries for new types and methods (RegExpConstructor, Float16Array, Set methods, Math.f16round, etc.)
- Enabled ES2025 transformer case to prevent incorrect downlevel transforms
- Updated test baselines to reflect correct ES2025 output (no downleveling of optional chaining and object spread)
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
internal/transformers/estransforms/definitions.go |
Uncommented ES2025 case to apply correct transformer level |
internal/checker/utilities.go |
Added ES2025/esnext feature map entries for new types and moved Set methods from esnext to es2025 |
testdata/baselines/reference/submodule/conformance/callChainWithSuper(target=es2025).js |
Updated baseline to show optional chaining is preserved (not downleveled) |
testdata/baselines/reference/submodule/conformance/callChainWithSuper(target=es2025).js.diff |
Removed diff showing ES2025 now correctly preserves optional chaining |
testdata/baselines/reference/compiler/declarationEmitQualifiedName.js |
Updated baseline to show object spread is preserved (not converted to Object.assign) |
DanielRosenwasser
approved these changes
Feb 17, 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.
Ports unported changes from microsoft/TypeScript#63046. The ES2025 target and lib declarations were already ported, but
ScriptTargetFeaturesentries and the transformer case were missing.ScriptTargetFeatures (
internal/checker/utilities.go)Added missing entries to
getFeatureMap:RegExpConstructor(es2025),Float16Array(es2025),ErrorConstructor(esnext),Uint8ArrayConstructor(esnext),DisposableStack(esnext),AsyncDisposableStack(esnext)Setmethods (union, intersection, etc.),DataViewFloat16 methods,Math.f16roundPromiseConstructor.try(es2025),Intlmembers for es2020–es2025 (RelativeTimeFormat, Locale, DisplayNames, ListFormat, DateTimeFormat, Segmenter, DurationFormat)ES2025 transformer (
internal/transformers/estransforms/definitions.go)Uncommented
core.ScriptTargetES2025inGetESTransformer. Previously ES2025 fell through to thedefaultcase, incorrectly applying ES2016-level downlevel transforms (e.g., optional chaining, spread →Object.assign).Not ported
esnext.collectionlib mapping change — the current submodule haslib.esnext.collection.d.tswithMap.getOrInsertmethods still under esnext, so the mapping must stay as-is until the submodule is updated.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.