Skip to content

Error on ES5, fix skipped tests#2787

Merged
jakebailey merged 4 commits intomainfrom
jabaile/error-es5-fix-tests
Feb 14, 2026
Merged

Error on ES5, fix skipped tests#2787
jakebailey merged 4 commits intomainfrom
jabaile/error-es5-fix-tests

Conversation

@jakebailey
Copy link
Member

Largely ports microsoft/TypeScript#63067

This also removes ES3 as a value we even recognize. ES3 is the same as "unset", so in the PR where I bumped the submodule and skipped ES3/ES5 tests, I accidentally skipped all tests without any target set.

Such is the risk of having a valid value that is also the unset value.

Copilot AI review requested due to automatic review settings February 14, 2026 00:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes ES3 as a recognized compiler target and adds error handling for ES5, porting changes from TypeScript PR #63067. The main issue addressed is that ES3 was both a valid value and the unset/default value, which caused tests without any target setting to be incorrectly skipped.

Changes:

  • Removed ES3 from the valid target options
  • Added error diagnostics for ES5 target usage
  • Updated test infrastructure to handle unrecognized option values
  • Generated new baseline files for previously skipped tests

Reviewed changes

Copilot reviewed 298 out of 355 changed files in this pull request and generated no comments.

Show a summary per file
File Description
internal/tsoptions/enummaps.go Removed ES3 entry from targetOptionMap
internal/tsoptions/commandlineoption.go Removed "es3" from deprecated target options
internal/testutil/harnessutil/harnessutil.go Added tryGetValueOfOptionString to handle unrecognized values; updated skipUnsupportedCompilerOptions to only skip ES5
internal/core/scripttarget_stringer_generated.go Removed ES3 from stringer generation
internal/core/compileroptions.go Removed ScriptTargetES3 constant and updated ES5 deprecation comment
internal/compiler/program.go Uncommented ES5 validation error
testdata/baselines/reference/* New baseline files for tests that were previously skipped

@jakebailey jakebailey enabled auto-merge February 14, 2026 00:52
@jakebailey
Copy link
Member Author

I have a fix for that skipped test; it's the same thing as #2134 but for functions/constructors. Enums also have the bug.

@jakebailey jakebailey added this pull request to the merge queue Feb 14, 2026
Merged via the queue into main with commit c15728a Feb 14, 2026
20 checks passed
@jakebailey jakebailey deleted the jabaile/error-es5-fix-tests branch February 14, 2026 08:19
Copilot AI pushed a commit that referenced this pull request Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants