From 4d518796311337cd3f295900d3b819c29e937172 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 19 Jan 2023 23:39:55 +0000 Subject: [PATCH 1/4] Use a `const` type parameter for `Object.freeze`. --- src/lib/es5.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index a74b3cb4c2111..f7b13900ab7a4 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -207,13 +207,13 @@ interface ObjectConstructor { * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. * @param o Object on which to lock the attributes. */ - freeze(o: T): Readonly; + freeze(o: T): Readonly; /** * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. * @param o Object on which to lock the attributes. */ - freeze(o: T): Readonly; + freeze(o: T): Readonly; /** * Prevents the addition of new properties to an object. From 241b3f2fe241be7c90ba7841c9870cf7d8237785 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 19 Jan 2023 23:40:03 +0000 Subject: [PATCH 2/4] Accepted baselines. --- .../circularContextualReturnType.types | 16 ++++---- .../completionsStringMethods.baseline | 4 +- .../contextualSignatureInObjectFreeze.types | 6 +-- .../reference/jsEnumTagOnObjectFrozen.types | 20 +++++----- .../reference/keyofAndIndexedAccess.types | 4 +- .../reference/objectFreeze.errors.txt | 11 ++---- .../baselines/reference/objectFreeze.symbols | 2 + tests/baselines/reference/objectFreeze.types | 38 +++++++++---------- .../objectFreezeLiteralsDontWiden.types | 12 +++--- .../reference/objectFromEntries.errors.txt | 20 ++++++++++ .../reference/objectFromEntries.types | 36 +++++++++--------- 11 files changed, 94 insertions(+), 75 deletions(-) create mode 100644 tests/baselines/reference/objectFromEntries.errors.txt diff --git a/tests/baselines/reference/circularContextualReturnType.types b/tests/baselines/reference/circularContextualReturnType.types index faaaee956da30..850029b65a181 100644 --- a/tests/baselines/reference/circularContextualReturnType.types +++ b/tests/baselines/reference/circularContextualReturnType.types @@ -2,20 +2,20 @@ // Repro from #17711 Object.freeze({ ->Object.freeze({ foo() { return Object.freeze('a'); },}) : Readonly<{ foo(): string; }> ->Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>Object.freeze({ foo() { return Object.freeze('a'); },}) : Readonly<{ readonly foo: () => "a"; }> +>Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } >Object : ObjectConstructor ->freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } ->{ foo() { return Object.freeze('a'); },} : { foo(): string; } +>freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>{ foo() { return Object.freeze('a'); },} : { foo(): "a"; } foo() { ->foo : () => string +>foo : () => "a" return Object.freeze('a'); ->Object.freeze('a') : string ->Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>Object.freeze('a') : "a" +>Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } >Object : ObjectConstructor ->freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } >'a' : "a" }, diff --git a/tests/baselines/reference/completionsStringMethods.baseline b/tests/baselines/reference/completionsStringMethods.baseline index 0ef6b4203714d..1e9675e04bd25 100644 --- a/tests/baselines/reference/completionsStringMethods.baseline +++ b/tests/baselines/reference/completionsStringMethods.baseline @@ -1105,7 +1105,7 @@ "target": { "fileName": "lib.d.ts", "textSpan": { - "start": 18529, + "start": 18541, "length": 28 } } @@ -1128,7 +1128,7 @@ "target": { "fileName": "lib.d.ts", "textSpan": { - "start": 18529, + "start": 18541, "length": 28 } } diff --git a/tests/baselines/reference/contextualSignatureInObjectFreeze.types b/tests/baselines/reference/contextualSignatureInObjectFreeze.types index 5c847f60c1e40..985c4525c6c18 100644 --- a/tests/baselines/reference/contextualSignatureInObjectFreeze.types +++ b/tests/baselines/reference/contextualSignatureInObjectFreeze.types @@ -2,10 +2,10 @@ // #49101 Object.freeze({ ->Object.freeze({ f: function () { }}) : Readonly<{ f: () => void; }> ->Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>Object.freeze({ f: function () { }}) : Readonly<{ readonly f: () => void; }> +>Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } >Object : ObjectConstructor ->freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } >{ f: function () { }} : { f: () => void; } f: function () { } diff --git a/tests/baselines/reference/jsEnumTagOnObjectFrozen.types b/tests/baselines/reference/jsEnumTagOnObjectFrozen.types index c05a168a436ba..3de0ae531d13a 100644 --- a/tests/baselines/reference/jsEnumTagOnObjectFrozen.types +++ b/tests/baselines/reference/jsEnumTagOnObjectFrozen.types @@ -1,6 +1,6 @@ === tests/cases/compiler/usage.js === const { Thing, useThing, cbThing } = require("./index"); ->Thing : Readonly<{ a: "thing"; b: "chill"; }> +>Thing : Readonly<{ readonly a: "thing"; readonly b: "chill"; }> >useThing : (x: string) => void >cbThing : (x: (x: string) => void) => void >require("./index") : typeof import("tests/cases/compiler/index") @@ -11,7 +11,7 @@ useThing(Thing.a); >useThing(Thing.a) : void >useThing : (x: string) => void >Thing.a : "thing" ->Thing : Readonly<{ a: "thing"; b: "chill"; }> +>Thing : Readonly<{ readonly a: "thing"; readonly b: "chill"; }> >a : "thing" /** @@ -47,11 +47,11 @@ cbThing(type => { === tests/cases/compiler/index.js === /** @enum {string} */ const Thing = Object.freeze({ ->Thing : Readonly<{ a: "thing"; b: "chill"; }> ->Object.freeze({ a: "thing", b: "chill"}) : Readonly<{ a: "thing"; b: "chill"; }> ->Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>Thing : Readonly<{ readonly a: "thing"; readonly b: "chill"; }> +>Object.freeze({ a: "thing", b: "chill"}) : Readonly<{ readonly a: "thing"; readonly b: "chill"; }> +>Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } >Object : ObjectConstructor ->freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } >{ a: "thing", b: "chill"} : { a: "thing"; b: "chill"; } a: "thing", @@ -65,11 +65,11 @@ const Thing = Object.freeze({ }); exports.Thing = Thing; ->exports.Thing = Thing : Readonly<{ a: "thing"; b: "chill"; }> ->exports.Thing : Readonly<{ a: "thing"; b: "chill"; }> +>exports.Thing = Thing : Readonly<{ readonly a: "thing"; readonly b: "chill"; }> +>exports.Thing : Readonly<{ readonly a: "thing"; readonly b: "chill"; }> >exports : typeof import("tests/cases/compiler/index") ->Thing : Readonly<{ a: "thing"; b: "chill"; }> ->Thing : Readonly<{ a: "thing"; b: "chill"; }> +>Thing : Readonly<{ readonly a: "thing"; readonly b: "chill"; }> +>Thing : Readonly<{ readonly a: "thing"; readonly b: "chill"; }> /** * @param {Thing} x diff --git a/tests/baselines/reference/keyofAndIndexedAccess.types b/tests/baselines/reference/keyofAndIndexedAccess.types index 13df0c25c6a12..467a94694f181 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess.types +++ b/tests/baselines/reference/keyofAndIndexedAccess.types @@ -1876,9 +1876,9 @@ class SampleClass

{ >this : this >props : Readonly

>Object.freeze(props) : Readonly

->Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } >Object : ObjectConstructor ->freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } >props : P } } diff --git a/tests/baselines/reference/objectFreeze.errors.txt b/tests/baselines/reference/objectFreeze.errors.txt index 4a78f28365f5d..55e5ff2383921 100644 --- a/tests/baselines/reference/objectFreeze.errors.txt +++ b/tests/baselines/reference/objectFreeze.errors.txt @@ -1,9 +1,8 @@ -tests/cases/compiler/objectFreeze.ts(9,1): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/compiler/objectFreeze.ts(9,1): error TS2542: Index signature in type 'readonly number[]' only permits reading. +tests/cases/compiler/objectFreeze.ts(9,3): error TS2540: Cannot assign to '0' because it is a read-only property. tests/cases/compiler/objectFreeze.ts(12,3): error TS2540: Cannot assign to 'b' because it is a read-only property. -==== tests/cases/compiler/objectFreeze.ts (3 errors) ==== +==== tests/cases/compiler/objectFreeze.ts (2 errors) ==== const f = Object.freeze(function foo(a: number, b: string) { return false; }); f(1, "") === false; @@ -13,10 +12,8 @@ tests/cases/compiler/objectFreeze.ts(12,3): error TS2540: Cannot assign to 'b' b const a = Object.freeze([1, 2, 3]); a[0] = a[2].toString(); - ~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. - ~~~~ -!!! error TS2542: Index signature in type 'readonly number[]' only permits reading. + ~ +!!! error TS2540: Cannot assign to '0' because it is a read-only property. const o = Object.freeze({ a: 1, b: "string", c: true }); o.b = o.a.toString(); diff --git a/tests/baselines/reference/objectFreeze.symbols b/tests/baselines/reference/objectFreeze.symbols index b550b79aeb7be..597fc4ba3b047 100644 --- a/tests/baselines/reference/objectFreeze.symbols +++ b/tests/baselines/reference/objectFreeze.symbols @@ -33,8 +33,10 @@ const a = Object.freeze([1, 2, 3]); a[0] = a[2].toString(); >a : Symbol(a, Decl(objectFreeze.ts, 7, 5)) +>0 : Symbol(0) >a[2].toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) >a : Symbol(a, Decl(objectFreeze.ts, 7, 5)) +>2 : Symbol(2) >toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --)) const o = Object.freeze({ a: 1, b: "string", c: true }); diff --git a/tests/baselines/reference/objectFreeze.types b/tests/baselines/reference/objectFreeze.types index a8c4f445aca13..e5e13dde06248 100644 --- a/tests/baselines/reference/objectFreeze.types +++ b/tests/baselines/reference/objectFreeze.types @@ -2,9 +2,9 @@ const f = Object.freeze(function foo(a: number, b: string) { return false; }); >f : (a: number, b: string) => false >Object.freeze(function foo(a: number, b: string) { return false; }) : (a: number, b: string) => false ->Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } >Object : ObjectConstructor ->freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } >function foo(a: number, b: string) { return false; } : (a: number, b: string) => false >foo : (a: number, b: string) => false >a : number @@ -26,9 +26,9 @@ class C { constructor(a: number) { } } const c = Object.freeze(C); >c : typeof C >Object.freeze(C) : typeof C ->Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } >Object : ObjectConstructor ->freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } >C : typeof C new c(1); @@ -37,34 +37,34 @@ new c(1); >1 : 1 const a = Object.freeze([1, 2, 3]); ->a : readonly number[] ->Object.freeze([1, 2, 3]) : readonly number[] ->Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>a : readonly [1, 2, 3] +>Object.freeze([1, 2, 3]) : readonly [1, 2, 3] +>Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } >Object : ObjectConstructor ->freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } ->[1, 2, 3] : number[] +>freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>[1, 2, 3] : [1, 2, 3] >1 : 1 >2 : 2 >3 : 3 a[0] = a[2].toString(); >a[0] = a[2].toString() : string ->a[0] : number ->a : readonly number[] +>a[0] : any +>a : readonly [1, 2, 3] >0 : 0 >a[2].toString() : string >a[2].toString : (radix?: number) => string ->a[2] : number ->a : readonly number[] +>a[2] : 3 +>a : readonly [1, 2, 3] >2 : 2 >toString : (radix?: number) => string const o = Object.freeze({ a: 1, b: "string", c: true }); ->o : Readonly<{ a: 1; b: "string"; c: true; }> ->Object.freeze({ a: 1, b: "string", c: true }) : Readonly<{ a: 1; b: "string"; c: true; }> ->Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>o : Readonly<{ readonly a: 1; readonly b: "string"; readonly c: true; }> +>Object.freeze({ a: 1, b: "string", c: true }) : Readonly<{ readonly a: 1; readonly b: "string"; readonly c: true; }> +>Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } >Object : ObjectConstructor ->freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } >{ a: 1, b: "string", c: true } : { a: 1; b: "string"; c: true; } >a : 1 >1 : 1 @@ -76,12 +76,12 @@ const o = Object.freeze({ a: 1, b: "string", c: true }); o.b = o.a.toString(); >o.b = o.a.toString() : string >o.b : any ->o : Readonly<{ a: 1; b: "string"; c: true; }> +>o : Readonly<{ readonly a: 1; readonly b: "string"; readonly c: true; }> >b : any >o.a.toString() : string >o.a.toString : (radix?: number) => string >o.a : 1 ->o : Readonly<{ a: 1; b: "string"; c: true; }> +>o : Readonly<{ readonly a: 1; readonly b: "string"; readonly c: true; }> >a : 1 >toString : (radix?: number) => string diff --git a/tests/baselines/reference/objectFreezeLiteralsDontWiden.types b/tests/baselines/reference/objectFreezeLiteralsDontWiden.types index a93f6d75e0d9c..7632207170977 100644 --- a/tests/baselines/reference/objectFreezeLiteralsDontWiden.types +++ b/tests/baselines/reference/objectFreezeLiteralsDontWiden.types @@ -1,10 +1,10 @@ === tests/cases/compiler/objectFreezeLiteralsDontWiden.ts === const PUPPETEER_REVISIONS = Object.freeze({ ->PUPPETEER_REVISIONS : Readonly<{ chromium: "1011831"; firefox: "latest"; }> ->Object.freeze({ chromium: '1011831', firefox: 'latest',}) : Readonly<{ chromium: "1011831"; firefox: "latest"; }> ->Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>PUPPETEER_REVISIONS : Readonly<{ readonly chromium: "1011831"; readonly firefox: "latest"; }> +>Object.freeze({ chromium: '1011831', firefox: 'latest',}) : Readonly<{ readonly chromium: "1011831"; readonly firefox: "latest"; }> +>Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } >Object : ObjectConstructor ->freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } >{ chromium: '1011831', firefox: 'latest',} : { chromium: "1011831"; firefox: "latest"; } chromium: '1011831', @@ -20,13 +20,13 @@ const PUPPETEER_REVISIONS = Object.freeze({ let preferredRevision = PUPPETEER_REVISIONS.chromium; >preferredRevision : "1011831" >PUPPETEER_REVISIONS.chromium : "1011831" ->PUPPETEER_REVISIONS : Readonly<{ chromium: "1011831"; firefox: "latest"; }> +>PUPPETEER_REVISIONS : Readonly<{ readonly chromium: "1011831"; readonly firefox: "latest"; }> >chromium : "1011831" preferredRevision = PUPPETEER_REVISIONS.firefox; >preferredRevision = PUPPETEER_REVISIONS.firefox : "latest" >preferredRevision : "1011831" >PUPPETEER_REVISIONS.firefox : "latest" ->PUPPETEER_REVISIONS : Readonly<{ chromium: "1011831"; firefox: "latest"; }> +>PUPPETEER_REVISIONS : Readonly<{ readonly chromium: "1011831"; readonly firefox: "latest"; }> >firefox : "latest" diff --git a/tests/baselines/reference/objectFromEntries.errors.txt b/tests/baselines/reference/objectFromEntries.errors.txt new file mode 100644 index 0000000000000..7c90b0bfffbcc --- /dev/null +++ b/tests/baselines/reference/objectFromEntries.errors.txt @@ -0,0 +1,20 @@ +tests/cases/compiler/objectFromEntries.ts(8,7): error TS2322: Type 'readonly [readonly ["a", 1], readonly ["b", 2], readonly ["c", 3]]' is not assignable to type 'readonly [string, number][]'. + Type 'readonly ["a", 1] | readonly ["b", 2] | readonly ["c", 3]' is not assignable to type '[string, number]'. + The type 'readonly ["a", 1]' is 'readonly' and cannot be assigned to the mutable type '[string, number]'. + + +==== tests/cases/compiler/objectFromEntries.ts (1 errors) ==== + const o = Object.fromEntries([['a', 1], ['b', 2], ['c', 3]]); + const o2 = Object.fromEntries(new URLSearchParams()); + const o3 = Object.fromEntries(new Map([[Symbol("key"), "value"]])); + + const frozenArray = Object.freeze([['a', 1], ['b', 2], ['c', 3]]); + const o4 = Object.fromEntries(frozenArray); + + const frozenArray2: readonly [string, number][] = Object.freeze([['a', 1], ['b', 2], ['c', 3]]); + ~~~~~~~~~~~~ +!!! error TS2322: Type 'readonly [readonly ["a", 1], readonly ["b", 2], readonly ["c", 3]]' is not assignable to type 'readonly [string, number][]'. +!!! error TS2322: Type 'readonly ["a", 1] | readonly ["b", 2] | readonly ["c", 3]' is not assignable to type '[string, number]'. +!!! error TS2322: The type 'readonly ["a", 1]' is 'readonly' and cannot be assigned to the mutable type '[string, number]'. + const o5 = Object.fromEntries(frozenArray2); + \ No newline at end of file diff --git a/tests/baselines/reference/objectFromEntries.types b/tests/baselines/reference/objectFromEntries.types index 9812b4ae90c4b..e60b2078364c1 100644 --- a/tests/baselines/reference/objectFromEntries.types +++ b/tests/baselines/reference/objectFromEntries.types @@ -41,44 +41,44 @@ const o3 = Object.fromEntries(new Map([[Symbol("key"), "value"]])); >"value" : "value" const frozenArray = Object.freeze([['a', 1], ['b', 2], ['c', 3]]); ->frozenArray : readonly (string | number)[][] ->Object.freeze([['a', 1], ['b', 2], ['c', 3]]) : readonly (string | number)[][] ->Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>frozenArray : readonly [readonly ["a", 1], readonly ["b", 2], readonly ["c", 3]] +>Object.freeze([['a', 1], ['b', 2], ['c', 3]]) : readonly [readonly ["a", 1], readonly ["b", 2], readonly ["c", 3]] +>Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } >Object : ObjectConstructor ->freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } ->[['a', 1], ['b', 2], ['c', 3]] : (string | number)[][] ->['a', 1] : (string | number)[] +>freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>[['a', 1], ['b', 2], ['c', 3]] : [["a", 1], ["b", 2], ["c", 3]] +>['a', 1] : ["a", 1] >'a' : "a" >1 : 1 ->['b', 2] : (string | number)[] +>['b', 2] : ["b", 2] >'b' : "b" >2 : 2 ->['c', 3] : (string | number)[] +>['c', 3] : ["c", 3] >'c' : "c" >3 : 3 const o4 = Object.fromEntries(frozenArray); ->o4 : any ->Object.fromEntries(frozenArray) : any +>o4 : { [k: string]: 2 | 1 | 3; } +>Object.fromEntries(frozenArray) : { [k: string]: 2 | 1 | 3; } >Object.fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } >Object : ObjectConstructor >fromEntries : { (entries: Iterable): { [k: string]: T; }; (entries: Iterable): any; } ->frozenArray : readonly (string | number)[][] +>frozenArray : readonly [readonly ["a", 1], readonly ["b", 2], readonly ["c", 3]] const frozenArray2: readonly [string, number][] = Object.freeze([['a', 1], ['b', 2], ['c', 3]]); >frozenArray2 : readonly [string, number][] ->Object.freeze([['a', 1], ['b', 2], ['c', 3]]) : readonly [string, number][] ->Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>Object.freeze([['a', 1], ['b', 2], ['c', 3]]) : readonly [readonly ["a", 1], readonly ["b", 2], readonly ["c", 3]] +>Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } >Object : ObjectConstructor ->freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } ->[['a', 1], ['b', 2], ['c', 3]] : [string, number][] ->['a', 1] : [string, number] +>freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>[['a', 1], ['b', 2], ['c', 3]] : [["a", 1], ["b", 2], ["c", 3]] +>['a', 1] : ["a", 1] >'a' : "a" >1 : 1 ->['b', 2] : [string, number] +>['b', 2] : ["b", 2] >'b' : "b" >2 : 2 ->['c', 3] : [string, number] +>['c', 3] : ["c", 3] >'c' : "c" >3 : 3 From 9705b7186cd13a882d252523f716111f481119e4 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 20 Jan 2023 00:15:00 +0000 Subject: [PATCH 3/4] Remove (hopefully) unnecessary overload. --- src/lib/es5.d.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index f7b13900ab7a4..2a6a4af5fec63 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -203,12 +203,6 @@ interface ObjectConstructor { */ freeze(f: T): T; - /** - * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. - * @param o Object on which to lock the attributes. - */ - freeze(o: T): Readonly; - /** * Prevents the modification of existing property attributes and values, and prevents the addition of new properties. * @param o Object on which to lock the attributes. From bedfac1188103ad07efc798eb64b93d1361346ed Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 20 Jan 2023 00:16:04 +0000 Subject: [PATCH 4/4] Accepted baselines. --- ...aintOfJavascriptClassExpression.errors.txt | 2 +- .../circularContextualReturnType.symbols | 8 ++++---- .../circularContextualReturnType.types | 8 ++++---- .../completionsStringMethods.baseline | 4 ++-- .../contextualSignatureInObjectFreeze.symbols | 4 ++-- .../contextualSignatureInObjectFreeze.types | 4 ++-- ...tructuringParameterDeclaration4.errors.txt | 2 +- .../reference/destructuringTuple.errors.txt | 4 ++-- .../duplicateNumericIndexers.errors.txt | 4 ++-- .../reference/externModule.errors.txt | 8 ++++---- .../reference/invalidTypeOfTarget.errors.txt | 2 +- .../reference/jsEnumTagOnObjectFrozen.symbols | 4 ++-- .../reference/jsEnumTagOnObjectFrozen.types | 4 ++-- .../reference/keyofAndIndexedAccess.symbols | 4 ++-- .../reference/keyofAndIndexedAccess.types | 4 ++-- ...ithAsClauseAndLateBoundProperty.errors.txt | 2 +- ...wExceptionVariableInCatchClause.errors.txt | 2 +- .../narrowFromAnyWithInstanceof.errors.txt | 4 ++-- .../narrowFromAnyWithTypePredicate.errors.txt | 4 ++-- .../baselines/reference/objectFreeze.symbols | 16 +++++++-------- tests/baselines/reference/objectFreeze.types | 16 +++++++-------- .../objectFreezeLiteralsDontWiden.symbols | 4 ++-- .../objectFreezeLiteralsDontWiden.types | 4 ++-- .../reference/objectFromEntries.symbols | 8 ++++---- .../reference/objectFromEntries.types | 8 ++++---- ...erAccessAfterPostfixExpression1.errors.txt | 2 +- ...gularExpressionDivideAmbiguity1.errors.txt | 2 +- ...gularExpressionDivideAmbiguity2.errors.txt | 2 +- .../reference/parserS7.2_A1.5_T2.errors.txt | 4 ++-- .../reference/parserS7.3_A1.1_T2.errors.txt | 2 +- .../reference/parserS7.6_A4.2_T1.errors.txt | 20 +++++++++---------- .../reference/parserUnicode1.errors.txt | 4 ++-- .../reference/promisePermutations.errors.txt | 2 +- .../reference/promisePermutations2.errors.txt | 2 +- .../reference/promisePermutations3.errors.txt | 4 ++-- .../reference/redefineArray.errors.txt | 2 +- .../reference/scannerS7.2_A1.5_T2.errors.txt | 4 ++-- .../reference/scannerS7.3_A1.1_T2.errors.txt | 2 +- .../reference/scannerS7.6_A4.2_T1.errors.txt | 20 +++++++++---------- ...eStringsWithOverloadResolution1.errors.txt | 2 +- ...ingsWithOverloadResolution1_ES6.errors.txt | 2 +- 41 files changed, 105 insertions(+), 105 deletions(-) diff --git a/tests/baselines/reference/checkIndexConstraintOfJavascriptClassExpression.errors.txt b/tests/baselines/reference/checkIndexConstraintOfJavascriptClassExpression.errors.txt index a8067965c68f0..128cdfaadc03a 100644 --- a/tests/baselines/reference/checkIndexConstraintOfJavascriptClassExpression.errors.txt +++ b/tests/baselines/reference/checkIndexConstraintOfJavascriptClassExpression.errors.txt @@ -9,7 +9,7 @@ tests/cases/compiler/weird.js(9,17): error TS7006: Parameter 'error' implicitly someFunction(function(BaseClass) { ~~~~~~~~~~~~ !!! error TS2552: Cannot find name 'someFunction'. Did you mean 'Function'? -!!! related TS2728 /.ts/lib.es5.d.ts:321:13: 'Function' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:315:13: 'Function' is declared here. ~~~~~~~~~ !!! error TS7006: Parameter 'BaseClass' implicitly has an 'any' type. 'use strict'; diff --git a/tests/baselines/reference/circularContextualReturnType.symbols b/tests/baselines/reference/circularContextualReturnType.symbols index 207daf487cc4e..fc0ec48ca9f26 100644 --- a/tests/baselines/reference/circularContextualReturnType.symbols +++ b/tests/baselines/reference/circularContextualReturnType.symbols @@ -2,17 +2,17 @@ // Repro from #17711 Object.freeze({ ->Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) foo() { >foo : Symbol(foo, Decl(circularContextualReturnType.ts, 2, 15)) return Object.freeze('a'); ->Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) }, }); diff --git a/tests/baselines/reference/circularContextualReturnType.types b/tests/baselines/reference/circularContextualReturnType.types index 850029b65a181..b0249d897bff6 100644 --- a/tests/baselines/reference/circularContextualReturnType.types +++ b/tests/baselines/reference/circularContextualReturnType.types @@ -3,9 +3,9 @@ Object.freeze({ >Object.freeze({ foo() { return Object.freeze('a'); },}) : Readonly<{ readonly foo: () => "a"; }> ->Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>Object.freeze : { (f: T): T; (o: T): Readonly; } >Object : ObjectConstructor ->freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>freeze : { (f: T): T; (o: T): Readonly; } >{ foo() { return Object.freeze('a'); },} : { foo(): "a"; } foo() { @@ -13,9 +13,9 @@ Object.freeze({ return Object.freeze('a'); >Object.freeze('a') : "a" ->Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>Object.freeze : { (f: T): T; (o: T): Readonly; } >Object : ObjectConstructor ->freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>freeze : { (f: T): T; (o: T): Readonly; } >'a' : "a" }, diff --git a/tests/baselines/reference/completionsStringMethods.baseline b/tests/baselines/reference/completionsStringMethods.baseline index 1e9675e04bd25..eba418a483755 100644 --- a/tests/baselines/reference/completionsStringMethods.baseline +++ b/tests/baselines/reference/completionsStringMethods.baseline @@ -1105,7 +1105,7 @@ "target": { "fileName": "lib.d.ts", "textSpan": { - "start": 18541, + "start": 18196, "length": 28 } } @@ -1128,7 +1128,7 @@ "target": { "fileName": "lib.d.ts", "textSpan": { - "start": 18541, + "start": 18196, "length": 28 } } diff --git a/tests/baselines/reference/contextualSignatureInObjectFreeze.symbols b/tests/baselines/reference/contextualSignatureInObjectFreeze.symbols index a9a164bf77e61..deefb61990657 100644 --- a/tests/baselines/reference/contextualSignatureInObjectFreeze.symbols +++ b/tests/baselines/reference/contextualSignatureInObjectFreeze.symbols @@ -2,9 +2,9 @@ // #49101 Object.freeze({ ->Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) f: function () { } >f : Symbol(f, Decl(contextualSignatureInObjectFreeze.ts, 2, 15)) diff --git a/tests/baselines/reference/contextualSignatureInObjectFreeze.types b/tests/baselines/reference/contextualSignatureInObjectFreeze.types index 985c4525c6c18..c75d78bfca5d8 100644 --- a/tests/baselines/reference/contextualSignatureInObjectFreeze.types +++ b/tests/baselines/reference/contextualSignatureInObjectFreeze.types @@ -3,9 +3,9 @@ Object.freeze({ >Object.freeze({ f: function () { }}) : Readonly<{ readonly f: () => void; }> ->Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>Object.freeze : { (f: T): T; (o: T): Readonly; } >Object : ObjectConstructor ->freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>freeze : { (f: T): T; (o: T): Readonly; } >{ f: function () { }} : { f: () => void; } f: function () { } diff --git a/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt index d6c101ccd028f..dbc9dbd254ec2 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt +++ b/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt @@ -41,7 +41,7 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts( a1(...array2); // Error parameter type is (number|string)[] ~~~~~~ !!! error TS2552: Cannot find name 'array2'. Did you mean 'Array'? -!!! related TS2728 /.ts/lib.es5.d.ts:1498:13: 'Array' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1492:13: 'Array' is declared here. a5([1, 2, "string", false, true]); // Error, parameter type is [any, any, [[any]]] ~~~~~~~~ !!! error TS2322: Type 'string' is not assignable to type '[[any]]'. diff --git a/tests/baselines/reference/destructuringTuple.errors.txt b/tests/baselines/reference/destructuringTuple.errors.txt index b0fa1bd259fe2..820f82c9e5d57 100644 --- a/tests/baselines/reference/destructuringTuple.errors.txt +++ b/tests/baselines/reference/destructuringTuple.errors.txt @@ -33,8 +33,8 @@ tests/cases/compiler/destructuringTuple.ts(11,60): error TS2769: No overload mat !!! error TS2769: Overload 2 of 3, '(callbackfn: (previousValue: [], currentValue: number, currentIndex: number, array: number[]) => [], initialValue: []): []', gave the following error. !!! error TS2769: Type 'never[]' is not assignable to type '[]'. !!! error TS2769: Target allows only 0 element(s) but source may have more. -!!! related TS6502 /.ts/lib.es5.d.ts:1463:24: The expected type comes from the return type of this signature. -!!! related TS6502 /.ts/lib.es5.d.ts:1469:27: The expected type comes from the return type of this signature. +!!! related TS6502 /.ts/lib.es5.d.ts:1457:24: The expected type comes from the return type of this signature. +!!! related TS6502 /.ts/lib.es5.d.ts:1463:27: The expected type comes from the return type of this signature. ~~ !!! error TS2769: No overload matches this call. !!! error TS2769: Overload 1 of 2, '(...items: ConcatArray[]): never[]', gave the following error. diff --git a/tests/baselines/reference/duplicateNumericIndexers.errors.txt b/tests/baselines/reference/duplicateNumericIndexers.errors.txt index 826a48d1c815b..bbe32a23b95b9 100644 --- a/tests/baselines/reference/duplicateNumericIndexers.errors.txt +++ b/tests/baselines/reference/duplicateNumericIndexers.errors.txt @@ -10,8 +10,8 @@ tests/cases/conformance/types/members/duplicateNumericIndexers.ts(24,5): error T tests/cases/conformance/types/members/duplicateNumericIndexers.ts(25,5): error TS2374: Duplicate index signature for type 'number'. tests/cases/conformance/types/members/duplicateNumericIndexers.ts(29,5): error TS2374: Duplicate index signature for type 'number'. tests/cases/conformance/types/members/duplicateNumericIndexers.ts(30,5): error TS2374: Duplicate index signature for type 'number'. -lib.es5.d.ts(520,5): error TS2374: Duplicate index signature for type 'number'. -lib.es5.d.ts(1484,5): error TS2374: Duplicate index signature for type 'number'. +lib.es5.d.ts(514,5): error TS2374: Duplicate index signature for type 'number'. +lib.es5.d.ts(1478,5): error TS2374: Duplicate index signature for type 'number'. ==== tests/cases/conformance/types/members/duplicateNumericIndexers.ts (12 errors) ==== diff --git a/tests/baselines/reference/externModule.errors.txt b/tests/baselines/reference/externModule.errors.txt index c3e3352d75be4..2e3192bb63662 100644 --- a/tests/baselines/reference/externModule.errors.txt +++ b/tests/baselines/reference/externModule.errors.txt @@ -66,20 +66,20 @@ tests/cases/compiler/externModule.ts(37,3): error TS2552: Cannot find name 'XDat var d=new XDate(); ~~~~~ !!! error TS2552: Cannot find name 'XDate'. Did you mean 'Date'? -!!! related TS2728 /.ts/lib.es5.d.ts:941:13: 'Date' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:935:13: 'Date' is declared here. d.getDay(); d=new XDate(1978,2); ~~~~~ !!! error TS2552: Cannot find name 'XDate'. Did you mean 'Date'? -!!! related TS2728 /.ts/lib.es5.d.ts:941:13: 'Date' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:935:13: 'Date' is declared here. d.getXDate(); var n=XDate.parse("3/2/2004"); ~~~~~ !!! error TS2552: Cannot find name 'XDate'. Did you mean 'Date'? -!!! related TS2728 /.ts/lib.es5.d.ts:941:13: 'Date' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:935:13: 'Date' is declared here. n=XDate.UTC(1964,2,1); ~~~~~ !!! error TS2552: Cannot find name 'XDate'. Did you mean 'Date'? -!!! related TS2728 /.ts/lib.es5.d.ts:941:13: 'Date' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:935:13: 'Date' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/invalidTypeOfTarget.errors.txt b/tests/baselines/reference/invalidTypeOfTarget.errors.txt index 0bcd66b4dd6f0..fa24d29abb47a 100644 --- a/tests/baselines/reference/invalidTypeOfTarget.errors.txt +++ b/tests/baselines/reference/invalidTypeOfTarget.errors.txt @@ -36,7 +36,7 @@ tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts var x7: typeof function f() { }; ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? -!!! related TS2728 /.ts/lib.es5.d.ts:321:13: 'Function' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:315:13: 'Function' is declared here. ~ !!! error TS1005: ',' expected. ~ diff --git a/tests/baselines/reference/jsEnumTagOnObjectFrozen.symbols b/tests/baselines/reference/jsEnumTagOnObjectFrozen.symbols index ecdf10f8ea467..eac0c0fa7d3bd 100644 --- a/tests/baselines/reference/jsEnumTagOnObjectFrozen.symbols +++ b/tests/baselines/reference/jsEnumTagOnObjectFrozen.symbols @@ -42,9 +42,9 @@ cbThing(type => { /** @enum {string} */ const Thing = Object.freeze({ >Thing : Symbol(Thing, Decl(index.js, 1, 5), Decl(index.js, 0, 4)) ->Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) a: "thing", >a : Symbol(a, Decl(index.js, 1, 29)) diff --git a/tests/baselines/reference/jsEnumTagOnObjectFrozen.types b/tests/baselines/reference/jsEnumTagOnObjectFrozen.types index 3de0ae531d13a..2a3ff57136bc0 100644 --- a/tests/baselines/reference/jsEnumTagOnObjectFrozen.types +++ b/tests/baselines/reference/jsEnumTagOnObjectFrozen.types @@ -49,9 +49,9 @@ cbThing(type => { const Thing = Object.freeze({ >Thing : Readonly<{ readonly a: "thing"; readonly b: "chill"; }> >Object.freeze({ a: "thing", b: "chill"}) : Readonly<{ readonly a: "thing"; readonly b: "chill"; }> ->Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>Object.freeze : { (f: T): T; (o: T): Readonly; } >Object : ObjectConstructor ->freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>freeze : { (f: T): T; (o: T): Readonly; } >{ a: "thing", b: "chill"} : { a: "thing"; b: "chill"; } a: "thing", diff --git a/tests/baselines/reference/keyofAndIndexedAccess.symbols b/tests/baselines/reference/keyofAndIndexedAccess.symbols index c3bebb6c7d042..69bc3e6b22a5a 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess.symbols +++ b/tests/baselines/reference/keyofAndIndexedAccess.symbols @@ -1933,9 +1933,9 @@ class SampleClass

{ >this.props : Symbol(SampleClass.props, Decl(keyofAndIndexedAccess.ts, 536, 22)) >this : Symbol(SampleClass, Decl(keyofAndIndexedAccess.ts, 532, 1)) >props : Symbol(SampleClass.props, Decl(keyofAndIndexedAccess.ts, 536, 22)) ->Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >props : Symbol(props, Decl(keyofAndIndexedAccess.ts, 538, 16)) } } diff --git a/tests/baselines/reference/keyofAndIndexedAccess.types b/tests/baselines/reference/keyofAndIndexedAccess.types index 467a94694f181..3edfe27e9d0a6 100644 --- a/tests/baselines/reference/keyofAndIndexedAccess.types +++ b/tests/baselines/reference/keyofAndIndexedAccess.types @@ -1876,9 +1876,9 @@ class SampleClass

{ >this : this >props : Readonly

>Object.freeze(props) : Readonly

->Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>Object.freeze : { (f: T): T; (o: T): Readonly; } >Object : ObjectConstructor ->freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>freeze : { (f: T): T; (o: T): Readonly; } >props : P } } diff --git a/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty.errors.txt b/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty.errors.txt index aa57a8ac9035e..e59937148afc5 100644 --- a/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty.errors.txt +++ b/tests/baselines/reference/mappedTypeWithAsClauseAndLateBoundProperty.errors.txt @@ -7,5 +7,5 @@ tests/cases/compiler/mappedTypeWithAsClauseAndLateBoundProperty.ts(3,1): error T tgt2 = src2; // Should error ~~~~ !!! error TS2741: Property 'length' is missing in type '{ [x: number]: number; toString: () => string; toLocaleString: () => string; pop: () => number; push: (...items: number[]) => number; concat: { (...items: ConcatArray[]): number[]; (...items: (number | ConcatArray)[]): number[]; }; join: (separator?: string) => string; reverse: () => number[]; shift: () => number; slice: (start?: number, end?: number) => number[]; sort: (compareFn?: (a: number, b: number) => number) => number[]; splice: { (start: number, deleteCount?: number): number[]; (start: number, deleteCount: number, ...items: number[]): number[]; }; unshift: (...items: number[]) => number; indexOf: (searchElement: number, fromIndex?: number) => number; lastIndexOf: (searchElement: number, fromIndex?: number) => number; every: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): this is S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): boolean; }; some: (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any) => boolean; forEach: (callbackfn: (value: number, index: number, array: number[]) => void, thisArg?: any) => void; map: (callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any) => U[]; filter: { (predicate: (value: number, index: number, array: number[]) => value is S, thisArg?: any): S[]; (predicate: (value: number, index: number, array: number[]) => unknown, thisArg?: any): number[]; }; reduce: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; reduceRight: { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; }; find: { (predicate: (value: number, index: number, obj: number[]) => value is S, thisArg?: any): S; (predicate: (value: number, index: number, obj: number[]) => unknown, thisArg?: any): number; }; findIndex: (predicate: (value: number, index: number, obj: number[]) => unknown, thisArg?: any) => number; fill: (value: number, start?: number, end?: number) => number[]; copyWithin: (target: number, start: number, end?: number) => number[]; entries: () => IterableIterator<[number, number]>; keys: () => IterableIterator; values: () => IterableIterator; includes: (searchElement: number, fromIndex?: number) => boolean; flatMap: (callback: (this: This, value: number, index: number, array: number[]) => U | readonly U[], thisArg?: This) => U[]; flat: (this: A, depth?: D) => FlatArray[]; [iterator]: () => IterableIterator; [unscopables]: () => { copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: boolean; values: boolean; }; }' but required in type 'number[]'. -!!! related TS2728 /.ts/lib.es5.d.ts:1307:5: 'length' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1301:5: 'length' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/narrowExceptionVariableInCatchClause.errors.txt b/tests/baselines/reference/narrowExceptionVariableInCatchClause.errors.txt index b07c2eb109593..5fce82757fe82 100644 --- a/tests/baselines/reference/narrowExceptionVariableInCatchClause.errors.txt +++ b/tests/baselines/reference/narrowExceptionVariableInCatchClause.errors.txt @@ -24,7 +24,7 @@ tests/cases/conformance/types/any/narrowExceptionVariableInCatchClause.ts(16,17) err.massage; // ERROR: Property 'massage' does not exist on type 'Error' ~~~~~~~ !!! error TS2551: Property 'massage' does not exist on type 'Error'. Did you mean 'message'? -!!! related TS2728 /.ts/lib.es5.d.ts:1057:5: 'message' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1051:5: 'message' is declared here. } else { diff --git a/tests/baselines/reference/narrowFromAnyWithInstanceof.errors.txt b/tests/baselines/reference/narrowFromAnyWithInstanceof.errors.txt index 0292b260eac4b..4f70d258c5509 100644 --- a/tests/baselines/reference/narrowFromAnyWithInstanceof.errors.txt +++ b/tests/baselines/reference/narrowFromAnyWithInstanceof.errors.txt @@ -22,7 +22,7 @@ tests/cases/conformance/types/any/narrowFromAnyWithInstanceof.ts(22,7): error TS x.mesage; ~~~~~~ !!! error TS2551: Property 'mesage' does not exist on type 'Error'. Did you mean 'message'? -!!! related TS2728 /.ts/lib.es5.d.ts:1057:5: 'message' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1051:5: 'message' is declared here. } if (x instanceof Date) { @@ -30,6 +30,6 @@ tests/cases/conformance/types/any/narrowFromAnyWithInstanceof.ts(22,7): error TS x.getHuors(); ~~~~~~~~ !!! error TS2551: Property 'getHuors' does not exist on type 'Date'. Did you mean 'getHours'? -!!! related TS2728 /.ts/lib.es5.d.ts:786:5: 'getHours' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:780:5: 'getHours' is declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/narrowFromAnyWithTypePredicate.errors.txt b/tests/baselines/reference/narrowFromAnyWithTypePredicate.errors.txt index 0e5168963afc6..ae59026aa2c48 100644 --- a/tests/baselines/reference/narrowFromAnyWithTypePredicate.errors.txt +++ b/tests/baselines/reference/narrowFromAnyWithTypePredicate.errors.txt @@ -41,7 +41,7 @@ tests/cases/conformance/types/any/narrowFromAnyWithTypePredicate.ts(33,7): error x.mesage; ~~~~~~ !!! error TS2551: Property 'mesage' does not exist on type 'Error'. Did you mean 'message'? -!!! related TS2728 /.ts/lib.es5.d.ts:1057:5: 'message' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1051:5: 'message' is declared here. } if (isDate(x)) { @@ -49,6 +49,6 @@ tests/cases/conformance/types/any/narrowFromAnyWithTypePredicate.ts(33,7): error x.getHuors(); ~~~~~~~~ !!! error TS2551: Property 'getHuors' does not exist on type 'Date'. Did you mean 'getHours'? -!!! related TS2728 /.ts/lib.es5.d.ts:786:5: 'getHours' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:780:5: 'getHours' is declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/objectFreeze.symbols b/tests/baselines/reference/objectFreeze.symbols index 597fc4ba3b047..62d7866668078 100644 --- a/tests/baselines/reference/objectFreeze.symbols +++ b/tests/baselines/reference/objectFreeze.symbols @@ -1,9 +1,9 @@ === tests/cases/compiler/objectFreeze.ts === const f = Object.freeze(function foo(a: number, b: string) { return false; }); >f : Symbol(f, Decl(objectFreeze.ts, 0, 5)) ->Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >foo : Symbol(foo, Decl(objectFreeze.ts, 0, 24)) >a : Symbol(a, Decl(objectFreeze.ts, 0, 37)) >b : Symbol(b, Decl(objectFreeze.ts, 0, 47)) @@ -17,9 +17,9 @@ class C { constructor(a: number) { } } const c = Object.freeze(C); >c : Symbol(c, Decl(objectFreeze.ts, 4, 5)) ->Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >C : Symbol(C, Decl(objectFreeze.ts, 1, 19)) new c(1); @@ -27,9 +27,9 @@ new c(1); const a = Object.freeze([1, 2, 3]); >a : Symbol(a, Decl(objectFreeze.ts, 7, 5)) ->Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) a[0] = a[2].toString(); >a : Symbol(a, Decl(objectFreeze.ts, 7, 5)) @@ -41,9 +41,9 @@ a[0] = a[2].toString(); const o = Object.freeze({ a: 1, b: "string", c: true }); >o : Symbol(o, Decl(objectFreeze.ts, 10, 5)) ->Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >a : Symbol(a, Decl(objectFreeze.ts, 10, 25)) >b : Symbol(b, Decl(objectFreeze.ts, 10, 31)) >c : Symbol(c, Decl(objectFreeze.ts, 10, 44)) diff --git a/tests/baselines/reference/objectFreeze.types b/tests/baselines/reference/objectFreeze.types index e5e13dde06248..8d0de10440d85 100644 --- a/tests/baselines/reference/objectFreeze.types +++ b/tests/baselines/reference/objectFreeze.types @@ -2,9 +2,9 @@ const f = Object.freeze(function foo(a: number, b: string) { return false; }); >f : (a: number, b: string) => false >Object.freeze(function foo(a: number, b: string) { return false; }) : (a: number, b: string) => false ->Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>Object.freeze : { (f: T): T; (o: T): Readonly; } >Object : ObjectConstructor ->freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>freeze : { (f: T): T; (o: T): Readonly; } >function foo(a: number, b: string) { return false; } : (a: number, b: string) => false >foo : (a: number, b: string) => false >a : number @@ -26,9 +26,9 @@ class C { constructor(a: number) { } } const c = Object.freeze(C); >c : typeof C >Object.freeze(C) : typeof C ->Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>Object.freeze : { (f: T): T; (o: T): Readonly; } >Object : ObjectConstructor ->freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>freeze : { (f: T): T; (o: T): Readonly; } >C : typeof C new c(1); @@ -39,9 +39,9 @@ new c(1); const a = Object.freeze([1, 2, 3]); >a : readonly [1, 2, 3] >Object.freeze([1, 2, 3]) : readonly [1, 2, 3] ->Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>Object.freeze : { (f: T): T; (o: T): Readonly; } >Object : ObjectConstructor ->freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>freeze : { (f: T): T; (o: T): Readonly; } >[1, 2, 3] : [1, 2, 3] >1 : 1 >2 : 2 @@ -62,9 +62,9 @@ a[0] = a[2].toString(); const o = Object.freeze({ a: 1, b: "string", c: true }); >o : Readonly<{ readonly a: 1; readonly b: "string"; readonly c: true; }> >Object.freeze({ a: 1, b: "string", c: true }) : Readonly<{ readonly a: 1; readonly b: "string"; readonly c: true; }> ->Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>Object.freeze : { (f: T): T; (o: T): Readonly; } >Object : ObjectConstructor ->freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>freeze : { (f: T): T; (o: T): Readonly; } >{ a: 1, b: "string", c: true } : { a: 1; b: "string"; c: true; } >a : 1 >1 : 1 diff --git a/tests/baselines/reference/objectFreezeLiteralsDontWiden.symbols b/tests/baselines/reference/objectFreezeLiteralsDontWiden.symbols index 6eb5b43a26e59..eadff4b4fd99c 100644 --- a/tests/baselines/reference/objectFreezeLiteralsDontWiden.symbols +++ b/tests/baselines/reference/objectFreezeLiteralsDontWiden.symbols @@ -1,9 +1,9 @@ === tests/cases/compiler/objectFreezeLiteralsDontWiden.ts === const PUPPETEER_REVISIONS = Object.freeze({ >PUPPETEER_REVISIONS : Symbol(PUPPETEER_REVISIONS, Decl(objectFreezeLiteralsDontWiden.ts, 0, 5)) ->Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) chromium: '1011831', >chromium : Symbol(chromium, Decl(objectFreezeLiteralsDontWiden.ts, 0, 43)) diff --git a/tests/baselines/reference/objectFreezeLiteralsDontWiden.types b/tests/baselines/reference/objectFreezeLiteralsDontWiden.types index 7632207170977..cace0e9adfb5e 100644 --- a/tests/baselines/reference/objectFreezeLiteralsDontWiden.types +++ b/tests/baselines/reference/objectFreezeLiteralsDontWiden.types @@ -2,9 +2,9 @@ const PUPPETEER_REVISIONS = Object.freeze({ >PUPPETEER_REVISIONS : Readonly<{ readonly chromium: "1011831"; readonly firefox: "latest"; }> >Object.freeze({ chromium: '1011831', firefox: 'latest',}) : Readonly<{ readonly chromium: "1011831"; readonly firefox: "latest"; }> ->Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>Object.freeze : { (f: T): T; (o: T): Readonly; } >Object : ObjectConstructor ->freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>freeze : { (f: T): T; (o: T): Readonly; } >{ chromium: '1011831', firefox: 'latest',} : { chromium: "1011831"; firefox: "latest"; } chromium: '1011831', diff --git a/tests/baselines/reference/objectFromEntries.symbols b/tests/baselines/reference/objectFromEntries.symbols index ffb38b0d92ca8..7dd3aba647ca2 100644 --- a/tests/baselines/reference/objectFromEntries.symbols +++ b/tests/baselines/reference/objectFromEntries.symbols @@ -22,9 +22,9 @@ const o3 = Object.fromEntries(new Map([[Symbol("key"), "value"]])); const frozenArray = Object.freeze([['a', 1], ['b', 2], ['c', 3]]); >frozenArray : Symbol(frozenArray, Decl(objectFromEntries.ts, 4, 5)) ->Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) const o4 = Object.fromEntries(frozenArray); >o4 : Symbol(o4, Decl(objectFromEntries.ts, 5, 5)) @@ -35,9 +35,9 @@ const o4 = Object.fromEntries(frozenArray); const frozenArray2: readonly [string, number][] = Object.freeze([['a', 1], ['b', 2], ['c', 3]]); >frozenArray2 : Symbol(frozenArray2, Decl(objectFromEntries.ts, 7, 5)) ->Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) const o5 = Object.fromEntries(frozenArray2); >o5 : Symbol(o5, Decl(objectFromEntries.ts, 8, 5)) diff --git a/tests/baselines/reference/objectFromEntries.types b/tests/baselines/reference/objectFromEntries.types index e60b2078364c1..fb7ec8f8f5295 100644 --- a/tests/baselines/reference/objectFromEntries.types +++ b/tests/baselines/reference/objectFromEntries.types @@ -43,9 +43,9 @@ const o3 = Object.fromEntries(new Map([[Symbol("key"), "value"]])); const frozenArray = Object.freeze([['a', 1], ['b', 2], ['c', 3]]); >frozenArray : readonly [readonly ["a", 1], readonly ["b", 2], readonly ["c", 3]] >Object.freeze([['a', 1], ['b', 2], ['c', 3]]) : readonly [readonly ["a", 1], readonly ["b", 2], readonly ["c", 3]] ->Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>Object.freeze : { (f: T): T; (o: T): Readonly; } >Object : ObjectConstructor ->freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>freeze : { (f: T): T; (o: T): Readonly; } >[['a', 1], ['b', 2], ['c', 3]] : [["a", 1], ["b", 2], ["c", 3]] >['a', 1] : ["a", 1] >'a' : "a" @@ -68,9 +68,9 @@ const o4 = Object.fromEntries(frozenArray); const frozenArray2: readonly [string, number][] = Object.freeze([['a', 1], ['b', 2], ['c', 3]]); >frozenArray2 : readonly [string, number][] >Object.freeze([['a', 1], ['b', 2], ['c', 3]]) : readonly [readonly ["a", 1], readonly ["b", 2], readonly ["c", 3]] ->Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>Object.freeze : { (f: T): T; (o: T): Readonly; } >Object : ObjectConstructor ->freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>freeze : { (f: T): T; (o: T): Readonly; } >[['a', 1], ['b', 2], ['c', 3]] : [["a", 1], ["b", 2], ["c", 3]] >['a', 1] : ["a", 1] >'a' : "a" diff --git a/tests/baselines/reference/parserMemberAccessAfterPostfixExpression1.errors.txt b/tests/baselines/reference/parserMemberAccessAfterPostfixExpression1.errors.txt index e54869c75ca99..2d5b8277e9848 100644 --- a/tests/baselines/reference/parserMemberAccessAfterPostfixExpression1.errors.txt +++ b/tests/baselines/reference/parserMemberAccessAfterPostfixExpression1.errors.txt @@ -11,4 +11,4 @@ tests/cases/conformance/parser/ecmascript5/Expressions/parserMemberAccessAfterPo !!! error TS1005: ';' expected. ~~~~~~~~ !!! error TS2552: Cannot find name 'toString'. Did you mean 'String'? -!!! related TS2728 /.ts/lib.es5.d.ts:533:13: 'String' is declared here. \ No newline at end of file +!!! related TS2728 /.ts/lib.es5.d.ts:527:13: 'String' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/parserRegularExpressionDivideAmbiguity1.errors.txt b/tests/baselines/reference/parserRegularExpressionDivideAmbiguity1.errors.txt index c808903b073a6..428aff63fa3cd 100644 --- a/tests/baselines/reference/parserRegularExpressionDivideAmbiguity1.errors.txt +++ b/tests/baselines/reference/parserRegularExpressionDivideAmbiguity1.errors.txt @@ -7,6 +7,6 @@ tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpre /notregexp/a.foo(); ~~~~~~~~~ !!! error TS2552: Cannot find name 'notregexp'. Did you mean 'RegExp'? -!!! related TS2728 /.ts/lib.es5.d.ts:1053:13: 'RegExp' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1047:13: 'RegExp' is declared here. ~ !!! error TS2304: Cannot find name 'a'. \ No newline at end of file diff --git a/tests/baselines/reference/parserRegularExpressionDivideAmbiguity2.errors.txt b/tests/baselines/reference/parserRegularExpressionDivideAmbiguity2.errors.txt index 0f8129fff7f04..9521afb38cbc0 100644 --- a/tests/baselines/reference/parserRegularExpressionDivideAmbiguity2.errors.txt +++ b/tests/baselines/reference/parserRegularExpressionDivideAmbiguity2.errors.txt @@ -6,6 +6,6 @@ tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpre (1) /notregexp/a.foo(); ~~~~~~~~~ !!! error TS2552: Cannot find name 'notregexp'. Did you mean 'RegExp'? -!!! related TS2728 /.ts/lib.es5.d.ts:1053:13: 'RegExp' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1047:13: 'RegExp' is declared here. ~ !!! error TS2304: Cannot find name 'a'. \ No newline at end of file diff --git a/tests/baselines/reference/parserS7.2_A1.5_T2.errors.txt b/tests/baselines/reference/parserS7.2_A1.5_T2.errors.txt index 21f0375cfb473..db3d789fee9c3 100644 --- a/tests/baselines/reference/parserS7.2_A1.5_T2.errors.txt +++ b/tests/baselines/reference/parserS7.2_A1.5_T2.errors.txt @@ -19,7 +19,7 @@ tests/cases/conformance/parser/ecmascript5/parserS7.2_A1.5_T2.ts(20,3): error TS $ERROR('#1: eval("\\u00A0var x\\u00A0= 1\\u00A0"); x === 1. Actual: ' + (x)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1067:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1061:13: 'Error' is declared here. } //CHECK#2 @@ -28,7 +28,7 @@ tests/cases/conformance/parser/ecmascript5/parserS7.2_A1.5_T2.ts(20,3): error TS $ERROR('#2:  var x = 1 ; x === 1. Actual: ' + (x)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1067:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1061:13: 'Error' is declared here. } diff --git a/tests/baselines/reference/parserS7.3_A1.1_T2.errors.txt b/tests/baselines/reference/parserS7.3_A1.1_T2.errors.txt index 26d6645fef9cb..29645029d49bb 100644 --- a/tests/baselines/reference/parserS7.3_A1.1_T2.errors.txt +++ b/tests/baselines/reference/parserS7.3_A1.1_T2.errors.txt @@ -21,7 +21,7 @@ tests/cases/conformance/parser/ecmascript5/parserS7.3_A1.1_T2.ts(17,3): error TS $ERROR('#1: var\\nx\\n=\\n1\\n; x === 1. Actual: ' + (x)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1067:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1061:13: 'Error' is declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/parserS7.6_A4.2_T1.errors.txt b/tests/baselines/reference/parserS7.6_A4.2_T1.errors.txt index 82d6f4a9ccf9f..455fd5dd6fc22 100644 --- a/tests/baselines/reference/parserS7.6_A4.2_T1.errors.txt +++ b/tests/baselines/reference/parserS7.6_A4.2_T1.errors.txt @@ -50,70 +50,70 @@ tests/cases/conformance/parser/ecmascript5/parserS7.6_A4.2_T1.ts(142,3): error T $ERROR('#А'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1067:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1061:13: 'Error' is declared here. } var \u0411 = 1; if (Б !== 1) { $ERROR('#Б'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1067:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1061:13: 'Error' is declared here. } var \u0412 = 1; if (В !== 1) { $ERROR('#В'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1067:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1061:13: 'Error' is declared here. } var \u0413 = 1; if (Г !== 1) { $ERROR('#Г'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1067:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1061:13: 'Error' is declared here. } var \u0414 = 1; if (Д !== 1) { $ERROR('#Д'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1067:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1061:13: 'Error' is declared here. } var \u0415 = 1; if (Е !== 1) { $ERROR('#Е'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1067:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1061:13: 'Error' is declared here. } var \u0416 = 1; if (Ж !== 1) { $ERROR('#Ж'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1067:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1061:13: 'Error' is declared here. } var \u0417 = 1; if (З !== 1) { $ERROR('#З'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1067:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1061:13: 'Error' is declared here. } var \u0418 = 1; if (И !== 1) { $ERROR('#И'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1067:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1061:13: 'Error' is declared here. } var \u0419 = 1; if (Й !== 1) { $ERROR('#Й'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1067:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1061:13: 'Error' is declared here. } var \u041A = 1; if (К !== 1) { diff --git a/tests/baselines/reference/parserUnicode1.errors.txt b/tests/baselines/reference/parserUnicode1.errors.txt index 3bf3ec8da574f..4e172e5e198d9 100644 --- a/tests/baselines/reference/parserUnicode1.errors.txt +++ b/tests/baselines/reference/parserUnicode1.errors.txt @@ -11,13 +11,13 @@ tests/cases/conformance/parser/ecmascript5/parserUnicode1.ts(10,5): error TS2552 $ERROR('#6.1: var \\u0078x = 1; xx === 6. Actual: ' + (xx)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1067:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1061:13: 'Error' is declared here. } } catch (e) { $ERROR('#6.2: var \\u0078x = 1; xx === 6. Actual: ' + (xx)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1067:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1061:13: 'Error' is declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/promisePermutations.errors.txt b/tests/baselines/reference/promisePermutations.errors.txt index 069760228de90..83b2d92cec393 100644 --- a/tests/baselines/reference/promisePermutations.errors.txt +++ b/tests/baselines/reference/promisePermutations.errors.txt @@ -447,7 +447,7 @@ tests/cases/compiler/promisePermutations.ts(160,21): error TS2769: No overload m !!! error TS2769: The last overload gave the following error. !!! error TS2769: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. !!! error TS2769: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -!!! related TS2728 /.ts/lib.es5.d.ts:1538:5: 'catch' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1532:5: 'catch' is declared here. !!! related TS2771 tests/cases/compiler/promisePermutations.ts:5:5: The last overload is declared here. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok diff --git a/tests/baselines/reference/promisePermutations2.errors.txt b/tests/baselines/reference/promisePermutations2.errors.txt index 570f1911c9e4c..975015323efca 100644 --- a/tests/baselines/reference/promisePermutations2.errors.txt +++ b/tests/baselines/reference/promisePermutations2.errors.txt @@ -351,7 +351,7 @@ tests/cases/compiler/promisePermutations2.ts(159,21): error TS2345: Argument of ~~~~~~~~~ !!! error TS2345: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. !!! error TS2345: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -!!! related TS2728 /.ts/lib.es5.d.ts:1538:5: 'catch' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1532:5: 'catch' is declared here. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok var r11: IPromise; diff --git a/tests/baselines/reference/promisePermutations3.errors.txt b/tests/baselines/reference/promisePermutations3.errors.txt index ad198fb310013..d8002f29b4c97 100644 --- a/tests/baselines/reference/promisePermutations3.errors.txt +++ b/tests/baselines/reference/promisePermutations3.errors.txt @@ -398,7 +398,7 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of !!! error TS2769: The last overload gave the following error. !!! error TS2769: Argument of type '(x: any) => IPromise' is not assignable to parameter of type '(error: any) => Promise'. !!! error TS2769: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -!!! related TS2728 /.ts/lib.es5.d.ts:1538:5: 'catch' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1532:5: 'catch' is declared here. !!! related TS2771 tests/cases/compiler/promisePermutations3.ts:7:5: The last overload is declared here. var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); // ok @@ -445,5 +445,5 @@ tests/cases/compiler/promisePermutations3.ts(165,21): error TS2345: Argument of ~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '{ (x: T): IPromise; (x: T, y: T): Promise; }' is not assignable to parameter of type '(value: (x: any) => any) => Promise'. !!! error TS2345: Property 'catch' is missing in type 'IPromise' but required in type 'Promise'. -!!! related TS2728 /.ts/lib.es5.d.ts:1538:5: 'catch' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1532:5: 'catch' is declared here. var s12c = s12.then(testFunction12P, testFunction12, testFunction12); // ok \ No newline at end of file diff --git a/tests/baselines/reference/redefineArray.errors.txt b/tests/baselines/reference/redefineArray.errors.txt index 24f7d9a356eb8..5b491bde16f3f 100644 --- a/tests/baselines/reference/redefineArray.errors.txt +++ b/tests/baselines/reference/redefineArray.errors.txt @@ -5,4 +5,4 @@ tests/cases/compiler/redefineArray.ts(1,1): error TS2741: Property 'isArray' is Array = function (n:number, s:string) {return n;}; ~~~~~ !!! error TS2741: Property 'isArray' is missing in type '(n: number, s: string) => number' but required in type 'ArrayConstructor'. -!!! related TS2728 /.ts/lib.es5.d.ts:1494:5: 'isArray' is declared here. \ No newline at end of file +!!! related TS2728 /.ts/lib.es5.d.ts:1488:5: 'isArray' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/scannerS7.2_A1.5_T2.errors.txt b/tests/baselines/reference/scannerS7.2_A1.5_T2.errors.txt index 45e3b25526bcd..922b4c1ccd218 100644 --- a/tests/baselines/reference/scannerS7.2_A1.5_T2.errors.txt +++ b/tests/baselines/reference/scannerS7.2_A1.5_T2.errors.txt @@ -19,7 +19,7 @@ tests/cases/conformance/scanner/ecmascript5/scannerS7.2_A1.5_T2.ts(20,3): error $ERROR('#1: eval("\\u00A0var x\\u00A0= 1\\u00A0"); x === 1. Actual: ' + (x)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1067:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1061:13: 'Error' is declared here. } //CHECK#2 @@ -28,7 +28,7 @@ tests/cases/conformance/scanner/ecmascript5/scannerS7.2_A1.5_T2.ts(20,3): error $ERROR('#2:  var x = 1 ; x === 1. Actual: ' + (x)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1067:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1061:13: 'Error' is declared here. } diff --git a/tests/baselines/reference/scannerS7.3_A1.1_T2.errors.txt b/tests/baselines/reference/scannerS7.3_A1.1_T2.errors.txt index 0e33986fca7bc..0adb75c4f2e7d 100644 --- a/tests/baselines/reference/scannerS7.3_A1.1_T2.errors.txt +++ b/tests/baselines/reference/scannerS7.3_A1.1_T2.errors.txt @@ -21,7 +21,7 @@ tests/cases/conformance/scanner/ecmascript5/scannerS7.3_A1.1_T2.ts(17,3): error $ERROR('#1: var\\nx\\n=\\n1\\n; x === 1. Actual: ' + (x)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1067:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1061:13: 'Error' is declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/scannerS7.6_A4.2_T1.errors.txt b/tests/baselines/reference/scannerS7.6_A4.2_T1.errors.txt index 3ca2bfc9437ed..938bb52ff2f24 100644 --- a/tests/baselines/reference/scannerS7.6_A4.2_T1.errors.txt +++ b/tests/baselines/reference/scannerS7.6_A4.2_T1.errors.txt @@ -50,70 +50,70 @@ tests/cases/conformance/scanner/ecmascript5/scannerS7.6_A4.2_T1.ts(142,3): error $ERROR('#А'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1067:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1061:13: 'Error' is declared here. } var \u0411 = 1; if (Б !== 1) { $ERROR('#Б'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1067:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1061:13: 'Error' is declared here. } var \u0412 = 1; if (В !== 1) { $ERROR('#В'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1067:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1061:13: 'Error' is declared here. } var \u0413 = 1; if (Г !== 1) { $ERROR('#Г'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1067:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1061:13: 'Error' is declared here. } var \u0414 = 1; if (Д !== 1) { $ERROR('#Д'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1067:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1061:13: 'Error' is declared here. } var \u0415 = 1; if (Е !== 1) { $ERROR('#Е'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1067:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1061:13: 'Error' is declared here. } var \u0416 = 1; if (Ж !== 1) { $ERROR('#Ж'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1067:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1061:13: 'Error' is declared here. } var \u0417 = 1; if (З !== 1) { $ERROR('#З'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1067:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1061:13: 'Error' is declared here. } var \u0418 = 1; if (И !== 1) { $ERROR('#И'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1067:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1061:13: 'Error' is declared here. } var \u0419 = 1; if (Й !== 1) { $ERROR('#Й'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? -!!! related TS2728 /.ts/lib.es5.d.ts:1067:13: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1061:13: 'Error' is declared here. } var \u041A = 1; if (К !== 1) { diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt index 7222dcffe926c..df28829239178 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1.errors.txt @@ -38,7 +38,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio ~~ !!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. !!! error TS2345: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. -!!! related TS2728 /.ts/lib.es5.d.ts:611:14: 'raw' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:605:14: 'raw' is declared here. !!! related TS2793 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. var b = foo([], 1); // string ~~ diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt index b7d6f9b7ab011..c6bb16548b693 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution1_ES6.errors.txt @@ -38,7 +38,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio ~~ !!! error TS2345: Argument of type 'undefined[]' is not assignable to parameter of type 'TemplateStringsArray'. !!! error TS2345: Property 'raw' is missing in type 'undefined[]' but required in type 'TemplateStringsArray'. -!!! related TS2728 /.ts/lib.es5.d.ts:611:14: 'raw' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:605:14: 'raw' is declared here. !!! related TS2793 tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolution1_ES6.ts:5:10: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible. var b = foo([], 1); // string ~~