Skip to content

Conversation

@jakebailey
Copy link
Member

Noticed in #63071.

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

Adjusts a few conformance/compiler tests to run with an ES5 target again (in addition to ES2015) and adds the corresponding ES5 baselines.

Changes:

  • Updated three test headers to run with @target: es5,es2015.
  • Added ES5 reference baselines for types/symbols/JS (and sourcemap validation where applicable).
  • Recorded the new ES5-target diagnostics output in *.errors.txt baselines.

Reviewed changes

Copilot reviewed 16 out of 28 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/cases/conformance/es6/spread/arrayLiteralSpreadES5iterable.ts Adds ES5 to the test’s target matrix so ES5 downleveling is exercised.
tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration1ES5iterable.ts Adds ES5 to the test’s target matrix so ES5 downleveling is exercised.
tests/cases/compiler/sourceMapValidationVarInDownLevelGenerator.ts Adds ES5 to the test’s target matrix to validate downlevel generator sourcemaps.
tests/baselines/reference/sourceMapValidationVarInDownLevelGenerator(target=es5).types New ES5 baseline for type printing.
tests/baselines/reference/sourceMapValidationVarInDownLevelGenerator(target=es5).symbols New ES5 baseline for symbol printing.
tests/baselines/reference/sourceMapValidationVarInDownLevelGenerator(target=es5).sourcemap.txt New ES5 baseline validating sourcemap mappings in downlevel emit.
tests/baselines/reference/sourceMapValidationVarInDownLevelGenerator(target=es5).js New ES5 baseline for JS emit.
tests/baselines/reference/sourceMapValidationVarInDownLevelGenerator(target=es5).errors.txt New ES5 baseline capturing diagnostics produced under the ES5 target.
tests/baselines/reference/destructuringVariableDeclaration1ES5iterable(target=es5).types New ES5 baseline for type printing.
tests/baselines/reference/destructuringVariableDeclaration1ES5iterable(target=es5).symbols New ES5 baseline for symbol printing.
tests/baselines/reference/destructuringVariableDeclaration1ES5iterable(target=es5).js New ES5 baseline for JS emit.
tests/baselines/reference/destructuringVariableDeclaration1ES5iterable(target=es5).errors.txt New ES5 baseline capturing diagnostics produced under the ES5 target.
tests/baselines/reference/arrayLiteralSpreadES5iterable(target=es5).types New ES5 baseline for type printing.
tests/baselines/reference/arrayLiteralSpreadES5iterable(target=es5).symbols New ES5 baseline for symbol printing.
tests/baselines/reference/arrayLiteralSpreadES5iterable(target=es5).js New ES5 baseline for JS emit.
tests/baselines/reference/arrayLiteralSpreadES5iterable(target=es5).errors.txt New ES5 baseline capturing diagnostics produced under the ES5 target.

@@ -1,4 +1,4 @@
// @target: es2015
// @target: es5,es2015
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

With ES5 included, the test now produces TS5107 ('target=ES5' is deprecated), which then gets baked into the *.errors.txt baseline. This diagnostic text is likely to churn over time and make the test brittle. Consider silencing it via a test header option (e.g. setting the compiler option to ignore this deprecation) so these conformance baselines remain focused on emit/type behavior rather than deprecation messaging.

Suggested change
// @target: es5,es2015
// @target: es5,es2015
// @ignoreDeprecations: 5.0

Copilot uses AI. Check for mistakes.
@@ -1,4 +1,4 @@
// @target: es2015
// @target: es5,es2015
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

Adding ES5 to the target list causes TS5107 deprecation output to appear in the new ES5 *.errors.txt baseline. This tends to be unstable noise for conformance tests. Prefer suppressing the deprecation via a test directive/compiler option so the baseline doesn’t need to pin a deprecation message.

Suggested change
// @target: es5,es2015
// @target: es5,es2015
// @suppressDeprecationWarnings: true

Copilot uses AI. Check for mistakes.
@@ -1,4 +1,4 @@
// @target: es2015
// @target: es5,es2015
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

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

The ES5 target now triggers TS5107 (ES5 target deprecation), which is captured in the newly added sourceMapValidationVarInDownLevelGenerator(target=es5).errors.txt. Since this test’s intent is sourcemap validation, pinning a deprecation message makes the baseline more fragile than necessary. Consider suppressing the deprecation through a test header/compiler option so the sourcemap baselines stay stable.

Suggested change
// @target: es5,es2015
// @target: es5,es2015
// @ignoreDeprecations: 5.0

Copilot uses AI. Check for mistakes.
@github-project-automation github-project-automation bot moved this from Not started to Needs merge in PR Backlog Feb 3, 2026
@jakebailey jakebailey added this pull request to the merge queue Feb 4, 2026
Merged via the queue into microsoft:main with commit 022800b Feb 4, 2026
33 checks passed
@jakebailey jakebailey deleted the fix-missing-es5-tests branch February 4, 2026 19:20
@github-project-automation github-project-automation bot moved this from Needs merge to Done in PR Backlog Feb 4, 2026
@jakebailey jakebailey restored the fix-missing-es5-tests branch February 4, 2026 19:35
@jakebailey jakebailey deleted the fix-missing-es5-tests branch February 4, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants