Skip to content

Port PR #62628: Add Date.toTemporalInstant to getScriptTargetFeatures#2810

Merged
jakebailey merged 3 commits intomainfrom
copilot/port-lib-esnext-temporal
Feb 18, 2026
Merged

Port PR #62628: Add Date.toTemporalInstant to getScriptTargetFeatures#2810
jakebailey merged 3 commits intomainfrom
copilot/port-lib-esnext-temporal

Conversation

Copy link
Contributor

Copilot AI commented Feb 17, 2026

The lib declarations for esnext.temporal and esnext.date were already ported, but the getFeatureMap in internal/checker/utilities.go was missing the Date entry. Without it, Date.toTemporalInstant() produces a generic "property does not exist" error instead of the helpful "Do you need to change your target library?" diagnostic.

  • Added Date{esnext: ["toTemporalInstant"]} entry to getFeatureMap
  • Baseline diff for doYouNeedToChangeYourTargetLibraryES2016Plus reduced as expected

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…poral support

Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
Copilot AI changed the title [WIP] Port add lib.esnext.temporal changes from TypeScript Port PR #62628: Add Date.toTemporalInstant to getScriptTargetFeatures Feb 17, 2026
Copilot AI requested a review from jakebailey February 17, 2026 19:15
@jakebailey jakebailey marked this pull request as ready for review February 17, 2026 19:48
Copilot AI review requested due to automatic review settings February 17, 2026 19:48
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 ports TypeScript PR #62628, which improves the error diagnostic for Date.toTemporalInstant() when the appropriate library target is not configured. Previously, accessing this method produced a generic TS2339 "Property does not exist" error. With this change, it now produces a helpful TS2550 error that suggests changing the 'lib' compiler option to 'esnext' or later.

Changes:

  • Added Date entry to the feature map in internal/checker/utilities.go with toTemporalInstant mapped to the esnext library
  • Baseline test outputs updated to reflect the improved diagnostic (TS2339 → TS2550)
  • Baseline diff file reduced, showing better convergence with TypeScript's reference implementation

Reviewed changes

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

File Description
internal/checker/utilities.go Added Date entry to getFeatureMap with toTemporalInstant property mapped to esnext library
testdata/baselines/reference/submodule/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt Updated baseline showing improved error diagnostic (TS2550 with library suggestion instead of generic TS2339)
testdata/baselines/reference/submodule/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt.diff Reduced diff file showing convergence with TypeScript reference implementation

@DanielRosenwasser
Copy link
Member

@DanielRosenwasser DanielRosenwasser added this pull request to the merge queue Feb 17, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Feb 17, 2026
@jakebailey jakebailey enabled auto-merge February 18, 2026 00:12
@jakebailey jakebailey added this pull request to the merge queue Feb 18, 2026
Merged via the queue into main with commit 65cc7c0 Feb 18, 2026
20 checks passed
@jakebailey jakebailey deleted the copilot/port-lib-esnext-temporal branch February 18, 2026 00:28
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.

3 participants

Comments