From dbb85c137b751bf369a30de498abeb2f200975c5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Feb 2026 18:57:43 +0000 Subject: [PATCH 1/3] Initial plan From fd6f2864a6ee625999b6ebe8a6215a761ef34d44 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Feb 2026 19:12:31 +0000 Subject: [PATCH 2/3] Add getOrInsert and getOrInsertComputed to Map and WeakMap in script target features Port getScriptTargetFeatures changes from TypeScript PR #62612 to add esnext entries for the proposal-upsert methods (getOrInsert and getOrInsertComputed) to Map and WeakMap. Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com> --- internal/checker/utilities.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/checker/utilities.go b/internal/checker/utilities.go index 873b1f76d23..62333034255 100644 --- a/internal/checker/utilities.go +++ b/internal/checker/utilities.go @@ -1369,6 +1369,10 @@ var getFeatureMap = sync.OnceValue(func() map[string][]FeatureMapEntry { }, "Map": { {lib: "es2015", props: []string{"entries", "keys", "values"}}, + {lib: "esnext", props: []string{ + "getOrInsert", + "getOrInsertComputed", + }}, }, "MapConstructor": { {lib: "es2024", props: []string{"groupBy"}}, @@ -1397,6 +1401,10 @@ var getFeatureMap = sync.OnceValue(func() map[string][]FeatureMapEntry { }, "WeakMap": { {lib: "es2015", props: []string{"entries", "keys", "values"}}, + {lib: "esnext", props: []string{ + "getOrInsert", + "getOrInsertComputed", + }}, }, "WeakSet": { {lib: "es2015", props: []string{"entries", "keys", "values"}}, From 3a7bf1b85248fa94c318d4cfe38f263700b55adc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 17 Feb 2026 22:40:23 +0000 Subject: [PATCH 3/3] Remove incorrect entries/keys/values from WeakMap and WeakSet feature map WeakMap and WeakSet are not iterable and don't have entries(), keys(), or values() methods. Replace the incorrect props with empty lists while keeping the es2015 lib entries so that "did you mean" suggestions correctly point to es2015. Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com> --- internal/checker/utilities.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/checker/utilities.go b/internal/checker/utilities.go index 62333034255..54a1e8cacb9 100644 --- a/internal/checker/utilities.go +++ b/internal/checker/utilities.go @@ -1400,14 +1400,14 @@ var getFeatureMap = sync.OnceValue(func() map[string][]FeatureMapEntry { {lib: "es2019", props: []string{"description"}}, }, "WeakMap": { - {lib: "es2015", props: []string{"entries", "keys", "values"}}, + {lib: "es2015", props: []string{}}, {lib: "esnext", props: []string{ "getOrInsert", "getOrInsertComputed", }}, }, "WeakSet": { - {lib: "es2015", props: []string{"entries", "keys", "values"}}, + {lib: "es2015", props: []string{}}, }, "String": { {lib: "es2015", props: []string{"codePointAt", "includes", "endsWith", "normalize", "repeat", "startsWith", "anchor", "big", "blink", "bold", "fixed", "fontcolor", "fontsize", "italics", "link", "small", "strike", "sub", "sup"}},