diff --git a/internal/checker/utilities.go b/internal/checker/utilities.go index 8faec72b231..8f534c2d6d6 100644 --- a/internal/checker/utilities.go +++ b/internal/checker/utilities.go @@ -1531,6 +1531,9 @@ var getFeatureMap = sync.OnceValue(func() map[string][]FeatureMapEntry { "AsyncDisposableStack": { {lib: "esnext", props: []string{}}, }, + "Date": { + {lib: "esnext", props: []string{"toTemporalInstant"}}, + }, } }) diff --git a/testdata/baselines/reference/submodule/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt b/testdata/baselines/reference/submodule/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt index 9da9745147c..a7240a31cc5 100644 --- a/testdata/baselines/reference/submodule/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt @@ -31,7 +31,7 @@ doYouNeedToChangeYourTargetLibraryES2016Plus.ts(39,47): error TS2550: Property ' doYouNeedToChangeYourTargetLibraryES2016Plus.ts(40,20): error TS2583: Cannot find name 'BigInt'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2020' or later. doYouNeedToChangeYourTargetLibraryES2016Plus.ts(43,32): error TS2550: Property 'any' does not exist on type 'PromiseConstructor'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2021' or later. doYouNeedToChangeYourTargetLibraryES2016Plus.ts(44,33): error TS2550: Property 'replaceAll' does not exist on type '""'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2021' or later. -doYouNeedToChangeYourTargetLibraryES2016Plus.ts(47,46): error TS2339: Property 'toTemporalInstant' does not exist on type 'Date'. +doYouNeedToChangeYourTargetLibraryES2016Plus.ts(47,46): error TS2550: Property 'toTemporalInstant' does not exist on type 'Date'. Do you need to change your target library? Try changing the 'lib' compiler option to 'esnext' or later. ==== doYouNeedToChangeYourTargetLibraryES2016Plus.ts (34 errors) ==== @@ -149,5 +149,5 @@ doYouNeedToChangeYourTargetLibraryES2016Plus.ts(47,46): error TS2339: Property ' // esnext const testDateToTemporalInstant = new Date().toTemporalInstant(); ~~~~~~~~~~~~~~~~~ -!!! error TS2339: Property 'toTemporalInstant' does not exist on type 'Date'. +!!! error TS2550: Property 'toTemporalInstant' does not exist on type 'Date'. Do you need to change your target library? Try changing the 'lib' compiler option to 'esnext' or later. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt.diff index bb208ca5ab9..143334c8331 100644 --- a/testdata/baselines/reference/submodule/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/doYouNeedToChangeYourTargetLibraryES2016Plus.errors.txt.diff @@ -14,22 +14,16 @@ doYouNeedToChangeYourTargetLibraryES2016Plus.ts(17,111): error TS2550: Property 'groups' does not exist on type 'RegExpExecArray'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later. doYouNeedToChangeYourTargetLibraryES2016Plus.ts(18,33): error TS2550: Property 'dotAll' does not exist on type 'RegExp'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later. doYouNeedToChangeYourTargetLibraryES2016Plus.ts(19,38): error TS2550: Property 'PluralRules' does not exist on type 'typeof Intl'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later. -@@= skipped -29, +23 lines =@@ - doYouNeedToChangeYourTargetLibraryES2016Plus.ts(40,20): error TS2583: Cannot find name 'BigInt'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2020' or later. - doYouNeedToChangeYourTargetLibraryES2016Plus.ts(43,32): error TS2550: Property 'any' does not exist on type 'PromiseConstructor'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2021' or later. - doYouNeedToChangeYourTargetLibraryES2016Plus.ts(44,33): error TS2550: Property 'replaceAll' does not exist on type '""'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2021' or later. --doYouNeedToChangeYourTargetLibraryES2016Plus.ts(47,46): error TS2550: Property 'toTemporalInstant' does not exist on type 'Date'. Do you need to change your target library? Try changing the 'lib' compiler option to 'esnext' or later. -- -- +@@= skipped -32, +26 lines =@@ + doYouNeedToChangeYourTargetLibraryES2016Plus.ts(47,46): error TS2550: Property 'toTemporalInstant' does not exist on type 'Date'. Do you need to change your target library? Try changing the 'lib' compiler option to 'esnext' or later. + + -==== doYouNeedToChangeYourTargetLibraryES2016Plus.ts (40 errors) ==== -+doYouNeedToChangeYourTargetLibraryES2016Plus.ts(47,46): error TS2339: Property 'toTemporalInstant' does not exist on type 'Date'. -+ -+ +==== doYouNeedToChangeYourTargetLibraryES2016Plus.ts (34 errors) ==== // es2016 const testIncludes = ["hello"].includes("world"); ~~~~~~~~ -@@= skipped -40, +40 lines =@@ +@@= skipped -37, +37 lines =@@ ~~~~~~~ !!! error TS2550: Property 'finally' does not exist on type 'Promise'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later. const testRegExpMatchArrayGroups = "2019-04-30".match(/(?[0-9]{4})-(?[0-9]{2})-(?[0-9]{2})/g).groups; @@ -50,11 +44,4 @@ -!!! error TS1503: Named capturing groups are only available when targeting 'ES2018' or later. ~~~~~~ !!! error TS2550: Property 'groups' does not exist on type 'RegExpExecArray'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2018' or later. - const testRegExpDotAll = /foo/g.dotAll; -@@= skipped -90, +78 lines =@@ - // esnext - const testDateToTemporalInstant = new Date().toTemporalInstant(); - ~~~~~~~~~~~~~~~~~ --!!! error TS2550: Property 'toTemporalInstant' does not exist on type 'Date'. Do you need to change your target library? Try changing the 'lib' compiler option to 'esnext' or later. -+!!! error TS2339: Property 'toTemporalInstant' does not exist on type 'Date'. - \ No newline at end of file + const testRegExpDotAll = /foo/g.dotAll; \ No newline at end of file