diff --git a/internal/checker/utilities.go b/internal/checker/utilities.go index 873b1f76d2..4fe39be6fe 100644 --- a/internal/checker/utilities.go +++ b/internal/checker/utilities.go @@ -1347,6 +1347,9 @@ var getFeatureMap = sync.OnceValue(func() map[string][]FeatureMapEntry { {lib: "es2018", props: []string{"dotAll"}}, {lib: "es2024", props: []string{"unicodeSets"}}, }, + "RegExpConstructor": { + {lib: "es2025", props: []string{"escape"}}, + }, "Reflect": { {lib: "es2015", props: []string{"apply", "construct", "defineProperty", "deleteProperty", "get", "getOwnPropertyDescriptor", "getPrototypeOf", "has", "isExtensible", "ownKeys", "preventExtensions", "set", "setPrototypeOf"}}, }, @@ -1366,6 +1369,7 @@ var getFeatureMap = sync.OnceValue(func() map[string][]FeatureMapEntry { }, "Math": { {lib: "es2015", props: []string{"clz32", "imul", "sign", "log10", "log2", "log1p", "expm1", "cosh", "sinh", "tanh", "acosh", "asinh", "atanh", "hypot", "trunc", "fround", "cbrt"}}, + {lib: "es2025", props: []string{"f16round"}}, }, "Map": { {lib: "es2015", props: []string{"entries", "keys", "values"}}, @@ -1375,7 +1379,7 @@ var getFeatureMap = sync.OnceValue(func() map[string][]FeatureMapEntry { }, "Set": { {lib: "es2015", props: []string{"entries", "keys", "values"}}, - {lib: "esnext", props: []string{ + {lib: "es2025", props: []string{ "union", "intersection", "difference", @@ -1390,6 +1394,7 @@ var getFeatureMap = sync.OnceValue(func() map[string][]FeatureMapEntry { {lib: "es2020", props: []string{"allSettled"}}, {lib: "es2021", props: []string{"any"}}, {lib: "es2024", props: []string{"withResolvers"}}, + {lib: "es2025", props: []string{"try"}}, }, "Symbol": { {lib: "es2015", props: []string{"for", "keyFor"}}, @@ -1428,6 +1433,10 @@ var getFeatureMap = sync.OnceValue(func() map[string][]FeatureMapEntry { }, "Intl": { {lib: "es2018", props: []string{"PluralRules"}}, + {lib: "es2020", props: []string{"RelativeTimeFormat", "Locale", "DisplayNames"}}, + {lib: "es2021", props: []string{"ListFormat", "DateTimeFormat"}}, + {lib: "es2022", props: []string{"Segmenter"}}, + {lib: "es2025", props: []string{"DurationFormat"}}, }, "NumberFormat": { {lib: "es2018", props: []string{"formatToParts"}}, @@ -1442,6 +1451,7 @@ var getFeatureMap = sync.OnceValue(func() map[string][]FeatureMapEntry { }, "DataView": { {lib: "es2020", props: []string{"setBigInt64", "setBigUint64", "getBigInt64", "getBigUint64"}}, + {lib: "es2025", props: []string{"setFloat16", "getFloat16"}}, }, "BigInt": { {lib: "es2020", props: []string{}}, @@ -1477,6 +1487,9 @@ var getFeatureMap = sync.OnceValue(func() map[string][]FeatureMapEntry { {lib: "es2022", props: []string{"at"}}, {lib: "es2023", props: []string{"findLastIndex", "findLast", "toReversed", "toSorted", "toSpliced", "with"}}, }, + "Float16Array": { + {lib: "es2025", props: []string{}}, + }, "Float32Array": { {lib: "es2022", props: []string{"at"}}, {lib: "es2023", props: []string{"findLastIndex", "findLast", "toReversed", "toSorted", "toSpliced", "with"}}, @@ -1498,6 +1511,18 @@ var getFeatureMap = sync.OnceValue(func() map[string][]FeatureMapEntry { "Error": { {lib: "es2022", props: []string{"cause"}}, }, + "ErrorConstructor": { + {lib: "esnext", props: []string{"isError"}}, + }, + "Uint8ArrayConstructor": { + {lib: "esnext", props: []string{"fromBase64", "fromHex"}}, + }, + "DisposableStack": { + {lib: "esnext", props: []string{}}, + }, + "AsyncDisposableStack": { + {lib: "esnext", props: []string{}}, + }, } }) diff --git a/internal/transformers/estransforms/definitions.go b/internal/transformers/estransforms/definitions.go index ca0950aa0b..f28bb7f8f6 100644 --- a/internal/transformers/estransforms/definitions.go +++ b/internal/transformers/estransforms/definitions.go @@ -26,7 +26,7 @@ func GetESTransformer(opts *transformers.TransformOptions) *transformers.Transfo switch options.GetEmitScriptTarget() { case core.ScriptTargetESNext: return nil // no transforms needed - case /*core.ScriptTargetES2025,*/ core.ScriptTargetES2024, core.ScriptTargetES2023, core.ScriptTargetES2022: + case core.ScriptTargetES2025, core.ScriptTargetES2024, core.ScriptTargetES2023, core.ScriptTargetES2022: return NewESNextTransformer(opts) case core.ScriptTargetES2021: return NewES2022Transformer(opts) diff --git a/testdata/baselines/reference/compiler/declarationEmitQualifiedName.js b/testdata/baselines/reference/compiler/declarationEmitQualifiedName.js index d0491108e7..d736f2f8c9 100644 --- a/testdata/baselines/reference/compiler/declarationEmitQualifiedName.js +++ b/testdata/baselines/reference/compiler/declarationEmitQualifiedName.js @@ -35,7 +35,7 @@ export const A = { }; //// [b.js] import { A } from './a.js'; -export const B = Object.assign({}, A); +export const B = { ...A }; //// [e.d.ts] diff --git a/testdata/baselines/reference/submodule/conformance/callChainWithSuper(target=es2025).js b/testdata/baselines/reference/submodule/conformance/callChainWithSuper(target=es2025).js index cc2dd20055..96be01245b 100644 --- a/testdata/baselines/reference/submodule/conformance/callChainWithSuper(target=es2025).js +++ b/testdata/baselines/reference/submodule/conformance/callChainWithSuper(target=es2025).js @@ -15,6 +15,6 @@ class Base { method() { } } class Derived extends Base { - method1() { var _a; return (_a = super.method) === null || _a === void 0 ? void 0 : _a.call(this); } - method2() { var _a; return (_a = super["method"]) === null || _a === void 0 ? void 0 : _a.call(this); } + method1() { return super.method?.(); } + method2() { return super["method"]?.(); } } diff --git a/testdata/baselines/reference/submodule/conformance/callChainWithSuper(target=es2025).js.diff b/testdata/baselines/reference/submodule/conformance/callChainWithSuper(target=es2025).js.diff deleted file mode 100644 index d6231aaf9c..0000000000 --- a/testdata/baselines/reference/submodule/conformance/callChainWithSuper(target=es2025).js.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- old.callChainWithSuper(target=es2025).js -+++ new.callChainWithSuper(target=es2025).js -@@= skipped -14, +14 lines =@@ - method() { } - } - class Derived extends Base { -- method1() { return super.method?.(); } -- method2() { return super["method"]?.(); } -+ method1() { var _a; return (_a = super.method) === null || _a === void 0 ? void 0 : _a.call(this); } -+ method2() { var _a; return (_a = super["method"]) === null || _a === void 0 ? void 0 : _a.call(this); } - } \ No newline at end of file