From 46bd405e5949fea6c26604a99fcca62131b56ea0 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 10 Sep 2018 11:25:30 -0700 Subject: [PATCH 01/71] Better scheme for choosing between co- and contra-variant inferences --- src/compiler/checker.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index e24984a6340..96b1a3e1424 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -13752,15 +13752,17 @@ namespace ts { if (!inferredType) { const signature = context.signature; if (signature) { - if (inference.contraCandidates && (!inference.candidates || inference.candidates.length === 1 && inference.candidates[0].flags & TypeFlags.Never)) { - // If we have contravariant inferences, but no covariant inferences or a single - // covariant inference of 'never', we find the best common subtype and treat that - // as a single covariant candidate. - inference.candidates = [getContravariantInference(inference)]; - inference.contraCandidates = undefined; + const inferredCovariantType = inference.candidates ? getCovariantInference(inference, signature) : undefined; + if (inference.contraCandidates) { + const inferredContravariantType = getContravariantInference(inference); + // If we have both co- and contra-variant inferences, we prefer the contra-variant inference + // unless the co-variant inference is a subtype and not 'never'. + inferredType = inferredCovariantType && !(inferredCovariantType.flags & TypeFlags.Never) && + isTypeSubtypeOf(inferredCovariantType, inferredContravariantType) ? + inferredCovariantType : inferredContravariantType; } - if (inference.candidates) { - inferredType = getCovariantInference(inference, signature); + else if (inferredCovariantType) { + inferredType = inferredCovariantType; } else if (context.flags & InferenceFlags.NoDefault) { // We use silentNeverType as the wildcard that signals no inferences. From df837847e96500edc31cca613e6efb5d04c9438e Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 10 Sep 2018 11:25:49 -0700 Subject: [PATCH 02/71] Accept new baselines --- .../reference/genericRestArityStrict.errors.txt | 11 +++++++---- .../baselines/reference/genericRestArityStrict.types | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/baselines/reference/genericRestArityStrict.errors.txt b/tests/baselines/reference/genericRestArityStrict.errors.txt index 9a77f8d8498..6f733be4153 100644 --- a/tests/baselines/reference/genericRestArityStrict.errors.txt +++ b/tests/baselines/reference/genericRestArityStrict.errors.txt @@ -1,7 +1,8 @@ -tests/cases/conformance/types/rest/genericRestArityStrict.ts(7,6): error TS2345: Argument of type '(x: number, y: number) => number' is not assignable to parameter of type '() => void'. +tests/cases/conformance/types/rest/genericRestArityStrict.ts(7,1): error TS2554: Expected 3 arguments, but got 1. +tests/cases/conformance/types/rest/genericRestArityStrict.ts(8,1): error TS2554: Expected 3 arguments, but got 8. -==== tests/cases/conformance/types/rest/genericRestArityStrict.ts (1 errors) ==== +==== tests/cases/conformance/types/rest/genericRestArityStrict.ts (2 errors) ==== // Repro from #25559 declare function call( @@ -9,7 +10,9 @@ tests/cases/conformance/types/rest/genericRestArityStrict.ts(7,6): error TS2345: ...args: TS): void; call((x: number, y: number) => x + y); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(x: number, y: number) => number' is not assignable to parameter of type '() => void'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2554: Expected 3 arguments, but got 1. call((x: number, y: number) => x + y, 1, 2, 3, 4, 5, 6, 7); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2554: Expected 3 arguments, but got 8. \ No newline at end of file diff --git a/tests/baselines/reference/genericRestArityStrict.types b/tests/baselines/reference/genericRestArityStrict.types index afdcbb2df0d..0bdf6d0e96d 100644 --- a/tests/baselines/reference/genericRestArityStrict.types +++ b/tests/baselines/reference/genericRestArityStrict.types @@ -22,7 +22,7 @@ call((x: number, y: number) => x + y); >y : number call((x: number, y: number) => x + y, 1, 2, 3, 4, 5, 6, 7); ->call((x: number, y: number) => x + y, 1, 2, 3, 4, 5, 6, 7) : void +>call((x: number, y: number) => x + y, 1, 2, 3, 4, 5, 6, 7) : any >call : (handler: (...args: TS) => void, ...args: TS) => void >(x: number, y: number) => x + y : (x: number, y: number) => number >x : number From 22a384d786f4eea2e61cf2d3ceb413f1af295875 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 10 Sep 2018 15:12:16 -0700 Subject: [PATCH 03/71] New --strictBindCallApply flag in compiler --- src/compiler/checker.ts | 13 +++++++++++-- src/compiler/commandLineParser.ts | 8 ++++++++ src/compiler/diagnosticMessages.json | 4 ++++ src/compiler/types.ts | 1 + src/compiler/utilities.ts | 2 +- 5 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 96b1a3e1424..9c2861c6792 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -77,6 +77,7 @@ namespace ts { const allowSyntheticDefaultImports = getAllowSyntheticDefaultImports(compilerOptions); const strictNullChecks = getStrictOptionValue(compilerOptions, "strictNullChecks"); const strictFunctionTypes = getStrictOptionValue(compilerOptions, "strictFunctionTypes"); + const strictBindCallApply = getStrictOptionValue(compilerOptions, "strictBindCallApply"); const strictPropertyInitialization = getStrictOptionValue(compilerOptions, "strictPropertyInitialization"); const noImplicitAny = getStrictOptionValue(compilerOptions, "noImplicitAny"); const noImplicitThis = getStrictOptionValue(compilerOptions, "noImplicitThis"); @@ -463,6 +464,8 @@ namespace ts { let globalObjectType: ObjectType; let globalFunctionType: ObjectType; + let globalCallableFunctionType: ObjectType; + let globalNewableFunctionType: ObjectType; let globalArrayType: GenericType; let globalReadonlyArrayType: GenericType; let globalStringType: ObjectType; @@ -7366,8 +7369,12 @@ namespace ts { if (symbol && symbolIsValue(symbol)) { return symbol; } - if (resolved === anyFunctionType || resolved.callSignatures.length || resolved.constructSignatures.length) { - const symbol = getPropertyOfObjectType(globalFunctionType, name); + const functionType = resolved === anyFunctionType ? globalFunctionType : + resolved.callSignatures.length ? globalCallableFunctionType : + resolved.constructSignatures.length ? globalNewableFunctionType : + undefined; + if (functionType) { + const symbol = getPropertyOfObjectType(functionType, name); if (symbol) { return symbol; } @@ -28527,6 +28534,8 @@ namespace ts { globalArrayType = getGlobalType("Array" as __String, /*arity*/ 1, /*reportErrors*/ true); globalObjectType = getGlobalType("Object" as __String, /*arity*/ 0, /*reportErrors*/ true); globalFunctionType = getGlobalType("Function" as __String, /*arity*/ 0, /*reportErrors*/ true); + globalCallableFunctionType = strictBindCallApply && getGlobalType("CallableFunction" as __String, /*arity*/ 0, /*reportErrors*/ true) || globalFunctionType; + globalNewableFunctionType = strictBindCallApply && getGlobalType("NewableFunction" as __String, /*arity*/ 0, /*reportErrors*/ true) || globalFunctionType; globalStringType = getGlobalType("String" as __String, /*arity*/ 0, /*reportErrors*/ true); globalNumberType = getGlobalType("Number" as __String, /*arity*/ 0, /*reportErrors*/ true); globalBooleanType = getGlobalType("Boolean" as __String, /*arity*/ 0, /*reportErrors*/ true); diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index e4c4edcb4db..db4ba2409bf 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -344,6 +344,14 @@ namespace ts { category: Diagnostics.Strict_Type_Checking_Options, description: Diagnostics.Enable_strict_checking_of_function_types }, + { + name: "strictBindCallApply", + type: "boolean", + strictFlag: true, + showInSimplifiedHelpView: true, + category: Diagnostics.Strict_Type_Checking_Options, + description: Diagnostics.Enable_strict_bind_call_and_apply_methods_on_functions + }, { name: "strictPropertyInitialization", type: "boolean", diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 4057a5528aa..ddf0bd22e1a 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3692,6 +3692,10 @@ "category": "Error", "code": 6205 }, + "Enable strict 'bind', 'call', and 'apply' methods on functions.": { + "category": "Message", + "code": 6206 + }, "Projects to reference": { "category": "Message", diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 279fef73d5e..8cf36cff713 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -4402,6 +4402,7 @@ namespace ts { sourceRoot?: string; strict?: boolean; strictFunctionTypes?: boolean; // Always combine with strict property + strictBindCallApply?: boolean; // Always combine with strict property strictNullChecks?: boolean; // Always combine with strict property strictPropertyInitialization?: boolean; // Always combine with strict property stripInternal?: boolean; diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 7a128a41c69..1fd4b0620cc 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -7074,7 +7074,7 @@ namespace ts { return !!(compilerOptions.declaration || compilerOptions.composite); } - export type StrictOptionName = "noImplicitAny" | "noImplicitThis" | "strictNullChecks" | "strictFunctionTypes" | "strictPropertyInitialization" | "alwaysStrict"; + export type StrictOptionName = "noImplicitAny" | "noImplicitThis" | "strictNullChecks" | "strictFunctionTypes" | "strictBindCallApply" | "strictPropertyInitialization" | "alwaysStrict"; export function getStrictOptionValue(compilerOptions: CompilerOptions, flag: StrictOptionName): boolean { return compilerOptions[flag] === undefined ? !!compilerOptions.strict : !!compilerOptions[flag]; From 55b6513078305ce3856a3dacf7e4beaf3141f778 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 10 Sep 2018 15:12:42 -0700 Subject: [PATCH 04/71] New CallableFunction and NewableFunction types in es5.d.ts --- src/lib/es5.d.ts | 58 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index 015eec5c3e0..f5d49a79b74 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -295,6 +295,64 @@ interface FunctionConstructor { declare const Function: FunctionConstructor; +interface CallableFunction extends Function { + /** + * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. + * @param thisArg The object to be used as the this object. + * @param argArray A set of arguments to be passed to the function. + */ + apply(this: (this: T) => R, thisArg: T): R; + apply(this: (this: T, ...args: A) => R, thisArg: T, args: A): R; + + /** + * Calls a method of an object, substituting another object for the current object. + * @param thisArg The object to be used as the current object. + * @param argArray A list of arguments to be passed to the method. + */ + call(this: (this: T, ...args: A) => R, thisArg: T, ...args: A): R; + + /** + * For a given function, creates a bound function that has the same body as the original function. + * The this object of the bound function is associated with the specified object, and has the specified initial parameters. + * @param thisArg An object to which the this keyword can refer inside the new function. + * @param argArray A list of arguments to be passed to the new function. + */ + bind(this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; + bind(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; + bind(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; + bind(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; + bind(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; +} + +interface NewableFunction extends Function { + /** + * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. + * @param thisArg The object to be used as the this object. + * @param argArray A set of arguments to be passed to the function. + */ + apply(this: new () => R, thisArg: any): R; + apply(this: new (...args: A) => R, thisArg: any, args: A): R; + + /** + * Calls a method of an object, substituting another object for the current object. + * @param thisArg The object to be used as the current object. + * @param argArray A list of arguments to be passed to the method. + */ + call(this: new (...args: A) => R, thisArg: any, ...args: A): R; + + /** + * For a given function, creates a bound function that has the same body as the original function. + * The this object of the bound function is associated with the specified object, and has the specified initial parameters. + * @param thisArg An object to which the this keyword can refer inside the new function. + * @param argArray A list of arguments to be passed to the new function. + */ + bind(this: new (...args: A) => R, thisArg: any): new (...args: A) => R; + bind(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; + bind(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; + bind(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; + bind(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; +} + interface IArguments { [index: number]: any; length: number; From a85b8966e0060fdde77b6b8dac898cb25ca4f3b8 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 10 Sep 2018 15:13:53 -0700 Subject: [PATCH 05/71] Accept new baselines --- .../reference/api/tsserverlibrary.d.ts | 1 + tests/baselines/reference/api/typescript.d.ts | 1 + ...tructuringParameterDeclaration4.errors.txt | 2 +- .../reference/externModule.errors.txt | 8 ++++---- ...mUsingES6FeaturesWithOnlyES5Lib.errors.txt | 2 +- ...wExceptionVariableInCatchClause.errors.txt | 2 +- .../narrowFromAnyWithInstanceof.errors.txt | 4 ++-- .../narrowFromAnyWithTypePredicate.errors.txt | 4 ++-- ...erAccessAfterPostfixExpression1.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/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 +++++++++---------- .../tsconfig.json | 1 + .../tsconfig.json | 1 + .../tsconfig.json | 1 + .../tsconfig.json | 1 + .../tsconfig.json | 1 + .../tsconfig.json | 1 + .../tsconfig.json | 1 + .../tsconfig.json | 1 + .../tsconfig.json | 1 + ...entPartialDefinitionStillErrors.errors.txt | 2 +- ...wrappedAndRecursiveConstraints4.errors.txt | 2 +- 27 files changed, 53 insertions(+), 42 deletions(-) diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 2fa23f14a7b..08367f34744 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -2493,6 +2493,7 @@ declare namespace ts { sourceRoot?: string; strict?: boolean; strictFunctionTypes?: boolean; + strictBindCallApply?: boolean; strictNullChecks?: boolean; strictPropertyInitialization?: boolean; stripInternal?: boolean; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 8290cb96236..773f0332cbc 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -2493,6 +2493,7 @@ declare namespace ts { sourceRoot?: string; strict?: boolean; strictFunctionTypes?: boolean; + strictBindCallApply?: boolean; strictNullChecks?: boolean; strictPropertyInitialization?: boolean; stripInternal?: boolean; diff --git a/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt index 46e4f597c21..ffa9a74c17e 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt +++ b/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt @@ -43,7 +43,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:1298:15: 'Array' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1356:15: '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/externModule.errors.txt b/tests/baselines/reference/externModule.errors.txt index 329ef0a8862..82782d150b8 100644 --- a/tests/baselines/reference/externModule.errors.txt +++ b/tests/baselines/reference/externModule.errors.txt @@ -69,20 +69,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:837:15: 'Date' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:895:15: '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:837:15: 'Date' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:895:15: '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:837:15: 'Date' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:895:15: '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:837:15: 'Date' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:895:15: 'Date' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.errors.txt b/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.errors.txt index a77030bd5de..e6068014d11 100644 --- a/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.errors.txt +++ b/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.errors.txt @@ -41,7 +41,7 @@ tests/cases/compiler/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.t Math.sign(1); ~~~~ !!! error TS2551: Property 'sign' does not exist on type 'Math'. Did you mean 'sin'? -!!! related TS2728 /.ts/lib.es5.d.ts:643:5: 'sin' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:701:5: 'sin' is declared here. // Using ES6 object var o = { diff --git a/tests/baselines/reference/narrowExceptionVariableInCatchClause.errors.txt b/tests/baselines/reference/narrowExceptionVariableInCatchClause.errors.txt index 699b65a4f64..56ed619c2d8 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:904:5: 'message' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:962:5: 'message' is declared here. } else { diff --git a/tests/baselines/reference/narrowFromAnyWithInstanceof.errors.txt b/tests/baselines/reference/narrowFromAnyWithInstanceof.errors.txt index 216211b2fa2..9a67a792e3c 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:904:5: 'message' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:962: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:693:5: 'getHours' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:751: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 c35d3263b8f..72a8b5470c8 100644 --- a/tests/baselines/reference/narrowFromAnyWithTypePredicate.errors.txt +++ b/tests/baselines/reference/narrowFromAnyWithTypePredicate.errors.txt @@ -39,7 +39,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:904:5: 'message' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:962:5: 'message' is declared here. } if (isDate(x)) { @@ -47,6 +47,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:693:5: 'getHours' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:751:5: 'getHours' is declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessAfterPostfixExpression1.errors.txt b/tests/baselines/reference/parserMemberAccessAfterPostfixExpression1.errors.txt index d0db1597607..d1c66ce2f4d 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:457:15: 'String' is declared here. \ No newline at end of file +!!! related TS2728 /.ts/lib.es5.d.ts:515:15: 'String' is declared here. \ 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 16a1a9c5ff2..b049c2d4769 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:914:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:972:15: '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:914:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:972:15: '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 a644e1b6f0d..85cbb50ff14 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:914:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:972:15: '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 f29839f43c1..7c2a5087723 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:914:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:972:15: '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:914:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:972:15: '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:914:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:972:15: '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:914:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:972:15: '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:914:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:972:15: '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:914:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:972:15: '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:914:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:972:15: '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:914:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:972:15: '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:914:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:972:15: '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:914:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:972:15: '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 803119cc3e7..6aa420e41a1 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:914:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:972:15: '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:914:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:972:15: 'Error' 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 da25f2199cf..5b2e0316df2 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:914:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:972:15: '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:914:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:972:15: '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 4bfaf868f6d..0b1a1631bb7 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:914:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:972:15: '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 1ff3ea85676..990f7fbfba0 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:914:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:972:15: '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:914:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:972:15: '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:914:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:972:15: '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:914:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:972:15: '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:914:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:972:15: '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:914:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:972:15: '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:914:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:972:15: '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:914:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:972:15: '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:914:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:972:15: '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:914:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:972:15: 'Error' is declared here. } var \u041A = 1; if (К !== 1) { diff --git a/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json b/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json index 261cdca7011..e4e3d7b8ec4 100644 --- a/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Default initialized TSConfig/tsconfig.json @@ -25,6 +25,7 @@ // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ // "strictNullChecks": true, /* Enable strict null checks. */ // "strictFunctionTypes": true, /* Enable strict checking of function types. */ + // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with advanced options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with advanced options/tsconfig.json index d3a9f8e9f47..1919671c489 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with advanced options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with advanced options/tsconfig.json @@ -25,6 +25,7 @@ // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ // "strictNullChecks": true, /* Enable strict null checks. */ // "strictFunctionTypes": true, /* Enable strict checking of function types. */ + // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json index 8484e61bcfa..3b49dee6e3d 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with boolean value compiler options/tsconfig.json @@ -25,6 +25,7 @@ // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ // "strictNullChecks": true, /* Enable strict null checks. */ // "strictFunctionTypes": true, /* Enable strict checking of function types. */ + // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json index 35aa1cf7eab..d91e167877d 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with enum value compiler options/tsconfig.json @@ -25,6 +25,7 @@ // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ // "strictNullChecks": true, /* Enable strict null checks. */ // "strictFunctionTypes": true, /* Enable strict checking of function types. */ + // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json index fbc441b823c..e6107b29b4c 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with files options/tsconfig.json @@ -25,6 +25,7 @@ // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ // "strictNullChecks": true, /* Enable strict null checks. */ // "strictFunctionTypes": true, /* Enable strict checking of function types. */ + // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json index f758c1f6c20..7c18b695c7b 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option value/tsconfig.json @@ -25,6 +25,7 @@ // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ // "strictNullChecks": true, /* Enable strict null checks. */ // "strictFunctionTypes": true, /* Enable strict checking of function types. */ + // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json index 261cdca7011..e4e3d7b8ec4 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with incorrect compiler option/tsconfig.json @@ -25,6 +25,7 @@ // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ // "strictNullChecks": true, /* Enable strict null checks. */ // "strictFunctionTypes": true, /* Enable strict checking of function types. */ + // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json index cdb52963ccb..eedcc357043 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options with enum value/tsconfig.json @@ -25,6 +25,7 @@ // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ // "strictNullChecks": true, /* Enable strict null checks. */ // "strictFunctionTypes": true, /* Enable strict checking of function types. */ + // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ diff --git a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json index fd6419e1e35..6fc7833730f 100644 --- a/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json +++ b/tests/baselines/reference/tsConfig/Initialized TSConfig with list compiler options/tsconfig.json @@ -25,6 +25,7 @@ // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ // "strictNullChecks": true, /* Enable strict null checks. */ // "strictFunctionTypes": true, /* Enable strict checking of function types. */ + // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ diff --git a/tests/baselines/reference/tsxTypeArgumentPartialDefinitionStillErrors.errors.txt b/tests/baselines/reference/tsxTypeArgumentPartialDefinitionStillErrors.errors.txt index 255d0eb32bc..8ddf169447e 100644 --- a/tests/baselines/reference/tsxTypeArgumentPartialDefinitionStillErrors.errors.txt +++ b/tests/baselines/reference/tsxTypeArgumentPartialDefinitionStillErrors.errors.txt @@ -15,5 +15,5 @@ tests/cases/compiler/file.tsx(11,14): error TS2322: Type 'number' is not assigna prop={1}>; // should error ~~~~ !!! error TS2322: Type 'number' is not assignable to type 'string'. -!!! related TS6500 /.ts/lib.es5.d.ts:1382:39: The expected type comes from property 'prop' which is declared here on type 'Record' +!!! related TS6500 /.ts/lib.es5.d.ts:1440:39: The expected type comes from property 'prop' which is declared here on type 'Record' \ No newline at end of file diff --git a/tests/baselines/reference/wrappedAndRecursiveConstraints4.errors.txt b/tests/baselines/reference/wrappedAndRecursiveConstraints4.errors.txt index 65bfc5b20d5..3ad4c8af115 100644 --- a/tests/baselines/reference/wrappedAndRecursiveConstraints4.errors.txt +++ b/tests/baselines/reference/wrappedAndRecursiveConstraints4.errors.txt @@ -19,4 +19,4 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/wrappedAndRecursi ~~~~~~ !!! error TS2322: Type '(x: number) => void' is not assignable to type '(pos: number) => string'. !!! error TS2322: Type 'void' is not assignable to type 'string'. -!!! related TS6500 /.ts/lib.es5.d.ts:332:5: The expected type comes from property 'charAt' which is declared here on type 'string' \ No newline at end of file +!!! related TS6500 /.ts/lib.es5.d.ts:390:5: The expected type comes from property 'charAt' which is declared here on type 'string' \ No newline at end of file From b687d906d87ac6cda69302dd78764c84442d35e2 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 10 Sep 2018 15:47:00 -0700 Subject: [PATCH 06/71] Add CallableFunction/NewableFunction to virtual file system --- src/harness/virtualFileSystemWithWatch.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/harness/virtualFileSystemWithWatch.ts b/src/harness/virtualFileSystemWithWatch.ts index 57fa33a84c2..8c241772227 100644 --- a/src/harness/virtualFileSystemWithWatch.ts +++ b/src/harness/virtualFileSystemWithWatch.ts @@ -4,6 +4,8 @@ namespace ts.TestFSWithWatch { content: `/// interface Boolean {} interface Function {} +interface CallableFunction {} +interface NewableFunction {} interface IArguments {} interface Number { toExponential: any; } interface Object {} From 1e3625c952967aaf93a9bb02c1e9022d7b6b17f7 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 10 Sep 2018 15:47:48 -0700 Subject: [PATCH 07/71] Accept new baselines --- ...eralsContextuallyTypedFromUnion.errors.txt | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/baselines/reference/booleanLiteralsContextuallyTypedFromUnion.errors.txt diff --git a/tests/baselines/reference/booleanLiteralsContextuallyTypedFromUnion.errors.txt b/tests/baselines/reference/booleanLiteralsContextuallyTypedFromUnion.errors.txt new file mode 100644 index 00000000000..5b8fb9b0ea8 --- /dev/null +++ b/tests/baselines/reference/booleanLiteralsContextuallyTypedFromUnion.errors.txt @@ -0,0 +1,31 @@ +error TS2318: Cannot find global type 'CallableFunction'. +error TS2318: Cannot find global type 'NewableFunction'. + + +!!! error TS2318: Cannot find global type 'CallableFunction'. +!!! error TS2318: Cannot find global type 'NewableFunction'. +==== tests/cases/compiler/booleanLiteralsContextuallyTypedFromUnion.tsx (0 errors) ==== + interface A { isIt: true; text: string; } + interface B { isIt: false; value: number; } + type C = A | B; + const isIt = Math.random() > 0.5; + const c: C = isIt ? { isIt, text: 'hey' } : { isIt, value: 123 }; + const cc: C = isIt ? { isIt: isIt, text: 'hey' } : { isIt: isIt, value: 123 }; + + type ComponentProps = + | { + optionalBool: true; + mandatoryFn: () => void; + } + | { + optionalBool: false; + }; + + let Funk = (_props: ComponentProps) =>
Hello
; + + let Fail1 = () => { }} optionalBool={true} /> + let Fail2 = () => { }} optionalBool={true as true} /> + let True = true as true; + let Fail3 = () => { }} optionalBool={True} /> + let attrs2 = { optionalBool: true as true, mandatoryFn: () => { } } + let Success = () => \ No newline at end of file From a5dece30d9df8973dc01f215d60943f6d2e09728 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 11 Sep 2018 06:14:41 -0700 Subject: [PATCH 08/71] Update declarations --- src/lib/es5.d.ts | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index f5d49a79b74..8c7bed232f0 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -297,25 +297,25 @@ declare const Function: FunctionConstructor; interface CallableFunction extends Function { /** - * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. + * Calls the function with the specified object as the this value and the elements of specified array as the arguments. * @param thisArg The object to be used as the this object. - * @param argArray A set of arguments to be passed to the function. + * @param args An array of argument values to be passed to the function. */ apply(this: (this: T) => R, thisArg: T): R; apply(this: (this: T, ...args: A) => R, thisArg: T, args: A): R; /** - * Calls a method of an object, substituting another object for the current object. - * @param thisArg The object to be used as the current object. - * @param argArray A list of arguments to be passed to the method. + * Calls the function with the specified object as the this value and the specified rest arguments as the arguments. + * @param thisArg The object to be used as the this object. + * @param args Argument values to be passed to the function. */ call(this: (this: T, ...args: A) => R, thisArg: T, ...args: A): R; /** * For a given function, creates a bound function that has the same body as the original function. * The this object of the bound function is associated with the specified object, and has the specified initial parameters. - * @param thisArg An object to which the this keyword can refer inside the new function. - * @param argArray A list of arguments to be passed to the new function. + * @param thisArg The object to be used as the this object. + * @param args Arguments to bind to the parameters of the function. */ bind(this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; bind(this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; @@ -326,25 +326,25 @@ interface CallableFunction extends Function { interface NewableFunction extends Function { /** - * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function. + * Calls the function with the specified object as the this value and the elements of specified array as the arguments. * @param thisArg The object to be used as the this object. - * @param argArray A set of arguments to be passed to the function. + * @param args An array of argument values to be passed to the function. */ - apply(this: new () => R, thisArg: any): R; - apply
(this: new (...args: A) => R, thisArg: any, args: A): R; + apply(this: new () => T, thisArg: T): void; + apply(this: new (...args: A) => T, thisArg: T, args: A): void; /** - * Calls a method of an object, substituting another object for the current object. - * @param thisArg The object to be used as the current object. - * @param argArray A list of arguments to be passed to the method. + * Calls the function with the specified object as the this value and the specified rest arguments as the arguments. + * @param thisArg The object to be used as the this object. + * @param args Argument values to be passed to the function. */ - call(this: new (...args: A) => R, thisArg: any, ...args: A): R; + call(this: new (...args: A) => T, thisArg: T, ...args: A): void; /** * For a given function, creates a bound function that has the same body as the original function. * The this object of the bound function is associated with the specified object, and has the specified initial parameters. - * @param thisArg An object to which the this keyword can refer inside the new function. - * @param argArray A list of arguments to be passed to the new function. + * @param thisArg The object to be used as the this object. + * @param args Arguments to bind to the parameters of the function. */ bind(this: new (...args: A) => R, thisArg: any): new (...args: A) => R; bind(this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; From d069da2f66334a4ea65d5ed30831ee46dbde1817 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 11 Sep 2018 06:33:15 -0700 Subject: [PATCH 09/71] Update getAugmentedPropertiesOfType --- src/compiler/checker.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 9c2861c6792..00c258a8eef 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -27758,8 +27758,11 @@ namespace ts { function getAugmentedPropertiesOfType(type: Type): Symbol[] { type = getApparentType(type); const propsByName = createSymbolTable(getPropertiesOfType(type)); - if (typeHasCallOrConstructSignatures(type)) { - forEach(getPropertiesOfType(globalFunctionType), p => { + const functionType = getSignaturesOfType(type, SignatureKind.Call).length ? globalCallableFunctionType : + getSignaturesOfType(type, SignatureKind.Call).length ? globalNewableFunctionType : + undefined; + if (functionType) { + forEach(getPropertiesOfType(functionType), p => { if (!propsByName.has(p.escapedName)) { propsByName.set(p.escapedName, p); } From e9679f0191ff5e3d5a6f56b87fdec6daa2231de2 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 11 Sep 2018 06:43:17 -0700 Subject: [PATCH 10/71] Add tests --- .../functions/strictBindCallApply1.ts | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 tests/cases/conformance/functions/strictBindCallApply1.ts diff --git a/tests/cases/conformance/functions/strictBindCallApply1.ts b/tests/cases/conformance/functions/strictBindCallApply1.ts new file mode 100644 index 00000000000..5a94d4b5416 --- /dev/null +++ b/tests/cases/conformance/functions/strictBindCallApply1.ts @@ -0,0 +1,59 @@ +// @strict: true + +declare function foo(a: number, b: string): string; + +let f00 = foo.bind(undefined); +let f01 = foo.bind(undefined, 10); +let f02 = foo.bind(undefined, 10, "hello"); +let f03 = foo.bind(undefined, 10, 20); // Error + +let c00 = foo.call(undefined, 10, "hello"); +let c01 = foo.call(undefined, 10); // Error +let c02 = foo.call(undefined, 10, 20); // Error +let c03 = foo.call(undefined, 10, "hello", 30); // Error + +let a00 = foo.apply(undefined, [10, "hello"]); +let a01 = foo.apply(undefined, [10]); // Error +let a02 = foo.apply(undefined, [10, 20]); // Error +let a03 = foo.apply(undefined, [10, "hello", 30]); // Error + +class C { + constructor(a: number, b: string) {} + foo(this: this, a: number, b: string): string { return "" } +} + +declare let c: C; +declare let obj: {}; + +let f10 = c.foo.bind(c); +let f11 = c.foo.bind(c, 10); +let f12 = c.foo.bind(c, 10, "hello"); +let f13 = c.foo.bind(c, 10, 20); // Error +let f14 = c.foo.bind(undefined); // Error + +let c10 = c.foo.call(c, 10, "hello"); +let c11 = c.foo.call(c, 10); // Error +let c12 = c.foo.call(c, 10, 20); // Error +let c13 = c.foo.call(c, 10, "hello", 30); // Error +let c14 = c.foo.call(undefined, 10, "hello"); // Error + +let a10 = c.foo.apply(c, [10, "hello"]); +let a11 = c.foo.apply(c, [10]); // Error +let a12 = c.foo.apply(c, [10, 20]); // Error +let a13 = c.foo.apply(c, [10, "hello", 30]); // Error +let a14 = c.foo.apply(undefined, [10, "hello"]); // Error + +let f20 = C.bind(undefined); +let f21 = C.bind(undefined, 10); +let f22 = C.bind(undefined, 10, "hello"); +let f23 = C.bind(undefined, 10, 20); // Error + +C.call(c, 10, "hello"); +C.call(c, 10); // Error +C.call(c, 10, 20); // Error +C.call(c, 10, "hello", 30); // Error + +C.apply(c, [10, "hello"]); +C.apply(c, [10]); // Error +C.apply(c, [10, 20]); // Error +C.apply(c, [10, "hello", 30]); // Error From 8a41f5f04b3df9996954307f0c823a7ee42f21e9 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 11 Sep 2018 06:43:28 -0700 Subject: [PATCH 11/71] Accept new baselines --- .../reference/strictBindCallApply1.errors.txt | 139 ++++++ .../reference/strictBindCallApply1.js | 107 +++++ .../reference/strictBindCallApply1.symbols | 322 +++++++++++++ .../reference/strictBindCallApply1.types | 441 ++++++++++++++++++ 4 files changed, 1009 insertions(+) create mode 100644 tests/baselines/reference/strictBindCallApply1.errors.txt create mode 100644 tests/baselines/reference/strictBindCallApply1.js create mode 100644 tests/baselines/reference/strictBindCallApply1.symbols create mode 100644 tests/baselines/reference/strictBindCallApply1.types diff --git a/tests/baselines/reference/strictBindCallApply1.errors.txt b/tests/baselines/reference/strictBindCallApply1.errors.txt new file mode 100644 index 00000000000..e998238a8f7 --- /dev/null +++ b/tests/baselines/reference/strictBindCallApply1.errors.txt @@ -0,0 +1,139 @@ +tests/cases/conformance/functions/strictBindCallApply1.ts(6,35): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. +tests/cases/conformance/functions/strictBindCallApply1.ts(9,11): error TS2554: Expected 3 arguments, but got 2. +tests/cases/conformance/functions/strictBindCallApply1.ts(10,35): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. +tests/cases/conformance/functions/strictBindCallApply1.ts(11,11): error TS2554: Expected 3 arguments, but got 4. +tests/cases/conformance/functions/strictBindCallApply1.ts(14,32): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'. + Property '1' is missing in type '[number]'. +tests/cases/conformance/functions/strictBindCallApply1.ts(15,37): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/functions/strictBindCallApply1.ts(16,32): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. + Types of property 'length' are incompatible. + Type '3' is not assignable to type '2'. +tests/cases/conformance/functions/strictBindCallApply1.ts(29,29): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. +tests/cases/conformance/functions/strictBindCallApply1.ts(30,22): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. +tests/cases/conformance/functions/strictBindCallApply1.ts(33,11): error TS2554: Expected 3 arguments, but got 2. +tests/cases/conformance/functions/strictBindCallApply1.ts(34,29): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. +tests/cases/conformance/functions/strictBindCallApply1.ts(35,11): error TS2554: Expected 3 arguments, but got 4. +tests/cases/conformance/functions/strictBindCallApply1.ts(36,22): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. +tests/cases/conformance/functions/strictBindCallApply1.ts(39,26): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'. +tests/cases/conformance/functions/strictBindCallApply1.ts(40,31): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/functions/strictBindCallApply1.ts(41,26): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. +tests/cases/conformance/functions/strictBindCallApply1.ts(42,23): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. +tests/cases/conformance/functions/strictBindCallApply1.ts(47,33): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. +tests/cases/conformance/functions/strictBindCallApply1.ts(50,1): error TS2554: Expected 3 arguments, but got 2. +tests/cases/conformance/functions/strictBindCallApply1.ts(51,15): error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. +tests/cases/conformance/functions/strictBindCallApply1.ts(52,1): error TS2554: Expected 3 arguments, but got 4. +tests/cases/conformance/functions/strictBindCallApply1.ts(55,12): error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'. +tests/cases/conformance/functions/strictBindCallApply1.ts(56,17): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/functions/strictBindCallApply1.ts(57,12): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. + + +==== tests/cases/conformance/functions/strictBindCallApply1.ts (24 errors) ==== + declare function foo(a: number, b: string): string; + + let f00 = foo.bind(undefined); + let f01 = foo.bind(undefined, 10); + let f02 = foo.bind(undefined, 10, "hello"); + let f03 = foo.bind(undefined, 10, 20); // Error + ~~ +!!! error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. + + let c00 = foo.call(undefined, 10, "hello"); + let c01 = foo.call(undefined, 10); // Error + ~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2554: Expected 3 arguments, but got 2. + let c02 = foo.call(undefined, 10, 20); // Error + ~~ +!!! error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. + let c03 = foo.call(undefined, 10, "hello", 30); // Error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2554: Expected 3 arguments, but got 4. + + let a00 = foo.apply(undefined, [10, "hello"]); + let a01 = foo.apply(undefined, [10]); // Error + ~~~~ +!!! error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'. +!!! error TS2345: Property '1' is missing in type '[number]'. + let a02 = foo.apply(undefined, [10, 20]); // Error + ~~ +!!! error TS2322: Type 'number' is not assignable to type 'string'. + let a03 = foo.apply(undefined, [10, "hello", 30]); // Error + ~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. +!!! error TS2345: Types of property 'length' are incompatible. +!!! error TS2345: Type '3' is not assignable to type '2'. + + class C { + constructor(a: number, b: string) {} + foo(this: this, a: number, b: string): string { return "" } + } + + declare let c: C; + declare let obj: {}; + + let f10 = c.foo.bind(c); + let f11 = c.foo.bind(c, 10); + let f12 = c.foo.bind(c, 10, "hello"); + let f13 = c.foo.bind(c, 10, 20); // Error + ~~ +!!! error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. + let f14 = c.foo.bind(undefined); // Error + ~~~~~~~~~ +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. + + let c10 = c.foo.call(c, 10, "hello"); + let c11 = c.foo.call(c, 10); // Error + ~~~~~~~~~~~~~~~~~ +!!! error TS2554: Expected 3 arguments, but got 2. + let c12 = c.foo.call(c, 10, 20); // Error + ~~ +!!! error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. + let c13 = c.foo.call(c, 10, "hello", 30); // Error + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2554: Expected 3 arguments, but got 4. + let c14 = c.foo.call(undefined, 10, "hello"); // Error + ~~~~~~~~~ +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. + + let a10 = c.foo.apply(c, [10, "hello"]); + let a11 = c.foo.apply(c, [10]); // Error + ~~~~ +!!! error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'. + let a12 = c.foo.apply(c, [10, 20]); // Error + ~~ +!!! error TS2322: Type 'number' is not assignable to type 'string'. + let a13 = c.foo.apply(c, [10, "hello", 30]); // Error + ~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. + let a14 = c.foo.apply(undefined, [10, "hello"]); // Error + ~~~~~~~~~ +!!! error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'C'. + + let f20 = C.bind(undefined); + let f21 = C.bind(undefined, 10); + let f22 = C.bind(undefined, 10, "hello"); + let f23 = C.bind(undefined, 10, 20); // Error + ~~ +!!! error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. + + C.call(c, 10, "hello"); + C.call(c, 10); // Error + ~~~~~~~~~~~~~ +!!! error TS2554: Expected 3 arguments, but got 2. + C.call(c, 10, 20); // Error + ~~ +!!! error TS2345: Argument of type '20' is not assignable to parameter of type 'string'. + C.call(c, 10, "hello", 30); // Error + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2554: Expected 3 arguments, but got 4. + + C.apply(c, [10, "hello"]); + C.apply(c, [10]); // Error + ~~~~ +!!! error TS2345: Argument of type '[number]' is not assignable to parameter of type '[number, string]'. + C.apply(c, [10, 20]); // Error + ~~ +!!! error TS2322: Type 'number' is not assignable to type 'string'. + C.apply(c, [10, "hello", 30]); // Error + ~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[number, string]'. + \ No newline at end of file diff --git a/tests/baselines/reference/strictBindCallApply1.js b/tests/baselines/reference/strictBindCallApply1.js new file mode 100644 index 00000000000..e43c84edbf1 --- /dev/null +++ b/tests/baselines/reference/strictBindCallApply1.js @@ -0,0 +1,107 @@ +//// [strictBindCallApply1.ts] +declare function foo(a: number, b: string): string; + +let f00 = foo.bind(undefined); +let f01 = foo.bind(undefined, 10); +let f02 = foo.bind(undefined, 10, "hello"); +let f03 = foo.bind(undefined, 10, 20); // Error + +let c00 = foo.call(undefined, 10, "hello"); +let c01 = foo.call(undefined, 10); // Error +let c02 = foo.call(undefined, 10, 20); // Error +let c03 = foo.call(undefined, 10, "hello", 30); // Error + +let a00 = foo.apply(undefined, [10, "hello"]); +let a01 = foo.apply(undefined, [10]); // Error +let a02 = foo.apply(undefined, [10, 20]); // Error +let a03 = foo.apply(undefined, [10, "hello", 30]); // Error + +class C { + constructor(a: number, b: string) {} + foo(this: this, a: number, b: string): string { return "" } +} + +declare let c: C; +declare let obj: {}; + +let f10 = c.foo.bind(c); +let f11 = c.foo.bind(c, 10); +let f12 = c.foo.bind(c, 10, "hello"); +let f13 = c.foo.bind(c, 10, 20); // Error +let f14 = c.foo.bind(undefined); // Error + +let c10 = c.foo.call(c, 10, "hello"); +let c11 = c.foo.call(c, 10); // Error +let c12 = c.foo.call(c, 10, 20); // Error +let c13 = c.foo.call(c, 10, "hello", 30); // Error +let c14 = c.foo.call(undefined, 10, "hello"); // Error + +let a10 = c.foo.apply(c, [10, "hello"]); +let a11 = c.foo.apply(c, [10]); // Error +let a12 = c.foo.apply(c, [10, 20]); // Error +let a13 = c.foo.apply(c, [10, "hello", 30]); // Error +let a14 = c.foo.apply(undefined, [10, "hello"]); // Error + +let f20 = C.bind(undefined); +let f21 = C.bind(undefined, 10); +let f22 = C.bind(undefined, 10, "hello"); +let f23 = C.bind(undefined, 10, 20); // Error + +C.call(c, 10, "hello"); +C.call(c, 10); // Error +C.call(c, 10, 20); // Error +C.call(c, 10, "hello", 30); // Error + +C.apply(c, [10, "hello"]); +C.apply(c, [10]); // Error +C.apply(c, [10, 20]); // Error +C.apply(c, [10, "hello", 30]); // Error + + +//// [strictBindCallApply1.js] +"use strict"; +var f00 = foo.bind(undefined); +var f01 = foo.bind(undefined, 10); +var f02 = foo.bind(undefined, 10, "hello"); +var f03 = foo.bind(undefined, 10, 20); // Error +var c00 = foo.call(undefined, 10, "hello"); +var c01 = foo.call(undefined, 10); // Error +var c02 = foo.call(undefined, 10, 20); // Error +var c03 = foo.call(undefined, 10, "hello", 30); // Error +var a00 = foo.apply(undefined, [10, "hello"]); +var a01 = foo.apply(undefined, [10]); // Error +var a02 = foo.apply(undefined, [10, 20]); // Error +var a03 = foo.apply(undefined, [10, "hello", 30]); // Error +var C = /** @class */ (function () { + function C(a, b) { + } + C.prototype.foo = function (a, b) { return ""; }; + return C; +}()); +var f10 = c.foo.bind(c); +var f11 = c.foo.bind(c, 10); +var f12 = c.foo.bind(c, 10, "hello"); +var f13 = c.foo.bind(c, 10, 20); // Error +var f14 = c.foo.bind(undefined); // Error +var c10 = c.foo.call(c, 10, "hello"); +var c11 = c.foo.call(c, 10); // Error +var c12 = c.foo.call(c, 10, 20); // Error +var c13 = c.foo.call(c, 10, "hello", 30); // Error +var c14 = c.foo.call(undefined, 10, "hello"); // Error +var a10 = c.foo.apply(c, [10, "hello"]); +var a11 = c.foo.apply(c, [10]); // Error +var a12 = c.foo.apply(c, [10, 20]); // Error +var a13 = c.foo.apply(c, [10, "hello", 30]); // Error +var a14 = c.foo.apply(undefined, [10, "hello"]); // Error +var f20 = C.bind(undefined); +var f21 = C.bind(undefined, 10); +var f22 = C.bind(undefined, 10, "hello"); +var f23 = C.bind(undefined, 10, 20); // Error +C.call(c, 10, "hello"); +C.call(c, 10); // Error +C.call(c, 10, 20); // Error +C.call(c, 10, "hello", 30); // Error +C.apply(c, [10, "hello"]); +C.apply(c, [10]); // Error +C.apply(c, [10, 20]); // Error +C.apply(c, [10, "hello", 30]); // Error diff --git a/tests/baselines/reference/strictBindCallApply1.symbols b/tests/baselines/reference/strictBindCallApply1.symbols new file mode 100644 index 00000000000..1b49e96a0f0 --- /dev/null +++ b/tests/baselines/reference/strictBindCallApply1.symbols @@ -0,0 +1,322 @@ +=== tests/cases/conformance/functions/strictBindCallApply1.ts === +declare function foo(a: number, b: string): string; +>foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) +>a : Symbol(a, Decl(strictBindCallApply1.ts, 0, 21)) +>b : Symbol(b, Decl(strictBindCallApply1.ts, 0, 31)) + +let f00 = foo.bind(undefined); +>f00 : Symbol(f00, Decl(strictBindCallApply1.ts, 2, 3)) +>foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +let f01 = foo.bind(undefined, 10); +>f01 : Symbol(f01, Decl(strictBindCallApply1.ts, 3, 3)) +>foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +let f02 = foo.bind(undefined, 10, "hello"); +>f02 : Symbol(f02, Decl(strictBindCallApply1.ts, 4, 3)) +>foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +let f03 = foo.bind(undefined, 10, 20); // Error +>f03 : Symbol(f03, Decl(strictBindCallApply1.ts, 5, 3)) +>foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +let c00 = foo.call(undefined, 10, "hello"); +>c00 : Symbol(c00, Decl(strictBindCallApply1.ts, 7, 3)) +>foo.call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) +>foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) +>call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +let c01 = foo.call(undefined, 10); // Error +>c01 : Symbol(c01, Decl(strictBindCallApply1.ts, 8, 3)) +>foo.call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) +>foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) +>call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +let c02 = foo.call(undefined, 10, 20); // Error +>c02 : Symbol(c02, Decl(strictBindCallApply1.ts, 9, 3)) +>foo.call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) +>foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) +>call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +let c03 = foo.call(undefined, 10, "hello", 30); // Error +>c03 : Symbol(c03, Decl(strictBindCallApply1.ts, 10, 3)) +>foo.call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) +>foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) +>call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +let a00 = foo.apply(undefined, [10, "hello"]); +>a00 : Symbol(a00, Decl(strictBindCallApply1.ts, 12, 3)) +>foo.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) +>apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +let a01 = foo.apply(undefined, [10]); // Error +>a01 : Symbol(a01, Decl(strictBindCallApply1.ts, 13, 3)) +>foo.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) +>apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +let a02 = foo.apply(undefined, [10, 20]); // Error +>a02 : Symbol(a02, Decl(strictBindCallApply1.ts, 14, 3)) +>foo.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) +>apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +let a03 = foo.apply(undefined, [10, "hello", 30]); // Error +>a03 : Symbol(a03, Decl(strictBindCallApply1.ts, 15, 3)) +>foo.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) +>apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +class C { +>C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) + + constructor(a: number, b: string) {} +>a : Symbol(a, Decl(strictBindCallApply1.ts, 18, 16)) +>b : Symbol(b, Decl(strictBindCallApply1.ts, 18, 26)) + + foo(this: this, a: number, b: string): string { return "" } +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>this : Symbol(this, Decl(strictBindCallApply1.ts, 19, 8)) +>a : Symbol(a, Decl(strictBindCallApply1.ts, 19, 19)) +>b : Symbol(b, Decl(strictBindCallApply1.ts, 19, 30)) +} + +declare let c: C; +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) + +declare let obj: {}; +>obj : Symbol(obj, Decl(strictBindCallApply1.ts, 23, 11)) + +let f10 = c.foo.bind(c); +>f10 : Symbol(f10, Decl(strictBindCallApply1.ts, 25, 3)) +>c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) + +let f11 = c.foo.bind(c, 10); +>f11 : Symbol(f11, Decl(strictBindCallApply1.ts, 26, 3)) +>c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) + +let f12 = c.foo.bind(c, 10, "hello"); +>f12 : Symbol(f12, Decl(strictBindCallApply1.ts, 27, 3)) +>c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) + +let f13 = c.foo.bind(c, 10, 20); // Error +>f13 : Symbol(f13, Decl(strictBindCallApply1.ts, 28, 3)) +>c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) + +let f14 = c.foo.bind(undefined); // Error +>f14 : Symbol(f14, Decl(strictBindCallApply1.ts, 29, 3)) +>c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +let c10 = c.foo.call(c, 10, "hello"); +>c10 : Symbol(c10, Decl(strictBindCallApply1.ts, 31, 3)) +>c.foo.call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) + +let c11 = c.foo.call(c, 10); // Error +>c11 : Symbol(c11, Decl(strictBindCallApply1.ts, 32, 3)) +>c.foo.call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) + +let c12 = c.foo.call(c, 10, 20); // Error +>c12 : Symbol(c12, Decl(strictBindCallApply1.ts, 33, 3)) +>c.foo.call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) + +let c13 = c.foo.call(c, 10, "hello", 30); // Error +>c13 : Symbol(c13, Decl(strictBindCallApply1.ts, 34, 3)) +>c.foo.call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) + +let c14 = c.foo.call(undefined, 10, "hello"); // Error +>c14 : Symbol(c14, Decl(strictBindCallApply1.ts, 35, 3)) +>c.foo.call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +let a10 = c.foo.apply(c, [10, "hello"]); +>a10 : Symbol(a10, Decl(strictBindCallApply1.ts, 37, 3)) +>c.foo.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) + +let a11 = c.foo.apply(c, [10]); // Error +>a11 : Symbol(a11, Decl(strictBindCallApply1.ts, 38, 3)) +>c.foo.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) + +let a12 = c.foo.apply(c, [10, 20]); // Error +>a12 : Symbol(a12, Decl(strictBindCallApply1.ts, 39, 3)) +>c.foo.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) + +let a13 = c.foo.apply(c, [10, "hello", 30]); // Error +>a13 : Symbol(a13, Decl(strictBindCallApply1.ts, 40, 3)) +>c.foo.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) + +let a14 = c.foo.apply(undefined, [10, "hello"]); // Error +>a14 : Symbol(a14, Decl(strictBindCallApply1.ts, 41, 3)) +>c.foo.apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) +>foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) +>apply : Symbol(CallableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +let f20 = C.bind(undefined); +>f20 : Symbol(f20, Decl(strictBindCallApply1.ts, 43, 3)) +>C.bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) +>bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +let f21 = C.bind(undefined, 10); +>f21 : Symbol(f21, Decl(strictBindCallApply1.ts, 44, 3)) +>C.bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) +>bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +let f22 = C.bind(undefined, 10, "hello"); +>f22 : Symbol(f22, Decl(strictBindCallApply1.ts, 45, 3)) +>C.bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) +>bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +let f23 = C.bind(undefined, 10, 20); // Error +>f23 : Symbol(f23, Decl(strictBindCallApply1.ts, 46, 3)) +>C.bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) +>bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>undefined : Symbol(undefined) + +C.call(c, 10, "hello"); +>C.call : Symbol(NewableFunction.call, Decl(lib.es5.d.ts, --, --)) +>C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) +>call : Symbol(NewableFunction.call, Decl(lib.es5.d.ts, --, --)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) + +C.call(c, 10); // Error +>C.call : Symbol(NewableFunction.call, Decl(lib.es5.d.ts, --, --)) +>C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) +>call : Symbol(NewableFunction.call, Decl(lib.es5.d.ts, --, --)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) + +C.call(c, 10, 20); // Error +>C.call : Symbol(NewableFunction.call, Decl(lib.es5.d.ts, --, --)) +>C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) +>call : Symbol(NewableFunction.call, Decl(lib.es5.d.ts, --, --)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) + +C.call(c, 10, "hello", 30); // Error +>C.call : Symbol(NewableFunction.call, Decl(lib.es5.d.ts, --, --)) +>C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) +>call : Symbol(NewableFunction.call, Decl(lib.es5.d.ts, --, --)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) + +C.apply(c, [10, "hello"]); +>C.apply : Symbol(NewableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) +>apply : Symbol(NewableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) + +C.apply(c, [10]); // Error +>C.apply : Symbol(NewableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) +>apply : Symbol(NewableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) + +C.apply(c, [10, 20]); // Error +>C.apply : Symbol(NewableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) +>apply : Symbol(NewableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) + +C.apply(c, [10, "hello", 30]); // Error +>C.apply : Symbol(NewableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) +>apply : Symbol(NewableFunction.apply, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) + diff --git a/tests/baselines/reference/strictBindCallApply1.types b/tests/baselines/reference/strictBindCallApply1.types new file mode 100644 index 00000000000..8e1607bf666 --- /dev/null +++ b/tests/baselines/reference/strictBindCallApply1.types @@ -0,0 +1,441 @@ +=== tests/cases/conformance/functions/strictBindCallApply1.ts === +declare function foo(a: number, b: string): string; +>foo : (a: number, b: string) => string +>a : number +>b : string + +let f00 = foo.bind(undefined); +>f00 : (a: number, b: string) => string +>foo.bind(undefined) : (a: number, b: string) => string +>foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>foo : (a: number, b: string) => string +>bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>undefined : undefined + +let f01 = foo.bind(undefined, 10); +>f01 : (b: string) => string +>foo.bind(undefined, 10) : (b: string) => string +>foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>foo : (a: number, b: string) => string +>bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>undefined : undefined +>10 : 10 + +let f02 = foo.bind(undefined, 10, "hello"); +>f02 : () => string +>foo.bind(undefined, 10, "hello") : () => string +>foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>foo : (a: number, b: string) => string +>bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>undefined : undefined +>10 : 10 +>"hello" : "hello" + +let f03 = foo.bind(undefined, 10, 20); // Error +>f03 : any +>foo.bind(undefined, 10, 20) : any +>foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>foo : (a: number, b: string) => string +>bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>undefined : undefined +>10 : 10 +>20 : 20 + +let c00 = foo.call(undefined, 10, "hello"); +>c00 : string +>foo.call(undefined, 10, "hello") : string +>foo.call : (this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R +>foo : (a: number, b: string) => string +>call : (this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R +>undefined : undefined +>10 : 10 +>"hello" : "hello" + +let c01 = foo.call(undefined, 10); // Error +>c01 : any +>foo.call(undefined, 10) : any +>foo.call : (this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R +>foo : (a: number, b: string) => string +>call : (this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R +>undefined : undefined +>10 : 10 + +let c02 = foo.call(undefined, 10, 20); // Error +>c02 : any +>foo.call(undefined, 10, 20) : any +>foo.call : (this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R +>foo : (a: number, b: string) => string +>call : (this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R +>undefined : undefined +>10 : 10 +>20 : 20 + +let c03 = foo.call(undefined, 10, "hello", 30); // Error +>c03 : any +>foo.call(undefined, 10, "hello", 30) : any +>foo.call : (this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R +>foo : (a: number, b: string) => string +>call : (this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R +>undefined : undefined +>10 : 10 +>"hello" : "hello" +>30 : 30 + +let a00 = foo.apply(undefined, [10, "hello"]); +>a00 : string +>foo.apply(undefined, [10, "hello"]) : string +>foo.apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +>foo : (a: number, b: string) => string +>apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +>undefined : undefined +>[10, "hello"] : [number, string] +>10 : 10 +>"hello" : "hello" + +let a01 = foo.apply(undefined, [10]); // Error +>a01 : any +>foo.apply(undefined, [10]) : any +>foo.apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +>foo : (a: number, b: string) => string +>apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +>undefined : undefined +>[10] : number[] +>10 : 10 + +let a02 = foo.apply(undefined, [10, 20]); // Error +>a02 : any +>foo.apply(undefined, [10, 20]) : any +>foo.apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +>foo : (a: number, b: string) => string +>apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +>undefined : undefined +>[10, 20] : number[] +>10 : 10 +>20 : 20 + +let a03 = foo.apply(undefined, [10, "hello", 30]); // Error +>a03 : any +>foo.apply(undefined, [10, "hello", 30]) : any +>foo.apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +>foo : (a: number, b: string) => string +>apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +>undefined : undefined +>[10, "hello", 30] : (string | number)[] +>10 : 10 +>"hello" : "hello" +>30 : 30 + +class C { +>C : C + + constructor(a: number, b: string) {} +>a : number +>b : string + + foo(this: this, a: number, b: string): string { return "" } +>foo : (this: this, a: number, b: string) => string +>this : this +>a : number +>b : string +>"" : "" +} + +declare let c: C; +>c : C + +declare let obj: {}; +>obj : {} + +let f10 = c.foo.bind(c); +>f10 : (a: number, b: string) => string +>c.foo.bind(c) : (a: number, b: string) => string +>c.foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>c.foo : (this: C, a: number, b: string) => string +>c : C +>foo : (this: C, a: number, b: string) => string +>bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>c : C + +let f11 = c.foo.bind(c, 10); +>f11 : (b: string) => string +>c.foo.bind(c, 10) : (b: string) => string +>c.foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>c.foo : (this: C, a: number, b: string) => string +>c : C +>foo : (this: C, a: number, b: string) => string +>bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>c : C +>10 : 10 + +let f12 = c.foo.bind(c, 10, "hello"); +>f12 : () => string +>c.foo.bind(c, 10, "hello") : () => string +>c.foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>c.foo : (this: C, a: number, b: string) => string +>c : C +>foo : (this: C, a: number, b: string) => string +>bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>c : C +>10 : 10 +>"hello" : "hello" + +let f13 = c.foo.bind(c, 10, 20); // Error +>f13 : any +>c.foo.bind(c, 10, 20) : any +>c.foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>c.foo : (this: C, a: number, b: string) => string +>c : C +>foo : (this: C, a: number, b: string) => string +>bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>c : C +>10 : 10 +>20 : 20 + +let f14 = c.foo.bind(undefined); // Error +>f14 : any +>c.foo.bind(undefined) : any +>c.foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>c.foo : (this: C, a: number, b: string) => string +>c : C +>foo : (this: C, a: number, b: string) => string +>bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>undefined : undefined + +let c10 = c.foo.call(c, 10, "hello"); +>c10 : string +>c.foo.call(c, 10, "hello") : string +>c.foo.call : (this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R +>c.foo : (this: C, a: number, b: string) => string +>c : C +>foo : (this: C, a: number, b: string) => string +>call : (this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R +>c : C +>10 : 10 +>"hello" : "hello" + +let c11 = c.foo.call(c, 10); // Error +>c11 : any +>c.foo.call(c, 10) : any +>c.foo.call : (this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R +>c.foo : (this: C, a: number, b: string) => string +>c : C +>foo : (this: C, a: number, b: string) => string +>call : (this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R +>c : C +>10 : 10 + +let c12 = c.foo.call(c, 10, 20); // Error +>c12 : any +>c.foo.call(c, 10, 20) : any +>c.foo.call : (this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R +>c.foo : (this: C, a: number, b: string) => string +>c : C +>foo : (this: C, a: number, b: string) => string +>call : (this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R +>c : C +>10 : 10 +>20 : 20 + +let c13 = c.foo.call(c, 10, "hello", 30); // Error +>c13 : any +>c.foo.call(c, 10, "hello", 30) : any +>c.foo.call : (this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R +>c.foo : (this: C, a: number, b: string) => string +>c : C +>foo : (this: C, a: number, b: string) => string +>call : (this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R +>c : C +>10 : 10 +>"hello" : "hello" +>30 : 30 + +let c14 = c.foo.call(undefined, 10, "hello"); // Error +>c14 : any +>c.foo.call(undefined, 10, "hello") : any +>c.foo.call : (this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R +>c.foo : (this: C, a: number, b: string) => string +>c : C +>foo : (this: C, a: number, b: string) => string +>call : (this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R +>undefined : undefined +>10 : 10 +>"hello" : "hello" + +let a10 = c.foo.apply(c, [10, "hello"]); +>a10 : string +>c.foo.apply(c, [10, "hello"]) : string +>c.foo.apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +>c.foo : (this: C, a: number, b: string) => string +>c : C +>foo : (this: C, a: number, b: string) => string +>apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +>c : C +>[10, "hello"] : [number, string] +>10 : 10 +>"hello" : "hello" + +let a11 = c.foo.apply(c, [10]); // Error +>a11 : any +>c.foo.apply(c, [10]) : any +>c.foo.apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +>c.foo : (this: C, a: number, b: string) => string +>c : C +>foo : (this: C, a: number, b: string) => string +>apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +>c : C +>[10] : number[] +>10 : 10 + +let a12 = c.foo.apply(c, [10, 20]); // Error +>a12 : any +>c.foo.apply(c, [10, 20]) : any +>c.foo.apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +>c.foo : (this: C, a: number, b: string) => string +>c : C +>foo : (this: C, a: number, b: string) => string +>apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +>c : C +>[10, 20] : number[] +>10 : 10 +>20 : 20 + +let a13 = c.foo.apply(c, [10, "hello", 30]); // Error +>a13 : any +>c.foo.apply(c, [10, "hello", 30]) : any +>c.foo.apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +>c.foo : (this: C, a: number, b: string) => string +>c : C +>foo : (this: C, a: number, b: string) => string +>apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +>c : C +>[10, "hello", 30] : (string | number)[] +>10 : 10 +>"hello" : "hello" +>30 : 30 + +let a14 = c.foo.apply(undefined, [10, "hello"]); // Error +>a14 : any +>c.foo.apply(undefined, [10, "hello"]) : any +>c.foo.apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +>c.foo : (this: C, a: number, b: string) => string +>c : C +>foo : (this: C, a: number, b: string) => string +>apply : { (this: (this: T) => R, thisArg: T): R; (this: (this: T, ...args: A) => R, thisArg: T, args: A): R; } +>undefined : undefined +>[10, "hello"] : (string | number)[] +>10 : 10 +>"hello" : "hello" + +let f20 = C.bind(undefined); +>f20 : new (a: number, b: string) => C +>C.bind(undefined) : new (a: number, b: string) => C +>C.bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; } +>C : typeof C +>bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; } +>undefined : undefined + +let f21 = C.bind(undefined, 10); +>f21 : new (b: string) => C +>C.bind(undefined, 10) : new (b: string) => C +>C.bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; } +>C : typeof C +>bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; } +>undefined : undefined +>10 : 10 + +let f22 = C.bind(undefined, 10, "hello"); +>f22 : new () => C +>C.bind(undefined, 10, "hello") : new () => C +>C.bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; } +>C : typeof C +>bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; } +>undefined : undefined +>10 : 10 +>"hello" : "hello" + +let f23 = C.bind(undefined, 10, 20); // Error +>f23 : any +>C.bind(undefined, 10, 20) : any +>C.bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; } +>C : typeof C +>bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; } +>undefined : undefined +>10 : 10 +>20 : 20 + +C.call(c, 10, "hello"); +>C.call(c, 10, "hello") : void +>C.call : (this: new (...args: A) => T, thisArg: T, ...args: A) => void +>C : typeof C +>call : (this: new (...args: A) => T, thisArg: T, ...args: A) => void +>c : C +>10 : 10 +>"hello" : "hello" + +C.call(c, 10); // Error +>C.call(c, 10) : any +>C.call : (this: new (...args: A) => T, thisArg: T, ...args: A) => void +>C : typeof C +>call : (this: new (...args: A) => T, thisArg: T, ...args: A) => void +>c : C +>10 : 10 + +C.call(c, 10, 20); // Error +>C.call(c, 10, 20) : any +>C.call : (this: new (...args: A) => T, thisArg: T, ...args: A) => void +>C : typeof C +>call : (this: new (...args: A) => T, thisArg: T, ...args: A) => void +>c : C +>10 : 10 +>20 : 20 + +C.call(c, 10, "hello", 30); // Error +>C.call(c, 10, "hello", 30) : any +>C.call : (this: new (...args: A) => T, thisArg: T, ...args: A) => void +>C : typeof C +>call : (this: new (...args: A) => T, thisArg: T, ...args: A) => void +>c : C +>10 : 10 +>"hello" : "hello" +>30 : 30 + +C.apply(c, [10, "hello"]); +>C.apply(c, [10, "hello"]) : void +>C.apply : { (this: new () => T, thisArg: T): void; (this: new (...args: A) => T, thisArg: T, args: A): void; } +>C : typeof C +>apply : { (this: new () => T, thisArg: T): void; (this: new (...args: A) => T, thisArg: T, args: A): void; } +>c : C +>[10, "hello"] : [number, string] +>10 : 10 +>"hello" : "hello" + +C.apply(c, [10]); // Error +>C.apply(c, [10]) : any +>C.apply : { (this: new () => T, thisArg: T): void; (this: new (...args: A) => T, thisArg: T, args: A): void; } +>C : typeof C +>apply : { (this: new () => T, thisArg: T): void; (this: new (...args: A) => T, thisArg: T, args: A): void; } +>c : C +>[10] : number[] +>10 : 10 + +C.apply(c, [10, 20]); // Error +>C.apply(c, [10, 20]) : any +>C.apply : { (this: new () => T, thisArg: T): void; (this: new (...args: A) => T, thisArg: T, args: A): void; } +>C : typeof C +>apply : { (this: new () => T, thisArg: T): void; (this: new (...args: A) => T, thisArg: T, args: A): void; } +>c : C +>[10, 20] : number[] +>10 : 10 +>20 : 20 + +C.apply(c, [10, "hello", 30]); // Error +>C.apply(c, [10, "hello", 30]) : any +>C.apply : { (this: new () => T, thisArg: T): void; (this: new (...args: A) => T, thisArg: T, args: A): void; } +>C : typeof C +>apply : { (this: new () => T, thisArg: T): void; (this: new (...args: A) => T, thisArg: T, args: A): void; } +>c : C +>[10, "hello", 30] : (string | number)[] +>10 : 10 +>"hello" : "hello" +>30 : 30 + From 91123fc544ad827eafa53a3faedc7faee7f4a916 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 11 Sep 2018 08:11:32 -0700 Subject: [PATCH 12/71] Minor fix --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 00c258a8eef..6fedcb7da72 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -27759,7 +27759,7 @@ namespace ts { type = getApparentType(type); const propsByName = createSymbolTable(getPropertiesOfType(type)); const functionType = getSignaturesOfType(type, SignatureKind.Call).length ? globalCallableFunctionType : - getSignaturesOfType(type, SignatureKind.Call).length ? globalNewableFunctionType : + getSignaturesOfType(type, SignatureKind.Construct).length ? globalNewableFunctionType : undefined; if (functionType) { forEach(getPropertiesOfType(functionType), p => { From 0226b661800f1d7dd7ace143a2f64b12f7b623ee Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 11 Sep 2018 10:55:32 -0700 Subject: [PATCH 13/71] Accept new baselines --- tests/baselines/reference/genericRestArityStrict.errors.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/baselines/reference/genericRestArityStrict.errors.txt b/tests/baselines/reference/genericRestArityStrict.errors.txt index 6f733be4153..2803c6215e4 100644 --- a/tests/baselines/reference/genericRestArityStrict.errors.txt +++ b/tests/baselines/reference/genericRestArityStrict.errors.txt @@ -12,6 +12,7 @@ tests/cases/conformance/types/rest/genericRestArityStrict.ts(8,1): error TS2554: call((x: number, y: number) => x + y); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 3 arguments, but got 1. +!!! related TS6210 tests/cases/conformance/types/rest/genericRestArityStrict.ts:5:5: An argument for 'args' was not provided. call((x: number, y: number) => x + y, 1, 2, 3, 4, 5, 6, 7); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2554: Expected 3 arguments, but got 8. From 52293edce517035d584559df8fcfd83cd036720c Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 12 Sep 2018 12:33:37 -0700 Subject: [PATCH 14/71] Fix inference when source and target both have rest parameters --- src/compiler/checker.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 5aaa236f0e0..c8e9ed58797 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -13128,10 +13128,8 @@ namespace ts { const targetCount = getParameterCount(target); const sourceRestType = getEffectiveRestType(source); const targetRestType = getEffectiveRestType(target); - const paramCount = targetRestType ? Math.min(targetCount - 1, sourceCount) : - sourceRestType ? targetCount : - Math.min(sourceCount, targetCount); - + const targetNonRestCount = targetRestType ? targetCount - 1 : targetCount; + const paramCount = sourceRestType ? targetNonRestCount : Math.min(sourceCount, targetNonRestCount); const sourceThisType = getThisTypeOfSignature(source); if (sourceThisType) { const targetThisType = getThisTypeOfSignature(target); From 2e17debbfbf82520f9c1110f133efeb850b62fb2 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 12 Sep 2018 13:16:33 -0700 Subject: [PATCH 15/71] Prefer error candidates with no rest parameters over those with --- src/compiler/checker.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index c8e9ed58797..588442668aa 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -19453,7 +19453,10 @@ namespace ts { checkCandidate = candidate; } if (!checkApplicableSignature(node, args, checkCandidate, relation, excludeArgument, /*reportErrors*/ false)) { - candidateForArgumentError = checkCandidate; + // Give preference to error candidates that have no rest parameters (as they are more specific) + if (!candidateForArgumentError || getEffectiveRestType(candidateForArgumentError) || !getEffectiveRestType(checkCandidate)) { + candidateForArgumentError = checkCandidate; + } continue; } if (excludeArgument) { @@ -19466,7 +19469,10 @@ namespace ts { checkCandidate = getSignatureInstantiation(candidate, typeArgumentTypes, isInJavaScriptFile(candidate.declaration)); } if (!checkApplicableSignature(node, args, checkCandidate, relation, excludeArgument, /*reportErrors*/ false)) { - candidateForArgumentError = checkCandidate; + // Give preference to error candidates that have no rest parameters (as they are more specific) + if (!candidateForArgumentError || getEffectiveRestType(candidateForArgumentError) || !getEffectiveRestType(checkCandidate)) { + candidateForArgumentError = checkCandidate; + } continue; } } From df1e33a8a5ed82ea793ac2891db13d3f63890b8e Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 12 Sep 2018 13:17:11 -0700 Subject: [PATCH 16/71] Add 'bind' overloads for rest parameter arrays --- src/lib/es5.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index 8c7bed232f0..2917539cfdb 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -322,6 +322,7 @@ interface CallableFunction extends Function { bind(this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; bind(this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; bind(this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; + bind(this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } interface NewableFunction extends Function { @@ -351,6 +352,7 @@ interface NewableFunction extends Function { bind(this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; bind(this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; bind(this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; + bind(this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } interface IArguments { From 339f310563da04aabf456c115232b0de9d907b2a Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 12 Sep 2018 13:18:00 -0700 Subject: [PATCH 17/71] Accept new baselines --- ...tructuringParameterDeclaration4.errors.txt | 2 +- .../reference/externModule.errors.txt | 8 +-- ...mUsingES6FeaturesWithOnlyES5Lib.errors.txt | 2 +- ...wExceptionVariableInCatchClause.errors.txt | 2 +- .../narrowFromAnyWithInstanceof.errors.txt | 4 +- .../narrowFromAnyWithTypePredicate.errors.txt | 4 +- ...erAccessAfterPostfixExpression1.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/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 +++---- .../reference/strictBindCallApply1.symbols | 52 +++++++++---------- .../reference/strictBindCallApply1.types | 52 +++++++++---------- ...entPartialDefinitionStillErrors.errors.txt | 2 +- ...wrappedAndRecursiveConstraints4.errors.txt | 2 +- 18 files changed, 94 insertions(+), 94 deletions(-) diff --git a/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt index ffa9a74c17e..6e45d29f977 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt +++ b/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt @@ -43,7 +43,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:1356:15: 'Array' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:1358:15: '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/externModule.errors.txt b/tests/baselines/reference/externModule.errors.txt index 82782d150b8..b6629387d2a 100644 --- a/tests/baselines/reference/externModule.errors.txt +++ b/tests/baselines/reference/externModule.errors.txt @@ -69,20 +69,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:895:15: 'Date' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:897:15: '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:895:15: 'Date' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:897:15: '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:895:15: 'Date' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:897:15: '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:895:15: 'Date' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:897:15: 'Date' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.errors.txt b/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.errors.txt index e6068014d11..543ca7e18bf 100644 --- a/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.errors.txt +++ b/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.errors.txt @@ -41,7 +41,7 @@ tests/cases/compiler/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.t Math.sign(1); ~~~~ !!! error TS2551: Property 'sign' does not exist on type 'Math'. Did you mean 'sin'? -!!! related TS2728 /.ts/lib.es5.d.ts:701:5: 'sin' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:703:5: 'sin' is declared here. // Using ES6 object var o = { diff --git a/tests/baselines/reference/narrowExceptionVariableInCatchClause.errors.txt b/tests/baselines/reference/narrowExceptionVariableInCatchClause.errors.txt index 56ed619c2d8..12b2790c3de 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:962:5: 'message' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:964:5: 'message' is declared here. } else { diff --git a/tests/baselines/reference/narrowFromAnyWithInstanceof.errors.txt b/tests/baselines/reference/narrowFromAnyWithInstanceof.errors.txt index 9a67a792e3c..f5c0c5728f1 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:962:5: 'message' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:964: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:751:5: 'getHours' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:753: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 72a8b5470c8..385357f2204 100644 --- a/tests/baselines/reference/narrowFromAnyWithTypePredicate.errors.txt +++ b/tests/baselines/reference/narrowFromAnyWithTypePredicate.errors.txt @@ -39,7 +39,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:962:5: 'message' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:964:5: 'message' is declared here. } if (isDate(x)) { @@ -47,6 +47,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:751:5: 'getHours' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:753:5: 'getHours' is declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessAfterPostfixExpression1.errors.txt b/tests/baselines/reference/parserMemberAccessAfterPostfixExpression1.errors.txt index d1c66ce2f4d..bd7db9c44fe 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:515:15: 'String' is declared here. \ No newline at end of file +!!! related TS2728 /.ts/lib.es5.d.ts:517:15: 'String' is declared here. \ 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 b049c2d4769..136d4477268 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:972:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:15: '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:972:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:15: '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 85cbb50ff14..3a35d5f0a83 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:972:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:15: '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 7c2a5087723..35fc8935b73 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:972:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:15: '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:972:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:15: '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:972:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:15: '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:972:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:15: '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:972:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:15: '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:972:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:15: '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:972:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:15: '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:972:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:15: '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:972:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:15: '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:972:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:15: '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 6aa420e41a1..2e16f696620 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:972:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:15: '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:972:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' 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 5b2e0316df2..f61392a51ec 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:972:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:15: '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:972:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:15: '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 0b1a1631bb7..f7ab44d83d5 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:972:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:15: '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 990f7fbfba0..ab3bddb5bc6 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:972:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:15: '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:972:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:15: '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:972:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:15: '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:972:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:15: '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:972:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:15: '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:972:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:15: '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:972:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:15: '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:972:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:15: '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:972:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:15: '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:972:15: 'Error' is declared here. +!!! related TS2728 /.ts/lib.es5.d.ts:974:15: 'Error' is declared here. } var \u041A = 1; if (К !== 1) { diff --git a/tests/baselines/reference/strictBindCallApply1.symbols b/tests/baselines/reference/strictBindCallApply1.symbols index 1b49e96a0f0..b8133a65a78 100644 --- a/tests/baselines/reference/strictBindCallApply1.symbols +++ b/tests/baselines/reference/strictBindCallApply1.symbols @@ -6,30 +6,30 @@ declare function foo(a: number, b: string): string; let f00 = foo.bind(undefined); >f00 : Symbol(f00, Decl(strictBindCallApply1.ts, 2, 3)) ->foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) ->bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >undefined : Symbol(undefined) let f01 = foo.bind(undefined, 10); >f01 : Symbol(f01, Decl(strictBindCallApply1.ts, 3, 3)) ->foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) ->bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >undefined : Symbol(undefined) let f02 = foo.bind(undefined, 10, "hello"); >f02 : Symbol(f02, Decl(strictBindCallApply1.ts, 4, 3)) ->foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) ->bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >undefined : Symbol(undefined) let f03 = foo.bind(undefined, 10, 20); // Error >f03 : Symbol(f03, Decl(strictBindCallApply1.ts, 5, 3)) ->foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >foo : Symbol(foo, Decl(strictBindCallApply1.ts, 0, 0)) ->bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >undefined : Symbol(undefined) let c00 = foo.call(undefined, 10, "hello"); @@ -111,47 +111,47 @@ declare let obj: {}; let f10 = c.foo.bind(c); >f10 : Symbol(f10, Decl(strictBindCallApply1.ts, 25, 3)) ->c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) >c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) >foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) ->bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) let f11 = c.foo.bind(c, 10); >f11 : Symbol(f11, Decl(strictBindCallApply1.ts, 26, 3)) ->c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) >c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) >foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) ->bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) let f12 = c.foo.bind(c, 10, "hello"); >f12 : Symbol(f12, Decl(strictBindCallApply1.ts, 27, 3)) ->c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) >c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) >foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) ->bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) let f13 = c.foo.bind(c, 10, 20); // Error >f13 : Symbol(f13, Decl(strictBindCallApply1.ts, 28, 3)) ->c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) >c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) >foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) ->bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) let f14 = c.foo.bind(undefined); // Error >f14 : Symbol(f14, Decl(strictBindCallApply1.ts, 29, 3)) ->c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>c.foo.bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >c.foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) >c : Symbol(c, Decl(strictBindCallApply1.ts, 22, 11)) >foo : Symbol(C.foo, Decl(strictBindCallApply1.ts, 18, 40)) ->bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>bind : Symbol(CallableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >undefined : Symbol(undefined) let c10 = c.foo.call(c, 10, "hello"); @@ -246,30 +246,30 @@ let a14 = c.foo.apply(undefined, [10, "hello"]); // Error let f20 = C.bind(undefined); >f20 : Symbol(f20, Decl(strictBindCallApply1.ts, 43, 3)) ->C.bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>C.bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) ->bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >undefined : Symbol(undefined) let f21 = C.bind(undefined, 10); >f21 : Symbol(f21, Decl(strictBindCallApply1.ts, 44, 3)) ->C.bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>C.bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) ->bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >undefined : Symbol(undefined) let f22 = C.bind(undefined, 10, "hello"); >f22 : Symbol(f22, Decl(strictBindCallApply1.ts, 45, 3)) ->C.bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>C.bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) ->bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >undefined : Symbol(undefined) let f23 = C.bind(undefined, 10, 20); // Error >f23 : Symbol(f23, Decl(strictBindCallApply1.ts, 46, 3)) ->C.bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>C.bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >C : Symbol(C, Decl(strictBindCallApply1.ts, 15, 50)) ->bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>bind : Symbol(NewableFunction.bind, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 1 more) >undefined : Symbol(undefined) C.call(c, 10, "hello"); diff --git a/tests/baselines/reference/strictBindCallApply1.types b/tests/baselines/reference/strictBindCallApply1.types index 8e1607bf666..a895447e182 100644 --- a/tests/baselines/reference/strictBindCallApply1.types +++ b/tests/baselines/reference/strictBindCallApply1.types @@ -7,26 +7,26 @@ declare function foo(a: number, b: string): string; let f00 = foo.bind(undefined); >f00 : (a: number, b: string) => string >foo.bind(undefined) : (a: number, b: string) => string ->foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >foo : (a: number, b: string) => string ->bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >undefined : undefined let f01 = foo.bind(undefined, 10); >f01 : (b: string) => string >foo.bind(undefined, 10) : (b: string) => string ->foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >foo : (a: number, b: string) => string ->bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >undefined : undefined >10 : 10 let f02 = foo.bind(undefined, 10, "hello"); >f02 : () => string >foo.bind(undefined, 10, "hello") : () => string ->foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >foo : (a: number, b: string) => string ->bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >undefined : undefined >10 : 10 >"hello" : "hello" @@ -34,9 +34,9 @@ let f02 = foo.bind(undefined, 10, "hello"); let f03 = foo.bind(undefined, 10, 20); // Error >f03 : any >foo.bind(undefined, 10, 20) : any ->foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >foo : (a: number, b: string) => string ->bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >undefined : undefined >10 : 10 >20 : 20 @@ -149,32 +149,32 @@ declare let obj: {}; let f10 = c.foo.bind(c); >f10 : (a: number, b: string) => string >c.foo.bind(c) : (a: number, b: string) => string ->c.foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>c.foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >c.foo : (this: C, a: number, b: string) => string >c : C >foo : (this: C, a: number, b: string) => string ->bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >c : C let f11 = c.foo.bind(c, 10); >f11 : (b: string) => string >c.foo.bind(c, 10) : (b: string) => string ->c.foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>c.foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >c.foo : (this: C, a: number, b: string) => string >c : C >foo : (this: C, a: number, b: string) => string ->bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >c : C >10 : 10 let f12 = c.foo.bind(c, 10, "hello"); >f12 : () => string >c.foo.bind(c, 10, "hello") : () => string ->c.foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>c.foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >c.foo : (this: C, a: number, b: string) => string >c : C >foo : (this: C, a: number, b: string) => string ->bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >c : C >10 : 10 >"hello" : "hello" @@ -182,11 +182,11 @@ let f12 = c.foo.bind(c, 10, "hello"); let f13 = c.foo.bind(c, 10, 20); // Error >f13 : any >c.foo.bind(c, 10, 20) : any ->c.foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>c.foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >c.foo : (this: C, a: number, b: string) => string >c : C >foo : (this: C, a: number, b: string) => string ->bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >c : C >10 : 10 >20 : 20 @@ -194,11 +194,11 @@ let f13 = c.foo.bind(c, 10, 20); // Error let f14 = c.foo.bind(undefined); // Error >f14 : any >c.foo.bind(undefined) : any ->c.foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>c.foo.bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >c.foo : (this: C, a: number, b: string) => string >c : C >foo : (this: C, a: number, b: string) => string ->bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; } +>bind : { (this: (this: T, ...args: A) => R, thisArg: T): (...args: A) => R; (this: (this: T, arg0: A0, ...args: A) => R, thisArg: T, arg0: A0): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2): (...args: A) => R; (this: (this: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: T, arg0: A0, arg1: A1, arg2: A2, arg3: A3): (...args: A) => R; (this: (this: T, ...args: AX[]) => R, thisArg: T, ...args: AX[]): (...args: AX[]) => R; } >undefined : undefined let c10 = c.foo.call(c, 10, "hello"); @@ -329,26 +329,26 @@ let a14 = c.foo.apply(undefined, [10, "hello"]); // Error let f20 = C.bind(undefined); >f20 : new (a: number, b: string) => C >C.bind(undefined) : new (a: number, b: string) => C ->C.bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; } +>C.bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } >C : typeof C ->bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; } +>bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } >undefined : undefined let f21 = C.bind(undefined, 10); >f21 : new (b: string) => C >C.bind(undefined, 10) : new (b: string) => C ->C.bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; } +>C.bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } >C : typeof C ->bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; } +>bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } >undefined : undefined >10 : 10 let f22 = C.bind(undefined, 10, "hello"); >f22 : new () => C >C.bind(undefined, 10, "hello") : new () => C ->C.bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; } +>C.bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } >C : typeof C ->bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; } +>bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } >undefined : undefined >10 : 10 >"hello" : "hello" @@ -356,9 +356,9 @@ let f22 = C.bind(undefined, 10, "hello"); let f23 = C.bind(undefined, 10, 20); // Error >f23 : any >C.bind(undefined, 10, 20) : any ->C.bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; } +>C.bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } >C : typeof C ->bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; } +>bind : { (this: new (...args: A) => R, thisArg: any): new (...args: A) => R; (this: new (arg0: A0, ...args: A) => R, thisArg: any, arg0: A0): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2): new (...args: A) => R; (this: new (arg0: A0, arg1: A1, arg2: A2, arg3: A3, ...args: A) => R, thisArg: any, arg0: A0, arg1: A1, arg2: A2, arg3: A3): new (...args: A) => R; (this: new (...args: AX[]) => R, thisArg: any, ...args: AX[]): new (...args: AX[]) => R; } >undefined : undefined >10 : 10 >20 : 20 diff --git a/tests/baselines/reference/tsxTypeArgumentPartialDefinitionStillErrors.errors.txt b/tests/baselines/reference/tsxTypeArgumentPartialDefinitionStillErrors.errors.txt index 8ddf169447e..fdae3b2f7cf 100644 --- a/tests/baselines/reference/tsxTypeArgumentPartialDefinitionStillErrors.errors.txt +++ b/tests/baselines/reference/tsxTypeArgumentPartialDefinitionStillErrors.errors.txt @@ -15,5 +15,5 @@ tests/cases/compiler/file.tsx(11,14): error TS2322: Type 'number' is not assigna prop={1}>; // should error ~~~~ !!! error TS2322: Type 'number' is not assignable to type 'string'. -!!! related TS6500 /.ts/lib.es5.d.ts:1440:39: The expected type comes from property 'prop' which is declared here on type 'Record' +!!! related TS6500 /.ts/lib.es5.d.ts:1442:39: The expected type comes from property 'prop' which is declared here on type 'Record' \ No newline at end of file diff --git a/tests/baselines/reference/wrappedAndRecursiveConstraints4.errors.txt b/tests/baselines/reference/wrappedAndRecursiveConstraints4.errors.txt index 3ad4c8af115..5c67d4f07b8 100644 --- a/tests/baselines/reference/wrappedAndRecursiveConstraints4.errors.txt +++ b/tests/baselines/reference/wrappedAndRecursiveConstraints4.errors.txt @@ -19,4 +19,4 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/wrappedAndRecursi ~~~~~~ !!! error TS2322: Type '(x: number) => void' is not assignable to type '(pos: number) => string'. !!! error TS2322: Type 'void' is not assignable to type 'string'. -!!! related TS6500 /.ts/lib.es5.d.ts:390:5: The expected type comes from property 'charAt' which is declared here on type 'string' \ No newline at end of file +!!! related TS6500 /.ts/lib.es5.d.ts:392:5: The expected type comes from property 'charAt' which is declared here on type 'string' \ No newline at end of file From b6d90841c9d9dd97d80d3a367a283a020cc9857a Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Mon, 17 Sep 2018 13:01:58 -0700 Subject: [PATCH 18/71] Add traceResolution option to build options --- src/compiler/commandLineParser.ts | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index f7b0bd8dcc1..dcf024f77a5 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -77,6 +77,14 @@ namespace ts { shortName: "?", type: "boolean" }, + { + name: "watch", + shortName: "w", + type: "boolean", + showInSimplifiedHelpView: true, + category: Diagnostics.Command_line_Options, + description: Diagnostics.Watch_input_files, + }, { name: "preserveWatchOutput", type: "boolean", @@ -96,13 +104,12 @@ namespace ts { category: Diagnostics.Advanced_Options, description: Diagnostics.Print_names_of_generated_files_part_of_the_compilation }, + { - name: "watch", - shortName: "w", + name: "traceResolution", type: "boolean", - showInSimplifiedHelpView: true, - category: Diagnostics.Command_line_Options, - description: Diagnostics.Watch_input_files, + category: Diagnostics.Advanced_Options, + description: Diagnostics.Enable_tracing_of_the_name_resolution_process }, ]; @@ -581,12 +588,6 @@ namespace ts { category: Diagnostics.Advanced_Options, description: Diagnostics.Show_verbose_diagnostic_information }, - { - name: "traceResolution", - type: "boolean", - category: Diagnostics.Advanced_Options, - description: Diagnostics.Enable_tracing_of_the_name_resolution_process - }, { name: "resolveJsonModule", type: "boolean", From d51b8d940c59449e976daa4b2aa7b89d4c96e9bb Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Mon, 17 Sep 2018 18:24:12 -0700 Subject: [PATCH 19/71] Use originalFileName (fileName of input project reference file) to resolve module/typereferences/reference paths in it instead of output decl file path This also ensures that originalFileName, resolvedPath are set correctly even when we are reusing program structure Fixes #26036 --- src/compiler/builderState.ts | 2 +- src/compiler/program.ts | 20 +++++++---- src/compiler/types.ts | 6 ++++ src/server/project.ts | 2 +- src/services/services.ts | 1 + src/testRunner/unittests/tsbuild.ts | 36 ++++++++++++++++++++ src/testRunner/unittests/tsbuildWatchMode.ts | 6 +--- 7 files changed, 59 insertions(+), 14 deletions(-) diff --git a/src/compiler/builderState.ts b/src/compiler/builderState.ts index 6a7c54d6186..f5f2538a60b 100644 --- a/src/compiler/builderState.ts +++ b/src/compiler/builderState.ts @@ -88,7 +88,7 @@ namespace ts.BuilderState { function getReferencedFileFromImportedModuleSymbol(symbol: Symbol) { if (symbol.declarations && symbol.declarations[0]) { const declarationSourceFile = getSourceFileOfNode(symbol.declarations[0]); - return declarationSourceFile && (declarationSourceFile.resolvedPath || declarationSourceFile.path); + return declarationSourceFile && declarationSourceFile.resolvedPath; } } diff --git a/src/compiler/program.ts b/src/compiler/program.ts index c7599e9bd6b..f1a93834cde 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -485,11 +485,11 @@ namespace ts { function sourceFileNotUptoDate(sourceFile: SourceFile) { return !sourceFileVersionUptoDate(sourceFile) || - hasInvalidatedResolution(sourceFile.resolvedPath || sourceFile.path); + hasInvalidatedResolution(sourceFile.resolvedPath); } function sourceFileVersionUptoDate(sourceFile: SourceFile) { - return sourceFile.version === getSourceVersion(sourceFile.resolvedPath || sourceFile.path); + return sourceFile.version === getSourceVersion(sourceFile.resolvedPath); } function projectReferenceUptoDate(oldRef: ProjectReference, newRef: ProjectReference, index: number) { @@ -1079,7 +1079,7 @@ namespace ts { for (const oldSourceFile of oldSourceFiles) { let newSourceFile = host.getSourceFileByPath - ? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.resolvedPath || oldSourceFile.path, options.target!, /*onError*/ undefined, shouldCreateNewSourceFile) + ? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.resolvedPath, options.target!, /*onError*/ undefined, shouldCreateNewSourceFile) : host.getSourceFile(oldSourceFile.fileName, options.target!, /*onError*/ undefined, shouldCreateNewSourceFile); // TODO: GH#18217 if (!newSourceFile) { @@ -1110,7 +1110,11 @@ namespace ts { fileChanged = newSourceFile !== oldSourceFile; } + // Since the project references havent changed, its right to set originalFileName and resolvedPath here newSourceFile.path = oldSourceFile.path; + newSourceFile.originalFileName = oldSourceFile.originalFileName; + newSourceFile.resolvedPath = oldSourceFile.resolvedPath; + newSourceFile.fileName = oldSourceFile.fileName; filePaths.push(newSourceFile.path); const packageName = oldProgram.sourceFileToPackageName.get(oldSourceFile.path); @@ -1187,7 +1191,7 @@ namespace ts { modifiedFilePaths = modifiedSourceFiles.map(f => f.newFile.path); // try to verify results of module resolution for (const { oldFile: oldSourceFile, newFile: newSourceFile } of modifiedSourceFiles) { - const newSourceFilePath = getNormalizedAbsolutePath(newSourceFile.fileName, currentDirectory); + const newSourceFilePath = getNormalizedAbsolutePath(newSourceFile.originalFileName, currentDirectory); if (resolveModuleNamesWorker) { const moduleNames = getModuleNames(newSourceFile); const oldProgramState: OldProgramState = { program: oldProgram, oldSourceFile, modifiedFilePaths }; @@ -2040,6 +2044,7 @@ namespace ts { // Get source file from normalized fileName function findSourceFile(fileName: string, path: Path, isDefaultLib: boolean, ignoreNoDefaultLib: boolean, refFile: SourceFile, refPos: number, refEnd: number, packageId: PackageId | undefined): SourceFile | undefined { + const originalFileName = fileName; if (filesByName.has(path)) { const file = filesByName.get(path); // try to check if we've already seen this file but with a different casing in path @@ -2136,6 +2141,7 @@ namespace ts { sourceFilesFoundSearchingNodeModules.set(path, currentNodeModulesDepth > 0); file.path = path; file.resolvedPath = toPath(fileName); + file.originalFileName = originalFileName; if (host.useCaseSensitiveFileNames()) { const pathLowerCase = path.toLowerCase(); @@ -2191,7 +2197,7 @@ namespace ts { function processReferencedFiles(file: SourceFile, isDefaultLib: boolean) { forEach(file.referencedFiles, ref => { - const referencedFileName = resolveTripleslashReference(ref.fileName, file.fileName); + const referencedFileName = resolveTripleslashReference(ref.fileName, file.originalFileName); processSourceFile(referencedFileName, isDefaultLib, /*ignoreNoDefaultLib*/ false, /*packageId*/ undefined, file, ref.pos, ref.end); }); } @@ -2203,7 +2209,7 @@ namespace ts { return; } - const resolutions = resolveTypeReferenceDirectiveNamesWorker(typeDirectives, file.fileName); + const resolutions = resolveTypeReferenceDirectiveNamesWorker(typeDirectives, file.originalFileName); for (let i = 0; i < typeDirectives.length; i++) { const ref = file.typeReferenceDirectives[i]; @@ -2299,7 +2305,7 @@ namespace ts { // Because global augmentation doesn't have string literal name, we can check for global augmentation as such. const moduleNames = getModuleNames(file); const oldProgramState: OldProgramState = { program: oldProgram, oldSourceFile: oldProgram && oldProgram.getSourceFile(file.fileName), modifiedFilePaths }; - const resolutions = resolveModuleNamesReusingOldState(moduleNames, getNormalizedAbsolutePath(file.fileName, currentDirectory), file, oldProgramState); + const resolutions = resolveModuleNamesReusingOldState(moduleNames, getNormalizedAbsolutePath(file.originalFileName, currentDirectory), file, oldProgramState); Debug.assert(resolutions.length === moduleNames.length); for (let i = 0; i < moduleNames.length; i++) { const resolution = resolutions[i]; diff --git a/src/compiler/types.ts b/src/compiler/types.ts index df0396b172d..176f259e074 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2557,6 +2557,12 @@ namespace ts { * path = input file's path */ /* @internal */ resolvedPath: Path; + /** Original file name that can be different from fileName, + * when file is included through project reference is mapped to its output instead of source + * in that case originalFileName = name of input file + * fileName = output file's name + */ + /* @internal */ originalFileName: string; /** * If two source files are for the same version of the same package, one will redirect to the other. diff --git a/src/server/project.ts b/src/server/project.ts index 3cabc8793db..3acb99dacd6 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -653,7 +653,7 @@ namespace ts.server { return this.rootFiles; } return map(this.program.getSourceFiles(), sourceFile => { - const scriptInfo = this.projectService.getScriptInfoForPath(sourceFile.resolvedPath || sourceFile.path); + const scriptInfo = this.projectService.getScriptInfoForPath(sourceFile.resolvedPath); Debug.assert(!!scriptInfo, "getScriptInfo", () => `scriptInfo for a file '${sourceFile.fileName}' Path: '${sourceFile.path}' / '${sourceFile.resolvedPath}' is missing.`); return scriptInfo!; }); diff --git a/src/services/services.ts b/src/services/services.ts index 57c45359179..c4318c03c69 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -541,6 +541,7 @@ namespace ts { public fileName: string; public path: Path; public resolvedPath: Path; + public originalFileName: string; public text: string; public scriptSnapshot: IScriptSnapshot; public lineMap: ReadonlyArray; diff --git a/src/testRunner/unittests/tsbuild.ts b/src/testRunner/unittests/tsbuild.ts index f54e3c93215..4643c2256bd 100644 --- a/src/testRunner/unittests/tsbuild.ts +++ b/src/testRunner/unittests/tsbuild.ts @@ -23,6 +23,42 @@ namespace ts { assert(fs.existsSync(output), `Expect file ${output} to exist`); } }); + + it("builds correctly when outDir is specified", () => { + const fs = projFs.shadow(); + fs.writeFileSync("/src/logic/tsconfig.json", JSON.stringify({ + compilerOptions: { composite: true, declaration: true, sourceMap: true, outDir: "outDir" }, + references: [{ path: "../core" }] + })); + + const host = new fakes.SolutionBuilderHost(fs); + const builder = createSolutionBuilder(host, ["/src/tests"], {}); + builder.buildAllProjects(); + host.assertDiagnosticMessages(/*empty*/); + const expectedOutputs = allExpectedOutputs.map(f => f.replace("/logic/", "/logic/outDir/")); + // Check for outputs. Not an exhaustive list + for (const output of expectedOutputs) { + assert(fs.existsSync(output), `Expect file ${output} to exist`); + } + }); + + it("builds correctly when declarationDir is specified", () => { + const fs = projFs.shadow(); + fs.writeFileSync("/src/logic/tsconfig.json", JSON.stringify({ + compilerOptions: { composite: true, declaration: true, sourceMap: true, declarationDir: "out/decls" }, + references: [{ path: "../core" }] + })); + + const host = new fakes.SolutionBuilderHost(fs); + const builder = createSolutionBuilder(host, ["/src/tests"], {}); + builder.buildAllProjects(); + host.assertDiagnosticMessages(/*empty*/); + const expectedOutputs = allExpectedOutputs.map(f => f.replace("/logic/index.d.ts", "/logic/out/decls/index.d.ts")); + // Check for outputs. Not an exhaustive list + for (const output of expectedOutputs) { + assert(fs.existsSync(output), `Expect file ${output} to exist`); + } + }); }); describe("tsbuild - dry builds", () => { diff --git a/src/testRunner/unittests/tsbuildWatchMode.ts b/src/testRunner/unittests/tsbuildWatchMode.ts index f0745a373a0..2ffe51189d8 100644 --- a/src/testRunner/unittests/tsbuildWatchMode.ts +++ b/src/testRunner/unittests/tsbuildWatchMode.ts @@ -486,11 +486,7 @@ export function gfoo() { solutionBuilder.buildInvalidatedProject(); host.checkTimeoutQueueLengthAndRun(1); - checkOutputErrorsIncremental(host, [ - // TODO: #26036 - // The error is reported in d.ts file because it isnt resolved from ts file path, but is resolved from .d.ts file - "sample1/logic/decls/index.d.ts(2,22): error TS2307: Cannot find module '../core/anotherModule'.\n" - ]); + checkOutputErrorsIncremental(host, emptyArray); checkProgramActualFiles(watch().getProgram(), [tests[1].path, libFile.path, coreIndexDts, coreAnotherModuleDts, projectFilePath(SubProject.logic, "decls/index.d.ts")]); }); }); From 1bcb4910ca4fa17fc29db84f4e9244999b53eb7d Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Tue, 18 Sep 2018 10:30:15 -0700 Subject: [PATCH 20/71] Thread typesMapLocation down to the ProjectService Fixes #22607 --- src/server/session.ts | 2 ++ src/tsserver/server.ts | 1 + tests/baselines/reference/api/tsserverlibrary.d.ts | 1 + 3 files changed, 4 insertions(+) diff --git a/src/server/session.ts b/src/server/session.ts index 14ad20d7aae..e62300bf7bc 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -490,6 +490,7 @@ namespace ts.server { globalPlugins?: ReadonlyArray; pluginProbeLocations?: ReadonlyArray; allowLocalPluginLoads?: boolean; + typesMapLocation?: string; } export class Session implements EventSender { @@ -550,6 +551,7 @@ namespace ts.server { globalPlugins: opts.globalPlugins, pluginProbeLocations: opts.pluginProbeLocations, allowLocalPluginLoads: opts.allowLocalPluginLoads, + typesMapLocation: opts.typesMapLocation, syntaxOnly: opts.syntaxOnly, }; this.projectService = new ProjectService(settings); diff --git a/src/tsserver/server.ts b/src/tsserver/server.ts index 951b158c152..c9b2d7981f7 100644 --- a/src/tsserver/server.ts +++ b/src/tsserver/server.ts @@ -510,6 +510,7 @@ namespace ts.server { globalPlugins, pluginProbeLocations, allowLocalPluginLoads, + typesMapLocation, }); this.eventPort = eventPort; diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index cd590f8e76a..3f9aefd7763 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -8667,6 +8667,7 @@ declare namespace ts.server { globalPlugins?: ReadonlyArray; pluginProbeLocations?: ReadonlyArray; allowLocalPluginLoads?: boolean; + typesMapLocation?: string; } class Session implements EventSender { private readonly gcTimer; From 0d5aeeef2267606245ce833734c7a0371ff93832 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 18 Sep 2018 11:44:16 -0700 Subject: [PATCH 21/71] Detect the input file of referenced project with fileNames from parsed command Fixes #25864 and #26054 --- src/compiler/program.ts | 39 +++++++++---------- src/compiler/tsbuild.ts | 2 +- src/testRunner/unittests/tsbuild.ts | 19 +++++++++ .../src/main/a.ts | 2 + .../src/main/b.ts | 1 + .../src/main/tsconfig.json | 6 +++ .../src/other/other.ts | 1 + .../src/other/tsconfig.json | 3 ++ .../tsconfig.base.json | 11 ++++++ 9 files changed, 62 insertions(+), 22 deletions(-) create mode 100644 tests/projects/projectReferenceWithRootDirInParent/src/main/a.ts create mode 100644 tests/projects/projectReferenceWithRootDirInParent/src/main/b.ts create mode 100644 tests/projects/projectReferenceWithRootDirInParent/src/main/tsconfig.json create mode 100644 tests/projects/projectReferenceWithRootDirInParent/src/other/other.ts create mode 100644 tests/projects/projectReferenceWithRootDirInParent/src/other/tsconfig.json create mode 100644 tests/projects/projectReferenceWithRootDirInParent/tsconfig.base.json diff --git a/src/compiler/program.ts b/src/compiler/program.ts index f1a93834cde..d0605bd55d9 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -663,7 +663,7 @@ namespace ts { // A parallel array to projectReferences storing the results of reading in the referenced tsconfig files let resolvedProjectReferences: (ResolvedProjectReference | undefined)[] | undefined = projectReferences ? [] : undefined; - const projectReferenceRedirects: Map = createMap(); + let projectReferenceRedirects: ParsedCommandLine[] | undefined; const shouldCreateNewSourceFile = shouldProgramCreateNewSourceFiles(oldProgram, options); const structuralIsReused = tryReuseStructureFromOldProgram(); @@ -681,7 +681,7 @@ namespace ts { const dtsOutfile = changeExtension(out, ".d.ts"); processSourceFile(dtsOutfile, /*isDefaultLib*/ false, /*ignoreNoDefaultLib*/ false, /*packageId*/ undefined); } - addProjectReferenceRedirects(parsedRef.commandLine, projectReferenceRedirects); + addProjectReferenceRedirects(parsedRef.commandLine); } } } @@ -1252,7 +1252,7 @@ namespace ts { if (resolvedProjectReferences) { resolvedProjectReferences.forEach(ref => { if (ref) { - addProjectReferenceRedirects(ref.commandLine, projectReferenceRedirects); + addProjectReferenceRedirects(ref.commandLine); } }); } @@ -2179,20 +2179,24 @@ namespace ts { } function getProjectReferenceRedirect(fileName: string): string | undefined { - const path = toPath(fileName); + // Ignore dts or any of the non ts files + if (!projectReferenceRedirects || fileExtensionIs(fileName, Extension.Dts) || !fileExtensionIsOneOf(fileName, supportedTSExtensions)) { + return undefined; + } + // If this file is produced by a referenced project, we need to rewrite it to // look in the output folder of the referenced project rather than the input - const normalized = getNormalizedAbsolutePath(fileName, path); - let result: string | undefined; - projectReferenceRedirects.forEach((v, k) => { - if (result !== undefined) { + return forEach(projectReferenceRedirects, referencedProject => { + // not input file from the referenced project, ignore + if (!contains(referencedProject.fileNames, fileName, isSameFile)) { return undefined; } - if (normalized.indexOf(k) === 0) { - result = changeExtension(fileName.replace(k, v), ".d.ts"); - } + + const out = referencedProject.options.outFile || referencedProject.options.out; + return out ? + changeExtension(out, Extension.Dts) : + getOutputDeclarationFileName(fileName, referencedProject); }); - return result; } function processReferencedFiles(file: SourceFile, isDefaultLib: boolean) { @@ -2396,15 +2400,8 @@ namespace ts { return { commandLine, sourceFile }; } - function addProjectReferenceRedirects(referencedProject: ParsedCommandLine, target: Map) { - const rootDir = normalizePath(referencedProject.options.rootDir || getDirectoryPath(referencedProject.options.configFilePath!)); // TODO: GH#18217 - target.set(rootDir, getDeclarationOutputDirectory(referencedProject)); - } - - function getDeclarationOutputDirectory(proj: ParsedCommandLine) { - return proj.options.declarationDir || - proj.options.outDir || - getDirectoryPath(proj.options.configFilePath!); // TODO: GH#18217 + function addProjectReferenceRedirects(referencedProject: ParsedCommandLine) { + (projectReferenceRedirects || (projectReferenceRedirects = [])).push(referencedProject); } function verifyCompilerOptions() { diff --git a/src/compiler/tsbuild.ts b/src/compiler/tsbuild.ts index 6c3681dbd5c..60733dbdc8c 100644 --- a/src/compiler/tsbuild.ts +++ b/src/compiler/tsbuild.ts @@ -248,7 +248,7 @@ namespace ts { return getOrCreateValueFromConfigFileMap>(configFileMap, resolved, createMap); } - function getOutputDeclarationFileName(inputFileName: string, configFile: ParsedCommandLine) { + export function getOutputDeclarationFileName(inputFileName: string, configFile: ParsedCommandLine) { const relativePath = getRelativePathFromDirectory(rootDirOfOptions(configFile.options, configFile.options.configFilePath!), inputFileName, /*ignoreCase*/ true); const outputPath = resolvePath(configFile.options.declarationDir || configFile.options.outDir || getDirectoryPath(configFile.options.configFilePath!), relativePath); return changeExtension(outputPath, Extension.Dts); diff --git a/src/testRunner/unittests/tsbuild.ts b/src/testRunner/unittests/tsbuild.ts index 4643c2256bd..36feb68a223 100644 --- a/src/testRunner/unittests/tsbuild.ts +++ b/src/testRunner/unittests/tsbuild.ts @@ -357,6 +357,25 @@ export class cNew {}`); ]); }); }); + + describe("tsbuild - with rootDir of project reference in parentDirectory", () => { + const projFs = loadProjectFromDisk("tests/projects/projectReferenceWithRootDirInParent"); + const allExpectedOutputs = [ + "/src/dist/other/other.js", "/src/dist/other/other.d.ts", + "/src/dist/main/a.js", "/src/dist/main/a.d.ts", + "/src/dist/main/b.js", "/src/dist/main/b.d.ts" + ]; + it("verify that it builds correctly", () => { + const fs = projFs.shadow(); + const host = new fakes.SolutionBuilderHost(fs); + const builder = createSolutionBuilder(host, ["/src/src/main", "/src/src/other"], {}); + builder.buildAllProjects(); + host.assertDiagnosticMessages(/*empty*/); + for (const output of allExpectedOutputs) { + assert(fs.existsSync(output), `Expect file ${output} to exist`); + } + }); + }); } export namespace OutFile { diff --git a/tests/projects/projectReferenceWithRootDirInParent/src/main/a.ts b/tests/projects/projectReferenceWithRootDirInParent/src/main/a.ts new file mode 100644 index 00000000000..bacd116a1bb --- /dev/null +++ b/tests/projects/projectReferenceWithRootDirInParent/src/main/a.ts @@ -0,0 +1,2 @@ +import { b } from './b'; +const a = b; \ No newline at end of file diff --git a/tests/projects/projectReferenceWithRootDirInParent/src/main/b.ts b/tests/projects/projectReferenceWithRootDirInParent/src/main/b.ts new file mode 100644 index 00000000000..8ff56d7eca4 --- /dev/null +++ b/tests/projects/projectReferenceWithRootDirInParent/src/main/b.ts @@ -0,0 +1 @@ +export const b = 0; diff --git a/tests/projects/projectReferenceWithRootDirInParent/src/main/tsconfig.json b/tests/projects/projectReferenceWithRootDirInParent/src/main/tsconfig.json new file mode 100644 index 00000000000..deb6cd7b9ba --- /dev/null +++ b/tests/projects/projectReferenceWithRootDirInParent/src/main/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.base.json", + "references": [ + { "path": "../other" } + ] +} \ No newline at end of file diff --git a/tests/projects/projectReferenceWithRootDirInParent/src/other/other.ts b/tests/projects/projectReferenceWithRootDirInParent/src/other/other.ts new file mode 100644 index 00000000000..002e06d5821 --- /dev/null +++ b/tests/projects/projectReferenceWithRootDirInParent/src/other/other.ts @@ -0,0 +1 @@ +export const Other = 0; diff --git a/tests/projects/projectReferenceWithRootDirInParent/src/other/tsconfig.json b/tests/projects/projectReferenceWithRootDirInParent/src/other/tsconfig.json new file mode 100644 index 00000000000..fdf102617fa --- /dev/null +++ b/tests/projects/projectReferenceWithRootDirInParent/src/other/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../../tsconfig.base.json" +} \ No newline at end of file diff --git a/tests/projects/projectReferenceWithRootDirInParent/tsconfig.base.json b/tests/projects/projectReferenceWithRootDirInParent/tsconfig.base.json new file mode 100644 index 00000000000..966eb3f3b8e --- /dev/null +++ b/tests/projects/projectReferenceWithRootDirInParent/tsconfig.base.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "composite": true, + "declaration": true, + "rootDir": "./src/", + "outDir": "./dist/" + }, + "exclude": [ + "node_modules" + ] +} \ No newline at end of file From 4c047254e62797f12141597b4fafe8e7f0385729 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 18 Sep 2018 13:16:25 -0700 Subject: [PATCH 22/71] Ensure all the usages of compilerOptions.declaration take into account compilerOptions.composite if needed. --- src/compiler/program.ts | 25 +++++++++++-------- src/services/services.ts | 2 +- src/services/transpile.ts | 1 + ...clFileEmitDeclarationOnlyError1.errors.txt | 4 +-- ...clFileEmitDeclarationOnlyError2.errors.txt | 4 +-- ...tCompositeAndDeclarationOptions.errors.txt | 4 +-- ...clarationMapsWithoutDeclaration.errors.txt | 4 +-- 7 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index c9d8a45fedb..d4ac082e251 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -207,7 +207,7 @@ namespace ts { ...program.getSemanticDiagnostics(sourceFile, cancellationToken) ]; - if (program.getCompilerOptions().declaration) { + if (getEmitDeclarations(program.getCompilerOptions())) { addRange(diagnostics, program.getDeclarationDiagnostics(sourceFile, cancellationToken)); } @@ -817,9 +817,9 @@ namespace ts { // If a rootDir is specified use it as the commonSourceDirectory commonSourceDirectory = getNormalizedAbsolutePath(options.rootDir, currentDirectory); } - else if (options.composite) { + else if (options.composite && options.configFilePath) { // Project compilations never infer their root from the input source paths - commonSourceDirectory = getDirectoryPath(normalizeSlashes(options.configFilePath!)); // TODO: GH#18217 + commonSourceDirectory = getDirectoryPath(normalizeSlashes(options.configFilePath)); checkSourceFilesBelongToPath(emittedFiles, commonSourceDirectory); } else { @@ -1388,7 +1388,7 @@ namespace ts { ...program.getSemanticDiagnostics(sourceFile, cancellationToken) ]; - if (diagnostics.length === 0 && program.getCompilerOptions().declaration) { + if (diagnostics.length === 0 && getEmitDeclarations(program.getCompilerOptions())) { declarationDiagnostics = program.getDeclarationDiagnostics(/*sourceFile*/ undefined, cancellationToken); } @@ -2407,8 +2407,8 @@ namespace ts { } if (options.isolatedModules) { - if (options.declaration) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "declaration", "isolatedModules"); + if (getEmitDeclarations(options)) { + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, getEmitDeclarationOptionName(options), "isolatedModules"); } if (options.noEmitOnError) { @@ -2533,7 +2533,7 @@ namespace ts { if (options.declarationDir) { if (!getEmitDeclarations(options)) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "declarationDir", "declaration"); + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, "declarationDir", "declaration", "composite"); } if (options.out || options.outFile) { createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "declarationDir", options.out ? "out" : "outFile"); @@ -2541,7 +2541,7 @@ namespace ts { } if (options.declarationMap && !getEmitDeclarations(options)) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "declarationMap", "declaration"); + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, "declarationMap", "declaration", "composite"); } if (options.lib && options.noLib) { @@ -2610,7 +2610,7 @@ namespace ts { } if (!options.noEmit && options.allowJs && getEmitDeclarations(options)) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "allowJs", options.declaration ? "declaration" : "composite"); + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_with_option_1, "allowJs", getEmitDeclarationOptionName(options)); } if (options.checkJs && !options.allowJs) { @@ -2618,8 +2618,8 @@ namespace ts { } if (options.emitDeclarationOnly) { - if (!options.declaration) { - createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDeclarationOnly", "declaration"); + if (!getEmitDeclarations(options)) { + createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1_or_option_2, "emitDeclarationOnly", "declaration", "composite"); } if (options.noEmit) { @@ -2877,6 +2877,9 @@ namespace ts { return resolveConfigFileProjectName(passedInRef.path); } + function getEmitDeclarationOptionName(options: CompilerOptions) { + return options.declaration ? "declaration" : "composite"; + } /* @internal */ /** * Returns a DiagnosticMessage if we won't include a resolved module due to its extension. diff --git a/src/services/services.ts b/src/services/services.ts index 5a035a92bcd..a9dfdc2d0af 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1382,7 +1382,7 @@ namespace ts { // Therefore only get diagnostics for given file. const semanticDiagnostics = program.getSemanticDiagnostics(targetSourceFile, cancellationToken); - if (!program.getCompilerOptions().declaration) { + if (!getEmitDeclarations(program.getCompilerOptions())) { return semanticDiagnostics.slice(); } diff --git a/src/services/transpile.ts b/src/services/transpile.ts index 70ca5b64314..030d2273b62 100644 --- a/src/services/transpile.ts +++ b/src/services/transpile.ts @@ -48,6 +48,7 @@ namespace ts { options.paths = undefined; options.rootDirs = undefined; options.declaration = undefined; + options.composite = undefined; options.declarationDir = undefined; options.out = undefined; options.outFile = undefined; diff --git a/tests/baselines/reference/declFileEmitDeclarationOnlyError1.errors.txt b/tests/baselines/reference/declFileEmitDeclarationOnlyError1.errors.txt index 62447a4a911..968b2a09b00 100644 --- a/tests/baselines/reference/declFileEmitDeclarationOnlyError1.errors.txt +++ b/tests/baselines/reference/declFileEmitDeclarationOnlyError1.errors.txt @@ -1,7 +1,7 @@ -error TS5052: Option 'emitDeclarationOnly' cannot be specified without specifying option 'declaration'. +error TS5069: Option 'emitDeclarationOnly' cannot be specified without specifying option 'declaration' or option 'composite'. -!!! error TS5052: Option 'emitDeclarationOnly' cannot be specified without specifying option 'declaration'. +!!! error TS5069: Option 'emitDeclarationOnly' cannot be specified without specifying option 'declaration' or option 'composite'. ==== tests/cases/compiler/hello.ts (0 errors) ==== var hello = "yo!"; \ No newline at end of file diff --git a/tests/baselines/reference/declFileEmitDeclarationOnlyError2.errors.txt b/tests/baselines/reference/declFileEmitDeclarationOnlyError2.errors.txt index 37be20aa132..0b1ea1409c5 100644 --- a/tests/baselines/reference/declFileEmitDeclarationOnlyError2.errors.txt +++ b/tests/baselines/reference/declFileEmitDeclarationOnlyError2.errors.txt @@ -1,9 +1,9 @@ -error TS5052: Option 'emitDeclarationOnly' cannot be specified without specifying option 'declaration'. error TS5053: Option 'emitDeclarationOnly' cannot be specified with option 'noEmit'. +error TS5069: Option 'emitDeclarationOnly' cannot be specified without specifying option 'declaration' or option 'composite'. -!!! error TS5052: Option 'emitDeclarationOnly' cannot be specified without specifying option 'declaration'. !!! error TS5053: Option 'emitDeclarationOnly' cannot be specified with option 'noEmit'. +!!! error TS5069: Option 'emitDeclarationOnly' cannot be specified without specifying option 'declaration' or option 'composite'. ==== tests/cases/compiler/hello.ts (0 errors) ==== var hello = "yo!"; \ No newline at end of file diff --git a/tests/baselines/reference/declarationEmitToDeclarationDirWithoutCompositeAndDeclarationOptions.errors.txt b/tests/baselines/reference/declarationEmitToDeclarationDirWithoutCompositeAndDeclarationOptions.errors.txt index e2a5a20452c..63ba6281732 100644 --- a/tests/baselines/reference/declarationEmitToDeclarationDirWithoutCompositeAndDeclarationOptions.errors.txt +++ b/tests/baselines/reference/declarationEmitToDeclarationDirWithoutCompositeAndDeclarationOptions.errors.txt @@ -1,11 +1,11 @@ -/foo/tsconfig.json(2,26): error TS5052: Option 'declarationDir' cannot be specified without specifying option 'declaration'. +/foo/tsconfig.json(2,26): error TS5069: Option 'declarationDir' cannot be specified without specifying option 'declaration' or option 'composite'. ==== /foo/tsconfig.json (1 errors) ==== { "compilerOptions": { "declarationDir": "out" } ~~~~~~~~~~~~~~~~ -!!! error TS5052: Option 'declarationDir' cannot be specified without specifying option 'declaration'. +!!! error TS5069: Option 'declarationDir' cannot be specified without specifying option 'declaration' or option 'composite'. } ==== /foo/test.ts (0 errors) ==== diff --git a/tests/baselines/reference/declarationMapsWithoutDeclaration.errors.txt b/tests/baselines/reference/declarationMapsWithoutDeclaration.errors.txt index c432f445130..8574b7d3388 100644 --- a/tests/baselines/reference/declarationMapsWithoutDeclaration.errors.txt +++ b/tests/baselines/reference/declarationMapsWithoutDeclaration.errors.txt @@ -1,7 +1,7 @@ -error TS5052: Option 'declarationMap' cannot be specified without specifying option 'declaration'. +error TS5069: Option 'declarationMap' cannot be specified without specifying option 'declaration' or option 'composite'. -!!! error TS5052: Option 'declarationMap' cannot be specified without specifying option 'declaration'. +!!! error TS5069: Option 'declarationMap' cannot be specified without specifying option 'declaration' or option 'composite'. ==== tests/cases/compiler/declarationMapsWithoutDeclaration.ts (0 errors) ==== module m2 { export interface connectModule { From 90d3f8b573e3372b71952379dea7f8fb3023f8f7 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Tue, 18 Sep 2018 15:28:16 -0700 Subject: [PATCH 23/71] Only report expando use-before-def for identical control flow containers (#27199) --- src/compiler/checker.ts | 5 ++- .../typeFromPropertyAssignment37.symbols | 34 ++++++++++++++ .../typeFromPropertyAssignment37.types | 44 +++++++++++++++++++ .../salsa/typeFromPropertyAssignment37.ts | 15 +++++++ 4 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/typeFromPropertyAssignment37.symbols create mode 100644 tests/baselines/reference/typeFromPropertyAssignment37.types create mode 100644 tests/cases/conformance/salsa/typeFromPropertyAssignment37.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f4bc6325092..019f6bc6307 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -18487,7 +18487,10 @@ namespace ts { } } } - else if (strictNullChecks && prop && prop.valueDeclaration && isPropertyAccessExpression(prop.valueDeclaration) && getAssignmentDeclarationPropertyAccessKind(prop.valueDeclaration)) { + else if (strictNullChecks && prop && prop.valueDeclaration && + isPropertyAccessExpression(prop.valueDeclaration) && + getAssignmentDeclarationPropertyAccessKind(prop.valueDeclaration) && + getControlFlowContainer(node) === getControlFlowContainer(prop.valueDeclaration)) { assumeUninitialized = true; } const flowType = getFlowTypeOfReference(node, propType, assumeUninitialized ? getOptionalType(propType) : propType); diff --git a/tests/baselines/reference/typeFromPropertyAssignment37.symbols b/tests/baselines/reference/typeFromPropertyAssignment37.symbols new file mode 100644 index 00000000000..4d2af775b00 --- /dev/null +++ b/tests/baselines/reference/typeFromPropertyAssignment37.symbols @@ -0,0 +1,34 @@ +=== tests/cases/conformance/salsa/use.js === +const util = require('./mod') +>util : Symbol(util, Decl(use.js, 0, 5)) +>require : Symbol(require) +>'./mod' : Symbol("tests/cases/conformance/salsa/mod", Decl(mod.js, 0, 0)) + +function n() { +>n : Symbol(n, Decl(use.js, 0, 29)) + + util.existy // no error +>util.existy : Symbol(existy, Decl(mod.js, 1, 14)) +>util : Symbol(util, Decl(use.js, 0, 5)) +>existy : Symbol(existy, Decl(mod.js, 1, 14)) +} +util.existy // no error +>util.existy : Symbol(existy, Decl(mod.js, 1, 14)) +>util : Symbol(util, Decl(use.js, 0, 5)) +>existy : Symbol(existy, Decl(mod.js, 1, 14)) + +=== tests/cases/conformance/salsa/mod.js === +const util = exports = module.exports = {} +>util : Symbol(util, Decl(mod.js, 0, 5)) +>exports : Symbol("tests/cases/conformance/salsa/mod", Decl(mod.js, 0, 0)) +>module.exports : Symbol("tests/cases/conformance/salsa/mod", Decl(mod.js, 0, 0)) +>module : Symbol(module, Decl(mod.js, 0, 22)) +>exports : Symbol("tests/cases/conformance/salsa/mod", Decl(mod.js, 0, 0)) + +if (!!false) { + util.existy = function () { } +>util.existy : Symbol(existy, Decl(mod.js, 1, 14)) +>util : Symbol(util, Decl(mod.js, 0, 5)) +>existy : Symbol(existy, Decl(mod.js, 1, 14)) +} + diff --git a/tests/baselines/reference/typeFromPropertyAssignment37.types b/tests/baselines/reference/typeFromPropertyAssignment37.types new file mode 100644 index 00000000000..b7355cbecf2 --- /dev/null +++ b/tests/baselines/reference/typeFromPropertyAssignment37.types @@ -0,0 +1,44 @@ +=== tests/cases/conformance/salsa/use.js === +const util = require('./mod') +>util : typeof import("tests/cases/conformance/salsa/mod") +>require('./mod') : typeof import("tests/cases/conformance/salsa/mod") +>require : any +>'./mod' : "./mod" + +function n() { +>n : () => void + + util.existy // no error +>util.existy : () => void +>util : typeof import("tests/cases/conformance/salsa/mod") +>existy : () => void +} +util.existy // no error +>util.existy : () => void +>util : typeof import("tests/cases/conformance/salsa/mod") +>existy : () => void + +=== tests/cases/conformance/salsa/mod.js === +const util = exports = module.exports = {} +>util : typeof import("tests/cases/conformance/salsa/mod") +>exports = module.exports = {} : typeof import("tests/cases/conformance/salsa/mod") +>exports : typeof import("tests/cases/conformance/salsa/mod") +>module.exports = {} : typeof import("tests/cases/conformance/salsa/mod") +>module.exports : typeof import("tests/cases/conformance/salsa/mod") +>module : { "tests/cases/conformance/salsa/mod": typeof import("tests/cases/conformance/salsa/mod"); } +>exports : typeof import("tests/cases/conformance/salsa/mod") +>{} : {} + +if (!!false) { +>!!false : boolean +>!false : true +>false : false + + util.existy = function () { } +>util.existy = function () { } : () => void +>util.existy : () => void +>util : typeof import("tests/cases/conformance/salsa/mod") +>existy : () => void +>function () { } : () => void +} + diff --git a/tests/cases/conformance/salsa/typeFromPropertyAssignment37.ts b/tests/cases/conformance/salsa/typeFromPropertyAssignment37.ts new file mode 100644 index 00000000000..0e60c78621e --- /dev/null +++ b/tests/cases/conformance/salsa/typeFromPropertyAssignment37.ts @@ -0,0 +1,15 @@ +// @noEmit: true +// @allowJs: true +// @checkJs: true +// @Filename: mod.js +const util = exports = module.exports = {} +if (!!false) { + util.existy = function () { } +} + +// @Filename: use.js +const util = require('./mod') +function n() { + util.existy // no error +} +util.existy // no error From efe76c4375576be6063eaf079e0f8695ae20a097 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Tue, 18 Sep 2018 15:58:18 -0700 Subject: [PATCH 24/71] Fix per-iteration bindings in for-loop head --- src/compiler/checker.ts | 36 +- src/compiler/transformers/es2015.ts | 611 +++++++++++++----- src/compiler/types.ts | 19 +- .../reference/capturedLetConstInLoop1.js | 115 +++- .../reference/capturedLetConstInLoop1.symbols | 264 ++++---- .../reference/capturedLetConstInLoop1.types | 82 +++ .../cases/compiler/capturedLetConstInLoop1.ts | 15 + 7 files changed, 841 insertions(+), 301 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 11f279d27d5..5118c1ff90b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -15620,6 +15620,10 @@ namespace ts { return !!findAncestor(node, n => n === threshold ? "quit" : isFunctionLike(n)); } + function getPartOfForStatementContainingNode(node: Node, container: ForStatement) { + return findAncestor(node, n => n === container ? "quit" : n === container.initializer || n === container.condition || n === container.incrementor || n === container.statement); + } + function checkNestedBlockScopedBinding(node: Identifier, symbol: Symbol): void { if (languageVersion >= ScriptTarget.ES2015 || (symbol.flags & (SymbolFlags.BlockScopedVariable | SymbolFlags.Class)) === 0 || @@ -15648,7 +15652,25 @@ namespace ts { if (containedInIterationStatement) { if (usedInFunction) { // mark iteration statement as containing block-scoped binding captured in some function - getNodeLinks(current).flags |= NodeCheckFlags.LoopWithCapturedBlockScopedBinding; + let capturesBlockScopeBindingInLoopBody = true; + if (isForStatement(container) && + getAncestor(symbol.valueDeclaration, SyntaxKind.VariableDeclarationList)!.parent === container) { + const part = getPartOfForStatementContainingNode(node.parent, container); + if (part) { + const links = getNodeLinks(part); + links.flags |= NodeCheckFlags.ContainsCapturedBlockScopeBinding; + + const capturedBindings = links.capturedBlockScopeBindings || (links.capturedBlockScopeBindings = []); + pushIfUnique(capturedBindings, symbol); + + if (part === container.initializer) { + capturesBlockScopeBindingInLoopBody = false; // Initializer is outside of loop body + } + } + } + if (capturesBlockScopeBindingInLoopBody) { + getNodeLinks(current).flags |= NodeCheckFlags.LoopWithCapturedBlockScopedBinding; + } } // mark variables that are declared in loop initializer and reassigned inside the body of ForStatement. @@ -15668,6 +15690,11 @@ namespace ts { } } + function isBindingCapturedByNode(node: Node, decl: VariableDeclaration | BindingElement) { + const links = getNodeLinks(node); + return !!links && contains(links.capturedBlockScopeBindings, getSymbolOfNode(decl)); + } + function isAssignedInBodyOfForStatement(node: Identifier, container: ForStatement): boolean { // skip parenthesized nodes let current: Node = node; @@ -28498,7 +28525,12 @@ namespace ts { getAccessor }; }, - getSymbolOfExternalModuleSpecifier: moduleName => resolveExternalModuleNameWorker(moduleName, moduleName, /*moduleNotFoundError*/ undefined) + getSymbolOfExternalModuleSpecifier: moduleName => resolveExternalModuleNameWorker(moduleName, moduleName, /*moduleNotFoundError*/ undefined), + isBindingCapturedByNode: (node, decl) => { + const parseNode = getParseTreeNode(node); + const parseDecl = getParseTreeNode(decl); + return !!parseNode && !!parseDecl && (isVariableDeclaration(parseDecl) || isBindingElement(parseDecl)) && isBindingCapturedByNode(parseNode, parseDecl); + } }; function isInHeritageClause(node: PropertyAccessEntityNameExpression) { diff --git a/src/compiler/transformers/es2015.ts b/src/compiler/transformers/es2015.ts index dcb0d9ac208..2e5176c4490 100644 --- a/src/compiler/transformers/es2015.ts +++ b/src/compiler/transformers/es2015.ts @@ -46,10 +46,16 @@ namespace ts { * so nobody can observe this new value. */ interface LoopOutParameter { + flags: LoopOutParameterFlags; originalName: Identifier; outParamName: Identifier; } + const enum LoopOutParameterFlags { + Body = 1 << 0, // Modified in the body of the iteration statement + Initializer = 1 << 1, // Set in the initializer of a ForStatement + } + const enum CopyDirection { ToOriginal, ToOutParameter @@ -129,10 +135,14 @@ namespace ts { */ hoistedLocalVariables?: Identifier[]; + conditionVariable?: Identifier; + + loopParameters: ParameterDeclaration[]; + /** * List of loop out parameters - detailed descripion can be found in the comment to LoopOutParameter */ - loopOutParameters?: LoopOutParameter[]; + loopOutParameters: LoopOutParameter[]; } const enum SuperCaptureResult { @@ -347,7 +357,7 @@ namespace ts { return (node.transformFlags & TransformFlags.ContainsES2015) !== 0 || convertedLoopState !== undefined || (hierarchyFacts & HierarchyFacts.ConstructorWithCapturedSuper && (isStatement(node) || (node.kind === SyntaxKind.Block))) - || (isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatementBody(node)) + || (isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatement(node)) || (getEmitFlags(node) & EmitFlags.TypeScriptClassWrapper) !== 0; } @@ -646,8 +656,8 @@ namespace ts { } } let returnExpression: Expression = createLiteral(labelMarker); - if (convertedLoopState.loopOutParameters!.length) { - const outParams = convertedLoopState.loopOutParameters!; + if (convertedLoopState.loopOutParameters.length) { + const outParams = convertedLoopState.loopOutParameters; let expr: Expression | undefined; for (let i = 0; i < outParams.length; i++) { const copyExpr = copyOutParameter(outParams[i], CopyDirection.ToOutParameter); @@ -2610,7 +2620,40 @@ namespace ts { return visitEachChild(node, visitor, context); } - function shouldConvertIterationStatementBody(node: IterationStatement): boolean { + interface ForStatementWithConvertibleInitializer extends ForStatement { + initializer: VariableDeclarationList; + } + + interface ForStatementWithConvertibleCondition extends ForStatement { + condition: Expression; + } + + interface ForStatementWithConvertibleIncrementor extends ForStatement { + incrementor: Expression; + } + + function shouldConvertPartOfIterationStatement(node: Node) { + return (resolver.getNodeCheckFlags(node) & NodeCheckFlags.ContainsCapturedBlockScopeBinding) !== 0; + } + + function shouldConvertInitializerOfForStatement(node: IterationStatement): node is ForStatementWithConvertibleInitializer { + return isForStatement(node) && !!node.initializer && shouldConvertPartOfIterationStatement(node.initializer); + } + + function shouldConvertConditionOfForStatement(node: IterationStatement): node is ForStatementWithConvertibleCondition { + return isForStatement(node) && !!node.condition && shouldConvertPartOfIterationStatement(node.condition); + } + + function shouldConvertIncrementorOfForStatement(node: IterationStatement): node is ForStatementWithConvertibleIncrementor { + return isForStatement(node) && !!node.incrementor && shouldConvertPartOfIterationStatement(node.incrementor); + } + + function shouldConvertIterationStatement(node: IterationStatement) { + return shouldConvertBodyOfIterationStatement(node) + || shouldConvertInitializerOfForStatement(node); + } + + function shouldConvertBodyOfIterationStatement(node: IterationStatement): boolean { return (resolver.getNodeCheckFlags(node) & NodeCheckFlags.LoopWithCapturedBlockScopedBinding) !== 0; } @@ -2639,7 +2682,7 @@ namespace ts { } function convertIterationStatementBodyIfNecessary(node: IterationStatement, outermostLabeledStatement: LabeledStatement | undefined, convert?: LoopConverter): VisitResult { - if (!shouldConvertIterationStatementBody(node)) { + if (!shouldConvertIterationStatement(node)) { let saveAllowedNonLabeledJumps: Jump | undefined; if (convertedLoopState) { // we get here if we are trying to emit normal loop loop inside converted loop @@ -2658,7 +2701,102 @@ namespace ts { return result; } - const functionName = createUniqueName("_loop"); + const currentState = createConvertedLoopState(node); + const statements: Statement[] = []; + + const outerConvertedLoopState = convertedLoopState; + convertedLoopState = currentState; + + const initializerFunction = shouldConvertInitializerOfForStatement(node) ? createFunctionForInitializerOfForStatement(node, currentState) : undefined; + const bodyFunction = shouldConvertBodyOfIterationStatement(node) ? createFunctionForBodyOfIterationStatement(node, currentState, outerConvertedLoopState) : undefined; + + convertedLoopState = outerConvertedLoopState; + + if (initializerFunction) statements.push(initializerFunction.functionDeclaration); + if (bodyFunction) statements.push(bodyFunction.functionDeclaration); + + addExtraDeclarationsForConvertedLoop(statements, currentState, outerConvertedLoopState); + + if (initializerFunction) { + statements.push(generateCallToConvertedLoopInitializer(initializerFunction.functionName, initializerFunction.containsYield)); + } + + let loop: Statement; + if (bodyFunction) { + if (convert) { + loop = convert(node, outermostLabeledStatement, bodyFunction.part); + } + else { + const clone = convertIterationStatementCore(node, initializerFunction, createBlock(bodyFunction.part, /*multiLine*/ true)); + aggregateTransformFlags(clone); + loop = restoreEnclosingLabel(clone, outermostLabeledStatement, convertedLoopState && resetLabel); + } + } + else { + const clone = convertIterationStatementCore(node, initializerFunction, visitNode(node.statement, visitor, isStatement, liftToBlock)); + aggregateTransformFlags(clone); + loop = restoreEnclosingLabel(clone, outermostLabeledStatement, convertedLoopState && resetLabel); + } + + statements.push(loop); + return statements; + } + + function convertIterationStatementCore(node: IterationStatement, initializerFunction: IterationStatementPartFunction | undefined, convertedLoopBody: Statement) { + switch (node.kind) { + case SyntaxKind.ForStatement: return convertForStatement(node as ForStatement, initializerFunction, convertedLoopBody); + case SyntaxKind.ForInStatement: return convertForInStatement(node as ForInStatement, convertedLoopBody); + case SyntaxKind.ForOfStatement: return convertForOfStatement(node as ForOfStatement, convertedLoopBody); + case SyntaxKind.DoStatement: return convertDoStatement(node as DoStatement, convertedLoopBody); + case SyntaxKind.WhileStatement: return convertWhileStatement(node as WhileStatement, convertedLoopBody); + default: return Debug.failBadSyntaxKind(node, "IterationStatement expected"); + } + } + + function convertForStatement(node: ForStatement, initializerFunction: IterationStatementPartFunction | undefined, convertedLoopBody: Statement) { + const shouldConvertCondition = node.condition && shouldConvertPartOfIterationStatement(node.condition); + const shouldConvertIncrementor = shouldConvertCondition || node.incrementor && shouldConvertPartOfIterationStatement(node.incrementor); + return updateFor( + node, + visitNode(initializerFunction ? initializerFunction.part : node.initializer, visitor, isForInitializer), + visitNode(shouldConvertCondition ? undefined : node.condition, visitor, isExpression), + visitNode(shouldConvertIncrementor ? undefined : node.incrementor, visitor, isExpression), + convertedLoopBody + ); + } + + function convertForOfStatement(node: ForOfStatement, convertedLoopBody: Statement) { + return updateForOf( + node, + /*awaitModifier*/ undefined, + visitNode(node.initializer, visitor, isForInitializer), + visitNode(node.expression, visitor, isExpression), + convertedLoopBody); + } + + function convertForInStatement(node: ForInStatement, convertedLoopBody: Statement) { + return updateForIn( + node, + visitNode(node.initializer, visitor, isForInitializer), + visitNode(node.expression, visitor, isExpression), + convertedLoopBody); + } + + function convertDoStatement(node: DoStatement, convertedLoopBody: Statement) { + return updateDo( + node, + convertedLoopBody, + visitNode(node.expression, visitor, isExpression)); + } + + function convertWhileStatement(node: WhileStatement, convertedLoopBody: Statement) { + return updateWhile( + node, + visitNode(node.expression, visitor, isExpression), + convertedLoopBody); + } + + function createConvertedLoopState(node: IterationStatement) { let loopInitializer: VariableDeclarationList | undefined; switch (node.kind) { case SyntaxKind.ForStatement: @@ -2670,74 +2808,311 @@ namespace ts { } break; } + // variables that will be passed to the loop as parameters const loopParameters: ParameterDeclaration[] = []; // variables declared in the loop initializer that will be changed inside the loop const loopOutParameters: LoopOutParameter[] = []; if (loopInitializer && (getCombinedNodeFlags(loopInitializer) & NodeFlags.BlockScoped)) { + const hasCapturedBindingsInForInitializer = shouldConvertInitializerOfForStatement(node); for (const decl of loopInitializer.declarations) { - processLoopVariableDeclaration(decl, loopParameters, loopOutParameters); + processLoopVariableDeclaration(node, decl, loopParameters, loopOutParameters, hasCapturedBindingsInForInitializer); } } - const outerConvertedLoopState = convertedLoopState; - convertedLoopState = { loopOutParameters }; - if (outerConvertedLoopState) { + const currentState: ConvertedLoopState = { loopParameters, loopOutParameters }; + if (convertedLoopState) { // convertedOuterLoopState !== undefined means that this converted loop is nested in another converted loop. // if outer converted loop has already accumulated some state - pass it through - if (outerConvertedLoopState.argumentsName) { + if (convertedLoopState.argumentsName) { // outer loop has already used 'arguments' so we've already have some name to alias it // use the same name in all nested loops - convertedLoopState.argumentsName = outerConvertedLoopState.argumentsName; + currentState.argumentsName = convertedLoopState.argumentsName; } - if (outerConvertedLoopState.thisName) { + if (convertedLoopState.thisName) { // outer loop has already used 'this' so we've already have some name to alias it // use the same name in all nested loops - convertedLoopState.thisName = outerConvertedLoopState.thisName; + currentState.thisName = convertedLoopState.thisName; } - if (outerConvertedLoopState.hoistedLocalVariables) { + if (convertedLoopState.hoistedLocalVariables) { // we've already collected some non-block scoped variable declarations in enclosing loop // use the same storage in nested loop - convertedLoopState.hoistedLocalVariables = outerConvertedLoopState.hoistedLocalVariables; + currentState.hoistedLocalVariables = convertedLoopState.hoistedLocalVariables; + } + } + return currentState; + } + + function addExtraDeclarationsForConvertedLoop(statements: Statement[], state: ConvertedLoopState, outerState: ConvertedLoopState | undefined) { + let extraVariableDeclarations: VariableDeclaration[] | undefined; + // propagate state from the inner loop to the outer loop if necessary + if (state.argumentsName) { + // if alias for arguments is set + if (outerState) { + // pass it to outer converted loop + outerState.argumentsName = state.argumentsName; + } + else { + // this is top level converted loop and we need to create an alias for 'arguments' object + (extraVariableDeclarations || (extraVariableDeclarations = [])).push( + createVariableDeclaration( + state.argumentsName, + /*type*/ undefined, + createIdentifier("arguments") + ) + ); } } + if (state.thisName) { + // if alias for this is set + if (outerState) { + // pass it to outer converted loop + outerState.thisName = state.thisName; + } + else { + // this is top level converted loop so we need to create an alias for 'this' here + // NOTE: + // if converted loops were all nested in arrow function then we'll always emit '_this' so convertedLoopState.thisName will not be set. + // If it is set this means that all nested loops are not nested in arrow function and it is safe to capture 'this'. + (extraVariableDeclarations || (extraVariableDeclarations = [])).push( + createVariableDeclaration( + state.thisName, + /*type*/ undefined, + createIdentifier("this") + ) + ); + } + } + + if (state.hoistedLocalVariables) { + // if hoistedLocalVariables !== undefined this means that we've possibly collected some variable declarations to be hoisted later + if (outerState) { + // pass them to outer converted loop + outerState.hoistedLocalVariables = state.hoistedLocalVariables; + } + else { + if (!extraVariableDeclarations) { + extraVariableDeclarations = []; + } + // hoist collected variable declarations + for (const identifier of state.hoistedLocalVariables) { + extraVariableDeclarations.push(createVariableDeclaration(identifier)); + } + } + } + + // add extra variables to hold out parameters if necessary + if (state.loopOutParameters.length) { + if (!extraVariableDeclarations) { + extraVariableDeclarations = []; + } + for (const outParam of state.loopOutParameters) { + extraVariableDeclarations.push(createVariableDeclaration(outParam.outParamName)); + } + } + + if (state.conditionVariable) { + if (!extraVariableDeclarations) { + extraVariableDeclarations = []; + } + extraVariableDeclarations.push(createVariableDeclaration(state.conditionVariable, /*type*/ undefined, createFalse())); + } + + // create variable statement to hold all introduced variable declarations + if (extraVariableDeclarations) { + statements.push(createVariableStatement( + /*modifiers*/ undefined, + createVariableDeclarationList(extraVariableDeclarations) + )); + } + } + + interface IterationStatementPartFunction { + functionName: Identifier; + functionDeclaration: Statement; + containsYield: boolean; + part: T; + } + + function createOutVariable(p: LoopOutParameter) { + return createVariableDeclaration(p.originalName, /*type*/ undefined, p.outParamName); + } + + /** + * Creates a `_loop_init` function for a `ForStatement` with a block-scoped initializer + * that is captured in a closure inside of the initializer. The `_loop_init` function is + * used to preserve the per-iteration environment semantics of + * [13.7.4.8 RS: ForBodyEvaluation](https://tc39.github.io/ecma262/#sec-forbodyevaluation). + */ + function createFunctionForInitializerOfForStatement(node: ForStatementWithConvertibleInitializer, currentState: ConvertedLoopState): IterationStatementPartFunction { + const functionName = createUniqueName("_loop_init"); + + const containsYield = (node.initializer.transformFlags & TransformFlags.ContainsYield) !== 0; + let emitFlags = EmitFlags.None; + if (currentState.containsLexicalThis) emitFlags |= EmitFlags.CapturesThis; + if (containsYield && hierarchyFacts & HierarchyFacts.AsyncFunctionBody) emitFlags |= EmitFlags.AsyncFunctionBody; + + const statements: Statement[] = []; + statements.push(createVariableStatement(/*modifiers*/ undefined, node.initializer)); + copyOutParameters(currentState.loopOutParameters, LoopOutParameterFlags.Initializer, CopyDirection.ToOutParameter, statements); + + // This transforms the following ES2015 syntax: + // + // for (let i = (setImmediate(() => console.log(i)), 0); i < 2; i++) { + // // loop body + // } + // + // Into the following ES5 syntax: + // + // var _loop_init_1 = function () { + // var i = (setImmediate(() => console.log(i)), 0); + // out_i_1 = i; + // }; + // var out_i_1; + // _loop_init_1(); + // for (var i = out_i_1; i < 2; i++) { + // // loop body + // } + // + // Which prevents mutations to `i` in the per-iteration environment of the body + // from affecting the initial value for `i` outside of the per-iteration environment. + + const functionDeclaration = createVariableStatement( + /*modifiers*/ undefined, + setEmitFlags( + createVariableDeclarationList([ + createVariableDeclaration( + functionName, + /*type*/ undefined, + setEmitFlags( + createFunctionExpression( + /*modifiers*/ undefined, + containsYield ? createToken(SyntaxKind.AsteriskToken) : undefined, + /*name*/ undefined, + /*typeParameters*/ undefined, + /*parameters*/ undefined, + /*type*/ undefined, + visitNode( + createBlock(statements, /*multiLine*/ true), + visitor, + isBlock + ) + ), + emitFlags + ) + ) + ]), + EmitFlags.NoHoisting + ) + ); + + const part = createVariableDeclarationList(map(currentState.loopOutParameters, createOutVariable)); + return { functionName, containsYield, functionDeclaration, part }; + } + + /** + * Creates a `_loop` function for an `IterationStatement` with a block-scoped initializer + * that is captured in a closure inside of the loop body. The `_loop` function is used to + * preserve the per-iteration environment semantics of + * [13.7.4.8 RS: ForBodyEvaluation](https://tc39.github.io/ecma262/#sec-forbodyevaluation). + */ + function createFunctionForBodyOfIterationStatement(node: IterationStatement, currentState: ConvertedLoopState, outerState: ConvertedLoopState | undefined): IterationStatementPartFunction { + const functionName = createUniqueName("_loop"); startLexicalEnvironment(); - let loopBody = visitNode(node.statement, visitor, isStatement, liftToBlock); + const statement = visitNode(node.statement, visitor, isStatement, liftToBlock); const lexicalEnvironment = endLexicalEnvironment(); - const currentState = convertedLoopState; - convertedLoopState = outerConvertedLoopState; + const statements: Statement[] = []; + if (shouldConvertConditionOfForStatement(node) || shouldConvertIncrementorOfForStatement(node)) { + // If a block-scoped variable declared in the initializer of `node` is captured in + // the condition or incrementor, we must move the condition and incrementor into + // the body of the for loop. + // + // This transforms the following ES2015 syntax: + // + // for (let i = 0; setImmediate(() => console.log(i)), i < 2; setImmediate(() => console.log(i)), i++) { + // // loop body + // } + // + // Into the following ES5 syntax: + // + // var _loop_1 = function (i) { + // if (inc_1) + // setImmediate(() => console.log(i)), i++; + // else + // inc_1 = true; + // if (!(setImmediate(() => console.log(i)), i < 2)) + // return out_i_1 = i, "break"; + // // loop body + // out_i_1 = i; + // } + // var out_i_1, inc_1 = false; + // for (var i = 0;;) { + // var state_1 = _loop_1(i); + // i = out_i_1; + // if (state_1 === "break") + // break; + // } + // + // Which prevents mutations to `i` in the per-iteration environment of the body + // from affecting the value of `i` in the previous per-iteration environment. + // + // Note that the incrementor of a `for` loop is evaluated in a *new* per-iteration + // environment that is carried over to the next iteration of the loop. As a result, + // we must indicate whether this is the first evaluation of the loop body so that + // we only evaluate the incrementor on subsequent evaluations. - if (loopOutParameters.length || lexicalEnvironment) { - const statements = isBlock(loopBody) ? loopBody.statements.slice() : [loopBody]; - if (loopOutParameters.length) { - copyOutParameters(loopOutParameters, CopyDirection.ToOutParameter, statements); + currentState.conditionVariable = createUniqueName("inc"); + statements.push(createIf( + currentState.conditionVariable, + createStatement(visitNode(node.incrementor, visitor, isExpression)), + createStatement(createAssignment(currentState.conditionVariable, createTrue())) + )); + + if (shouldConvertConditionOfForStatement(node)) { + statements.push(createIf( + createPrefix(SyntaxKind.ExclamationToken, visitNode(node.condition, visitor, isExpression)), + visitNode(createBreak(), visitor, isStatement) + )); } - addStatementsAfterPrologue(statements, lexicalEnvironment); - loopBody = createBlock(statements, /*multiline*/ true); } - if (isBlock(loopBody)) { - loopBody.multiLine = true; + if (isBlock(statement)) { + addRange(statements, statement.statements); } else { - loopBody = createBlock([loopBody], /*multiline*/ true); + statements.push(statement); } + copyOutParameters(currentState.loopOutParameters, LoopOutParameterFlags.Body, CopyDirection.ToOutParameter, statements); + addStatementsAfterPrologue(statements, lexicalEnvironment); + + const loopBody = createBlock(statements, /*multiLine*/ true); + if (isBlock(statement)) setOriginalNode(loopBody, statement); + const containsYield = (node.statement.transformFlags & TransformFlags.ContainsYield) !== 0; - const isAsyncBlockContainingAwait = containsYield && (hierarchyFacts & HierarchyFacts.AsyncFunctionBody) !== 0; - let loopBodyFlags: EmitFlags = 0; - if (currentState.containsLexicalThis) { - loopBodyFlags |= EmitFlags.CapturesThis; - } + let emitFlags: EmitFlags = 0; + if (currentState.containsLexicalThis) emitFlags |= EmitFlags.CapturesThis; + if (containsYield && (hierarchyFacts & HierarchyFacts.AsyncFunctionBody) !== 0) emitFlags |= EmitFlags.AsyncFunctionBody; - if (isAsyncBlockContainingAwait) { - loopBodyFlags |= EmitFlags.AsyncFunctionBody; - } + // This transforms the following ES2015 syntax (in addition to other variations): + // + // for (let i = 0; i < 2; i++) { + // setImmediate(() => console.log(i)); + // } + // + // Into the following ES5 syntax: + // + // var _loop_1 = function (i) { + // setImmediate(() => console.log(i)); + // }; + // for (var i = 0; i < 2; i++) { + // _loop_1(i); + // } - const convertedLoopVariable = + const functionDeclaration = createVariableStatement( /*modifiers*/ undefined, setEmitFlags( @@ -2752,11 +3127,11 @@ namespace ts { containsYield ? createToken(SyntaxKind.AsteriskToken) : undefined, /*name*/ undefined, /*typeParameters*/ undefined, - loopParameters, + currentState.loopParameters, /*type*/ undefined, - loopBody + loopBody ), - loopBodyFlags + emitFlags ) ) ] @@ -2765,106 +3140,8 @@ namespace ts { ) ); - const statements: Statement[] = [convertedLoopVariable]; - - let extraVariableDeclarations: VariableDeclaration[] | undefined; - // propagate state from the inner loop to the outer loop if necessary - if (currentState.argumentsName) { - // if alias for arguments is set - if (outerConvertedLoopState) { - // pass it to outer converted loop - outerConvertedLoopState.argumentsName = currentState.argumentsName; - } - else { - // this is top level converted loop and we need to create an alias for 'arguments' object - (extraVariableDeclarations || (extraVariableDeclarations = [])).push( - createVariableDeclaration( - currentState.argumentsName, - /*type*/ undefined, - createIdentifier("arguments") - ) - ); - } - } - - if (currentState.thisName) { - // if alias for this is set - if (outerConvertedLoopState) { - // pass it to outer converted loop - outerConvertedLoopState.thisName = currentState.thisName; - } - else { - // this is top level converted loop so we need to create an alias for 'this' here - // NOTE: - // if converted loops were all nested in arrow function then we'll always emit '_this' so convertedLoopState.thisName will not be set. - // If it is set this means that all nested loops are not nested in arrow function and it is safe to capture 'this'. - (extraVariableDeclarations || (extraVariableDeclarations = [])).push( - createVariableDeclaration( - currentState.thisName, - /*type*/ undefined, - createIdentifier("this") - ) - ); - } - } - - if (currentState.hoistedLocalVariables) { - // if hoistedLocalVariables !== undefined this means that we've possibly collected some variable declarations to be hoisted later - if (outerConvertedLoopState) { - // pass them to outer converted loop - outerConvertedLoopState.hoistedLocalVariables = currentState.hoistedLocalVariables; - } - else { - if (!extraVariableDeclarations) { - extraVariableDeclarations = []; - } - // hoist collected variable declarations - for (const identifier of currentState.hoistedLocalVariables) { - extraVariableDeclarations.push(createVariableDeclaration(identifier)); - } - } - } - - // add extra variables to hold out parameters if necessary - if (loopOutParameters.length) { - if (!extraVariableDeclarations) { - extraVariableDeclarations = []; - } - for (const outParam of loopOutParameters) { - extraVariableDeclarations.push(createVariableDeclaration(outParam.outParamName)); - } - } - - // create variable statement to hold all introduced variable declarations - if (extraVariableDeclarations) { - statements.push(createVariableStatement( - /*modifiers*/ undefined, - createVariableDeclarationList(extraVariableDeclarations) - )); - } - - const convertedLoopBodyStatements = generateCallToConvertedLoop(functionName, loopParameters, currentState, containsYield); - - let loop: Statement; - if (convert) { - loop = convert(node, outermostLabeledStatement, convertedLoopBodyStatements); - } - else { - let clone = getMutableClone(node); - // clean statement part - clone.statement = undefined!; - // visit childnodes to transform initializer/condition/incrementor parts - clone = visitEachChild(clone, visitor, context); - // set loop statement - clone.statement = createBlock(convertedLoopBodyStatements, /*multiline*/ true); - // reset and re-aggregate the transform flags - clone.transformFlags = 0; - aggregateTransformFlags(clone); - loop = restoreEnclosingLabel(clone, outermostLabeledStatement, convertedLoopState && resetLabel); - } - - statements.push(loop); - return statements; + const part = generateCallToConvertedLoop(functionName, currentState, outerState, containsYield); + return { functionName, containsYield, functionDeclaration, part }; } function copyOutParameter(outParam: LoopOutParameter, copyDirection: CopyDirection): BinaryExpression { @@ -2873,14 +3150,26 @@ namespace ts { return createBinary(target, SyntaxKind.EqualsToken, source); } - function copyOutParameters(outParams: LoopOutParameter[], copyDirection: CopyDirection, statements: Statement[]): void { + function copyOutParameters(outParams: LoopOutParameter[], partFlags: LoopOutParameterFlags, copyDirection: CopyDirection, statements: Statement[]): void { for (const outParam of outParams) { - statements.push(createExpressionStatement(copyOutParameter(outParam, copyDirection))); + if (outParam.flags & partFlags) { + statements.push(createExpressionStatement(copyOutParameter(outParam, copyDirection))); + } } } - function generateCallToConvertedLoop(loopFunctionExpressionName: Identifier, parameters: ParameterDeclaration[], state: ConvertedLoopState, isAsyncBlockContainingAwait: boolean): Statement[] { - const outerConvertedLoopState = convertedLoopState; + function generateCallToConvertedLoopInitializer(initFunctionExpressionName: Identifier, containsYield: boolean): Statement { + const call = createCall(initFunctionExpressionName, /*typeArguments*/ undefined, []); + const callResult = containsYield + ? createYield( + createToken(SyntaxKind.AsteriskToken), + setEmitFlags(call, EmitFlags.Iterator) + ) + : call; + return createStatement(callResult); + } + + function generateCallToConvertedLoop(loopFunctionExpressionName: Identifier, state: ConvertedLoopState, outerState: ConvertedLoopState | undefined, containsYield: boolean): Statement[] { const statements: Statement[] = []; // loop is considered simple if it does not have any return statements or break\continue that transfer control outside of the loop @@ -2891,8 +3180,8 @@ namespace ts { !state.labeledNonLocalBreaks && !state.labeledNonLocalContinues; - const call = createCall(loopFunctionExpressionName, /*typeArguments*/ undefined, map(parameters, p => p.name)); - const callResult = isAsyncBlockContainingAwait + const call = createCall(loopFunctionExpressionName, /*typeArguments*/ undefined, map(state.loopParameters, p => p.name)); + const callResult = containsYield ? createYield( createToken(SyntaxKind.AsteriskToken), setEmitFlags(call, EmitFlags.Iterator) @@ -2900,7 +3189,7 @@ namespace ts { : call; if (isSimpleLoop) { statements.push(createExpressionStatement(callResult)); - copyOutParameters(state.loopOutParameters!, CopyDirection.ToOriginal, statements); + copyOutParameters(state.loopOutParameters, LoopOutParameterFlags.Body, CopyDirection.ToOriginal, statements); } else { const loopResultName = createUniqueName("state"); @@ -2911,12 +3200,12 @@ namespace ts { ) ); statements.push(stateVariable); - copyOutParameters(state.loopOutParameters!, CopyDirection.ToOriginal, statements); + copyOutParameters(state.loopOutParameters, LoopOutParameterFlags.Body, CopyDirection.ToOriginal, statements); if (state.nonLocalJumps! & Jump.Return) { let returnStatement: ReturnStatement; - if (outerConvertedLoopState) { - outerConvertedLoopState.nonLocalJumps! |= Jump.Return; + if (outerState) { + outerState.nonLocalJumps! |= Jump.Return; returnStatement = createReturn(loopResultName); } else { @@ -2949,8 +3238,8 @@ namespace ts { if (state.labeledNonLocalBreaks || state.labeledNonLocalContinues) { const caseClauses: CaseClause[] = []; - processLabeledJumps(state.labeledNonLocalBreaks!, /*isBreak*/ true, loopResultName, outerConvertedLoopState, caseClauses); - processLabeledJumps(state.labeledNonLocalContinues!, /*isBreak*/ false, loopResultName, outerConvertedLoopState, caseClauses); + processLabeledJumps(state.labeledNonLocalBreaks!, /*isBreak*/ true, loopResultName, outerState, caseClauses); + processLabeledJumps(state.labeledNonLocalContinues!, /*isBreak*/ false, loopResultName, outerState, caseClauses); statements.push( createSwitch( loopResultName, @@ -2998,20 +3287,28 @@ namespace ts { }); } - function processLoopVariableDeclaration(decl: VariableDeclaration | BindingElement, loopParameters: ParameterDeclaration[], loopOutParameters: LoopOutParameter[]) { + function processLoopVariableDeclaration(container: IterationStatement, decl: VariableDeclaration | BindingElement, loopParameters: ParameterDeclaration[], loopOutParameters: LoopOutParameter[], hasCapturedBindingsInForInitializer: boolean) { const name = decl.name; if (isBindingPattern(name)) { for (const element of name.elements) { if (!isOmittedExpression(element)) { - processLoopVariableDeclaration(element, loopParameters, loopOutParameters); + processLoopVariableDeclaration(container, element, loopParameters, loopOutParameters, hasCapturedBindingsInForInitializer); } } } else { loopParameters.push(createParameter(/*decorators*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, name)); - if (resolver.getNodeCheckFlags(decl) & NodeCheckFlags.NeedsLoopOutParameter) { + const checkFlags = resolver.getNodeCheckFlags(decl); + if (checkFlags & NodeCheckFlags.NeedsLoopOutParameter || hasCapturedBindingsInForInitializer) { const outParamName = createUniqueName("out_" + idText(name)); - loopOutParameters.push({ originalName: name, outParamName }); + let flags: LoopOutParameterFlags = 0; + if (checkFlags & NodeCheckFlags.NeedsLoopOutParameter) { + flags |= LoopOutParameterFlags.Body; + } + if (isForStatement(container) && container.initializer && resolver.isBindingCapturedByNode(container.initializer, decl)) { + flags |= LoopOutParameterFlags.Initializer; + } + loopOutParameters.push({ flags, originalName: name, outParamName }); } } } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index e0d027ded22..b113a7f8a64 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -3408,6 +3408,7 @@ namespace ts { getJsxFactoryEntity(location?: Node): EntityName | undefined; getAllAccessorDeclarations(declaration: AccessorDeclaration): AllAccessorDeclarations; getSymbolOfExternalModuleSpecifier(node: StringLiteralLike): Symbol | undefined; + isBindingCapturedByNode(node: Node, decl: VariableDeclaration | BindingElement): boolean; } export const enum SymbolFlags { @@ -3656,14 +3657,15 @@ namespace ts { EnumValuesComputed = 0x00004000, // Values for enum members have been computed, and any errors have been reported for them. LexicalModuleMergesWithClass = 0x00008000, // Instantiated lexical module declaration is merged with a previous class declaration. LoopWithCapturedBlockScopedBinding = 0x00010000, // Loop that contains block scoped variable captured in closure - CapturedBlockScopedBinding = 0x00020000, // Block-scoped binding that is captured in some function - BlockScopedBindingInLoop = 0x00040000, // Block-scoped binding with declaration nested inside iteration statement - ClassWithBodyScopedClassBinding = 0x00080000, // Decorated class that contains a binding to itself inside of the class body. - BodyScopedClassBinding = 0x00100000, // Binding to a decorated class inside of the class's body. - NeedsLoopOutParameter = 0x00200000, // Block scoped binding whose value should be explicitly copied outside of the converted loop - AssignmentsMarked = 0x00400000, // Parameter assignments have been marked - ClassWithConstructorReference = 0x00800000, // Class that contains a binding to its constructor inside of the class body. - ConstructorReferenceInClass = 0x01000000, // Binding to a class constructor inside of the class's body. + ContainsCapturedBlockScopeBinding = 0x00020000, // Part of a loop that contains block scoped variable captured in closure + CapturedBlockScopedBinding = 0x00040000, // Block-scoped binding that is captured in some function + BlockScopedBindingInLoop = 0x00080000, // Block-scoped binding with declaration nested inside iteration statement + ClassWithBodyScopedClassBinding = 0x00100000, // Decorated class that contains a binding to itself inside of the class body. + BodyScopedClassBinding = 0x00200000, // Binding to a decorated class inside of the class's body. + NeedsLoopOutParameter = 0x00400000, // Block scoped binding whose value should be explicitly copied outside of the converted loop + AssignmentsMarked = 0x00800000, // Parameter assignments have been marked + ClassWithConstructorReference = 0x01000000, // Class that contains a binding to its constructor inside of the class body. + ConstructorReferenceInClass = 0x02000000, // Binding to a class constructor inside of the class's body. } /* @internal */ @@ -3687,6 +3689,7 @@ namespace ts { switchTypes?: Type[]; // Cached array of switch case expression types jsxNamespace?: Symbol | false; // Resolved jsx namespace symbol for this node contextFreeType?: Type; // Cached context-free type used by the first pass of inference; used when a function's return is partially contextually sensitive + capturedBlockScopeBindings?: Symbol[]; // Block-scoped bindings captured beneath this part of an IterationStatement } export const enum TypeFlags { diff --git a/tests/baselines/reference/capturedLetConstInLoop1.js b/tests/baselines/reference/capturedLetConstInLoop1.js index 3c064059cb0..7acaf851cc2 100644 --- a/tests/baselines/reference/capturedLetConstInLoop1.js +++ b/tests/baselines/reference/capturedLetConstInLoop1.js @@ -1,4 +1,6 @@ //// [capturedLetConstInLoop1.ts] +declare function use(x: any): any; + //==== let for (let x in {}) { (function() { return x}); @@ -56,6 +58,19 @@ for (let y = 0; y < 1; ++y) { (() => x + y); } +for (let y = (use(() => y), 0); y < 1; ++y) { +} + +for (let y = 0; use(() => y), y < 1; ++y) { +} + +for (let y = 0; y < 1; use(() => y), ++y) { +} + +for (let y = (use(() => y), 0); use(() => y), y < 1; use(() => y), ++y) { + use(() => y); +} + //=========const for (const x in {}) { (function() { return x}); @@ -202,93 +217,145 @@ var _loop_10 = function (y) { for (var y = 0; y < 1; ++y) { _loop_10(y); } -var _loop_11 = function (x) { +var _loop_init_1 = function () { + var y = (use(function () { return y; }), 0); + out_y_1 = y; +}; +var out_y_1; +_loop_init_1(); +for (var y = out_y_1; y < 1; ++y) { +} +var _loop_11 = function (y) { + if (inc_1) + ++y; + else + inc_1 = true; + if (!(use(function () { return y; }), y < 1)) + return "break"; +}; +var inc_1 = false; +for (var y = 0;;) { + var state_1 = _loop_11(y); + if (state_1 === "break") + break; +} +var _loop_12 = function (y) { + if (inc_2) + use(function () { return y; }), ++y; + else + inc_2 = true; +}; +var inc_2 = false; +for (var y = 0; y < 1;) { + _loop_12(y); +} +var _loop_init_2 = function () { + var y = (use(function () { return y; }), 0); + out_y_2 = y; +}; +var _loop_13 = function (y) { + if (inc_3) + use(function () { return y; }), ++y; + else + inc_3 = true; + if (!(use(function () { return y; }), y < 1)) + return out_y_2 = y, "break"; + use(function () { return y; }); +}; +var out_y_2, inc_3 = false; +_loop_init_2(); +for (var y = out_y_2;;) { + var state_2 = _loop_13(y); + if (state_2 === "break") + break; +} +var _loop_14 = function (x) { (function () { return x; }); (function () { return x; }); }; //=========const for (var x in {}) { - _loop_11(x); + _loop_14(x); } -var _loop_12 = function (x) { +var _loop_15 = function (x) { (function () { return x; }); (function () { return x; }); }; for (var _b = 0, _c = []; _b < _c.length; _b++) { var x = _c[_b]; - _loop_12(x); + _loop_15(x); } -var _loop_13 = function (x) { +var _loop_16 = function (x) { (function () { return x; }); (function () { return x; }); }; for (var x = 0; x < 1;) { - _loop_13(x); + _loop_16(x); } -var _loop_14 = function () { +var _loop_17 = function () { var x = 1; (function () { return x; }); (function () { return x; }); }; while (1 === 1) { - _loop_14(); + _loop_17(); } -var _loop_15 = function () { +var _loop_18 = function () { var x = 1; (function () { return x; }); (function () { return x; }); }; do { - _loop_15(); + _loop_18(); } while (1 === 1); -var _loop_16 = function (y) { +var _loop_19 = function (y) { var x = 1; (function () { return x; }); (function () { return x; }); }; for (var y = 0; y < 1;) { - _loop_16(y); + _loop_19(y); } -var _loop_17 = function (x, y) { +var _loop_20 = function (x, y) { (function () { return x + y; }); (function () { return x + y; }); }; for (var x = 0, y = 1; x < 1;) { - _loop_17(x, y); + _loop_20(x, y); } -var _loop_18 = function () { +var _loop_21 = function () { var x = 1, y = 1; (function () { return x + y; }); (function () { return x + y; }); }; while (1 === 1) { - _loop_18(); + _loop_21(); } -var _loop_19 = function () { +var _loop_22 = function () { var x = 1, y = 1; (function () { return x + y; }); (function () { return x + y; }); }; do { - _loop_19(); + _loop_22(); } while (1 === 1); -var _loop_20 = function (y) { +var _loop_23 = function (y) { var x = 1; (function () { return x + y; }); (function () { return x + y; }); }; for (var y = 0; y < 1;) { - _loop_20(y); + _loop_23(y); } -var _loop_21 = function (sx) { +var _loop_24 = function (sx) { (function () { return sobj[sx]; }); }; for (var sx in sobj) { - _loop_21(sx); + _loop_24(sx); } -var _loop_22 = function (ix) { +var _loop_25 = function (ix) { (function () { return iobj[ix]; }); }; for (var ix in iobj) { - _loop_22(ix); + _loop_25(ix); } diff --git a/tests/baselines/reference/capturedLetConstInLoop1.symbols b/tests/baselines/reference/capturedLetConstInLoop1.symbols index afa7898a258..43f263bd73a 100644 --- a/tests/baselines/reference/capturedLetConstInLoop1.symbols +++ b/tests/baselines/reference/capturedLetConstInLoop1.symbols @@ -1,286 +1,330 @@ === tests/cases/compiler/capturedLetConstInLoop1.ts === +declare function use(x: any): any; +>use : Symbol(use, Decl(capturedLetConstInLoop1.ts, 0, 0)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 0, 21)) + //==== let for (let x in {}) { ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 1, 8)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 3, 8)) (function() { return x}); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 1, 8)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 3, 8)) (() => x); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 1, 8)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 3, 8)) } for (let x of []) { ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 6, 8)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 8, 8)) (function() { return x}); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 6, 8)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 8, 8)) (() => x); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 6, 8)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 8, 8)) } for (let x = 0; x < 1; ++x) { ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 11, 8)) ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 11, 8)) ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 11, 8)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 13, 8)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 13, 8)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 13, 8)) (function() { return x}); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 11, 8)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 13, 8)) (() => x); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 11, 8)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 13, 8)) } while (1 === 1) { let x; ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 17, 7)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 19, 7)) (function() { return x}); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 17, 7)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 19, 7)) (() => x); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 17, 7)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 19, 7)) } do { let x; ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 23, 7)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 25, 7)) (function() { return x}); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 23, 7)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 25, 7)) (() => x); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 23, 7)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 25, 7)) } while (1 === 1) for (let y = 0; y < 1; ++y) { ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 28, 8)) ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 28, 8)) ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 28, 8)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 30, 8)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 30, 8)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 30, 8)) let x = 1; ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 29, 7)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 31, 7)) (function() { return x}); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 29, 7)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 31, 7)) (() => x); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 29, 7)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 31, 7)) } for (let x = 0, y = 1; x < 1; ++x) { ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 34, 8)) ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 34, 15)) ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 34, 8)) ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 34, 8)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 36, 8)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 36, 15)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 36, 8)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 36, 8)) (function() { return x + y}); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 34, 8)) ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 34, 15)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 36, 8)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 36, 15)) (() => x + y); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 34, 8)) ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 34, 15)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 36, 8)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 36, 15)) } while (1 === 1) { let x, y; ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 40, 7)) ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 40, 10)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 42, 7)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 42, 10)) (function() { return x + y}); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 40, 7)) ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 40, 10)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 42, 7)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 42, 10)) (() => x + y); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 40, 7)) ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 40, 10)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 42, 7)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 42, 10)) } do { let x, y; ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 46, 7)) ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 46, 10)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 48, 7)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 48, 10)) (function() { return x + y}); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 46, 7)) ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 46, 10)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 48, 7)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 48, 10)) (() => x + y); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 46, 7)) ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 46, 10)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 48, 7)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 48, 10)) } while (1 === 1) for (let y = 0; y < 1; ++y) { ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 51, 8)) ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 51, 8)) ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 51, 8)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 53, 8)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 53, 8)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 53, 8)) let x = 1; ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 52, 7)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 54, 7)) (function() { return x + y}); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 52, 7)) ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 51, 8)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 54, 7)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 53, 8)) (() => x + y); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 52, 7)) ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 51, 8)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 54, 7)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 53, 8)) +} + +for (let y = (use(() => y), 0); y < 1; ++y) { +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 59, 8)) +>use : Symbol(use, Decl(capturedLetConstInLoop1.ts, 0, 0)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 59, 8)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 59, 8)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 59, 8)) +} + +for (let y = 0; use(() => y), y < 1; ++y) { +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 62, 8)) +>use : Symbol(use, Decl(capturedLetConstInLoop1.ts, 0, 0)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 62, 8)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 62, 8)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 62, 8)) +} + +for (let y = 0; y < 1; use(() => y), ++y) { +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 65, 8)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 65, 8)) +>use : Symbol(use, Decl(capturedLetConstInLoop1.ts, 0, 0)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 65, 8)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 65, 8)) +} + +for (let y = (use(() => y), 0); use(() => y), y < 1; use(() => y), ++y) { +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 68, 8)) +>use : Symbol(use, Decl(capturedLetConstInLoop1.ts, 0, 0)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 68, 8)) +>use : Symbol(use, Decl(capturedLetConstInLoop1.ts, 0, 0)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 68, 8)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 68, 8)) +>use : Symbol(use, Decl(capturedLetConstInLoop1.ts, 0, 0)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 68, 8)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 68, 8)) + + use(() => y); +>use : Symbol(use, Decl(capturedLetConstInLoop1.ts, 0, 0)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 68, 8)) } //=========const for (const x in {}) { ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 58, 10)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 73, 10)) (function() { return x}); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 58, 10)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 73, 10)) (() => x); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 58, 10)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 73, 10)) } for (const x of []) { ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 63, 10)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 78, 10)) (function() { return x}); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 63, 10)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 78, 10)) (() => x); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 63, 10)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 78, 10)) } for (const x = 0; x < 1;) { ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 68, 10)) ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 68, 10)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 83, 10)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 83, 10)) (function() { return x}); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 68, 10)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 83, 10)) (() => x); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 68, 10)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 83, 10)) } while (1 === 1) { const x = 1; ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 74, 9)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 89, 9)) (function() { return x}); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 74, 9)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 89, 9)) (() => x); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 74, 9)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 89, 9)) } do { const x = 1; ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 80, 9)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 95, 9)) (function() { return x}); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 80, 9)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 95, 9)) (() => x); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 80, 9)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 95, 9)) } while (1 === 1) for (const y = 0; y < 1;) { ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 85, 10)) ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 85, 10)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 100, 10)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 100, 10)) const x = 1; ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 86, 9)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 101, 9)) (function() { return x}); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 86, 9)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 101, 9)) (() => x); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 86, 9)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 101, 9)) } for (const x = 0, y = 1; x < 1;) { ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 91, 10)) ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 91, 17)) ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 91, 10)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 106, 10)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 106, 17)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 106, 10)) (function() { return x + y}); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 91, 10)) ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 91, 17)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 106, 10)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 106, 17)) (() => x + y); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 91, 10)) ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 91, 17)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 106, 10)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 106, 17)) } while (1 === 1) { const x = 1, y = 1; ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 97, 9)) ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 97, 16)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 112, 9)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 112, 16)) (function() { return x + y}); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 97, 9)) ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 97, 16)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 112, 9)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 112, 16)) (() => x + y); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 97, 9)) ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 97, 16)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 112, 9)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 112, 16)) } do { const x = 1, y = 1; ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 103, 9)) ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 103, 16)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 118, 9)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 118, 16)) (function() { return x + y}); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 103, 9)) ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 103, 16)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 118, 9)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 118, 16)) (() => x + y); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 103, 9)) ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 103, 16)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 118, 9)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 118, 16)) } while (1 === 1) for (const y = 0; y < 1;) { ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 108, 10)) ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 108, 10)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 123, 10)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 123, 10)) const x = 1; ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 109, 9)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 124, 9)) (function() { return x + y}); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 109, 9)) ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 108, 10)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 124, 9)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 123, 10)) (() => x + y); ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 109, 9)) ->y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 108, 10)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 124, 9)) +>y : Symbol(y, Decl(capturedLetConstInLoop1.ts, 123, 10)) } // https://github.com/Microsoft/TypeScript/issues/20594 declare const sobj: { [x: string]: any }; ->sobj : Symbol(sobj, Decl(capturedLetConstInLoop1.ts, 115, 13)) ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 115, 23)) +>sobj : Symbol(sobj, Decl(capturedLetConstInLoop1.ts, 130, 13)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 130, 23)) for (let sx in sobj) { ->sx : Symbol(sx, Decl(capturedLetConstInLoop1.ts, 116, 8)) ->sobj : Symbol(sobj, Decl(capturedLetConstInLoop1.ts, 115, 13)) +>sx : Symbol(sx, Decl(capturedLetConstInLoop1.ts, 131, 8)) +>sobj : Symbol(sobj, Decl(capturedLetConstInLoop1.ts, 130, 13)) (() => sobj[sx]); ->sobj : Symbol(sobj, Decl(capturedLetConstInLoop1.ts, 115, 13)) ->sx : Symbol(sx, Decl(capturedLetConstInLoop1.ts, 116, 8)) +>sobj : Symbol(sobj, Decl(capturedLetConstInLoop1.ts, 130, 13)) +>sx : Symbol(sx, Decl(capturedLetConstInLoop1.ts, 131, 8)) } declare const iobj: { [x: number]: any }; ->iobj : Symbol(iobj, Decl(capturedLetConstInLoop1.ts, 119, 13)) ->x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 119, 23)) +>iobj : Symbol(iobj, Decl(capturedLetConstInLoop1.ts, 134, 13)) +>x : Symbol(x, Decl(capturedLetConstInLoop1.ts, 134, 23)) for (let ix in iobj) { ->ix : Symbol(ix, Decl(capturedLetConstInLoop1.ts, 120, 8)) ->iobj : Symbol(iobj, Decl(capturedLetConstInLoop1.ts, 119, 13)) +>ix : Symbol(ix, Decl(capturedLetConstInLoop1.ts, 135, 8)) +>iobj : Symbol(iobj, Decl(capturedLetConstInLoop1.ts, 134, 13)) (() => iobj[ix]); ->iobj : Symbol(iobj, Decl(capturedLetConstInLoop1.ts, 119, 13)) ->ix : Symbol(ix, Decl(capturedLetConstInLoop1.ts, 120, 8)) +>iobj : Symbol(iobj, Decl(capturedLetConstInLoop1.ts, 134, 13)) +>ix : Symbol(ix, Decl(capturedLetConstInLoop1.ts, 135, 8)) } diff --git a/tests/baselines/reference/capturedLetConstInLoop1.types b/tests/baselines/reference/capturedLetConstInLoop1.types index 34ba101752b..a7d3094268c 100644 --- a/tests/baselines/reference/capturedLetConstInLoop1.types +++ b/tests/baselines/reference/capturedLetConstInLoop1.types @@ -1,4 +1,8 @@ === tests/cases/compiler/capturedLetConstInLoop1.ts === +declare function use(x: any): any; +>use : (x: any) => any +>x : any + //==== let for (let x in {}) { >x : string @@ -214,6 +218,84 @@ for (let y = 0; y < 1; ++y) { >y : number } +for (let y = (use(() => y), 0); y < 1; ++y) { +>y : number +>(use(() => y), 0) : 0 +>use(() => y), 0 : 0 +>use(() => y) : any +>use : (x: any) => any +>() => y : () => number +>y : number +>0 : 0 +>y < 1 : boolean +>y : number +>1 : 1 +>++y : number +>y : number +} + +for (let y = 0; use(() => y), y < 1; ++y) { +>y : number +>0 : 0 +>use(() => y), y < 1 : boolean +>use(() => y) : any +>use : (x: any) => any +>() => y : () => number +>y : number +>y < 1 : boolean +>y : number +>1 : 1 +>++y : number +>y : number +} + +for (let y = 0; y < 1; use(() => y), ++y) { +>y : number +>0 : 0 +>y < 1 : boolean +>y : number +>1 : 1 +>use(() => y), ++y : number +>use(() => y) : any +>use : (x: any) => any +>() => y : () => number +>y : number +>++y : number +>y : number +} + +for (let y = (use(() => y), 0); use(() => y), y < 1; use(() => y), ++y) { +>y : number +>(use(() => y), 0) : 0 +>use(() => y), 0 : 0 +>use(() => y) : any +>use : (x: any) => any +>() => y : () => number +>y : number +>0 : 0 +>use(() => y), y < 1 : boolean +>use(() => y) : any +>use : (x: any) => any +>() => y : () => number +>y : number +>y < 1 : boolean +>y : number +>1 : 1 +>use(() => y), ++y : number +>use(() => y) : any +>use : (x: any) => any +>() => y : () => number +>y : number +>++y : number +>y : number + + use(() => y); +>use(() => y) : any +>use : (x: any) => any +>() => y : () => number +>y : number +} + //=========const for (const x in {}) { >x : string diff --git a/tests/cases/compiler/capturedLetConstInLoop1.ts b/tests/cases/compiler/capturedLetConstInLoop1.ts index e4956fd16df..4919429eec7 100644 --- a/tests/cases/compiler/capturedLetConstInLoop1.ts +++ b/tests/cases/compiler/capturedLetConstInLoop1.ts @@ -1,3 +1,5 @@ +declare function use(x: any): any; + //==== let for (let x in {}) { (function() { return x}); @@ -55,6 +57,19 @@ for (let y = 0; y < 1; ++y) { (() => x + y); } +for (let y = (use(() => y), 0); y < 1; ++y) { +} + +for (let y = 0; use(() => y), y < 1; ++y) { +} + +for (let y = 0; y < 1; use(() => y), ++y) { +} + +for (let y = (use(() => y), 0); use(() => y), y < 1; use(() => y), ++y) { + use(() => y); +} + //=========const for (const x in {}) { (function() { return x}); From 6ac38fe773d9a42c62f633170d81ffe5fabdbbd2 Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Wed, 19 Sep 2018 10:21:30 -0700 Subject: [PATCH 25/71] Update user baselines (#27213) --- .../user/chrome-devtools-frontend.log | 1536 ++++++++--------- tests/baselines/reference/user/npm.log | 19 +- tests/baselines/reference/user/puppeteer.log | 23 +- 3 files changed, 766 insertions(+), 812 deletions(-) diff --git a/tests/baselines/reference/user/chrome-devtools-frontend.log b/tests/baselines/reference/user/chrome-devtools-frontend.log index 7a53da21ec4..2936205dc19 100644 --- a/tests/baselines/reference/user/chrome-devtools-frontend.log +++ b/tests/baselines/reference/user/chrome-devtools-frontend.log @@ -51,8 +51,17 @@ node_modules/chrome-devtools-frontend/front_end/Tests.js(440,5): error TS2554: E node_modules/chrome-devtools-frontend/front_end/Tests.js(475,5): error TS2554: Expected 4 arguments, but got 3. node_modules/chrome-devtools-frontend/front_end/Tests.js(571,33): error TS2339: Property 'deprecatedRunAfterPendingDispatches' does not exist on type 'typeof InspectorBackend'. node_modules/chrome-devtools-frontend/front_end/Tests.js(590,27): error TS2554: Expected 0 arguments, but got 1. +node_modules/chrome-devtools-frontend/front_end/Tests.js(619,44): error TS2339: Property 'emulationAgent' does not exist on type 'Target'. +node_modules/chrome-devtools-frontend/front_end/Tests.js(666,38): error TS2339: Property 'inputAgent' does not exist on type 'Target'. +node_modules/chrome-devtools-frontend/front_end/Tests.js(668,38): error TS2339: Property 'inputAgent' does not exist on type 'Target'. +node_modules/chrome-devtools-frontend/front_end/Tests.js(673,38): error TS2339: Property 'inputAgent' does not exist on type 'Target'. +node_modules/chrome-devtools-frontend/front_end/Tests.js(675,38): error TS2339: Property 'inputAgent' does not exist on type 'Target'. +node_modules/chrome-devtools-frontend/front_end/Tests.js(677,38): error TS2339: Property 'inputAgent' does not exist on type 'Target'. +node_modules/chrome-devtools-frontend/front_end/Tests.js(679,38): error TS2339: Property 'inputAgent' does not exist on type 'Target'. node_modules/chrome-devtools-frontend/front_end/Tests.js(687,7): error TS2554: Expected 3 arguments, but got 2. node_modules/chrome-devtools-frontend/front_end/Tests.js(711,7): error TS2554: Expected 3 arguments, but got 2. +node_modules/chrome-devtools-frontend/front_end/Tests.js(717,36): error TS2339: Property 'inputAgent' does not exist on type 'Target'. +node_modules/chrome-devtools-frontend/front_end/Tests.js(719,36): error TS2339: Property 'inputAgent' does not exist on type 'Target'. node_modules/chrome-devtools-frontend/front_end/Tests.js(735,5): error TS2554: Expected 4 arguments, but got 3. node_modules/chrome-devtools-frontend/front_end/Tests.js(814,38): error TS2339: Property 'timeline' does not exist on type 'any[]'. node_modules/chrome-devtools-frontend/front_end/Tests.js(816,7): error TS2554: Expected 2 arguments, but got 1. @@ -298,6 +307,12 @@ node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(2 node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(21,32): error TS2554: Expected 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(26,32): error TS2694: Namespace 'Protocol' has no exported member 'DOM'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(36,47): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffect, timeline?: AnimationTimeline): Animation; prototype: Animation; }'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(36,63): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Type 'AnimationTimeline' is not assignable to type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Types of property 'modelAdded' are incompatible. + Type '(animationModel: AnimationModel) => void' is not assignable to type '(model: T) => void'. + Types of parameters 'animationModel' and 'model' are incompatible. + Type 'T' is not assignable to type 'AnimationModel'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(44,67): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffect, timeline?: AnimationTimeline): Animation; prototype: Animation; }'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(52,67): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffect, timeline?: AnimationTimeline): Animation; prototype: Animation; }'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(80,19): error TS2339: Property 'AnimationModel' does not exist on type '{ new (effect?: AnimationEffect, timeline?: AnimationTimeline): Animation; prototype: Animation; }'. @@ -308,11 +323,7 @@ node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(1 node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(105,28): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(110,48): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(112,44): error TS2554: Expected 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(114,34): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(117,46): error TS2554: Expected 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(119,34): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(123,40): error TS2339: Property 'AnimationTimeline' does not exist on type '{ new (effect?: AnimationEffect, timeline?: AnimationTimeline): Animation; prototype: Animation; }'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(125,45): error TS2345: Argument of type 'TemplateStringsArray' is not assignable to parameter of type 'string | string[]'. Type 'TemplateStringsArray' is not assignable to type 'string[]'. @@ -325,8 +336,6 @@ node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(1 node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(139,41): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(144,48): error TS2554: Expected 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(145,36): error TS2339: Property 'AnimationTimeline' does not exist on type '{ new (effect?: AnimationEffect, timeline?: AnimationTimeline): Animation; prototype: Animation; }'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(148,31): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(165,19): error TS2694: Namespace 'UI' has no exported member 'PopoverRequest'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(169,18): error TS2339: Property 'isDescendant' does not exist on type 'EventTarget'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(173,25): error TS2339: Property 'boxInWindow' does not exist on type 'EventTarget'. @@ -355,10 +364,10 @@ node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(4 node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(450,37): error TS2339: Property 'AnimationUI' does not exist on type '{ new (effect?: AnimationEffect, timeline?: AnimationTimeline): Animation; prototype: Animation; }'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(457,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(484,36): error TS2339: Property 'millisToString' does not exist on type 'NumberConstructor'. -node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(566,9): error TS2345: Argument of type '{ transform: string; }[]' is not assignable to parameter of type 'PropertyIndexedKeyframes | Keyframe[]'. - Type '{ transform: string; }[]' is not assignable to type 'Keyframe[]'. - Type '{ transform: string; }' is not assignable to type 'Keyframe'. - Property 'alignContent' is missing in type '{ transform: string; }'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(566,10): error TS2322: Type '{ transform: string; }' is not assignable to type 'string | string[] | Keyframe'. + Type '{ transform: string; }' is not assignable to type 'string'. +node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(566,42): error TS2322: Type '{ transform: string; }' is not assignable to type 'string | string[] | Keyframe'. + Type '{ transform: string; }' is not assignable to type 'string'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(571,18): error TS2339: Property 'window' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(587,44): error TS2339: Property 'millisToString' does not exist on type 'NumberConstructor'. node_modules/chrome-devtools-frontend/front_end/animation/AnimationTimeline.js(589,20): error TS2339: Property 'window' does not exist on type 'Element'. @@ -453,23 +462,20 @@ node_modules/chrome-devtools-frontend/front_end/application_test_runner/Resource node_modules/chrome-devtools-frontend/front_end/application_test_runner/ResourcesTestRunner.js(76,15): error TS2339: Property 'resources' does not exist on type 'any[]'. node_modules/chrome-devtools-frontend/front_end/application_test_runner/ResourcesTestRunner.js(77,33): error TS2339: Property 'resources' does not exist on type 'any[]'. node_modules/chrome-devtools-frontend/front_end/application_test_runner/ServiceWorkersTestRunner.js(44,26): error TS2339: Property 'resources' does not exist on type 'any[]'. -node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(16,50): error TS2345: Argument of type '(msg: string) => void' is not assignable to parameter of type '(arg0: string) => undefined'. - Type 'void' is not assignable to type 'undefined'. +node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(16,57): error TS2322: Type 'void' is not assignable to type 'undefined'. node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(16,76): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(20,42): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(21,31): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(24,47): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(25,31): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(31,31): error TS2345: Argument of type 'ToolbarComboBox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarComboBox' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarComboBox'. node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(33,44): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(34,31): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(37,53): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(39,57): error TS2555: Expected at least 2 arguments, but got 1. +node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(45,63): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Type 'Audits2Panel' is not assignable to type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Types of property 'modelAdded' are incompatible. + Type '(serviceWorkerManager: ServiceWorkerManager) => void' is not assignable to type '(model: T) => void'. + Types of parameters 'serviceWorkerManager' and 'model' are incompatible. + Type 'T' is not assignable to type 'ServiceWorkerManager'. +node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(94,50): error TS2339: Property 'asParsedURL' does not exist on type 'string'. node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(126,14): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(135,14): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(147,42): error TS2555: Expected at least 2 arguments, but got 1. @@ -486,6 +492,7 @@ node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(229,29): node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(230,23): error TS2339: Property 'autofocus' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(233,46): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(252,7): error TS2322: Type 'Promise' is not assignable to type 'Promise'. +node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(256,5): error TS2322: Type 'Promise' is not assignable to type 'Promise'. node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(276,31): error TS2339: Property 'singleton' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(302,30): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(342,26): error TS2555: Expected at least 2 arguments, but got 1. @@ -520,6 +527,7 @@ node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(690,15): node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(701,15): error TS2503: Cannot find namespace 'ReportRenderer'. node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(718,22): error TS2551: Property 'Preset' does not exist on type 'typeof Audits2Panel'. Did you mean 'Presets'? node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(720,42): error TS2694: Namespace 'Audits2.Audits2Panel' has no exported member 'Preset'. +node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(772,5): error TS2322: Type 'Promise' is not assignable to type 'Promise'. node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(780,25): error TS2503: Cannot find namespace 'ReportRenderer'. node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(832,25): error TS2503: Cannot find namespace 'ReportRenderer'. node_modules/chrome-devtools-frontend/front_end/audits2/Audits2Panel.js(901,15): error TS2503: Cannot find namespace 'ReportRenderer'. @@ -1285,20 +1293,9 @@ node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighth node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(44340,15): error TS2339: Property 'valuesArray' does not exist on type 'Map'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(44348,15): error TS2339: Property 'keysArray' does not exist on type 'Map'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(44356,15): error TS2339: Property 'inverse' does not exist on type 'Map'. -node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(44361,8): error TS2339: Property 'set' does not exist on type 'Multimap'. -node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(44439,17): error TS2339: Property 'get' does not exist on type 'Multimap'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(44458,18): error TS2339: Property 'keysArray' does not exist on type 'Map'. -node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(44467,15): error TS2339: Property 'keysArray' does not exist on type 'Multimap'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(44469,8): error TS2339: Property 'pushAll' does not exist on type 'any[]'. -node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(44469,21): error TS2339: Property 'get' does not exist on type 'Multimap'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(44495,27): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(44525,22): error TS2339: Property '_outgoingCallback' does not exist on type 'CallbackBarrier'. -node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(44527,13): error TS2339: Property '_incomingCallback' does not exist on type 'CallbackBarrier'. -node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(44535,22): error TS2339: Property '_outgoingCallback' does not exist on type 'CallbackBarrier'. -node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(44536,6): error TS2339: Property '_outgoingCallback' does not exist on type 'CallbackBarrier'. -node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(44538,6): error TS2339: Property '_outgoingCallback' does not exist on type 'CallbackBarrier'. -node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(44568,50): error TS2339: Property '_outgoingCallback' does not exist on type 'CallbackBarrier'. -node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(44569,6): error TS2339: Property '_outgoingCallback' does not exist on type 'CallbackBarrier'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(44584,6): error TS2339: Property 'setImmediate' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(44595,19): error TS2339: Property 'spread' does not exist on type 'Promise'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(44610,19): error TS2339: Property 'catchException' does not exist on type 'Promise'. @@ -3017,8 +3014,6 @@ node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighth node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(65576,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'comment' must be of type '{ multiLine: boolean; slice: any[]; range: number[]; loc: { start: { line: number; column: number; }; end: {}; }; }[]', but here has type '{ multiLine: boolean; slice: number[]; range: any[]; loc: { start: { line: number; column: number; }; end: {}; }; }[]'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(67117,1): error TS2322: Type 'string[]' is not assignable to type 'RegExpExecArray'. Property 'index' is missing in type 'string[]'. -node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(67167,19): error TS2339: Property 'parse' does not exist on type 'Link'. -node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(67225,13): error TS2339: Property 'get' does not exist on type 'Link'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(67300,14): error TS2339: Property 'Channels' does not exist on type '{}'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(67300,35): error TS2339: Property 'Channels' does not exist on type '{}'. node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighthouse-background.js(67301,24): error TS2339: Property 'Channels' does not exist on type '{}'. @@ -3058,6 +3053,12 @@ node_modules/chrome-devtools-frontend/front_end/audits2_worker/lighthouse/lighth node_modules/chrome-devtools-frontend/front_end/audits2_worker.js(5,11): error TS2339: Property 'Runtime' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/audits2_worker.js(6,8): error TS2339: Property 'importScripts' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/bindings/BlackboxManager.js(25,71): error TS2694: Namespace 'Protocol' has no exported member 'Debugger'. +node_modules/chrome-devtools-frontend/front_end/bindings/BlackboxManager.js(30,56): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Type 'BlackboxManager' is not assignable to type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Types of property 'modelAdded' are incompatible. + Type '(debuggerModel: DebuggerModel) => void' is not assignable to type '(model: T) => void'. + Types of parameters 'debuggerModel' and 'model' are incompatible. + Type 'T' is not assignable to type 'DebuggerModel'. node_modules/chrome-devtools-frontend/front_end/bindings/BlackboxManager.js(69,72): error TS2339: Property 'getAsArray' does not exist on type 'Setting'. node_modules/chrome-devtools-frontend/front_end/bindings/BlackboxManager.js(89,27): error TS2339: Property 'lowerBound' does not exist on type 'any[]'. node_modules/chrome-devtools-frontend/front_end/bindings/BlackboxManager.js(94,26): error TS2694: Namespace 'Protocol' has no exported member 'Debugger'. @@ -3078,6 +3079,12 @@ node_modules/chrome-devtools-frontend/front_end/bindings/BlackboxManager.js(362, node_modules/chrome-devtools-frontend/front_end/bindings/BlackboxManager.js(375,9): error TS2322: Type 'Promise' is not assignable to type 'Promise'. node_modules/chrome-devtools-frontend/front_end/bindings/BlackboxManager.js(378,9): error TS2322: Type 'Promise' is not assignable to type 'Promise'. node_modules/chrome-devtools-frontend/front_end/bindings/BlackboxManager.js(381,5): error TS2322: Type 'Promise' is not assignable to type 'Promise'. +node_modules/chrome-devtools-frontend/front_end/bindings/BreakpointManager.js(60,52): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Type 'BreakpointManager' is not assignable to type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Types of property 'modelAdded' are incompatible. + Type '(debuggerModel: DebuggerModel) => void' is not assignable to type '(model: T) => void'. + Types of parameters 'debuggerModel' and 'model' are incompatible. + Type 'T' is not assignable to type 'DebuggerModel'. node_modules/chrome-devtools-frontend/front_end/bindings/BreakpointManager.js(97,52): error TS2339: Property 'get' does not exist on type 'Multimap'. node_modules/chrome-devtools-frontend/front_end/bindings/BreakpointManager.js(120,52): error TS2339: Property 'valuesArray' does not exist on type 'Multimap'. node_modules/chrome-devtools-frontend/front_end/bindings/BreakpointManager.js(123,34): error TS2339: Property 'clear' does not exist on type 'Multimap'. @@ -3098,12 +3105,28 @@ node_modules/chrome-devtools-frontend/front_end/bindings/BreakpointManager.js(44 node_modules/chrome-devtools-frontend/front_end/bindings/BreakpointManager.js(444,23): error TS2339: Property 'remove' does not exist on type 'Map'. node_modules/chrome-devtools-frontend/front_end/bindings/BreakpointManager.js(446,19): error TS2339: Property 'remove' does not exist on type 'Map>'. node_modules/chrome-devtools-frontend/front_end/bindings/BreakpointManager.js(448,40): error TS2339: Property 'remove' does not exist on type 'Map>>'. +node_modules/chrome-devtools-frontend/front_end/bindings/BreakpointManager.js(518,77): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Type 'Breakpoint' is not assignable to type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Types of property 'modelAdded' are incompatible. + Type '(debuggerModel: DebuggerModel) => void' is not assignable to type '(model: T) => void'. + Types of parameters 'debuggerModel' and 'model' are incompatible. + Type 'T' is not assignable to type 'DebuggerModel'. node_modules/chrome-devtools-frontend/front_end/bindings/BreakpointManager.js(536,50): error TS2339: Property 'remove' does not exist on type 'Map'. node_modules/chrome-devtools-frontend/front_end/bindings/BreakpointManager.js(655,51): error TS2339: Property 'valuesArray' does not exist on type 'Map'. node_modules/chrome-devtools-frontend/front_end/bindings/BreakpointManager.js(667,51): error TS2339: Property 'valuesArray' does not exist on type 'Map'. +node_modules/chrome-devtools-frontend/front_end/bindings/BreakpointManager.js(674,79): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Type 'Breakpoint' is not assignable to type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Types of property 'modelAdded' are incompatible. + Type '(debuggerModel: DebuggerModel) => void' is not assignable to type '(model: T) => void'. node_modules/chrome-devtools-frontend/front_end/bindings/BreakpointManager.js(713,51): error TS2339: Property 'valuesArray' does not exist on type 'Map'. node_modules/chrome-devtools-frontend/front_end/bindings/BreakpointManager.js(863,24): error TS2694: Namespace 'Protocol' has no exported member 'Debugger'. node_modules/chrome-devtools-frontend/front_end/bindings/BreakpointManager.js(905,22): error TS2694: Namespace 'Common' has no exported member 'Event'. +node_modules/chrome-devtools-frontend/front_end/bindings/CSSWorkspaceBinding.js(20,47): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Type 'CSSWorkspaceBinding' is not assignable to type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Types of property 'modelAdded' are incompatible. + Type '(cssModel: CSSModel) => void' is not assignable to type '(model: T) => void'. + Types of parameters 'cssModel' and 'model' are incompatible. + Type 'T' is not assignable to type 'CSSModel'. node_modules/chrome-devtools-frontend/front_end/bindings/CSSWorkspaceBinding.js(104,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'rawLocations' must be of type 'CSSLocation[]', but here has type 'any[]'. node_modules/chrome-devtools-frontend/front_end/bindings/CSSWorkspaceBinding.js(106,20): error TS2339: Property 'pushAll' does not exist on type 'CSSLocation[]'. node_modules/chrome-devtools-frontend/front_end/bindings/CSSWorkspaceBinding.js(126,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. @@ -3126,6 +3149,12 @@ node_modules/chrome-devtools-frontend/front_end/bindings/CompilerScriptMapping.j node_modules/chrome-devtools-frontend/front_end/bindings/CompilerScriptMapping.js(202,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/bindings/CompilerScriptMapping.js(218,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/bindings/ContentProviderBasedProject.js(180,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. +node_modules/chrome-devtools-frontend/front_end/bindings/DebuggerWorkspaceBinding.js(26,52): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Type 'DebuggerWorkspaceBinding' is not assignable to type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Types of property 'modelAdded' are incompatible. + Type '(debuggerModel: DebuggerModel) => void' is not assignable to type '(model: T) => void'. + Types of parameters 'debuggerModel' and 'model' are incompatible. + Type 'T' is not assignable to type 'DebuggerModel'. node_modules/chrome-devtools-frontend/front_end/bindings/DebuggerWorkspaceBinding.js(51,31): error TS2339: Property 'remove' does not exist on type 'Map'. node_modules/chrome-devtools-frontend/front_end/bindings/DebuggerWorkspaceBinding.js(85,5): error TS2322: Type 'StackTraceTopFrameLocation' is not assignable to type '{ update(): void; uiLocation(): UILocation; dispose(): void; isBlackboxed(): boolean; }'. node_modules/chrome-devtools-frontend/front_end/bindings/DebuggerWorkspaceBinding.js(85,5): error TS2322: Type 'StackTraceTopFrameLocation' is not assignable to type '{ update(): void; uiLocation(): UILocation; dispose(): void; isBlackboxed(): boolean; }'. @@ -3158,6 +3187,12 @@ node_modules/chrome-devtools-frontend/front_end/bindings/NetworkProject.js(286,2 node_modules/chrome-devtools-frontend/front_end/bindings/NetworkProject.js(308,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/bindings/PresentationConsoleMessageHelper.js(66,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/bindings/PresentationConsoleMessageHelper.js(130,22): error TS2694: Namespace 'Common' has no exported member 'Event'. +node_modules/chrome-devtools-frontend/front_end/bindings/ResourceMapping.js(17,56): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Type 'ResourceMapping' is not assignable to type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Types of property 'modelAdded' are incompatible. + Type '(resourceTreeModel: ResourceTreeModel) => void' is not assignable to type '(model: T) => void'. + Types of parameters 'resourceTreeModel' and 'model' are incompatible. + Type 'T' is not assignable to type 'ResourceTreeModel'. node_modules/chrome-devtools-frontend/front_end/bindings/ResourceMapping.js(147,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/bindings/ResourceMapping.js(181,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/bindings/ResourceMapping.js(189,22): error TS2694: Namespace 'Common' has no exported member 'Event'. @@ -3182,6 +3217,7 @@ node_modules/chrome-devtools-frontend/front_end/bindings/ResourceScriptMapping.j node_modules/chrome-devtools-frontend/front_end/bindings/ResourceScriptMapping.js(323,14): error TS2339: Property '_scriptSource' does not exist on type 'ResourceScriptFile'. node_modules/chrome-devtools-frontend/front_end/bindings/ResourceScriptMapping.js(384,38): error TS2339: Property '_scriptSource' does not exist on type 'ResourceScriptFile'. node_modules/chrome-devtools-frontend/front_end/bindings/ResourceScriptMapping.js(395,12): error TS2339: Property '_scriptSource' does not exist on type 'ResourceScriptFile'. +node_modules/chrome-devtools-frontend/front_end/bindings/ResourceUtils.js(72,32): error TS2339: Property 'asParsedURL' does not exist on type 'string'. node_modules/chrome-devtools-frontend/front_end/bindings/SASSSourceMapping.js(63,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/bindings/SASSSourceMapping.js(90,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/bindings/SASSSourceMapping.js(108,22): error TS2694: Namespace 'Common' has no exported member 'Event'. @@ -3256,10 +3292,6 @@ node_modules/chrome-devtools-frontend/front_end/changes/ChangesSidebar.js(38,22) node_modules/chrome-devtools-frontend/front_end/changes/ChangesView.js(26,44): error TS2694: Namespace 'Changes.ChangesView' has no exported member 'Row'. node_modules/chrome-devtools-frontend/front_end/changes/ChangesView.js(37,42): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/changes/ChangesView.js(43,45): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/changes/ChangesView.js(45,37): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/changes/ChangesView.js(47,37): error TS2345: Argument of type 'ToolbarText' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarText' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/changes/ChangesView.js(50,20): error TS2554: Expected 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/changes/ChangesView.js(75,11): error TS2339: Property 'consume' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/changes/ChangesView.js(111,22): error TS2554: Expected 2 arguments, but got 1. @@ -3319,8 +3351,6 @@ node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(2858,32): error node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(2858,49): error TS2339: Property 'right' does not exist on type 'never'. node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(3034,25): error TS2339: Property 'xRel' does not exist on type 'Pos'. node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(4840,5): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. -node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(5583,12): error TS2339: Property 'collapse' does not exist on type 'BranchChunk'. -node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(5615,18): error TS2339: Property 'maybeSpill' does not exist on type 'BranchChunk'. node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(5675,35): error TS2339: Property 'line' does not exist on type 'LineWidget'. node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(5675,61): error TS2339: Property 'line' does not exist on type 'LineWidget'. node_modules/chrome-devtools-frontend/front_end/cm/codemirror.js(5693,57): error TS2339: Property 'line' does not exist on type 'LineWidget'. @@ -3430,11 +3460,10 @@ node_modules/chrome-devtools-frontend/front_end/cm/overlay.js(16,19): error TS23 node_modules/chrome-devtools-frontend/front_end/cm/overlay.js(16,43): error TS2304: Cannot find name 'define'. node_modules/chrome-devtools-frontend/front_end/cm/overlay.js(17,5): error TS2304: Cannot find name 'define'. node_modules/chrome-devtools-frontend/front_end/cm_headless/headlesscodemirror.js(30,14): error TS2403: Subsequent variable declarations must have the same type. Variable 'ok' must be of type 'boolean', but here has type 'any'. -node_modules/chrome-devtools-frontend/front_end/cm_headless/headlesscodemirror.js(35,17): error TS2339: Property 'eat' does not exist on type 'StringStream'. node_modules/chrome-devtools-frontend/front_end/cm_headless/headlesscodemirror.js(74,1): error TS2719: Type 'typeof StringStream' is not assignable to type 'typeof StringStream'. Two different types with this name exist, but they are unrelated. - Type 'StringStream' is not assignable to type 'StringStream & { backUp: (n: any) => void; column: () => void; current: () => void; eat: (match: any) => void; eatSpace: () => void; eatWhile: (match: any) => void; eol: () => void; indentation: () => void; ... 5 more ...; sol: () => void; }'. - Type 'StringStream' is not assignable to type '{ backUp: (n: any) => void; column: () => void; current: () => void; eat: (match: any) => void; eatSpace: () => void; eatWhile: (match: any) => void; eol: () => void; indentation: () => void; match: (pattern: string | RegExp, consume?: boolean, caseInsensitive?: boolean) => void; ... 4 more ...; sol: () => void; }'. - Property 'backUp' is missing in type 'StringStream'. + Types of property 'prototype' are incompatible. + Type '{ eol: () => boolean; sol: () => boolean; peek: () => any; next: () => any; eat: (match: any) => any; eatWhile: (match: any) => boolean; eatSpace: () => boolean; skipToEnd: typeof skipToEnd; skipTo: typeof skipTo; backUp: (n: any) => void; ... 5 more ...; lookAhead: () => any; }' is not assignable to type '{ backUp: (n: any) => void; column: () => void; current: () => void; eat: (match: any) => void; eatSpace: () => void; eatWhile: (match: any) => void; eol: () => void; indentation: () => void; match: (pattern: string | RegExp, consume?: boolean, caseInsensitive?: boolean) => void; ... 4 more ...; sol: () => void; }'. + Property 'hideFirstChars' does not exist on type '{ backUp: (n: any) => void; column: () => void; current: () => void; eat: (match: any) => void; eatSpace: () => void; eatWhile: (match: any) => void; eol: () => void; indentation: () => void; match: (pattern: string | RegExp, consume?: boolean, caseInsensitive?: boolean) => void; ... 4 more ...; sol: () => void; }'. node_modules/chrome-devtools-frontend/front_end/cm_headless/headlesscodemirror.js(87,12): error TS2339: Property 'resolveMode' does not exist on type 'typeof CodeMirror'. node_modules/chrome-devtools-frontend/front_end/cm_headless/headlesscodemirror.js(97,21): error TS2339: Property 'resolveMode' does not exist on type 'typeof CodeMirror'. node_modules/chrome-devtools-frontend/front_end/cm_headless/headlesscodemirror.js(102,12): error TS2339: Property 'registerHelper' does not exist on type 'typeof CodeMirror'. @@ -3525,13 +3554,9 @@ node_modules/chrome-devtools-frontend/front_end/color_picker/ContrastDetails.js( node_modules/chrome-devtools-frontend/front_end/color_picker/ContrastDetails.js(39,42): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/color_picker/ContrastDetails.js(42,46): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/color_picker/ContrastDetails.js(58,47): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/color_picker/ContrastDetails.js(61,37): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/color_picker/ContrastDetails.js(63,43): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/color_picker/ContrastDetails.js(76,39): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/color_picker/ContrastDetails.js(82,30): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/color_picker/ContrastDetails.js(85,37): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/color_picker/ContrastDetails.js(125,27): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/color_picker/ContrastDetails.js(136,28): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/color_picker/ContrastDetails.js(178,22): error TS2694: Namespace 'Common' has no exported member 'Event'. @@ -3547,20 +3572,14 @@ node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(48,25): node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(51,46): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(58,46): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(60,52): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(64,31): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(84,18): error TS2339: Property 'maxLength' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(97,20): error TS2339: Property 'maxLength' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(126,52): error TS2694: Namespace 'ColorPicker.Spectrum' has no exported member 'Palette'. node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(128,46): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(130,57): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(133,49): error TS2339: Property 'createChild' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(144,47): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(146,39): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(150,47): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(152,45): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(166,12): error TS2339: Property '_hueAlphaLeft' does not exist on type 'Spectrum'. node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(167,12): error TS2339: Property '_colorOffset' does not exist on type 'Spectrum'. node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(178,24): error TS2339: Property 'constrain' does not exist on type 'NumberConstructor'. @@ -3576,15 +3595,13 @@ node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(200,24) node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(200,45): error TS2339: Property 'y' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(200,54): error TS2339: Property '_colorOffset' does not exist on type 'Spectrum'. node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(217,25): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(221,31): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(241,27): error TS2339: Property 'focus' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(251,13): error TS2339: Property 'style' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(251,39): error TS2339: Property 'sprintf' does not exist on type 'StringConstructor'. -node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(253,23): error TS2345: Argument of type '{ opacity: number; }[]' is not assignable to parameter of type 'PropertyIndexedKeyframes | Keyframe[]'. - Type '{ opacity: number; }[]' is not assignable to type 'Keyframe[]'. - Type '{ opacity: number; }' is not assignable to type 'Keyframe'. - Property 'alignContent' is missing in type '{ opacity: number; }'. +node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(253,24): error TS2322: Type '{ opacity: number; }' is not assignable to type 'string | string[] | Keyframe'. + Type '{ opacity: number; }' is not assignable to type 'string'. +node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(253,38): error TS2322: Type '{ opacity: number; }' is not assignable to type 'string | string[] | Keyframe'. + Type '{ opacity: number; }' is not assignable to type 'string'. node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(254,13): error TS2339: Property 'title' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(259,36): error TS2694: Namespace 'ColorPicker.Spectrum' has no exported member 'Palette'. node_modules/chrome-devtools-frontend/front_end/color_picker/Spectrum.js(272,22): error TS2339: Property '__mutable' does not exist on type 'Element'. @@ -3711,9 +3728,8 @@ node_modules/chrome-devtools-frontend/front_end/common/Settings.js(277,41): erro node_modules/chrome-devtools-frontend/front_end/common/Settings.js(281,31): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/common/Settings.js(285,44): error TS2345: Argument of type 'string' is not assignable to parameter of type 'symbol'. node_modules/chrome-devtools-frontend/front_end/common/Settings.js(350,49): error TS2345: Argument of type 'string' is not assignable to parameter of type 'symbol'. -node_modules/chrome-devtools-frontend/front_end/common/Settings.js(424,21): error TS2345: Argument of type '{ pattern: string; }[]' is not assignable to parameter of type '{ pattern: string; disabled: boolean; }[]'. - Type '{ pattern: string; }' is not assignable to type '{ pattern: string; disabled: boolean; }'. - Property 'disabled' is missing in type '{ pattern: string; }'. +node_modules/chrome-devtools-frontend/front_end/common/Settings.js(424,22): error TS2322: Type '{ pattern: string; }' is not assignable to type '{ pattern: string; disabled: boolean; }'. + Property 'disabled' is missing in type '{ pattern: string; }'. node_modules/chrome-devtools-frontend/front_end/common/Settings.js(534,18): error TS2339: Property 'vertical' does not exist on type '{}'. node_modules/chrome-devtools-frontend/front_end/common/Settings.js(535,18): error TS2339: Property 'vertical' does not exist on type '{}'. node_modules/chrome-devtools-frontend/front_end/common/Settings.js(541,18): error TS2339: Property 'horizontal' does not exist on type '{}'. @@ -3788,9 +3804,6 @@ node_modules/chrome-devtools-frontend/front_end/components/DockController.js(70, node_modules/chrome-devtools-frontend/front_end/components/DockController.js(70,76): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/components/DockController.js(71,7): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/components/DockController.js(116,33): error TS2339: Property 'deepActiveElement' does not exist on type 'Document'. -node_modules/chrome-devtools-frontend/front_end/components/DockController.js(193,5): error TS2322: Type 'ToolbarButton' is not assignable to type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarButton'. node_modules/chrome-devtools-frontend/front_end/components/Linkifier.js(62,24): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/components/Linkifier.js(125,94): error TS2339: Property 'remove' does not exist on type 'Map'. node_modules/chrome-devtools-frontend/front_end/components/Linkifier.js(127,41): error TS2339: Property 'remove' does not exist on type 'Map'. @@ -3841,9 +3854,12 @@ node_modules/chrome-devtools-frontend/front_end/components/Linkifier.js(732,19): node_modules/chrome-devtools-frontend/front_end/components/Linkifier.js(739,30): error TS2339: Property 'value' does not exist on type 'EventTarget'. node_modules/chrome-devtools-frontend/front_end/components/Linkifier.js(748,46): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/console/ConsoleContextSelector.js(8,9): error TS2339: Property 'ConsoleContextSelector' does not exist on type '{ new (): Console; prototype: Console; }'. -node_modules/chrome-devtools-frontend/front_end/console/ConsoleContextSelector.js(45,5): error TS2322: Type 'ToolbarItem' is not assignable to type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarItem' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarItem'. +node_modules/chrome-devtools-frontend/front_end/console/ConsoleContextSelector.js(36,55): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Type 'ConsoleContextSelector' is not assignable to type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Types of property 'modelAdded' are incompatible. + Type '(runtimeModel: RuntimeModel) => void' is not assignable to type '(model: T) => void'. + Types of parameters 'runtimeModel' and 'model' are incompatible. + Type 'T' is not assignable to type 'RuntimeModel'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleContextSelector.js(162,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleContextSelector.js(170,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleContextSelector.js(192,22): error TS2694: Namespace 'Common' has no exported member 'Event'. @@ -3925,7 +3941,7 @@ node_modules/chrome-devtools-frontend/front_end/console/ConsoleSidebar.js(111,9) node_modules/chrome-devtools-frontend/front_end/console/ConsoleSidebar.js(119,47): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleSidebar.js(122,25): error TS2345: Argument of type 'Element' is not assignable to parameter of type 'Icon'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleSidebar.js(133,9): error TS2339: Property 'ConsoleSidebar' does not exist on type '{ new (): Console; prototype: Console; }'. -node_modules/chrome-devtools-frontend/front_end/console/ConsoleSidebar.js(147,26): error TS2345: Argument of type 'Element[]' is not assignable to parameter of type 'Icon[]'. +node_modules/chrome-devtools-frontend/front_end/console/ConsoleSidebar.js(147,27): error TS2322: Type 'Element' is not assignable to type 'Icon'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleSidebar.js(177,60): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/console/ConsoleSidebar.js(179,61): error TS2339: Property 'ConsoleSidebar' does not exist on type '{ new (): Console; prototype: Console; }'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleSidebar.js(209,41): error TS2339: Property 'asParsedURL' does not exist on type 'string'. @@ -3957,23 +3973,10 @@ node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(42,41): e node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(45,33): error TS2339: Property 'ConsoleSidebar' does not exist on type '{ new (): Console; prototype: Console; }'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(46,44): error TS2339: Property 'ConsoleSidebar' does not exist on type '{ new (): Console; prototype: Console; }'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(48,32): error TS2339: Property 'ConsoleViewFilter' does not exist on type '{ new (): Console; prototype: Console; }'. -node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(63,33): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(88,44): error TS2694: Namespace 'Console.ConsoleView' has no exported member 'RegexMatchRange'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(92,48): error TS2339: Property 'ConsoleContextSelector' does not exist on type '{ new (): Console; prototype: Console; }'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(98,67): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(102,87): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(104,31): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(111,31): error TS2345: Argument of type 'ToolbarSettingCheckbox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSettingCheckbox' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(112,31): error TS2345: Argument of type 'ToolbarItem' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarItem' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarItem'. -node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(114,31): error TS2345: Argument of type 'ToolbarText' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarText' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(116,31): error TS2345: Argument of type 'ToolbarSettingToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSettingToggle' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(119,53): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(120,9): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(123,9): error TS2555: Expected at least 2 arguments, but got 1. @@ -3981,20 +3984,6 @@ node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(126,9): e node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(127,9): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(129,58): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(130,9): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(141,43): error TS2345: Argument of type 'ToolbarSettingCheckbox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSettingCheckbox' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(142,43): error TS2345: Argument of type 'ToolbarSettingCheckbox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSettingCheckbox' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(143,43): error TS2345: Argument of type 'ToolbarSettingCheckbox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSettingCheckbox' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(145,45): error TS2345: Argument of type 'ToolbarSettingCheckbox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSettingCheckbox' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(149,44): error TS2345: Argument of type 'ToolbarSettingCheckbox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSettingCheckbox' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(150,44): error TS2345: Argument of type 'ToolbarSettingCheckbox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSettingCheckbox' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(151,44): error TS2345: Argument of type 'ToolbarSettingCheckbox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSettingCheckbox' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(157,34): error TS2339: Property 'ConsoleViewport' does not exist on type '{ new (): Console; prototype: Console; }'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(169,30): error TS2339: Property 'ConsoleGroup' does not exist on type '{ new (): Console; prototype: Console; }'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(185,56): error TS2339: Property 'ConsoleViewMessage' does not exist on type '{ new (): Console; prototype: Console; }'. @@ -4034,6 +4023,7 @@ node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(674,42): node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(675,22): error TS2339: Property 'hasSelection' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(677,11): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(683,11): error TS2555: Expected at least 2 arguments, but got 1. +node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(691,25): error TS2339: Property 'asParsedURL' does not exist on type 'string'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(692,27): error TS2339: Property 'sprintf' does not exist on type 'StringConstructor'. node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(696,32): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/console/ConsoleView.js(757,22): error TS2339: Property 'window' does not exist on type 'Element'. @@ -4317,9 +4307,6 @@ node_modules/chrome-devtools-frontend/front_end/console_counters/WarningErrorCou node_modules/chrome-devtools-frontend/front_end/console_counters/WarningErrorCounter.js(42,21): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/console_counters/WarningErrorCounter.js(58,5): error TS2322: Type 'number' is not assignable to type 'string'. node_modules/chrome-devtools-frontend/front_end/console_counters/WarningErrorCounter.js(84,19): error TS2339: Property 'title' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/console_counters/WarningErrorCounter.js(96,5): error TS2322: Type 'ToolbarItem' is not assignable to type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarItem' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarItem'. node_modules/chrome-devtools-frontend/front_end/console_model/ConsoleModel.js(173,9): error TS2339: Property '_pageLoadSequenceNumber' does not exist on type 'ConsoleMessage'. node_modules/chrome-devtools-frontend/front_end/console_model/ConsoleModel.js(193,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/console_model/ConsoleModel.js(196,70): error TS2694: Namespace 'Protocol' has no exported member 'Log'. @@ -4384,9 +4371,8 @@ node_modules/chrome-devtools-frontend/front_end/cookie_table/CookiesTable.js(65, node_modules/chrome-devtools-frontend/front_end/cookie_table/CookiesTable.js(67,16): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/cookie_table/CookiesTable.js(74,16): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/cookie_table/CookiesTable.js(81,16): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/cookie_table/CookiesTable.js(116,27): error TS2345: Argument of type '{ cookies: Cookie[]; }[]' is not assignable to parameter of type '{ folderName: string; cookies: Cookie[]; }[]'. - Type '{ cookies: Cookie[]; }' is not assignable to type '{ folderName: string; cookies: Cookie[]; }'. - Property 'folderName' is missing in type '{ cookies: Cookie[]; }'. +node_modules/chrome-devtools-frontend/front_end/cookie_table/CookiesTable.js(116,28): error TS2322: Type '{ cookies: Cookie[]; }' is not assignable to type '{ folderName: string; cookies: Cookie[]; }'. + Property 'folderName' is missing in type '{ cookies: Cookie[]; }'. node_modules/chrome-devtools-frontend/front_end/cookie_table/CookiesTable.js(320,33): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. node_modules/chrome-devtools-frontend/front_end/cookie_table/CookiesTable.js(320,52): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type. node_modules/chrome-devtools-frontend/front_end/cookie_table/CookiesTable.js(346,21): error TS2555: Expected at least 2 arguments, but got 1. @@ -4457,20 +4443,10 @@ node_modules/chrome-devtools-frontend/front_end/coverage/CoverageModel.js(427,31 node_modules/chrome-devtools-frontend/front_end/coverage/CoverageModel.js(428,31): error TS2694: Namespace 'Coverage' has no exported member 'CoverageSegment'. node_modules/chrome-devtools-frontend/front_end/coverage/CoverageModel.js(441,25): error TS2339: Property 'peekLast' does not exist on type '{ end: number; count: any; }[]'. node_modules/chrome-devtools-frontend/front_end/coverage/CoverageView.js(20,48): error TS2339: Property 'createChild' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/coverage/CoverageView.js(26,31): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/coverage/CoverageView.js(31,31): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/coverage/CoverageView.js(32,46): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/coverage/CoverageView.js(34,31): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/coverage/CoverageView.js(40,45): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/coverage/CoverageView.js(43,31): error TS2345: Argument of type 'ToolbarInput' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarInput' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/coverage/CoverageView.js(49,42): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/coverage/CoverageView.js(50,9): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/coverage/CoverageView.js(51,31): error TS2345: Argument of type 'ToolbarSettingCheckbox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSettingCheckbox' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/coverage/CoverageView.js(53,56): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/coverage/CoverageView.js(57,54): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/coverage/CoverageView.js(141,5): error TS2322: Type 'Timer' is not assignable to type 'number'. @@ -4760,10 +4736,9 @@ node_modules/chrome-devtools-frontend/front_end/data_grid/ViewportDataGrid.js(25 node_modules/chrome-devtools-frontend/front_end/data_grid/ViewportDataGrid.js(257,47): error TS2339: Property 'offsetHeight' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/data_grid/ViewportDataGrid.js(272,1): error TS8022: JSDoc '@extends' is not attached to a class. node_modules/chrome-devtools-frontend/front_end/data_grid/ViewportDataGrid.js(320,22): error TS2352: Conversion of type 'NODE_TYPE' to type 'ViewportDataGridNode' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. -node_modules/chrome-devtools-frontend/front_end/data_grid/ViewportDataGrid.js(334,9): error TS2322: Type 'NODE_TYPE[][]' is not assignable to type 'ViewportDataGridNode[][]'. -node_modules/chrome-devtools-frontend/front_end/data_grid/ViewportDataGrid.js(334,9): error TS2322: Type 'NODE_TYPE[][]' is not assignable to type 'ViewportDataGridNode[][]'. - Type 'NODE_TYPE[]' is not assignable to type 'ViewportDataGridNode[]'. - Type 'NODE_TYPE' is not assignable to type 'ViewportDataGridNode'. +node_modules/chrome-devtools-frontend/front_end/data_grid/ViewportDataGrid.js(334,21): error TS2322: Type 'NODE_TYPE[]' is not assignable to type 'ViewportDataGridNode[]'. +node_modules/chrome-devtools-frontend/front_end/data_grid/ViewportDataGrid.js(334,21): error TS2322: Type 'NODE_TYPE[]' is not assignable to type 'ViewportDataGridNode[]'. + Type 'NODE_TYPE' is not assignable to type 'ViewportDataGridNode'. node_modules/chrome-devtools-frontend/front_end/data_grid/ViewportDataGrid.js(363,15): error TS2339: Property 'parent' does not exist on type 'NODE_TYPE'. node_modules/chrome-devtools-frontend/front_end/data_grid/ViewportDataGrid.js(372,11): error TS2339: Property 'remove' does not exist on type 'NODE_TYPE'. node_modules/chrome-devtools-frontend/front_end/data_grid/ViewportDataGrid.js(373,11): error TS2339: Property 'parent' does not exist on type 'NODE_TYPE'. @@ -4833,9 +4808,6 @@ node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(279,45): node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(280,60): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(283,88): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(285,36): error TS2694: Namespace 'Adb' has no exported member 'PortForwardingRule'. -node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(286,5): error TS2322: Type 'ListWidget' is not assignable to type '{ renderItem(item: T, editable: boolean): Element; removeItemRequested(item: T, index: number): void; beginEdit(item: T): Editor; commitEdit(item: T, editor: Editor, isNew: boolean): void; } & { ...; }'. - Type 'ListWidget' is not assignable to type '{ renderItem(item: T, editable: boolean): Element; removeItemRequested(item: T, index: number): void; beginEdit(item: T): Editor; commitEdit(item: T, editor: Editor, isNew: boolean): void; }'. - Property 'renderItem' is missing in type 'ListWidget'. node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(290,31): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(293,43): error TS2694: Namespace 'Adb' has no exported member 'PortForwardingRule'. node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(297,29): error TS2555: Expected at least 2 arguments, but got 1. @@ -4862,9 +4834,6 @@ node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(461,11): node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(463,26): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(466,64): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(469,36): error TS2694: Namespace 'Adb' has no exported member 'PortForwardingRule'. -node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(470,5): error TS2322: Type 'ListWidget' is not assignable to type '{ renderItem(item: T, editable: boolean): Element; removeItemRequested(item: T, index: number): void; beginEdit(item: T): Editor; commitEdit(item: T, editor: Editor, isNew: boolean): void; } & { ...; }'. - Type 'ListWidget' is not assignable to type '{ renderItem(item: T, editable: boolean): Element; removeItemRequested(item: T, index: number): void; beginEdit(item: T): Editor; commitEdit(item: T, editor: Editor, isNew: boolean): void; }'. - Property 'renderItem' is missing in type 'ListWidget'. node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(475,24): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(475,70): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(478,43): error TS2694: Namespace 'Adb' has no exported member 'PortForwardingRule'. @@ -4911,8 +4880,6 @@ node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(745,44): node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(783,36): error TS2694: Namespace 'Devices.DevicesView' has no exported member 'PageSection'. node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(788,28): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(790,39): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(794,31): error TS2345: Argument of type 'ToolbarMenuButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarMenuButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(797,23): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(805,47): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/devices/DevicesView.js(806,47): error TS2555: Expected at least 2 arguments, but got 1. @@ -5155,9 +5122,6 @@ node_modules/chrome-devtools-frontend/front_end/elements/ClassesPaneWidget.js(13 node_modules/chrome-devtools-frontend/front_end/elements/ClassesPaneWidget.js(152,32): error TS2339: Property 'checked' does not exist on type 'EventTarget'. node_modules/chrome-devtools-frontend/front_end/elements/ClassesPaneWidget.js(203,36): error TS2339: Property 'valuesArray' does not exist on type 'Set'. node_modules/chrome-devtools-frontend/front_end/elements/ClassesPaneWidget.js(241,41): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/elements/ClassesPaneWidget.js(257,5): error TS2322: Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarToggle'. node_modules/chrome-devtools-frontend/front_end/elements/ClassesPaneWidget.js(291,94): error TS2339: Property 'addAll' does not exist on type 'Set'. node_modules/chrome-devtools-frontend/front_end/elements/ClassesPaneWidget.js(297,55): error TS2339: Property 'addAll' does not exist on type 'Set'. node_modules/chrome-devtools-frontend/front_end/elements/ClassesPaneWidget.js(299,57): error TS2339: Property 'valuesArray' does not exist on type 'Set'. @@ -5193,8 +5157,6 @@ node_modules/chrome-devtools-frontend/front_end/elements/ComputedStyleModel.js(1 node_modules/chrome-devtools-frontend/front_end/elements/ComputedStyleWidget.js(48,36): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/elements/ComputedStyleWidget.js(51,9): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/elements/ComputedStyleWidget.js(52,49): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/elements/ComputedStyleWidget.js(57,31): error TS2345: Argument of type 'ToolbarSettingCheckbox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSettingCheckbox' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/elements/ComputedStyleWidget.js(58,71): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/elements/ComputedStyleWidget.js(73,12): error TS2339: Property '_filterRegex' does not exist on type 'ComputedStyleWidget'. node_modules/chrome-devtools-frontend/front_end/elements/ComputedStyleWidget.js(91,24): error TS2345: Argument of type '(Promise | Promise)[]' is not assignable to parameter of type 'Iterable>'. @@ -5235,18 +5197,21 @@ node_modules/chrome-devtools-frontend/front_end/elements/ElementStatePaneWidget. node_modules/chrome-devtools-frontend/front_end/elements/ElementStatePaneWidget.js(51,16): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/elements/ElementStatePaneWidget.js(108,41): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/elements/ElementStatePaneWidget.js(109,26): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/elements/ElementStatePaneWidget.js(124,5): error TS2322: Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarToggle'. node_modules/chrome-devtools-frontend/front_end/elements/ElementsBreadcrumbs.js(12,46): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/elements/ElementsBreadcrumbs.js(86,37): error TS2339: Property 'nextSiblingElement' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/elements/ElementsBreadcrumbs.js(104,16): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/elements/ElementsBreadcrumbs.js(215,38): error TS2339: Property 'offsetWidth' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/elements/ElementsPanel.js(49,41): error TS2555: Expected at least 2 arguments, but got 1. +node_modules/chrome-devtools-frontend/front_end/elements/ElementsPanel.js(83,51): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Type 'ElementsPanel' is not assignable to type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Types of property 'modelAdded' are incompatible. + Type '(domModel: DOMModel) => void' is not assignable to type '(model: T) => void'. + Types of parameters 'domModel' and 'model' are incompatible. + Type 'T' is not assignable to type 'DOMModel'. node_modules/chrome-devtools-frontend/front_end/elements/ElementsPanel.js(90,32): error TS2339: Property 'addEventListener' does not exist on type 'typeof extensionServer'. node_modules/chrome-devtools-frontend/front_end/elements/ElementsPanel.js(98,57): error TS2339: Property 'runtime' does not exist on type 'Window'. -node_modules/chrome-devtools-frontend/front_end/elements/ElementsPanel.js(116,5): error TS2322: Type '{ tabbedPane(): TabbedPane; enableMoreTabsButton(): void; }' is not assignable to type '{ appendApplicableItems(locationName: string): void; appendView(view: { viewId(): string; title(): string; isCloseable(): boolean; isTransient(): boolean; toolbarItems(): Promise<({ item(): any & any; } & { ...; })[]>; widget(): Promise<...>; disposeView(): void; }, insertBefore?: { ...; }): void; showView(view: { ....'. -node_modules/chrome-devtools-frontend/front_end/elements/ElementsPanel.js(116,5): error TS2322: Type '{ tabbedPane(): TabbedPane; enableMoreTabsButton(): void; }' is not assignable to type '{ appendApplicableItems(locationName: string): void; appendView(view: { viewId(): string; title(): string; isCloseable(): boolean; isTransient(): boolean; toolbarItems(): Promise<({ item(): any & any; } & { ...; })[]>; widget(): Promise<...>; disposeView(): void; }, insertBefore?: { ...; }): void; showView(view: { ....'. +node_modules/chrome-devtools-frontend/front_end/elements/ElementsPanel.js(116,5): error TS2322: Type '{ tabbedPane(): TabbedPane; enableMoreTabsButton(): void; }' is not assignable to type '{ appendApplicableItems(locationName: string): void; appendView(view: { viewId(): string; title(): string; isCloseable(): boolean; isTransient(): boolean; toolbarItems(): Promise; widget(): Promise<...>; disposeView(): void; }, insertBefore?: { ...; }): void; showView(view: { ...; }, insertBefore?: { ...'. +node_modules/chrome-devtools-frontend/front_end/elements/ElementsPanel.js(116,5): error TS2322: Type '{ tabbedPane(): TabbedPane; enableMoreTabsButton(): void; }' is not assignable to type '{ appendApplicableItems(locationName: string): void; appendView(view: { viewId(): string; title(): string; isCloseable(): boolean; isTransient(): boolean; toolbarItems(): Promise; widget(): Promise<...>; disposeView(): void; }, insertBefore?: { ...; }): void; showView(view: { ...; }, insertBefore?: { ...'. Property 'appendApplicableItems' is missing in type '{ tabbedPane(): TabbedPane; enableMoreTabsButton(): void; }'. node_modules/chrome-devtools-frontend/front_end/elements/ElementsPanel.js(159,24): error TS2339: Property 'remove' does not exist on type 'ElementsTreeOutline[]'. node_modules/chrome-devtools-frontend/front_end/elements/ElementsPanel.js(180,12): error TS2339: Property 'removeChildren' does not exist on type 'Element'. @@ -5438,6 +5403,10 @@ node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeOutline.js( node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeOutline.js(566,29): error TS2339: Property 'naturalHeight' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeOutline.js(567,26): error TS2339: Property 'currentSrc' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeOutline.js(594,19): error TS2339: Property 'hovered' does not exist on type 'TreeElement'. +node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeOutline.js(608,30): error TS2345: Argument of type '{ mode: string; showInfo: boolean; }' is not assignable to parameter of type '{ mode: string; showInfo: boolean; selectors: string; }'. + Property 'selectors' is missing in type '{ mode: string; showInfo: boolean; }'. +node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeOutline.js(614,22): error TS2345: Argument of type '{ mode: string; showInfo: boolean; }' is not assignable to parameter of type '{ mode: string; showInfo: boolean; selectors: string; }'. + Property 'selectors' is missing in type '{ mode: string; showInfo: boolean; }'. node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeOutline.js(755,33): error TS2339: Property 'enclosingNodeOrSelfWithClass' does not exist on type 'EventTarget'. node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeOutline.js(758,36): error TS2339: Property 'enclosingNodeOrSelfWithClass' does not exist on type 'EventTarget'. node_modules/chrome-devtools-frontend/front_end/elements/ElementsTreeOutline.js(813,22): error TS2339: Property 'index' does not exist on type 'DOMNode'. @@ -5488,7 +5457,12 @@ node_modules/chrome-devtools-frontend/front_end/elements/EventListenersWidget.js node_modules/chrome-devtools-frontend/front_end/elements/EventListenersWidget.js(73,15): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/elements/EventListenersWidget.js(77,46): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/elements/EventListenersWidget.js(129,52): error TS2339: Property 'value' does not exist on type 'EventTarget'. -node_modules/chrome-devtools-frontend/front_end/elements/InspectElementModeController.js(52,5): error TS2554: Expected 2 arguments, but got 1. +node_modules/chrome-devtools-frontend/front_end/elements/InspectElementModeController.js(40,55): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Type 'InspectElementModeController' is not assignable to type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Types of property 'modelAdded' are incompatible. + Type '(overlayModel: OverlayModel) => void' is not assignable to type '(model: T) => void'. + Types of parameters 'overlayModel' and 'model' are incompatible. + Type 'T' is not assignable to type 'OverlayModel'. node_modules/chrome-devtools-frontend/front_end/elements/InspectElementModeController.js(91,24): error TS2694: Namespace 'Protocol' has no exported member 'Overlay'. node_modules/chrome-devtools-frontend/front_end/elements/MetricsSidebarPane.js(56,27): error TS2339: Property 'removeChildren' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/elements/MetricsSidebarPane.js(82,24): error TS2345: Argument of type '(Promise> | Promise)[]' is not assignable to parameter of type 'Iterable | PromiseLike>>'. @@ -5550,10 +5524,12 @@ node_modules/chrome-devtools-frontend/front_end/elements/PropertiesWidget.js(153 node_modules/chrome-devtools-frontend/front_end/elements/PropertiesWidget.js(162,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/elements/StylePropertyHighlighter.js(29,25): error TS2339: Property 'property' does not exist on type 'TreeElement'. node_modules/chrome-devtools-frontend/front_end/elements/StylePropertyHighlighter.js(43,42): error TS2339: Property 'scrollIntoViewIfNeeded' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/elements/StylePropertyHighlighter.js(45,9): error TS2345: Argument of type '{ offset: number; backgroundColor: string; }[]' is not assignable to parameter of type 'PropertyIndexedKeyframes | Keyframe[]'. - Type '{ offset: number; backgroundColor: string; }[]' is not assignable to type 'Keyframe[]'. - Type '{ offset: number; backgroundColor: string; }' is not assignable to type 'Keyframe'. - Property 'alignContent' is missing in type '{ offset: number; backgroundColor: string; }'. +node_modules/chrome-devtools-frontend/front_end/elements/StylePropertyHighlighter.js(46,11): error TS2322: Type '{ offset: number; backgroundColor: string; }' is not assignable to type 'string | string[] | Keyframe'. + Type '{ offset: number; backgroundColor: string; }' is not assignable to type 'string'. +node_modules/chrome-devtools-frontend/front_end/elements/StylePropertyHighlighter.js(47,11): error TS2322: Type '{ offset: number; backgroundColor: string; }' is not assignable to type 'string | string[] | Keyframe'. + Type '{ offset: number; backgroundColor: string; }' is not assignable to type 'string'. +node_modules/chrome-devtools-frontend/front_end/elements/StylePropertyHighlighter.js(47,69): error TS2322: Type '{ offset: number; backgroundColor: string; }' is not assignable to type 'string | string[] | Keyframe'. + Type '{ offset: number; backgroundColor: string; }' is not assignable to type 'string'. node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(35,18): error TS2339: Property 'tabIndex' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(50,51): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(69,32): error TS2339: Property '_instance' does not exist on type 'typeof StylesSidebarPane'. @@ -5619,12 +5595,8 @@ node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(95 node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(957,30): error TS2339: Property 'tabIndex' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(962,44): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(964,29): error TS2339: Property 'tabIndex' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(970,40): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(972,43): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(973,24): error TS2339: Property 'tabIndex' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(974,38): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(1019,61): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(1021,51): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(1022,35): error TS2339: Property 'selectorText' does not exist on type 'CSSRule'. @@ -5782,9 +5754,6 @@ node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(32 node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(3302,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(3305,32): error TS2339: Property '_instance' does not exist on type 'typeof StylesSidebarPane'. node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(3312,32): error TS2339: Property '_instance' does not exist on type 'typeof StylesSidebarPane'. -node_modules/chrome-devtools-frontend/front_end/elements/StylesSidebarPane.js(3320,5): error TS2322: Type 'ToolbarButton' is not assignable to type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarButton'. node_modules/chrome-devtools-frontend/front_end/elements_test_runner/EditDOMTestRunner.js(15,5): error TS2304: Cannot find name 'eventSender'. node_modules/chrome-devtools-frontend/front_end/elements_test_runner/EditDOMTestRunner.js(19,37): error TS2339: Property 'elements' does not exist on type 'any[]'. node_modules/chrome-devtools-frontend/front_end/elements_test_runner/ElementsTestRunner.js(112,55): error TS2339: Property 'eventListener' does not exist on type 'TreeElement'. @@ -5817,6 +5786,12 @@ node_modules/chrome-devtools-frontend/front_end/emulation/AdvancedApp.js(199,5): Property '_rootSplitWidget' does not exist on type '{ presentUI(document: Document): void; }'. node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeModel.js(9,1): error TS8022: JSDoc '@extends' is not attached to a class. node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeModel.js(56,42): error TS2694: Namespace 'Emulation.EmulatedDevice' has no exported member 'Mode'. +node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeModel.js(67,57): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Type 'DeviceModeModel' is not assignable to type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Types of property 'modelAdded' are incompatible. + Type '(emulationModel: EmulationModel) => void' is not assignable to type '(model: T) => void'. + Types of parameters 'emulationModel' and 'model' are incompatible. + Type 'T' is not assignable to type 'EmulationModel'. node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeModel.js(75,34): error TS2365: Operator '>=' cannot be applied to types 'string' and 'number'. node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeModel.js(76,9): error TS2365: Operator '<=' cannot be applied to types 'string' and 'number'. node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeModel.js(86,59): error TS2365: Operator '>=' cannot be applied to types 'string' and 'number'. @@ -5834,8 +5809,6 @@ node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeModel.js(715 node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(25,74): error TS2694: Namespace 'Emulation.EmulatedDevice' has no exported member 'Mode'. node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(33,39): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(43,40): error TS2339: Property 'createChild' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(87,31): error TS2345: Argument of type 'ToolbarMenuButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarMenuButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(95,16): error TS2339: Property 'maxLength' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(96,16): error TS2339: Property 'title' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(96,24): error TS2555: Expected at least 2 arguments, but got 1. @@ -5843,21 +5816,9 @@ node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(1 node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(110,17): error TS2339: Property 'title' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(110,25): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(148,30): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(152,31): error TS2345: Argument of type 'ToolbarMenuButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarMenuButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(158,36): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(162,31): error TS2345: Argument of type 'ToolbarMenuButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarMenuButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(168,27): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(172,31): error TS2345: Argument of type 'ToolbarMenuButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarMenuButton' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(175,31): error TS2345: Argument of type 'ToolbarMenuButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarMenuButton' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(186,31): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(194,32): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(195,31): error TS2345: Argument of type 'ToolbarMenuButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarMenuButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(211,26): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(212,26): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(213,26): error TS2555: Expected at least 2 arguments, but got 1. @@ -5877,11 +5838,6 @@ node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(3 node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(302,71): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(303,9): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(305,44): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(338,5): error TS2322: Type 'ToolbarItem' is not assignable to type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarItem' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(338,5): error TS2322: Type 'ToolbarItem' is not assignable to type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarItem' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarItem'. node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(392,9): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(397,9): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/emulation/DeviceModeToolbar.js(441,22): error TS2694: Namespace 'Common' has no exported member 'Event'. @@ -5970,6 +5926,12 @@ node_modules/chrome-devtools-frontend/front_end/emulation/EmulatedDevices.js(470 node_modules/chrome-devtools-frontend/front_end/emulation/InspectedPagePlaceholder.js(21,20): error TS2339: Property 'window' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/emulation/InspectedPagePlaceholder.js(22,35): error TS2339: Property 'window' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/emulation/InspectedPagePlaceholder.js(72,15): error TS2339: Property 'singleton' does not exist on type 'Window'. +node_modules/chrome-devtools-frontend/front_end/emulation/MediaQueryInspector.js(25,51): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Type 'MediaQueryInspector' is not assignable to type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Types of property 'modelAdded' are incompatible. + Type '(cssModel: CSSModel) => void' is not assignable to type '(model: T) => void'. + Types of parameters 'cssModel' and 'model' are incompatible. + Type 'T' is not assignable to type 'CSSModel'. node_modules/chrome-devtools-frontend/front_end/emulation/MediaQueryInspector.js(74,41): error TS2339: Property 'enclosingNodeOrSelfWithClass' does not exist on type 'EventTarget'. node_modules/chrome-devtools-frontend/front_end/emulation/MediaQueryInspector.js(101,41): error TS2339: Property 'enclosingNodeOrSelfWithClass' does not exist on type 'EventTarget'. node_modules/chrome-devtools-frontend/front_end/emulation/MediaQueryInspector.js(111,31): error TS2339: Property 'sprintf' does not exist on type 'StringConstructor'. @@ -6094,60 +6056,18 @@ node_modules/chrome-devtools-frontend/front_end/event_listeners/EventListenersVi node_modules/chrome-devtools-frontend/front_end/event_listeners/EventListenersView.js(301,29): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/event_listeners/EventListenersView.js(311,13): error TS2339: Property 'consume' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/event_listeners/EventListenersView.js(321,13): error TS2339: Property 'consume' does not exist on type 'Event'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(130,25): error TS2339: Property 'sendRequest' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(132,23): error TS2339: Property 'registerHandler' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(132,68): error TS2339: Property '_dispatch' does not exist on type 'EventSinkImpl'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(145,25): error TS2339: Property 'sendRequest' does not exist on type 'ExtensionServerClient'. node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(149,19): error TS1110: Type expected. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(161,14): error TS2339: Property '_fire' does not exist on type 'EventSinkImpl'. node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(186,12): error TS2339: Property '_fire' does not exist on type 'EventSinkImpl'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(203,23): error TS2339: Property 'sendRequest' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(207,23): error TS2339: Property 'sendRequest' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(224,23): error TS2339: Property 'sendRequest' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(241,12): error TS2339: Property '__defineGetter__' does not exist on type 'Panels'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(243,23): error TS2339: Property 'sendRequest' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(249,53): error TS2339: Property 'nextObjectId' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(251,23): error TS2339: Property 'sendRequest' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(255,40): error TS2339: Property 'hasHandler' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(268,25): error TS2339: Property 'unregisterHandler' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(270,25): error TS2339: Property 'registerHandler' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(274,25): error TS2339: Property 'sendRequest' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(278,23): error TS2339: Property 'sendRequest' does not exist on type 'ExtensionServerClient'. node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(298,14): error TS2339: Property '_fire' does not exist on type 'EventSinkImpl'. node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(300,14): error TS2339: Property '_fire' does not exist on type 'EventSinkImpl'. node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(314,12): error TS8022: JSDoc '@extends' is not attached to a class. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(322,55): error TS2339: Property 'nextObjectId' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(327,23): error TS2339: Property 'sendRequest' does not exist on type 'ExtensionServerClient'. node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(371,12): error TS8022: JSDoc '@extends' is not attached to a class. node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(381,12): error TS8022: JSDoc '@extends' is not attached to a class. node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(391,12): error TS8022: JSDoc '@extends' is not attached to a class. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(401,44): error TS2339: Property 'nextObjectId' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(404,21): error TS2339: Property '_id' does not exist on type 'ExtensionPanelImpl'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(410,23): error TS2339: Property 'sendRequest' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(418,60): error TS2339: Property '_id' does not exist on type 'ExtensionPanelImpl'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(419,23): error TS2339: Property 'sendRequest' does not exist on type 'ExtensionServerClient'. node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(429,12): error TS8022: JSDoc '@extends' is not attached to a class. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(435,23): error TS2339: Property 'sendRequest' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(448,23): error TS2339: Property 'sendRequest' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(452,23): error TS2339: Property 'sendRequest' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(457,23): error TS2339: Property 'sendRequest' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(475,23): error TS2339: Property 'sendRequest' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(492,62): error TS2339: Property 'nextObjectId' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(493,23): error TS2339: Property 'sendRequest' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(515,23): error TS2339: Property 'sendRequest' does not exist on type 'ExtensionServerClient'. node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(529,12): error TS2339: Property '_fire' does not exist on type 'EventSinkImpl'. node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(544,12): error TS2339: Property '_fire' does not exist on type 'EventSinkImpl'. node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(551,12): error TS2339: Property '_fire' does not exist on type 'EventSinkImpl'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(569,23): error TS2339: Property 'sendRequest' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(586,23): error TS2339: Property 'sendRequest' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(597,23): error TS2339: Property 'sendRequest' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(623,23): error TS2339: Property 'sendRequest' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(627,23): error TS2339: Property 'sendRequest' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(662,21): error TS2339: Property 'sendRequest' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(678,10): error TS2339: Property 'registerHandler' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(678,43): error TS2551: Property '_onCallback' does not exist on type 'ExtensionServerClient'. Did you mean '_callbacks'? -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(682,49): error TS2339: Property '_onMessage' does not exist on type 'ExtensionServerClient'. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(695,34): error TS2339: Property '_registerCallback' does not exist on type 'ExtensionServerClient'. node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(789,21): error TS2339: Property 'exposeWebInspectorNamespace' does not exist on type 'ExtensionDescriptor'. node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionAPI.js(790,12): error TS2339: Property 'webInspector' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionPanel.js(232,23): error TS2339: Property 'style' does not exist on type 'Element'. @@ -6160,9 +6080,6 @@ node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(16 node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(219,43): error TS2694: Namespace 'Protocol' has no exported member 'Network'. node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(244,54): error TS2339: Property 'traverseNextNode' does not exist on type 'HTMLElement'. node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(245,27): error TS2693: 'ShadowRoot' only refers to a type, but is being used as a value here. -node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(290,77): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarButton'. node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(463,53): error TS2345: Argument of type '{ url: string; type: string; }' is not assignable to parameter of type '{ contentURL(): string; contentType(): ResourceType; contentEncoded(): Promise; requestContent(): Promise; searchInContent(query: string, caseSensitive: boolean, isRegex: boolean): Promise<...>; }'. Property 'contentURL' is missing in type '{ url: string; type: string; }'. node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(471,22): error TS2339: Property 'valuesArray' does not exist on type 'Map; requestContent(): Promise; searchInContent(query: string, caseSensitive: boolean, isRegex: boolean): Promise<...>; }>'. @@ -6181,6 +6098,16 @@ node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(71 node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(765,31): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(777,31): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(839,43): error TS2694: Namespace 'Extensions.ExtensionStatus' has no exported member 'Record'. +node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(881,30): error TS2339: Property 'resourceTreeModel' does not exist on type 'true | ResourceTreeFrame'. + Property 'resourceTreeModel' does not exist on type 'true'. +node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(886,48): error TS2339: Property 'id' does not exist on type 'true | ResourceTreeFrame'. + Property 'id' does not exist on type 'true'. +node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(891,113): error TS2339: Property 'url' does not exist on type 'true | ResourceTreeFrame'. + Property 'url' does not exist on type 'true'. +node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(897,48): error TS2339: Property 'id' does not exist on type 'true | ResourceTreeFrame'. + Property 'id' does not exist on type 'true'. +node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(901,44): error TS2339: Property 'url' does not exist on type 'true | ResourceTreeFrame'. + Property 'url' does not exist on type 'true'. node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(918,34): error TS2694: Namespace 'SDK.RuntimeModel' has no exported member 'EvaluationResult'. node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(976,45): error TS2694: Namespace 'Extensions.ExtensionStatus' has no exported member 'Record'. node_modules/chrome-devtools-frontend/front_end/extensions/ExtensionServer.js(983,59): error TS2339: Property 'vsprintf' does not exist on type 'StringConstructor'. @@ -6858,7 +6785,6 @@ node_modules/chrome-devtools-frontend/front_end/layer_viewer/LayerViewHost.js(13 node_modules/chrome-devtools-frontend/front_end/layer_viewer/LayerViewHost.js(149,34): error TS2339: Property '_snapshot' does not exist on type 'Selection'. node_modules/chrome-devtools-frontend/front_end/layer_viewer/LayerViewHost.js(153,20): error TS2694: Namespace 'SDK' has no exported member 'SnapshotWithRect'. node_modules/chrome-devtools-frontend/front_end/layer_viewer/LayerViewHost.js(231,9): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/layer_viewer/LayerViewHost.js(235,7): error TS2554: Expected 3 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(44,30): error TS2339: Property 'createTextChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(44,46): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(54,47): error TS2339: Property 'createChild' does not exist on type 'Element'. @@ -6897,8 +6823,6 @@ node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(626 node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(641,21): error TS2339: Property 'clientX' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(642,22): error TS2339: Property 'clientY' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(670,22): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(672,31): error TS2345: Argument of type 'ToolbarSettingCheckbox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSettingCheckbox' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(693,9): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(697,11): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/layer_viewer/Layers3DView.js(708,15): error TS2339: Property 'which' does not exist on type 'Event'. @@ -6954,14 +6878,8 @@ node_modules/chrome-devtools-frontend/front_end/layer_viewer/PaintProfilerView.j node_modules/chrome-devtools-frontend/front_end/layer_viewer/TransformController.js(19,22): error TS2339: Property 'tabIndex' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/layer_viewer/TransformController.js(20,20): error TS2339: Property 'tabIndex' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/layer_viewer/TransformController.js(35,48): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/layer_viewer/TransformController.js(39,51): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/layer_viewer/TransformController.js(40,51): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/layer_viewer/TransformController.js(44,51): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/layer_viewer/TransformController.js(48,44): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/layer_viewer/TransformController.js(50,49): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/layer_viewer/TransformController.js(128,18): error TS2339: Property 'focus' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/layer_viewer/TransformController.js(144,18): error TS2339: Property 'focus' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/layer_viewer/TransformController.js(154,26): error TS2339: Property 'constrain' does not exist on type 'NumberConstructor'. @@ -7018,11 +6936,6 @@ node_modules/chrome-devtools-frontend/front_end/main/Main.js(192,32): error TS25 node_modules/chrome-devtools-frontend/front_end/main/Main.js(193,32): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/main/Main.js(194,32): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/main/Main.js(195,32): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/main/Main.js(204,5): error TS2322: Type 'CSSWorkspaceBinding' is not assignable to type '{ rawLocationToUILocation(rawLocation: CSSLocation): UILocation; uiLocationToRawLocations(uiLocation: UILocation): CSSLocation[]; } & { rawLocationToUILocation(rawLocation: CSSLocation): UILocation; uiLocationToRawLocations(uiLocation: UILocation): CSSLocation[]; }'. - Type 'CSSWorkspaceBinding' is not assignable to type '{ rawLocationToUILocation(rawLocation: CSSLocation): UILocation; uiLocationToRawLocations(uiLocation: UILocation): CSSLocation[]; }'. -node_modules/chrome-devtools-frontend/front_end/main/Main.js(204,5): error TS2322: Type 'CSSWorkspaceBinding' is not assignable to type '{ rawLocationToUILocation(rawLocation: CSSLocation): UILocation; uiLocationToRawLocations(uiLocation: UILocation): CSSLocation[]; } & { rawLocationToUILocation(rawLocation: CSSLocation): UILocation; uiLocationToRawLocations(uiLocation: UILocation): CSSLocation[]; }'. - Type 'CSSWorkspaceBinding' is not assignable to type '{ rawLocationToUILocation(rawLocation: CSSLocation): UILocation; uiLocationToRawLocations(uiLocation: UILocation): CSSLocation[]; }'. - Property '_workspace' does not exist on type '{ rawLocationToUILocation(rawLocation: CSSLocation): UILocation; uiLocationToRawLocations(uiLocation: UILocation): CSSLocation[]; }'. node_modules/chrome-devtools-frontend/front_end/main/Main.js(208,5): error TS2322: Type 'ExtensionServer' is not assignable to type 'typeof extensionServer'. node_modules/chrome-devtools-frontend/front_end/main/Main.js(208,5): error TS2322: Type 'ExtensionServer' is not assignable to type 'typeof extensionServer'. Property '_extensionAPITestHook' is missing in type 'ExtensionServer'. @@ -7050,23 +6963,12 @@ node_modules/chrome-devtools-frontend/front_end/main/Main.js(472,12): error TS23 node_modules/chrome-devtools-frontend/front_end/main/Main.js(473,12): error TS2339: Property 'inspectorAgent' does not exist on type 'Target'. node_modules/chrome-devtools-frontend/front_end/main/Main.js(567,65): error TS2339: Property 'deepActiveElement' does not exist on type 'Document'. node_modules/chrome-devtools-frontend/front_end/main/Main.js(591,25): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/main/Main.js(599,5): error TS2322: Type 'ToolbarMenuButton' is not assignable to type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarMenuButton' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarMenuButton'. node_modules/chrome-devtools-frontend/front_end/main/Main.js(608,42): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/main/Main.js(609,34): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/main/Main.js(616,41): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/main/Main.js(617,41): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/main/Main.js(618,40): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/main/Main.js(619,39): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/main/Main.js(636,41): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/main/Main.js(637,41): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/main/Main.js(638,41): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/main/Main.js(639,41): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/main/Main.js(653,44): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/main/Main.js(654,44): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/main/Main.js(656,68): error TS2555: Expected at least 2 arguments, but got 1. @@ -7074,9 +6976,6 @@ node_modules/chrome-devtools-frontend/front_end/main/Main.js(657,27): error TS23 node_modules/chrome-devtools-frontend/front_end/main/Main.js(668,69): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/main/Main.js(682,32): error TS2339: Property 'createChild' does not exist on type 'DocumentFragment'. node_modules/chrome-devtools-frontend/front_end/main/Main.js(685,27): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/main/Main.js(702,5): error TS2322: Type 'ToolbarItem' is not assignable to type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarItem' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarItem'. node_modules/chrome-devtools-frontend/front_end/main/Main.js(721,22): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/main/Main.js(724,22): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/main/Main.js(727,22): error TS2555: Expected at least 2 arguments, but got 1. @@ -7108,6 +7007,7 @@ node_modules/chrome-devtools-frontend/front_end/main/RenderingOptions.js(52,25): node_modules/chrome-devtools-frontend/front_end/main/RenderingOptions.js(57,42): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/main/RenderingOptions.js(58,51): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/main/RenderingOptions.js(59,47): error TS2555: Expected at least 2 arguments, but got 1. +node_modules/chrome-devtools-frontend/front_end/main/RequestAppBannerActionDelegate.js(18,14): error TS2339: Property 'pageAgent' does not exist on type 'Target'. node_modules/chrome-devtools-frontend/front_end/mobile_throttling/MobileThrottlingSelector.js(7,48): error TS2694: Namespace 'MobileThrottling' has no exported member 'MobileThrottlingConditionsGroup'. node_modules/chrome-devtools-frontend/front_end/mobile_throttling/MobileThrottlingSelector.js(7,100): error TS2694: Namespace 'MobileThrottling' has no exported member 'ConditionsList'. node_modules/chrome-devtools-frontend/front_end/mobile_throttling/MobileThrottlingSelector.js(17,34): error TS2694: Namespace 'MobileThrottling' has no exported member 'ConditionsList'. @@ -7128,6 +7028,12 @@ node_modules/chrome-devtools-frontend/front_end/mobile_throttling/NetworkThrottl node_modules/chrome-devtools-frontend/front_end/mobile_throttling/ThrottlingManager.js(16,59): error TS2694: Namespace 'SDK.NetworkManager' has no exported member 'Conditions'. node_modules/chrome-devtools-frontend/front_end/mobile_throttling/ThrottlingManager.js(18,36): error TS2694: Namespace 'SDK.NetworkManager' has no exported member 'Conditions'. node_modules/chrome-devtools-frontend/front_end/mobile_throttling/ThrottlingManager.js(20,36): error TS2694: Namespace 'SDK.NetworkManager' has no exported member 'Conditions'. +node_modules/chrome-devtools-frontend/front_end/mobile_throttling/ThrottlingManager.js(28,57): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Type 'ThrottlingManager' is not assignable to type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Types of property 'modelAdded' are incompatible. + Type '(emulationModel: EmulationModel) => void' is not assignable to type '(model: T) => void'. + Types of parameters 'emulationModel' and 'model' are incompatible. + Type 'T' is not assignable to type 'EmulationModel'. node_modules/chrome-devtools-frontend/front_end/mobile_throttling/ThrottlingManager.js(44,42): error TS2694: Namespace 'MobileThrottling' has no exported member 'NetworkThrottlingConditionsGroup'. node_modules/chrome-devtools-frontend/front_end/mobile_throttling/ThrottlingManager.js(45,44): error TS2694: Namespace 'SDK.NetworkManager' has no exported member 'Conditions'. node_modules/chrome-devtools-frontend/front_end/mobile_throttling/ThrottlingManager.js(48,21): error TS2339: Property 'removeChildren' does not exist on type 'HTMLSelectElement'. @@ -7200,18 +7106,9 @@ node_modules/chrome-devtools-frontend/front_end/mobile_throttling/ThrottlingSett node_modules/chrome-devtools-frontend/front_end/mobile_throttling/ThrottlingSettingsTab.js(197,50): error TS2365: Operator '>=' cannot be applied to types 'string' and 'number'. node_modules/chrome-devtools-frontend/front_end/mobile_throttling/ThrottlingSettingsTab.js(197,64): error TS2365: Operator '<=' cannot be applied to types 'string' and 'number'. node_modules/chrome-devtools-frontend/front_end/network/BlockedURLsPane.js(18,32): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/network/BlockedURLsPane.js(19,37): error TS2345: Argument of type 'ToolbarCheckbox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarCheckbox' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/network/BlockedURLsPane.js(21,42): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/network/BlockedURLsPane.js(23,37): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/network/BlockedURLsPane.js(24,44): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/network/BlockedURLsPane.js(26,37): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/network/BlockedURLsPane.js(28,51): error TS2694: Namespace 'SDK.NetworkManager' has no exported member 'BlockedPattern'. -node_modules/chrome-devtools-frontend/front_end/network/BlockedURLsPane.js(29,5): error TS2322: Type 'ListWidget' is not assignable to type '{ renderItem(item: T, editable: boolean): Element; removeItemRequested(item: T, index: number): void; beginEdit(item: T): Editor; commitEdit(item: T, editor: Editor, isNew: boolean): void; } & { ...; }'. - Type 'ListWidget' is not assignable to type '{ renderItem(item: T, editable: boolean): Element; removeItemRequested(item: T, index: number): void; beginEdit(item: T): Editor; commitEdit(item: T, editor: Editor, isNew: boolean): void; }'. - Property 'renderItem' is missing in type 'ListWidget'. node_modules/chrome-devtools-frontend/front_end/network/BlockedURLsPane.js(35,58): error TS2694: Namespace 'SDK.NetworkManager' has no exported member 'BlockedPattern'. node_modules/chrome-devtools-frontend/front_end/network/BlockedURLsPane.js(52,39): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/network/BlockedURLsPane.js(53,47): error TS2555: Expected at least 2 arguments, but got 1. @@ -7356,6 +7253,12 @@ node_modules/chrome-devtools-frontend/front_end/network/NetworkLogView.js(114,37 node_modules/chrome-devtools-frontend/front_end/network/NetworkLogView.js(124,26): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/network/NetworkLogView.js(144,44): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/network/NetworkLogView.js(147,50): error TS2555: Expected at least 2 arguments, but got 1. +node_modules/chrome-devtools-frontend/front_end/network/NetworkLogView.js(152,57): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Type 'NetworkLogView' is not assignable to type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Types of property 'modelAdded' are incompatible. + Type '(networkManager: NetworkManager) => void' is not assignable to type '(model: T) => void'. + Types of parameters 'networkManager' and 'model' are incompatible. + Type 'T' is not assignable to type 'NetworkManager'. node_modules/chrome-devtools-frontend/front_end/network/NetworkLogView.js(174,46): error TS2694: Namespace 'Protocol' has no exported member 'Network'. node_modules/chrome-devtools-frontend/front_end/network/NetworkLogView.js(175,46): error TS2694: Namespace 'Protocol' has no exported member 'Network'. node_modules/chrome-devtools-frontend/front_end/network/NetworkLogView.js(184,38): error TS2694: Namespace 'Network.NetworkLogView' has no exported member 'Filter'. @@ -7384,7 +7287,6 @@ node_modules/chrome-devtools-frontend/front_end/network/NetworkLogView.js(905,5) node_modules/chrome-devtools-frontend/front_end/network/NetworkLogView.js(916,20): error TS2339: Property 'window' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/network/NetworkLogView.js(938,41): error TS2339: Property 'firstValue' does not exist on type 'Set'. node_modules/chrome-devtools-frontend/front_end/network/NetworkLogView.js(1074,22): error TS2694: Namespace 'Common' has no exported member 'Event'. -node_modules/chrome-devtools-frontend/front_end/network/NetworkLogView.js(1149,5): error TS2554: Expected 3 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/network/NetworkLogView.js(1150,69): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/network/NetworkLogView.js(1157,13): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/network/NetworkLogView.js(1162,13): error TS2555: Expected at least 2 arguments, but got 1. @@ -7405,6 +7307,7 @@ node_modules/chrome-devtools-frontend/front_end/network/NetworkLogView.js(1194,9 node_modules/chrome-devtools-frontend/front_end/network/NetworkLogView.js(1204,13): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/network/NetworkLogView.js(1214,13): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/network/NetworkLogView.js(1223,13): error TS2555: Expected at least 2 arguments, but got 1. +node_modules/chrome-devtools-frontend/front_end/network/NetworkLogView.js(1294,25): error TS2339: Property 'asParsedURL' does not exist on type 'string'. node_modules/chrome-devtools-frontend/front_end/network/NetworkLogView.js(1309,17): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/network/NetworkLogView.js(1314,17): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/network/NetworkLogView.js(1501,39): error TS2694: Namespace 'Network.NetworkLogView' has no exported member 'Filter'. @@ -7496,42 +7399,18 @@ node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(67,53): node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(79,41): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(140,55): error TS2339: Property 'runtime' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(158,22): error TS2694: Namespace 'Common' has no exported member 'Event'. -node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(167,42): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(169,44): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(171,42): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(174,66): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(175,42): error TS2345: Argument of type 'ToolbarSettingToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSettingToggle' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(177,42): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(180,35): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(183,67): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(184,9): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(185,42): error TS2345: Argument of type 'ToolbarSettingToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSettingToggle' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(188,69): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(189,9): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(190,42): error TS2345: Argument of type 'ToolbarSettingToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSettingToggle' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(192,42): error TS2345: Argument of type 'ToolbarSettingCheckbox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSettingCheckbox' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(193,61): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(196,42): error TS2345: Argument of type 'ToolbarSettingCheckbox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSettingCheckbox' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(197,35): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(198,9): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(201,48): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(202,9): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(203,42): error TS2345: Argument of type 'ToolbarSettingCheckbox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSettingCheckbox' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(206,42): error TS2345: Argument of type 'ToolbarCheckbox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarCheckbox' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(207,42): error TS2345: Argument of type 'ToolbarComboBox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarComboBox' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(209,42): error TS2345: Argument of type 'ToolbarItem' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarItem' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(274,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(287,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(291,7): error TS2322: Type 'Timer' is not assignable to type 'number'. @@ -7540,8 +7419,6 @@ node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(397,22): node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(404,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(412,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(420,22): error TS2694: Namespace 'Common' has no exported member 'Event'. -node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(438,61): error TS2345: Argument of type 'ToolbarItem' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarItem' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(520,46): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(523,22): error TS2339: Property 'isSelfOrDescendant' does not exist on type 'EventTarget'. node_modules/chrome-devtools-frontend/front_end/network/NetworkPanel.js(550,22): error TS2694: Namespace 'Common' has no exported member 'Event'. @@ -7694,13 +7571,7 @@ node_modules/chrome-devtools-frontend/front_end/network/ResourceWebSocketFrameVi node_modules/chrome-devtools-frontend/front_end/network/ResourceWebSocketFrameView.js(38,16): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/network/ResourceWebSocketFrameView.js(43,27): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/network/ResourceWebSocketFrameView.js(63,49): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/network/ResourceWebSocketFrameView.js(65,41): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/network/ResourceWebSocketFrameView.js(72,41): error TS2345: Argument of type 'ToolbarComboBox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarComboBox' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/network/ResourceWebSocketFrameView.js(76,49): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/network/ResourceWebSocketFrameView.js(78,41): error TS2345: Argument of type 'ToolbarInput' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarInput' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/network/ResourceWebSocketFrameView.js(86,49): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/network/ResourceWebSocketFrameView.js(99,11): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/network/ResourceWebSocketFrameView.js(100,46): error TS2555: Expected at least 2 arguments, but got 1. @@ -7724,6 +7595,17 @@ node_modules/chrome-devtools-frontend/front_end/network/ResourceWebSocketFrameVi node_modules/chrome-devtools-frontend/front_end/network_log/HAREntry.js(130,29): error TS2339: Property 'localizedFailDescription' does not exist on type 'NetworkRequest'. node_modules/chrome-devtools-frontend/front_end/network_log/HAREntry.js(150,36): error TS2694: Namespace 'NetworkLog.HAREntry' has no exported member 'Timing'. node_modules/chrome-devtools-frontend/front_end/network_log/HAREntry.js(319,21): error TS2339: Property 'Timing' does not exist on type 'typeof HAREntry'. +node_modules/chrome-devtools-frontend/front_end/network_log/NetworkLog.js(44,57): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Type 'NetworkLog' is not assignable to type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Types of property 'modelAdded' are incompatible. + Type '(networkManager: NetworkManager) => void' is not assignable to type '(model: T) => void'. + Types of parameters 'networkManager' and 'model' are incompatible. + Type 'T' is not assignable to type 'NetworkManager'. +node_modules/chrome-devtools-frontend/front_end/network_log/NetworkLog.js(99,59): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. +node_modules/chrome-devtools-frontend/front_end/network_log/NetworkLog.js(101,61): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Type 'NetworkLog' is not assignable to type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Types of property 'modelAdded' are incompatible. + Type '(networkManager: NetworkManager) => void' is not assignable to type '(model: T) => void'. node_modules/chrome-devtools-frontend/front_end/network_log/NetworkLog.js(123,24): error TS2694: Namespace 'Protocol' has no exported member 'Network'. node_modules/chrome-devtools-frontend/front_end/network_log/NetworkLog.js(154,49): error TS2694: Namespace 'NetworkLog.NetworkLog' has no exported member '_InitiatorInfo'. node_modules/chrome-devtools-frontend/front_end/network_log/NetworkLog.js(165,38): error TS2694: Namespace 'NetworkLog.NetworkLog' has no exported member '_InitiatorInfo'. @@ -7764,11 +7646,8 @@ node_modules/chrome-devtools-frontend/front_end/network_test_runner/NetworkTestR node_modules/chrome-devtools-frontend/front_end/network_test_runner/NetworkTestRunner.js(69,15): error TS2304: Cannot find name 'i'. node_modules/chrome-devtools-frontend/front_end/network_test_runner/NetworkTestRunner.js(69,36): error TS2304: Cannot find name 'i'. node_modules/chrome-devtools-frontend/front_end/network_test_runner/NetworkTestRunner.js(70,35): error TS2304: Cannot find name 'i'. -node_modules/chrome-devtools-frontend/front_end/network_test_runner/ProductRegistryTestRunner.js(38,22): error TS2345: Argument of type '{ hash: string; prefixes: {}; }[]' is not assignable to parameter of type '{ hash: string; prefixes: { [x: string]: { product: number; type: number; }; }; }[]'. - Type '{ hash: string; prefixes: {}; }' is not assignable to type '{ hash: string; prefixes: { [x: string]: { product: number; type: number; }; }; }'. - Types of property 'prefixes' are incompatible. - Type '{}' is not assignable to type '{ [x: string]: { product: number; type: number; }; }'. - Index signature is missing in type '{}'. +node_modules/chrome-devtools-frontend/front_end/network_test_runner/ProductRegistryTestRunner.js(38,81): error TS2322: Type '{}' is not assignable to type '{ [x: string]: { product: number; type: number; }; }'. + Index signature is missing in type '{}'. node_modules/chrome-devtools-frontend/front_end/object_ui/CustomPreviewComponent.js(31,20): error TS2339: Property 'classList' does not exist on type 'Node'. node_modules/chrome-devtools-frontend/front_end/object_ui/CustomPreviewComponent.js(94,30): error TS2694: Namespace 'Protocol' has no exported member 'Runtime'. node_modules/chrome-devtools-frontend/front_end/object_ui/CustomPreviewComponent.js(116,11): error TS2339: Property 'consume' does not exist on type 'Event'. @@ -8257,8 +8136,6 @@ node_modules/chrome-devtools-frontend/front_end/persistence/WorkspaceSettingsTab node_modules/chrome-devtools-frontend/front_end/persistence/WorkspaceSettingsTab.js(61,18): error TS2339: Property 'style' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/persistence/WorkspaceSettingsTab.js(112,26): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/persistence/WorkspaceSettingsTab.js(120,39): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/persistence/WorkspaceSettingsTab.js(122,31): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(30,30): error TS2304: Cannot find name 'Arguments'. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(31,5): error TS2300: Duplicate identifier 'ArrayLike'. node_modules/chrome-devtools-frontend/front_end/platform/utilities.js(46,18): error TS2339: Property 'findAll' does not exist on type 'String'. @@ -8362,25 +8239,427 @@ node_modules/chrome-devtools-frontend/front_end/product_registry/ProductRegistry node_modules/chrome-devtools-frontend/front_end/product_registry/ProductRegistry.js(34,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. node_modules/chrome-devtools-frontend/front_end/product_registry/ProductRegistry.js(55,41): error TS2694: Namespace 'ProductRegistry.Registry' has no exported member 'ProductEntry'. node_modules/chrome-devtools-frontend/front_end/product_registry/ProductRegistry.js(72,26): error TS2339: Property 'ProductEntry' does not exist on type '{ (): void; prototype: { nameForUrl: (parsedUrl: ParsedURL) => string; entryForUrl: (parsedUrl: ParsedURL) => any; typeForUrl: (parsedUrl: ParsedURL) => number; }; }'. -node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(1488,1): error TS2345: Argument of type '({ "hash": string; "prefixes": { "": { "product": number; "type": number; }; }; } | { "hash": string; "prefixes": { "*": { "product": number; "type": number; }; }; } | { "hash": string; "prefixes": { "": { "product": number; }; }; } | { "hash": string; "prefixes": { ...; }; } | ... 35 more ... | { ...; })[]' is not assignable to parameter of type '{ hash: string; prefixes: { [x: string]: { product: number; type: number; }; }; }[]'. - Type '{ "hash": string; "prefixes": { "": { "product": number; "type": number; }; }; } | { "hash": string; "prefixes": { "*": { "product": number; "type": number; }; }; } | { "hash": string; "prefixes": { "": { "product": number; }; }; } | { "hash": string; "prefixes": { ...; }; } | ... 35 more ... | { ...; }' is not assignable to type '{ hash: string; prefixes: { [x: string]: { product: number; type: number; }; }; }'. - Type '{ "hash": string; "prefixes": { "": { "product": number; }; }; }' is not assignable to type '{ hash: string; prefixes: { [x: string]: { product: number; type: number; }; }; }'. - Types of property 'prefixes' are incompatible. - Type '{ "": { "product": number; }; }' is not assignable to type '{ [x: string]: { product: number; type: number; }; }'. - Property '""' is incompatible with index signature. - Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. - Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(1559,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(1563,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(1604,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(1605,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(1606,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(1865,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2136,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2136,64): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2136,86): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2208,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2269,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2270,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2322,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2323,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2503,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2856,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2857,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2858,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2859,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2860,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2861,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2862,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2863,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2864,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(2865,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3126,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3572,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3573,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3574,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3575,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3576,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3747,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3748,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3770,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3771,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3772,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3773,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3774,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3775,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3776,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3780,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3819,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3826,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3873,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3874,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3957,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(3958,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4068,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4069,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4138,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4139,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4203,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4230,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4260,104): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4264,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4265,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4266,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4312,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4480,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4832,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4833,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4834,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(4835,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5127,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5137,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5159,70): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5175,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5186,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5202,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5249,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5522,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5523,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5524,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5525,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5539,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5565,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5612,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5613,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5614,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5615,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5616,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5617,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5618,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5619,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5684,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5789,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5820,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5852,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5858,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5859,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5860,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5970,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5971,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(5972,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6145,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6151,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6152,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6153,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6154,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6180,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6181,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6182,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6183,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6184,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6185,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6186,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6187,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6193,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6194,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6195,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6196,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6197,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6198,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6199,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6217,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6218,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6225,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6227,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6228,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6229,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6230,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6231,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6232,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6233,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6243,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6270,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6272,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6276,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6294,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6296,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6297,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6298,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6299,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6300,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6303,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6305,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6323,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6324,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6325,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6326,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6327,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6333,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6334,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6335,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6336,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6337,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6338,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6339,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6340,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6341,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6342,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6343,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6344,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6345,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6346,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6347,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6348,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6349,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6350,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6351,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6360,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6361,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6362,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6363,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6364,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6365,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6369,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6382,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6388,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6389,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6404,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6405,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6406,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6425,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6441,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6442,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6445,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6481,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6521,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6560,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6573,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6574,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6575,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6576,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6577,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6578,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6579,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6580,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6581,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6582,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6583,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6615,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6620,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6629,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6637,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6661,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6668,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6675,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6689,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6690,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6699,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6726,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6735,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6737,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6738,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. +node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryData.js(6741,42): error TS2322: Type '{ "product": number; }' is not assignable to type '{ product: number; type: number; }'. + Property 'type' is missing in type '{ "product": number; }'. node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryImpl.js(27,41): error TS2694: Namespace 'ProductRegistry.Registry' has no exported member 'ProductEntry'. node_modules/chrome-devtools-frontend/front_end/product_registry_impl/ProductRegistryImpl.js(103,67): error TS2694: Namespace 'ProductRegistry.Registry' has no exported member 'ProductEntry'. -node_modules/chrome-devtools-frontend/front_end/profiler/BottomUpProfileDataGrid.js(68,9): error TS2322: Type 'BottomUpProfileDataGridNode' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'BottomUpProfileDataGridNode' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. -node_modules/chrome-devtools-frontend/front_end/profiler/BottomUpProfileDataGrid.js(68,9): error TS2322: Type 'BottomUpProfileDataGridNode' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'BottomUpProfileDataGridNode' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Property 'formatValue' is missing in type 'BottomUpProfileDataGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/BottomUpProfileDataGrid.js(83,15): error TS2339: Property '_remainingNodeInfos' does not exist on type 'ProfileDataGridNode'. node_modules/chrome-devtools-frontend/front_end/profiler/BottomUpProfileDataGrid.js(196,26): error TS2339: Property 'UID' does not exist on type 'ProfileNode'. node_modules/chrome-devtools-frontend/front_end/profiler/BottomUpProfileDataGrid.js(197,23): error TS2339: Property 'UID' does not exist on type 'ProfileNode'. node_modules/chrome-devtools-frontend/front_end/profiler/BottomUpProfileDataGrid.js(212,68): error TS2339: Property 'UID' does not exist on type 'ProfileNode'. node_modules/chrome-devtools-frontend/front_end/profiler/BottomUpProfileDataGrid.js(219,40): error TS2339: Property 'UID' does not exist on type 'ProfileNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/BottomUpProfileDataGrid.js(253,19): error TS2339: Property '_takePropertiesFromProfileDataGridNode' does not exist on type 'ProfileDataGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/BottomUpProfileDataGrid.js(259,21): error TS2339: Property '_keepOnlyChild' does not exist on type 'ProfileDataGridNode'. node_modules/chrome-devtools-frontend/front_end/profiler/CPUProfileFlameChart.js(45,49): error TS2551: Property '_colorGenerator' does not exist on type 'typeof ProfileFlameChartDataProvider'. Did you mean 'colorGenerator'? node_modules/chrome-devtools-frontend/front_end/profiler/CPUProfileFlameChart.js(52,46): error TS2551: Property '_colorGenerator' does not exist on type 'typeof ProfileFlameChartDataProvider'. Did you mean 'colorGenerator'? node_modules/chrome-devtools-frontend/front_end/profiler/CPUProfileFlameChart.js(54,51): error TS2551: Property '_colorGenerator' does not exist on type 'typeof ProfileFlameChartDataProvider'. Did you mean 'colorGenerator'? @@ -8413,9 +8692,6 @@ node_modules/chrome-devtools-frontend/front_end/profiler/CPUProfileView.js(141,2 node_modules/chrome-devtools-frontend/front_end/profiler/CPUProfileView.js(144,49): error TS2694: Namespace 'SDK.CPUProfilerModel' has no exported member 'EventData'. node_modules/chrome-devtools-frontend/front_end/profiler/CPUProfileView.js(145,43): error TS2694: Namespace 'Protocol' has no exported member 'Profiler'. node_modules/chrome-devtools-frontend/front_end/profiler/CPUProfileView.js(159,26): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/profiler/CPUProfileView.js(212,65): error TS2345: Argument of type 'CPUProfileType' is not assignable to parameter of type '{ showProfile(profile: ProfileHeader): Widget; showObject(snapshotObjectId: any, perspectiveName: string): void; } & { showProfile(profile: ProfileHeader): Widget; showObject(snapshotObjectId: any, perspectiveName: string): void; }'. - Type 'CPUProfileType' is not assignable to type '{ showProfile(profile: ProfileHeader): Widget; showObject(snapshotObjectId: any, perspectiveName: string): void; }'. - Property 'showProfile' is missing in type 'CPUProfileType'. node_modules/chrome-devtools-frontend/front_end/profiler/CPUProfileView.js(225,25): error TS2694: Namespace 'Protocol' has no exported member 'Profiler'. node_modules/chrome-devtools-frontend/front_end/profiler/CPUProfileView.js(240,24): error TS2694: Namespace 'Protocol' has no exported member 'Profiler'. node_modules/chrome-devtools-frontend/front_end/profiler/CPUProfileView.js(390,21): error TS2339: Property 'secondsToString' does not exist on type 'NumberConstructor'. @@ -8440,9 +8716,6 @@ node_modules/chrome-devtools-frontend/front_end/profiler/HeapProfileView.js(82,7 node_modules/chrome-devtools-frontend/front_end/profiler/HeapProfileView.js(99,12): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapProfileView.js(103,12): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapProfileView.js(114,26): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/profiler/HeapProfileView.js(167,65): error TS2345: Argument of type 'SamplingHeapProfileType' is not assignable to parameter of type '{ showProfile(profile: ProfileHeader): Widget; showObject(snapshotObjectId: any, perspectiveName: string): void; } & { showProfile(profile: ProfileHeader): Widget; showObject(snapshotObjectId: any, perspectiveName: string): void; }'. - Type 'SamplingHeapProfileType' is not assignable to type '{ showProfile(profile: ProfileHeader): Widget; showObject(snapshotObjectId: any, perspectiveName: string): void; }'. - Property 'showProfile' is missing in type 'SamplingHeapProfileType'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapProfileView.js(181,25): error TS2694: Namespace 'Protocol' has no exported member 'HeapProfiler'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapProfileView.js(193,24): error TS2694: Namespace 'Protocol' has no exported member 'HeapProfiler'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapProfileView.js(196,60): error TS2694: Namespace 'Protocol' has no exported member 'Runtime'. @@ -8456,11 +8729,6 @@ node_modules/chrome-devtools-frontend/front_end/profiler/HeapProfileView.js(389, node_modules/chrome-devtools-frontend/front_end/profiler/HeapProfileView.js(390,22): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapProfileView.js(390,60): error TS2339: Property 'bytesToString' does not exist on type 'NumberConstructor'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapProfileView.js(395,24): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/profiler/HeapProfilerPanel.js(14,9): error TS2345: Argument of type '(HeapSnapshotProfileType | SamplingHeapProfileType)[]' is not assignable to parameter of type '({ showProfile(profile: ProfileHeader): Widget; showObject(snapshotObjectId: any, perspectiveName: string): void; } & { showProfile(profile: ProfileHeader): Widget; showObject(snapshotObjectId: any, perspectiveName: string): void; })[]'. - Type 'HeapSnapshotProfileType | SamplingHeapProfileType' is not assignable to type '{ showProfile(profile: ProfileHeader): Widget; showObject(snapshotObjectId: any, perspectiveName: string): void; } & { showProfile(profile: ProfileHeader): Widget; showObject(snapshotObjectId: any, perspectiveName: string): void; }'. - Type 'HeapSnapshotProfileType' is not assignable to type '{ showProfile(profile: ProfileHeader): Widget; showObject(snapshotObjectId: any, perspectiveName: string): void; } & { showProfile(profile: ProfileHeader): Widget; showObject(snapshotObjectId: any, perspectiveName: string): void; }'. - Type 'HeapSnapshotProfileType' is not assignable to type '{ showProfile(profile: ProfileHeader): Widget; showObject(snapshotObjectId: any, perspectiveName: string): void; }'. - Property 'showProfile' is missing in type 'HeapSnapshotProfileType'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapProfilerPanel.js(56,9): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapProfilerPanel.js(88,24): error TS2694: Namespace 'Protocol' has no exported member 'HeapProfiler'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapProfilerPanel.js(100,14): error TS2339: Property 'selectLiveObject' does not exist on type 'Widget'. @@ -8478,18 +8746,17 @@ node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.j node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(191,27): error TS2339: Property '_sortFields' does not exist on type 'HeapSnapshotSortableDataGrid'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(295,41): error TS2694: Namespace 'DataGrid.DataGrid' has no exported member 'ColumnDescriptor'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(329,72): error TS2339: Property 'offsetHeight' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(394,41): error TS2345: Argument of type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; } & { ...; }' is not assignable to parameter of type 'DataGridNode'. - Property '_element' is missing in type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; } & { ...; }'. -node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(419,37): error TS2345: Argument of type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; } & { ...; }' is not assignable to parameter of type 'DataGridNode'. - Property '_element' is missing in type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; } & { ...; }'. -node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(431,76): error TS2339: Property 'peekLast' does not exist on type '({ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; } & { ...; })[]'. +node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(375,36): error TS2339: Property 'filteredOut' does not exist on type 'HeapSnapshotGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(375,57): error TS2339: Property 'filteredOut' does not exist on type 'HeapSnapshotGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(387,36): error TS2339: Property 'filteredOut' does not exist on type 'HeapSnapshotGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(387,57): error TS2339: Property 'filteredOut' does not exist on type 'HeapSnapshotGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(401,36): error TS2339: Property 'filteredOut' does not exist on type 'HeapSnapshotGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(401,57): error TS2339: Property 'filteredOut' does not exist on type 'HeapSnapshotGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(431,76): error TS2339: Property 'peekLast' does not exist on type 'HeapSnapshotGridNode[]'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(433,57): error TS2339: Property 'offsetHeight' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(465,34): error TS2339: Property 'peekLast' does not exist on type '({ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; } & { ...; })[]'. +node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(465,34): error TS2339: Property 'peekLast' does not exist on type 'HeapSnapshotGridNode[]'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(474,19): error TS2551: Property '_allChildren' does not exist on type 'DataGridNode'. Did you mean '_hasChildren'? node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(474,43): error TS2551: Property '_allChildren' does not exist on type 'DataGridNode'. Did you mean '_hasChildren'? -node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(492,51): error TS2352: Conversion of type 'DataGridNode' to type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; } & { ...; }' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. - Type 'DataGridNode' is not comparable to type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; }'. - Property 'dispose' is missing in type 'DataGridNode'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(522,27): error TS2339: Property 'offsetTop' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(523,40): error TS2339: Property 'offsetHeight' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(554,41): error TS2694: Namespace 'DataGrid.DataGrid' has no exported member 'ColumnDescriptor'. @@ -8517,9 +8784,12 @@ node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.j node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(673,34): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(675,16): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(700,24): error TS2694: Namespace 'Protocol' has no exported member 'HeapProfiler'. -node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(776,11): error TS2345: Argument of type 'HeapSnapshotConstructorNode' is not assignable to parameter of type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; } & { ...; }'. - Type 'HeapSnapshotConstructorNode' is not assignable to type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; }'. - Property 'nodePosition' is missing in type 'HeapSnapshotConstructorNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(713,67): error TS2339: Property '_name' does not exist on type 'HeapSnapshotGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(717,30): error TS2339: Property 'populateNodeBySnapshotObjectId' does not exist on type 'HeapSnapshotGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(776,11): error TS2345: Argument of type 'HeapSnapshotConstructorNode' is not assignable to parameter of type 'HeapSnapshotGridNode'. + Types of property 'createProvider' are incompatible. + Type '() => HeapSnapshotProviderProxy' is not assignable to type '() => { dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; }'. + Type 'HeapSnapshotProviderProxy' is not assignable to type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; }'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(822,56): error TS2694: Namespace 'DataGrid.DataGrid' has no exported member 'ColumnDescriptor'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(823,29): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(824,33): error TS2555: Expected at least 2 arguments, but got 1. @@ -8528,45 +8798,31 @@ node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.j node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(828,16): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(834,34): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(835,32): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(887,40): error TS2345: Argument of type 'HeapSnapshotDiffNode' is not assignable to parameter of type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; } & { ...; }'. - Type 'HeapSnapshotDiffNode' is not assignable to type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; }'. - Property 'nodePosition' is missing in type 'HeapSnapshotDiffNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(887,40): error TS2345: Argument of type 'HeapSnapshotDiffNode' is not assignable to parameter of type 'HeapSnapshotGridNode'. + Types of property 'createProvider' are incompatible. + Type '() => HeapSnapshotDiffNodesProvider' is not assignable to type '() => { dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; }'. + Type 'HeapSnapshotDiffNodesProvider' is not assignable to type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; }'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(902,56): error TS2694: Namespace 'DataGrid.DataGrid' has no exported member 'ColumnDescriptor'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(903,32): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(904,28): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(905,31): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(908,16): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(914,27): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotDataGrids.js(946,29): error TS2345: Argument of type 'AllocationGridNode' is not assignable to parameter of type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; } & { ...; }'. - Type 'AllocationGridNode' is not assignable to type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; }'. - Property 'nodePosition' is missing in type 'AllocationGridNode'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(63,16): error TS2352: Conversion of type '{ fieldName1: string; ascending1: string; fieldName2: string; ascending2: string; }' to type 'ComparatorConfig' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. Types of property 'ascending1' are incompatible. Type 'string' is not comparable to type 'boolean'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(104,14): error TS2339: Property '_searchMatched' does not exist on type 'HeapSnapshotGridNode'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(137,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(156,95): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(163,5): error TS2322: Type '({ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; } & { ...; })[]' is not assignable to type 'DataGridNode[]'. -node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(163,5): error TS2322: Type '({ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; } & { ...; })[]' is not assignable to type 'DataGridNode[]'. - Type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; } & { ...; }' is not assignable to type 'DataGridNode'. - Property '_element' is missing in type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; } & { ...; }'. -node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(170,39): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; } & { ...; }'. - Type 'HeapSnapshotGridNode' is not assignable to type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; } & { ...; }'. - Type 'HeapSnapshotGridNode' is not assignable to type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; }'. - Type 'this' is not assignable to type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; }'. - Type 'HeapSnapshotGridNode' is not assignable to type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; }'. - Property 'nodePosition' is missing in type 'HeapSnapshotGridNode'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(197,23): error TS2339: Property 'snapshot' does not exist on type 'DataGrid'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(222,41): error TS2339: Property 'comparator' does not exist on type 'HeapSnapshotGridNode'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(232,48): error TS2339: Property 'comparator' does not exist on type 'HeapSnapshotGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(265,25): error TS2339: Property '_childHashForEntity' does not exist on type 'HeapSnapshotGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(271,45): error TS2339: Property '_createChildNode' does not exist on type 'HeapSnapshotGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(322,50): error TS2339: Property 'setEndPosition' does not exist on type 'DataGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(365,50): error TS2339: Property 'setStartPosition' does not exist on type 'DataGridNode'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(393,32): error TS2339: Property '_childHashForNode' does not exist on type 'HeapSnapshotGridNode'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(400,47): error TS2339: Property 'comparator' does not exist on type 'HeapSnapshotGridNode'. -node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(403,38): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; } & { ...; }'. - Type 'HeapSnapshotGridNode' is not assignable to type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; } & { ...; }'. - Type 'HeapSnapshotGridNode' is not assignable to type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; }'. - Type 'this' is not assignable to type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; }'. - Type 'HeapSnapshotGridNode' is not assignable to type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; }'. - Property 'nodePosition' is missing in type 'HeapSnapshotGridNode'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(412,15): error TS2339: Property 'sort' does not exist on type 'DataGridNode'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(433,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(438,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. @@ -8604,18 +8860,14 @@ node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.j Type '() => HeapSnapshotProviderProxy' is not assignable to type '() => { dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; }'. Type 'HeapSnapshotProviderProxy' is not assignable to type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; }'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(981,27): error TS2339: Property 'snapshot' does not exist on type 'HeapSnapshotSortableDataGrid'. -node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(1000,20): error TS2352: Conversion of type 'DataGridNode' to type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; } & { ...; }' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. - Type 'DataGridNode' is not comparable to type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; }'. - Property 'dispose' is missing in type 'DataGridNode'. -node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(1001,5): error TS2322: Type '(this | ({ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; } & { ...; }))[]' is not assignable to type '({ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; } & { ...; })[]'. -node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(1001,5): error TS2322: Type '(this | ({ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; } & { ...; }))[]' is not assignable to type '({ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; } & { ...; })[]'. - Type 'this | ({ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; } & { ...; })' is not assignable to type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; } & { ...; }'. - Type 'this' is not assignable to type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; } & { ...; }'. - Type 'HeapSnapshotConstructorNode' is not assignable to type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; } & { ...; }'. - Type 'HeapSnapshotConstructorNode' is not assignable to type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; }'. - Type 'this' is not assignable to type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; }'. - Type 'HeapSnapshotConstructorNode' is not assignable to type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; }'. - Property 'nodePosition' is missing in type 'HeapSnapshotConstructorNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(1001,5): error TS2322: Type '(HeapSnapshotGridNode | this)[]' is not assignable to type 'HeapSnapshotGridNode[]'. +node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(1001,5): error TS2322: Type '(HeapSnapshotGridNode | this)[]' is not assignable to type 'HeapSnapshotGridNode[]'. + Type 'HeapSnapshotGridNode | this' is not assignable to type 'HeapSnapshotGridNode'. + Type 'this' is not assignable to type 'HeapSnapshotGridNode'. + Type 'HeapSnapshotConstructorNode' is not assignable to type 'HeapSnapshotGridNode'. + Types of property 'createProvider' are incompatible. + Type '() => HeapSnapshotProviderProxy' is not assignable to type '() => { dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; }'. + Type 'HeapSnapshotProviderProxy' is not assignable to type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; }'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(1019,14): error TS2339: Property '_searchMatched' does not exist on type 'HeapSnapshotConstructorNode'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(1029,81): error TS2339: Property 'snapshot' does not exist on type 'HeapSnapshotSortableDataGrid'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(1140,22): error TS2339: Property 'pushAll' does not exist on type 'any[]'. @@ -8642,12 +8894,8 @@ node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.j node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(1288,26): error TS2339: Property 'withThousandsSeparator' does not exist on type 'NumberConstructor'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(1289,22): error TS2339: Property 'withThousandsSeparator' does not exist on type 'NumberConstructor'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(1306,40): error TS2339: Property 'snapshot' does not exist on type 'HeapSnapshotSortableDataGrid'. -node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(1313,39): error TS2345: Argument of type 'AllocationGridNode' is not assignable to parameter of type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; } & { ...; }'. - Type 'AllocationGridNode' is not assignable to type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; }'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(1314,7): error TS2322: Type 'AllocationGridNode' is not assignable to type 'this'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(1321,39): error TS2339: Property '_createComparator' does not exist on type 'HeapSnapshotSortableDataGrid'. -node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(1323,39): error TS2345: Argument of type 'AllocationGridNode' is not assignable to parameter of type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; } & { ...; }'. - Type 'AllocationGridNode' is not assignable to type '{ dispose(): void; nodePosition(snapshotObjectId: number): Promise; isEmpty(): Promise; serializeItemsRange(startPosition: number, endPosition: number): Promise<...>; sortAndRewind(comparator: ComparatorConfig): Promise<...>; }'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(1347,44): error TS2339: Property 'heapProfilerModel' does not exist on type 'HeapSnapshotSortableDataGrid'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotGridNodes.js(1349,38): error TS2339: Property '_linkifier' does not exist on type 'HeapSnapshotSortableDataGrid'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotProxy.js(161,40): error TS2339: Property 'keysArray' does not exist on type 'Map any>'. @@ -8660,11 +8908,11 @@ node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotProxy.js(45 node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotProxy.js(457,12): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotProxy.js(507,12): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(42,11): error TS2555: Expected at least 2 arguments, but got 1. +node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(48,9): error TS2345: Argument of type 'string' is not assignable to parameter of type 'symbol'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(106,47): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(107,54): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(113,57): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(115,41): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(132,9): error TS2367: This condition will always return 'true' since the types '{ showProfile(profile: ProfileHeader): Widget; showObject(snapshotObjectId: any, perspectiveName: string): void; } & { showProfile(profile: ProfileHeader): Widget; showObject(snapshotObjectId: any, perspectiveName: string): void; }' and 'TrackingHeapSnapshotProfileType' have no overlap. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(192,24): error TS2694: Namespace 'Protocol' has no exported member 'HeapProfiler'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(228,53): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(229,56): error TS2555: Expected at least 2 arguments, but got 1. @@ -8674,16 +8922,9 @@ node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(232 node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(233,54): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(238,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(243,80): error TS2339: Property 'bytesToString' does not exist on type 'NumberConstructor'. -node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(254,9): error TS2367: This condition will always return 'true' since the types '{ showProfile(profile: ProfileHeader): Widget; showObject(snapshotObjectId: any, perspectiveName: string): void; } & { showProfile(profile: ProfileHeader): Widget; showObject(snapshotObjectId: any, perspectiveName: string): void; }' and 'TrackingHeapSnapshotProfileType' have no overlap. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(256,17): error TS2345: Argument of type 'ToolbarText' is not assignable to parameter of type 'ToolbarComboBox | ToolbarInput'. Type 'ToolbarText' is not assignable to type 'ToolbarInput'. Property '_prompt' is missing in type 'ToolbarText'. -node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(257,5): error TS2322: Type '(ToolbarComboBox | ToolbarInput)[]' is not assignable to type '({ item(): any & any; } & { item(): any & any; })[]'. -node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(257,5): error TS2322: Type '(ToolbarComboBox | ToolbarInput)[]' is not assignable to type '({ item(): any & any; } & { item(): any & any; })[]'. - Type 'ToolbarComboBox | ToolbarInput' is not assignable to type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarComboBox' is not assignable to type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarComboBox' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarComboBox'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(344,50): error TS2551: Property 'jumpBackwards' does not exist on type 'SearchConfig'. Did you mean 'jumpBackward'? node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(397,25): error TS2339: Property '_loadPromise' does not exist on type 'ProfileHeader'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(405,24): error TS2345: Argument of type 'SearchConfig' is not assignable to parameter of type 'SearchConfig'. @@ -8704,6 +8945,7 @@ node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(576 node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(628,37): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(649,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(658,22): error TS2694: Namespace 'Common' has no exported member 'Event'. +node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(667,11): error TS2345: Argument of type 'string' is not assignable to parameter of type 'symbol'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(749,11): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(793,11): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(831,11): error TS2555: Expected at least 2 arguments, but got 1. @@ -8712,6 +8954,12 @@ node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(875 node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(876,25): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(915,11): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(946,67): error TS2555: Expected at least 2 arguments, but got 1. +node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(947,60): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Type 'HeapSnapshotProfileType' is not assignable to type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Types of property 'modelAdded' are incompatible. + Type '(heapProfilerModel: HeapProfilerModel) => void' is not assignable to type '(model: T) => void'. + Types of parameters 'heapProfilerModel' and 'model' are incompatible. + Type 'T' is not assignable to type 'HeapProfilerModel'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(989,12): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(1011,12): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(1015,12): error TS2555: Expected at least 2 arguments, but got 1. @@ -8741,15 +8989,17 @@ node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(122 node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(1248,12): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(1252,12): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(1258,22): error TS2694: Namespace 'Common' has no exported member 'Event'. -node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(1313,11): error TS2345: Argument of type 'HeapSnapshotProfileType' is not assignable to parameter of type '{ showProfile(profile: ProfileHeader): Widget; showObject(snapshotObjectId: any, perspectiveName: string): void; } & { showProfile(profile: ProfileHeader): Widget; showObject(snapshotObjectId: any, perspectiveName: string): void; }'. - Type 'HeapSnapshotProfileType' is not assignable to type '{ showProfile(profile: ProfileHeader): Widget; showObject(snapshotObjectId: any, perspectiveName: string): void; }'. - Property 'showProfile' is missing in type 'HeapSnapshotProfileType'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(1358,23): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(1430,30): error TS2339: Property 'bytesToString' does not exist on type 'NumberConstructor'. +node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(1458,24): error TS2339: Property '_snapshotReceived' does not exist on type 'ProfileType'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(1476,61): error TS2339: Property 'toISO8601Compact' does not exist on type 'Date'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(1525,23): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(1547,44): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(1557,77): error TS2339: Property '_profileSamples' does not exist on type 'HeapProfileHeader'. +node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(1561,11): error TS2345: Argument of type 'string' is not assignable to parameter of type 'symbol'. +node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(1563,11): error TS2345: Argument of type 'string' is not assignable to parameter of type 'symbol'. +node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(1578,9): error TS2345: Argument of type 'string' is not assignable to parameter of type 'symbol'. +node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(1580,9): error TS2345: Argument of type 'string' is not assignable to parameter of type 'symbol'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(1584,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(1604,79): error TS2339: Property 'peekLast' does not exist on type 'number[]'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(1719,26): error TS2339: Property 'bytesToString' does not exist on type 'NumberConstructor'. @@ -8762,97 +9012,43 @@ node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(196 node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(1972,33): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/profiler/HeapSnapshotView.js(1987,18): error TS2339: Property 'removeChildren' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(48,37): error TS2339: Property 'deoptReason' does not exist on type 'ProfileNode'. -node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(97,15): error TS2339: Property 'self' does not exist on type 'ProfileDataGridTree | ({ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { ...; })'. +node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(97,15): error TS2339: Property 'self' does not exist on type 'ProfileDataGridNode | ProfileDataGridTree'. Property 'self' does not exist on type 'ProfileDataGridTree'. -node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(100,17): error TS2339: Property 'total' does not exist on type 'ProfileDataGridTree | ({ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { ...; })'. - Property 'total' does not exist on type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. -node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(102,30): error TS2339: Property 'children' does not exist on type 'ProfileDataGridTree | ({ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { ...; })'. - Property 'children' does not exist on type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. -node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(104,15): error TS2339: Property 'removeChildren' does not exist on type 'ProfileDataGridTree | ({ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { ...; })'. - Property 'removeChildren' does not exist on type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. -node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(110,19): error TS2339: Property 'appendChild' does not exist on type 'ProfileDataGridTree | ({ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { ...; })'. - Property 'appendChild' does not exist on type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. -node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(118,37): error TS2339: Property 'childrenByCallUID' does not exist on type 'ProfileDataGridTree | ({ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { ...; })'. - Property 'childrenByCallUID' does not exist on type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. -node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(123,19): error TS2339: Property 'appendChild' does not exist on type 'ProfileDataGridTree | ({ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { ...; })'. - Property 'appendChild' does not exist on type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. -node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(131,19): error TS2339: Property '_populated' does not exist on type 'ProfileDataGridTree | ({ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { ...; })'. - Property '_populated' does not exist on type 'ProfileDataGridTree'. -node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(133,15): error TS2339: Property '_populated' does not exist on type 'ProfileDataGridTree | ({ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { ...; })'. - Property '_populated' does not exist on type 'ProfileDataGridTree'. -node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(135,15): error TS2339: Property 'populateChildren' does not exist on type 'ProfileDataGridTree | ({ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { ...; })'. - Property 'populateChildren' does not exist on type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. -node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(137,39): error TS2339: Property 'tree' does not exist on type 'ProfileDataGridTree | ({ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { ...; })'. - Property 'tree' does not exist on type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. -node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(140,17): error TS2339: Property 'sort' does not exist on type 'ProfileDataGridTree | ({ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { ...; })'. - Property 'sort' does not exist on type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. +node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(118,27): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((key: any) => any) | ((key: string) => ProfileDataGridNode)' has no compatible call signatures. +node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(131,19): error TS2339: Property '_populated' does not exist on type 'ProfileDataGridNode | ProfileDataGridTree'. + Property '_populated' does not exist on type 'ProfileDataGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(133,15): error TS2339: Property '_populated' does not exist on type 'ProfileDataGridNode | ProfileDataGridTree'. + Property '_populated' does not exist on type 'ProfileDataGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(140,7): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((comparator: (arg0: T, arg1: T) => any, force: boolean) => any) | ((comparator: (arg0: T, arg1: T) => any, force: boolean) => void)' has no compatible call signatures. node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(153,49): error TS2339: Property '_searchMatchedSelfColumn' does not exist on type 'ProfileDataGridNode'. node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(158,49): error TS2339: Property '_searchMatchedTotalColumn' does not exist on type 'ProfileDataGridNode'. node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(163,49): error TS2339: Property '_searchMatchedFunctionColumn' does not exist on type 'ProfileDataGridNode'. node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(170,14): error TS2339: Property 'createTextChild' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(173,59): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'ProfileDataGridNode' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'ProfileDataGridNode' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'this' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'ProfileDataGridNode' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Property 'formatValue' is missing in type 'ProfileDataGridNode'. node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(176,20): error TS2339: Property 'style' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(194,20): error TS2339: Property 'createChild' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(195,83): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'ProfileDataGridNode' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'ProfileDataGridNode' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'this' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'ProfileDataGridNode' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Property 'formatValue' is missing in type 'ProfileDataGridNode'. -node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(196,105): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'ProfileDataGridNode' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'ProfileDataGridNode' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'this' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'ProfileDataGridNode' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Property 'formatValue' is missing in type 'ProfileDataGridNode'. -node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(206,46): error TS2345: Argument of type 'this[][]' is not assignable to parameter of type '({ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; })[][]'. - Type 'this[]' is not assignable to type '({ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; })[]'. - Type 'this' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'ProfileDataGridNode' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'ProfileDataGridNode' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'this' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'ProfileDataGridNode' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Property 'formatValue' is missing in type 'ProfileDataGridNode'. node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(218,29): error TS2339: Property 'callUID' does not exist on type 'DataGridNode'. -node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(218,42): error TS2352: Conversion of type 'DataGridNode' to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. - Type 'DataGridNode' is not comparable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Property 'formatValue' is missing in type 'DataGridNode'. -node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(228,40): error TS2352: Conversion of type 'DataGridNode' to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. - Type 'DataGridNode' is not comparable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Property 'formatValue' is missing in type 'DataGridNode'. -node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(262,43): error TS2345: Argument of type 'this' is not assignable to parameter of type 'ProfileDataGridTree | ({ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { ...; })'. - Type 'ProfileDataGridNode' is not assignable to type 'ProfileDataGridTree | ({ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { ...; })'. - Type 'ProfileDataGridNode' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'ProfileDataGridNode' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'this' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'ProfileDataGridNode' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'ProfileDataGridNode' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'this' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'ProfileDataGridNode' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Property 'formatValue' is missing in type 'ProfileDataGridNode'. -node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(312,40): error TS2345: Argument of type 'this' is not assignable to parameter of type 'ProfileDataGridTree | ({ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { ...; })'. - Type 'ProfileDataGridNode' is not assignable to type 'ProfileDataGridTree | ({ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { ...; })'. - Type 'ProfileDataGridNode' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'ProfileDataGridNode' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'this' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'ProfileDataGridNode' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'ProfileDataGridNode' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'this' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'ProfileDataGridNode' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Property 'formatValue' is missing in type 'ProfileDataGridNode'. -node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(412,46): error TS2345: Argument of type 'this[][]' is not assignable to parameter of type '({ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; })[][]'. - Type 'this[]' is not assignable to type '({ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; })[]'. - Type 'this' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'ProfileDataGridTree' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'ProfileDataGridTree' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'this' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'ProfileDataGridTree' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Property 'formatValue' is missing in type 'ProfileDataGridTree'. +node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(412,48): error TS2322: Type 'this' is not assignable to type 'ProfileDataGridNode'. + Type 'ProfileDataGridTree' is not assignable to type 'ProfileDataGridNode'. + Property 'profileNode' is missing in type 'ProfileDataGridTree'. +node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(479,34): error TS2339: Property '_searchMatchedSelfColumn' does not exist on type 'ProfileDataGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(480,34): error TS2339: Property '_searchMatchedTotalColumn' does not exist on type 'ProfileDataGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(481,34): error TS2339: Property '_searchMatchedFunctionColumn' does not exist on type 'ProfileDataGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(486,33): error TS2339: Property '_searchMatchedSelfColumn' does not exist on type 'ProfileDataGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(488,33): error TS2339: Property '_searchMatchedTotalColumn' does not exist on type 'ProfileDataGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(491,33): error TS2339: Property '_searchMatchedSelfColumn' does not exist on type 'ProfileDataGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(493,33): error TS2339: Property '_searchMatchedTotalColumn' does not exist on type 'ProfileDataGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(498,33): error TS2339: Property '_searchMatchedSelfColumn' does not exist on type 'ProfileDataGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(500,33): error TS2339: Property '_searchMatchedTotalColumn' does not exist on type 'ProfileDataGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(505,33): error TS2339: Property '_searchMatchedSelfColumn' does not exist on type 'ProfileDataGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(507,33): error TS2339: Property '_searchMatchedTotalColumn' does not exist on type 'ProfileDataGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(510,33): error TS2339: Property '_searchMatchedSelfColumn' does not exist on type 'ProfileDataGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(512,33): error TS2339: Property '_searchMatchedTotalColumn' does not exist on type 'ProfileDataGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(517,33): error TS2339: Property '_searchMatchedSelfColumn' does not exist on type 'ProfileDataGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(519,33): error TS2339: Property '_searchMatchedTotalColumn' does not exist on type 'ProfileDataGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(525,29): error TS2339: Property '_searchMatchedFunctionColumn' does not exist on type 'ProfileDataGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(527,31): error TS2339: Property '_searchMatchedSelfColumn' does not exist on type 'ProfileDataGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(527,79): error TS2339: Property '_searchMatchedTotalColumn' does not exist on type 'ProfileDataGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(528,31): error TS2339: Property '_searchMatchedFunctionColumn' does not exist on type 'ProfileDataGridNode'. node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(640,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(647,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. node_modules/chrome-devtools-frontend/front_end/profiler/ProfileDataGrid.js(653,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. @@ -8886,12 +9082,6 @@ node_modules/chrome-devtools-frontend/front_end/profiler/ProfileView.js(80,45): node_modules/chrome-devtools-frontend/front_end/profiler/ProfileView.js(84,17): error TS2345: Argument of type '(string | Element)[][]' is not assignable to parameter of type 'ReadonlyArray<[any, any]>'. Type '(string | Element)[]' is not assignable to type '[any, any]'. Property '0' is missing in type '(string | Element)[]'. -node_modules/chrome-devtools-frontend/front_end/profiler/ProfileView.js(127,5): error TS2322: Type '(ToolbarButton | ToolbarComboBox)[]' is not assignable to type '({ item(): any & any; } & { item(): any & any; })[]'. -node_modules/chrome-devtools-frontend/front_end/profiler/ProfileView.js(127,5): error TS2322: Type '(ToolbarButton | ToolbarComboBox)[]' is not assignable to type '({ item(): any & any; } & { item(): any & any; })[]'. - Type 'ToolbarButton | ToolbarComboBox' is not assignable to type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarButton'. node_modules/chrome-devtools-frontend/front_end/profiler/ProfileView.js(136,59): error TS2339: Property 'profile' does not exist on type 'ProfileView'. node_modules/chrome-devtools-frontend/front_end/profiler/ProfileView.js(136,78): error TS2339: Property 'adjustedTotal' does not exist on type 'ProfileView'. node_modules/chrome-devtools-frontend/front_end/profiler/ProfileView.js(147,59): error TS2339: Property 'profile' does not exist on type 'ProfileView'. @@ -8914,13 +9104,7 @@ node_modules/chrome-devtools-frontend/front_end/profiler/ProfileView.js(485,23): node_modules/chrome-devtools-frontend/front_end/profiler/ProfileView.js(488,44): error TS2694: Namespace 'Protocol' has no exported member 'Profiler'. node_modules/chrome-devtools-frontend/front_end/profiler/ProfileView.js(490,25): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/profiler/ProfileView.js(503,24): error TS2694: Namespace 'Protocol' has no exported member 'Profiler'. -node_modules/chrome-devtools-frontend/front_end/profiler/ProfilesPanel.js(72,31): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/profiler/ProfilesPanel.js(74,52): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/profiler/ProfilesPanel.js(76,31): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/profiler/ProfilesPanel.js(78,31): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/profiler/ProfilesPanel.js(109,15): error TS2339: Property 'key' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/profiler/ProfilesPanel.js(109,45): error TS2339: Property 'altKey' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/profiler/ProfilesPanel.js(111,20): error TS2339: Property 'key' does not exist on type 'Event'. @@ -8958,10 +9142,6 @@ node_modules/chrome-devtools-frontend/front_end/profiler/ProfilesPanel.js(776,26 node_modules/chrome-devtools-frontend/front_end/profiler/ProfilesPanel.js(807,26): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/profiler/ProfilesPanel.js(808,26): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/profiler/ProfilesPanel.js(811,24): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/profiler/ProfilesPanel.js(821,26): error TS2345: Argument of type 'CPUProfileType[]' is not assignable to parameter of type '({ showProfile(profile: ProfileHeader): Widget; showObject(snapshotObjectId: any, perspectiveName: string): void; } & { showProfile(profile: ProfileHeader): Widget; showObject(snapshotObjectId: any, perspectiveName: string): void; })[]'. - Type 'CPUProfileType' is not assignable to type '{ showProfile(profile: ProfileHeader): Widget; showObject(snapshotObjectId: any, perspectiveName: string): void; } & { showProfile(profile: ProfileHeader): Widget; showObject(snapshotObjectId: any, perspectiveName: string): void; }'. - Type 'CPUProfileType' is not assignable to type '{ showProfile(profile: ProfileHeader): Widget; showObject(snapshotObjectId: any, perspectiveName: string): void; }'. - Property 'showProfile' is missing in type 'CPUProfileType'. node_modules/chrome-devtools-frontend/front_end/profiler/TargetsComboBoxController.js(31,38): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/profiler/TargetsComboBoxController.js(36,27): error TS2339: Property 'selectedIndex' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/profiler/TargetsComboBoxController.js(49,39): error TS2339: Property 'remove' does not exist on type 'Map'. @@ -8972,12 +9152,7 @@ node_modules/chrome-devtools-frontend/front_end/profiler/TargetsComboBoxControll node_modules/chrome-devtools-frontend/front_end/profiler/TargetsComboBoxController.js(97,25): error TS2339: Property 'selectedIndex' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/profiler/TopDownProfileDataGrid.js(63,17): error TS2339: Property 'populate' does not exist on type 'TopDownProfileDataGridTree | TopDownProfileDataGridNode'. Property 'populate' does not exist on type 'TopDownProfileDataGridTree'. -node_modules/chrome-devtools-frontend/front_end/profiler/TopDownProfileDataGrid.js(73,17): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((key: any) => any) | ((key: string) => { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { ...; })' has no compatible call signatures. -node_modules/chrome-devtools-frontend/front_end/profiler/TopDownProfileDataGrid.js(76,42): error TS2345: Argument of type 'TopDownProfileDataGridTree | TopDownProfileDataGridNode' is not assignable to parameter of type 'ProfileDataGridTree | ({ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { ...; })'. - Type 'TopDownProfileDataGridNode' is not assignable to type 'ProfileDataGridTree | ({ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { ...; })'. - Type 'TopDownProfileDataGridNode' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; } & { formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Type 'TopDownProfileDataGridNode' is not assignable to type '{ formatValue(value: number, node: any & any): string; formatPercent(value: number, node: any & any): string; linkifyNode(node: any & any): Element; }'. - Property 'formatValue' is missing in type 'TopDownProfileDataGridNode'. +node_modules/chrome-devtools-frontend/front_end/profiler/TopDownProfileDataGrid.js(73,17): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((key: any) => any) | ((key: string) => ProfileDataGridNode)' has no compatible call signatures. node_modules/chrome-devtools-frontend/front_end/protocol/InspectorBackend.js(168,40): error TS2345: Argument of type 'S' is not assignable to parameter of type 'S'. node_modules/chrome-devtools-frontend/front_end/protocol/InspectorBackend.js(170,24): error TS2345: Argument of type 'S' is not assignable to parameter of type 'T'. node_modules/chrome-devtools-frontend/front_end/protocol/InspectorBackend.js(194,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. @@ -9050,8 +9225,6 @@ node_modules/chrome-devtools-frontend/front_end/resources/AppManifestView.js(27, node_modules/chrome-devtools-frontend/front_end/resources/AppManifestView.js(28,60): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/resources/AppManifestView.js(32,30): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/resources/AppManifestView.js(32,79): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/resources/AppManifestView.js(34,31): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/resources/AppManifestView.js(36,64): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/resources/AppManifestView.js(37,57): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/resources/AppManifestView.js(39,57): error TS2555: Expected at least 2 arguments, but got 1. @@ -9061,20 +9234,23 @@ node_modules/chrome-devtools-frontend/front_end/resources/AppManifestView.js(44, node_modules/chrome-devtools-frontend/front_end/resources/AppManifestView.js(48,70): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/resources/AppManifestView.js(52,68): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/resources/AppManifestView.js(53,64): error TS2555: Expected at least 2 arguments, but got 1. +node_modules/chrome-devtools-frontend/front_end/resources/AppManifestView.js(55,60): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Type 'AppManifestView' is not assignable to type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Types of property 'modelAdded' are incompatible. + Type '(resourceTreeModel: ResourceTreeModel) => void' is not assignable to type '(model: T) => void'. + Types of parameters 'resourceTreeModel' and 'model' are incompatible. + Type 'T' is not assignable to type 'ResourceTreeModel'. node_modules/chrome-devtools-frontend/front_end/resources/AppManifestView.js(88,31): error TS2694: Namespace 'Protocol' has no exported member 'Page'. node_modules/chrome-devtools-frontend/front_end/resources/AppManifestView.js(116,25): error TS2339: Property 'removeChildren' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/resources/AppManifestView.js(139,32): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/resources/AppManifestView.js(158,22): error TS2694: Namespace 'Common' has no exported member 'Event'. +node_modules/chrome-devtools-frontend/front_end/resources/AppManifestView.js(163,14): error TS2339: Property 'pageAgent' does not exist on type 'Target'. node_modules/chrome-devtools-frontend/front_end/resources/ApplicationCacheItemsView.js(31,11): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/resources/ApplicationCacheItemsView.js(37,47): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/resources/ApplicationCacheItemsView.js(42,28): error TS2339: Property 'style' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/resources/ApplicationCacheItemsView.js(44,22): error TS2339: Property 'style' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/resources/ApplicationCacheItemsView.js(48,44): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/resources/ApplicationCacheItemsView.js(59,32): error TS2339: Property 'style' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/resources/ApplicationCacheItemsView.js(67,5): error TS2322: Type 'ToolbarItem[]' is not assignable to type '({ item(): any & any; } & { item(): any & any; })[]'. - Type 'ToolbarItem' is not assignable to type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarItem' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarItem'. node_modules/chrome-devtools-frontend/front_end/resources/ApplicationCacheItemsView.js(117,22): error TS2339: Property 'type' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/resources/ApplicationCacheItemsView.js(131,30): error TS2339: Property 'type' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/resources/ApplicationCacheItemsView.js(132,44): error TS2555: Expected at least 2 arguments, but got 1. @@ -9213,12 +9389,6 @@ node_modules/chrome-devtools-frontend/front_end/resources/DatabaseQueryView.js(1 node_modules/chrome-devtools-frontend/front_end/resources/DatabaseTableView.js(31,11): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/resources/DatabaseTableView.js(40,47): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/resources/DatabaseTableView.js(42,53): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/resources/DatabaseTableView.js(58,5): error TS2322: Type '(ToolbarButton | ToolbarInput)[]' is not assignable to type '({ item(): any & any; } & { item(): any & any; })[]'. -node_modules/chrome-devtools-frontend/front_end/resources/DatabaseTableView.js(58,5): error TS2322: Type '(ToolbarButton | ToolbarInput)[]' is not assignable to type '({ item(): any & any; } & { item(): any & any; })[]'. - Type 'ToolbarButton | ToolbarInput' is not assignable to type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarButton'. node_modules/chrome-devtools-frontend/front_end/resources/DatabaseTableView.js(77,18): error TS2339: Property 'removeChildren' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/resources/DatabaseTableView.js(114,37): error TS2339: Property 'valuesArray' does not exist on type 'Set'. node_modules/chrome-devtools-frontend/front_end/resources/DatabaseTableView.js(124,40): error TS2345: Argument of type '{}' is not assignable to parameter of type '{ [x: string]: boolean; }'. @@ -9264,26 +9434,10 @@ node_modules/chrome-devtools-frontend/front_end/resources/IndexedDBViews.js(191, node_modules/chrome-devtools-frontend/front_end/resources/IndexedDBViews.js(201,27): error TS2339: Property 'createTextChild' does not exist on type 'DocumentFragment'. node_modules/chrome-devtools-frontend/front_end/resources/IndexedDBViews.js(202,45): error TS2339: Property 'createChild' does not exist on type 'DocumentFragment'. node_modules/chrome-devtools-frontend/front_end/resources/IndexedDBViews.js(204,27): error TS2339: Property 'createTextChild' does not exist on type 'DocumentFragment'. -node_modules/chrome-devtools-frontend/front_end/resources/IndexedDBViews.js(211,37): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/resources/IndexedDBViews.js(212,37): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/resources/IndexedDBViews.js(213,37): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/resources/IndexedDBViews.js(215,37): error TS2345: Argument of type 'ToolbarSeparator' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSeparator' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/resources/IndexedDBViews.js(217,49): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/resources/IndexedDBViews.js(219,37): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/resources/IndexedDBViews.js(221,52): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/resources/IndexedDBViews.js(224,37): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/resources/IndexedDBViews.js(227,37): error TS2345: Argument of type 'ToolbarItem' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarItem' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/resources/IndexedDBViews.js(228,27): error TS2339: Property 'placeholder' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/resources/IndexedDBViews.js(228,41): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/resources/IndexedDBViews.js(234,37): error TS2345: Argument of type 'ToolbarItem' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarItem' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/resources/IndexedDBViews.js(238,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/resources/IndexedDBViews.js(246,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/resources/IndexedDBViews.js(295,52): error TS2339: Property 'value' does not exist on type 'Element'. @@ -9301,17 +9455,9 @@ node_modules/chrome-devtools-frontend/front_end/resources/ResourcesSection.js(32 node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkerCacheViews.js(11,11): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkerCacheViews.js(25,46): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkerCacheViews.js(41,49): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkerCacheViews.js(43,37): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkerCacheViews.js(45,52): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkerCacheViews.js(48,37): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkerCacheViews.js(50,48): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkerCacheViews.js(52,37): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkerCacheViews.js(54,55): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkerCacheViews.js(56,37): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkerCacheViews.js(90,36): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkerCacheViews.js(99,56): error TS2694: Namespace 'DataGrid.DataGrid' has no exported member 'ColumnDescriptor'. node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkerCacheViews.js(100,27): error TS2555: Expected at least 2 arguments, but got 1. @@ -9331,19 +9477,17 @@ node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkerCacheView node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkersView.js(12,50): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkersView.js(31,46): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkersView.js(42,31): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkersView.js(48,31): error TS2345: Argument of type 'ToolbarInput' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarInput' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkersView.js(57,37): error TS2345: Argument of type 'ToolbarCheckbox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarCheckbox' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkersView.js(59,36): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkersView.js(61,32): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkersView.js(62,37): error TS2345: Argument of type 'ToolbarSettingCheckbox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSettingCheckbox' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkersView.js(64,41): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkersView.js(66,37): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkersView.js(67,37): error TS2345: Argument of type 'ToolbarSettingCheckbox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSettingCheckbox' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkersView.js(69,75): error TS2694: Namespace 'Common.EventTarget' has no exported member 'EventDescriptor'. +node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkersView.js(71,63): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Type 'ServiceWorkersView' is not assignable to type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Types of property 'modelAdded' are incompatible. + Type '(serviceWorkerManager: ServiceWorkerManager) => void' is not assignable to type '(model: T) => void'. + Types of parameters 'serviceWorkerManager' and 'model' are incompatible. + Type 'T' is not assignable to type 'ServiceWorkerManager'. node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkersView.js(120,7): error TS2447: The '|=' operator is not allowed for boolean types. Consider using '||' instead. node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkersView.js(121,7): error TS2447: The '|=' operator is not allowed for boolean types. Consider using '||' instead. node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkersView.js(150,22): error TS2694: Namespace 'Common' has no exported member 'Event'. @@ -9353,12 +9497,8 @@ node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkersView.js( node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkersView.js(293,56): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkersView.js(298,47): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkersView.js(298,85): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkersView.js(300,37): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkersView.js(302,30): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkersView.js(302,87): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkersView.js(304,37): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkersView.js(307,68): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkersView.js(308,68): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/resources/ServiceWorkersView.js(309,69): error TS2555: Expected at least 2 arguments, but got 1. @@ -9409,9 +9549,6 @@ node_modules/chrome-devtools-frontend/front_end/resources/StorageItemsView.js(15 node_modules/chrome-devtools-frontend/front_end/resources/StorageItemsView.js(17,25): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/resources/StorageItemsView.js(18,43): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/resources/StorageItemsView.js(22,44): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/resources/StorageItemsView.js(27,43): error TS2345: Argument of type 'ToolbarButton | ToolbarInput' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/resources/StorageItemsView.js(40,60): error TS2345: Argument of type 'Function' is not assignable to parameter of type '(arg0: any) => any'. Type 'Function' provides no match for the signature '(arg0: any): any'. node_modules/chrome-devtools-frontend/front_end/resources/StorageItemsView.js(49,45): error TS2555: Expected at least 2 arguments, but got 1. @@ -9435,10 +9572,13 @@ node_modules/chrome-devtools-frontend/front_end/screencast/InputModel.js(112,44) node_modules/chrome-devtools-frontend/front_end/screencast/InputModel.js(112,70): error TS2339: Property 'metaKey' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/screencast/InputModel.js(112,96): error TS2339: Property 'shiftKey' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/screencast/ScreencastApp.js(12,47): error TS2555: Expected at least 2 arguments, but got 1. +node_modules/chrome-devtools-frontend/front_end/screencast/ScreencastApp.js(16,61): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Type 'ScreencastApp' is not assignable to type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Types of property 'modelAdded' are incompatible. + Type '(screenCaptureModel: ScreenCaptureModel) => void' is not assignable to type '(model: T) => void'. + Types of parameters 'screenCaptureModel' and 'model' are incompatible. + Type 'T' is not assignable to type 'ScreenCaptureModel'. node_modules/chrome-devtools-frontend/front_end/screencast/ScreencastApp.js(85,35): error TS2345: Argument of type 'ScreencastView' is not assignable to parameter of type 'boolean'. -node_modules/chrome-devtools-frontend/front_end/screencast/ScreencastApp.js(107,5): error TS2322: Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarToggle'. node_modules/chrome-devtools-frontend/front_end/screencast/ScreencastApp.js(121,5): error TS2322: Type 'ScreencastApp' is not assignable to type '{ presentUI(document: Document): void; }'. Property '_enabledSetting' does not exist on type '{ presentUI(document: Document): void; }'. node_modules/chrome-devtools-frontend/front_end/screencast/ScreencastView.js(56,42): error TS2339: Property 'createChild' does not exist on type 'Element'. @@ -9669,6 +9809,12 @@ node_modules/chrome-devtools-frontend/front_end/sdk/DOMDebuggerModel.js(659,9): node_modules/chrome-devtools-frontend/front_end/sdk/DOMDebuggerModel.js(661,9): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/sdk/DOMDebuggerModel.js(663,9): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/sdk/DOMDebuggerModel.js(665,9): error TS2555: Expected at least 2 arguments, but got 1. +node_modules/chrome-devtools-frontend/front_end/sdk/DOMDebuggerModel.js(673,59): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Type 'DOMDebuggerManager' is not assignable to type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Types of property 'modelAdded' are incompatible. + Type '(domDebuggerModel: DOMDebuggerModel) => void' is not assignable to type '(model: T) => void'. + Types of parameters 'domDebuggerModel' and 'model' are incompatible. + Type 'T' is not assignable to type 'DOMDebuggerModel'. node_modules/chrome-devtools-frontend/front_end/sdk/DOMModel.js(47,24): error TS2694: Namespace 'Protocol' has no exported member 'DOM'. node_modules/chrome-devtools-frontend/front_end/sdk/DOMModel.js(59,24): error TS2694: Namespace 'Protocol' has no exported member 'DOM'. node_modules/chrome-devtools-frontend/front_end/sdk/DOMModel.js(136,53): error TS2339: Property 'documentElement' does not exist on type 'DOMDocument'. @@ -9697,9 +9843,6 @@ node_modules/chrome-devtools-frontend/front_end/sdk/DOMModel.js(970,13): error T node_modules/chrome-devtools-frontend/front_end/sdk/DOMModel.js(1042,24): error TS2694: Namespace 'Protocol' has no exported member 'DOM'. node_modules/chrome-devtools-frontend/front_end/sdk/DOMModel.js(1062,26): error TS2339: Property 'domAgent' does not exist on type 'Target'. node_modules/chrome-devtools-frontend/front_end/sdk/DOMModel.js(1070,12): error TS2339: Property 'registerDOMDispatcher' does not exist on type 'Target'. -node_modules/chrome-devtools-frontend/front_end/sdk/DOMModel.js(1096,16): error TS2352: Conversion of type 'OverlayModel' to type '{ highlightDOMNode(node: DOMNode, config: any, backendNodeId?: any, objectId?: any): void; setInspectMode(mode: any, config: any): Promise; highlightFrame(frameId: any): void; } & { ...; }' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. - Type 'OverlayModel' is not comparable to type '{ highlightDOMNode(node: DOMNode, config: any, backendNodeId?: any, objectId?: any): void; setInspectMode(mode: any, config: any): Promise; highlightFrame(frameId: any): void; }'. - Property '_domModel' does not exist on type '{ highlightDOMNode(node: DOMNode, config: any, backendNodeId?: any, objectId?: any): void; setInspectMode(mode: any, config: any): Promise; highlightFrame(frameId: any): void; }'. node_modules/chrome-devtools-frontend/front_end/sdk/DOMModel.js(1165,24): error TS2694: Namespace 'Protocol' has no exported member 'Runtime'. node_modules/chrome-devtools-frontend/front_end/sdk/DOMModel.js(1176,34): error TS2694: Namespace 'Protocol' has no exported member 'DOM'. node_modules/chrome-devtools-frontend/front_end/sdk/DOMModel.js(1188,46): error TS2339: Property 'valuesArray' does not exist on type 'Set'. @@ -9839,11 +9982,6 @@ node_modules/chrome-devtools-frontend/front_end/sdk/EmulationModel.js(11,35): er node_modules/chrome-devtools-frontend/front_end/sdk/EmulationModel.js(12,30): error TS2339: Property 'pageAgent' does not exist on type 'Target'. node_modules/chrome-devtools-frontend/front_end/sdk/EmulationModel.js(13,43): error TS2339: Property 'deviceOrientationAgent' does not exist on type 'Target'. node_modules/chrome-devtools-frontend/front_end/sdk/EmulationModel.js(51,24): error TS2694: Namespace 'Protocol' has no exported member 'PageAgent'. -node_modules/chrome-devtools-frontend/front_end/sdk/EmulationModel.js(65,5): error TS2322: Type 'OverlayModel' is not assignable to type '{ highlightDOMNode(node: DOMNode, config: any, backendNodeId?: any, objectId?: any): void; setInspectMode(mode: any, config: any): Promise; highlightFrame(frameId: any): void; } & { ...; }'. - Type 'OverlayModel' is not assignable to type '{ highlightDOMNode(node: DOMNode, config: any, backendNodeId?: any, objectId?: any): void; setInspectMode(mode: any, config: any): Promise; highlightFrame(frameId: any): void; }'. -node_modules/chrome-devtools-frontend/front_end/sdk/EmulationModel.js(65,5): error TS2322: Type 'OverlayModel' is not assignable to type '{ highlightDOMNode(node: DOMNode, config: any, backendNodeId?: any, objectId?: any): void; setInspectMode(mode: any, config: any): Promise; highlightFrame(frameId: any): void; } & { ...; }'. - Type 'OverlayModel' is not assignable to type '{ highlightDOMNode(node: DOMNode, config: any, backendNodeId?: any, objectId?: any): void; setInspectMode(mode: any, config: any): Promise; highlightFrame(frameId: any): void; }'. - Property '_domModel' does not exist on type '{ highlightDOMNode(node: DOMNode, config: any, backendNodeId?: any, objectId?: any): void; setInspectMode(mode: any, config: any): Promise; highlightFrame(frameId: any): void; }'. node_modules/chrome-devtools-frontend/front_end/sdk/EmulationModel.js(148,5): error TS2322: Type '{ enabled: boolean; configuration: string; }' is not assignable to type '{ enabled: boolean; configuration: string; scriptId: string; }'. node_modules/chrome-devtools-frontend/front_end/sdk/EmulationModel.js(148,5): error TS2322: Type '{ enabled: boolean; configuration: string; }' is not assignable to type '{ enabled: boolean; configuration: string; scriptId: string; }'. Property 'scriptId' is missing in type '{ enabled: boolean; configuration: string; }'. @@ -9999,6 +10137,7 @@ node_modules/chrome-devtools-frontend/front_end/sdk/NetworkManager.js(1025,37): node_modules/chrome-devtools-frontend/front_end/sdk/NetworkManager.js(1027,39): error TS2339: Property 'set' does not exist on type 'Multimap'. node_modules/chrome-devtools-frontend/front_end/sdk/NetworkManager.js(1050,82): error TS2339: Property 'valuesArray' does not exist on type 'Multimap'. node_modules/chrome-devtools-frontend/front_end/sdk/NetworkManager.js(1059,68): error TS2339: Property 'keysArray' does not exist on type 'Multimap'. +node_modules/chrome-devtools-frontend/front_end/sdk/NetworkManager.js(1084,19): error TS2339: Property 'networkAgent' does not exist on type 'Target'. node_modules/chrome-devtools-frontend/front_end/sdk/NetworkManager.js(1101,35): error TS2345: Argument of type '{}' is not assignable to parameter of type '{ [x: string]: string; }'. Index signature is missing in type '{}'. node_modules/chrome-devtools-frontend/front_end/sdk/NetworkManager.js(1115,24): error TS2694: Namespace 'Protocol' has no exported member 'NetworkAgent'. @@ -10076,15 +10215,12 @@ node_modules/chrome-devtools-frontend/front_end/sdk/NetworkRequest.js(1131,20): node_modules/chrome-devtools-frontend/front_end/sdk/NetworkRequest.js(1134,20): error TS2339: Property 'ContentData' does not exist on type 'typeof NetworkRequest'. node_modules/chrome-devtools-frontend/front_end/sdk/OverlayModel.js(16,12): error TS2339: Property 'registerOverlayDispatcher' does not exist on type 'Target'. node_modules/chrome-devtools-frontend/front_end/sdk/OverlayModel.js(17,33): error TS2339: Property 'overlayAgent' does not exist on type 'Target'. -node_modules/chrome-devtools-frontend/front_end/sdk/OverlayModel.js(35,72): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ highlightDOMNode(node: DOMNode, config: any, backendNodeId?: any, objectId?: any): void; setInspectMode(mode: any, config: any): Promise; highlightFrame(frameId: any): void; } & { ...; }'. - Type 'OverlayModel' is not assignable to type '{ highlightDOMNode(node: DOMNode, config: any, backendNodeId?: any, objectId?: any): void; setInspectMode(mode: any, config: any): Promise; highlightFrame(frameId: any): void; } & { ...; }'. - Type 'OverlayModel' is not assignable to type '{ highlightDOMNode(node: DOMNode, config: any, backendNodeId?: any, objectId?: any): void; setInspectMode(mode: any, config: any): Promise; highlightFrame(frameId: any): void; }'. - Type 'this' is not assignable to type '{ highlightDOMNode(node: DOMNode, config: any, backendNodeId?: any, objectId?: any): void; setInspectMode(mode: any, config: any): Promise; highlightFrame(frameId: any): void; }'. - Type 'OverlayModel' is not assignable to type '{ highlightDOMNode(node: DOMNode, config: any, backendNodeId?: any, objectId?: any): void; setInspectMode(mode: any, config: any): Promise; highlightFrame(frameId: any): void; }'. - Property '_domModel' does not exist on type '{ highlightDOMNode(node: DOMNode, config: any, backendNodeId?: any, objectId?: any): void; setInspectMode(mode: any, config: any): Promise; highlightFrame(frameId: any): void; }'. node_modules/chrome-devtools-frontend/front_end/sdk/OverlayModel.js(81,22): error TS2339: Property '_highlightDisabled' does not exist on type 'typeof OverlayModel'. node_modules/chrome-devtools-frontend/front_end/sdk/OverlayModel.js(85,22): error TS2339: Property '_highlightDisabled' does not exist on type 'typeof OverlayModel'. node_modules/chrome-devtools-frontend/front_end/sdk/OverlayModel.js(110,9): error TS2555: Expected at least 2 arguments, but got 1. +node_modules/chrome-devtools-frontend/front_end/sdk/OverlayModel.js(119,5): error TS2322: Type '{ highlightDOMNode(node: DOMNode, config: any, backendNodeId?: any, objectId?: any): void; setInspectMode(mode: any, config: any): Promise; highlightFrame(frameId: any): void; }' is not assignable to type 'DefaultHighlighter'. +node_modules/chrome-devtools-frontend/front_end/sdk/OverlayModel.js(119,5): error TS2322: Type '{ highlightDOMNode(node: DOMNode, config: any, backendNodeId?: any, objectId?: any): void; setInspectMode(mode: any, config: any): Promise; highlightFrame(frameId: any): void; }' is not assignable to type 'DefaultHighlighter'. + Property '_model' is missing in type '{ highlightDOMNode(node: DOMNode, config: any, backendNodeId?: any, objectId?: any): void; setInspectMode(mode: any, config: any): Promise; highlightFrame(frameId: any): void; }'. node_modules/chrome-devtools-frontend/front_end/sdk/OverlayModel.js(123,24): error TS2694: Namespace 'Protocol' has no exported member 'Overlay'. node_modules/chrome-devtools-frontend/front_end/sdk/OverlayModel.js(141,24): error TS2694: Namespace 'Protocol' has no exported member 'DOM'. node_modules/chrome-devtools-frontend/front_end/sdk/OverlayModel.js(143,24): error TS2694: Namespace 'Protocol' has no exported member 'DOM'. @@ -10211,6 +10347,7 @@ node_modules/chrome-devtools-frontend/front_end/sdk/Resource.js(241,13): error T node_modules/chrome-devtools-frontend/front_end/sdk/Resource.js(263,61): error TS2339: Property 'pageAgent' does not exist on type 'Target'. node_modules/chrome-devtools-frontend/front_end/sdk/ResourceTreeModel.js(44,26): error TS2339: Property 'pageAgent' does not exist on type 'Target'. node_modules/chrome-devtools-frontend/front_end/sdk/ResourceTreeModel.js(48,12): error TS2339: Property 'registerPageDispatcher' does not exist on type 'Target'. +node_modules/chrome-devtools-frontend/front_end/sdk/ResourceTreeModel.js(80,56): error TS2339: Property 'valuesArray' does not exist on type 'Map'. node_modules/chrome-devtools-frontend/front_end/sdk/ResourceTreeModel.js(117,24): error TS2694: Namespace 'Protocol' has no exported member 'Page'. node_modules/chrome-devtools-frontend/front_end/sdk/ResourceTreeModel.js(161,24): error TS2694: Namespace 'Protocol' has no exported member 'Page'. node_modules/chrome-devtools-frontend/front_end/sdk/ResourceTreeModel.js(162,24): error TS2694: Namespace 'Protocol' has no exported member 'Page'. @@ -10427,6 +10564,8 @@ node_modules/chrome-devtools-frontend/front_end/sdk/Target.js(16,52): error TS26 node_modules/chrome-devtools-frontend/front_end/sdk/Target.js(148,48): error TS2339: Property 'valuesArray' does not exist on type 'Map'. node_modules/chrome-devtools-frontend/front_end/sdk/Target.js(159,53): error TS2345: Argument of type 'new (arg1: Target) => T' is not assignable to parameter of type 'new (arg1: Target) => SDKModel'. Type 'T' is not assignable to type 'SDKModel'. +node_modules/chrome-devtools-frontend/front_end/sdk/Target.js(166,48): error TS2345: Argument of type 'new (arg1: Target) => T' is not assignable to parameter of type 'new (arg1: Target) => SDKModel'. + Type 'T' is not assignable to type 'SDKModel'. node_modules/chrome-devtools-frontend/front_end/sdk/Target.js(191,34): error TS2339: Property 'asParsedURL' does not exist on type 'string'. node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(15,120): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(104,35): error TS2345: Argument of type 'new (arg1: Target) => T' is not assignable to parameter of type 'new (arg1: Target) => SDKModel'. @@ -10448,26 +10587,12 @@ node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(169,31): er node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(177,42): error TS2345: Argument of type 'Function' is not assignable to parameter of type 'new (arg1: Target) => any'. node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(209,21): error TS2339: Property 'remove' does not exist on type '{ targetAdded(target: Target): void; targetRemoved(target: Target): void; }[]'. node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(216,52): error TS2694: Namespace 'Protocol.InspectorBackend.Connection' has no exported member 'Factory'. -node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(221,33): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ targetAdded(target: Target): void; targetRemoved(target: Target): void; } & { targetAdded(target: Target): void; targetRemoved(target: Target): void; }'. - Type 'TargetManager' is not assignable to type '{ targetAdded(target: Target): void; targetRemoved(target: Target): void; } & { targetAdded(target: Target): void; targetRemoved(target: Target): void; }'. - Type 'TargetManager' is not assignable to type '{ targetAdded(target: Target): void; targetRemoved(target: Target): void; }'. - Type 'this' is not assignable to type '{ targetAdded(target: Target): void; targetRemoved(target: Target): void; }'. - Type 'TargetManager' is not assignable to type '{ targetAdded(target: Target): void; targetRemoved(target: Target): void; }'. - Property 'targetAdded' is missing in type 'TargetManager'. -node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(224,72): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ targetAdded(target: Target): void; targetRemoved(target: Target): void; } & { targetAdded(target: Target): void; targetRemoved(target: Target): void; }'. - Type 'TargetManager' is not assignable to type '{ targetAdded(target: Target): void; targetRemoved(target: Target): void; } & { targetAdded(target: Target): void; targetRemoved(target: Target): void; }'. - Type 'TargetManager' is not assignable to type '{ targetAdded(target: Target): void; targetRemoved(target: Target): void; }'. - Type 'this' is not assignable to type '{ targetAdded(target: Target): void; targetRemoved(target: Target): void; }'. - Type 'TargetManager' is not assignable to type '{ targetAdded(target: Target): void; targetRemoved(target: Target): void; }'. - Property 'targetAdded' is missing in type 'TargetManager'. +node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(237,34): error TS2345: Argument of type 'Function' is not assignable to parameter of type 'new (arg1: Target) => any'. node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(267,19): error TS2339: Property 'remove' does not exist on type 'Target[]'. node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(279,34): error TS2345: Argument of type 'Function' is not assignable to parameter of type 'new (arg1: Target) => any'. -node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(329,11): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ targetAdded(target: Target): void; targetRemoved(target: Target): void; } & { targetAdded(target: Target): void; targetRemoved(target: Target): void; }'. - Type 'this' is not assignable to type '{ targetAdded(target: Target): void; targetRemoved(target: Target): void; }'. node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(329,25): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(332,72): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ targetAdded(target: Target): void; targetRemoved(target: Target): void; } & { targetAdded(target: Target): void; targetRemoved(target: Target): void; }'. - Type 'this' is not assignable to type '{ targetAdded(target: Target): void; targetRemoved(target: Target): void; }'. node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(351,35): error TS2555: Expected at least 2 arguments, but got 1. +node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(352,12): error TS2339: Property 'runtimeAgent' does not exist on type 'Target'. node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(356,52): error TS2694: Namespace 'Protocol.InspectorBackend.Connection' has no exported member 'Params'. node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(364,7): error TS2322: Type 'WebSocketConnection' is not assignable to type '{ sendMessage(message: string): void; disconnect(): Promise; }'. node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(364,7): error TS2322: Type 'WebSocketConnection' is not assignable to type '{ sendMessage(message: string): void; disconnect(): Promise; }'. @@ -10485,6 +10610,7 @@ node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(427,34): er node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(483,24): error TS2694: Namespace 'Protocol' has no exported member 'Target'. node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(501,24): error TS2694: Namespace 'Protocol' has no exported member 'Target'. node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(530,24): error TS2694: Namespace 'Protocol' has no exported member 'Target'. +node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(552,12): error TS2339: Property 'runtimeAgent' does not exist on type 'Target'. node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(581,24): error TS2694: Namespace 'Protocol' has no exported member 'TargetAgent'. node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(583,52): error TS2694: Namespace 'Protocol.InspectorBackend.Connection' has no exported member 'Params'. node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(589,5): error TS2322: Type 'ChildConnection' is not assignable to type '{ sendMessage(message: string): void; disconnect(): Promise; }'. @@ -10492,9 +10618,6 @@ node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(589,5): err Property '_agent' does not exist on type '{ sendMessage(message: string): void; disconnect(): Promise; }'. node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(598,24): error TS2694: Namespace 'Protocol' has no exported member 'TargetAgent'. node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(600,52): error TS2694: Namespace 'Protocol.InspectorBackend.Connection' has no exported member 'Params'. -node_modules/chrome-devtools-frontend/front_end/sdk/TargetManager.js(672,1): error TS2322: Type 'TargetManager' is not assignable to type '{ targetAdded(target: Target): void; targetRemoved(target: Target): void; } & { targetAdded(target: Target): void; targetRemoved(target: Target): void; }'. - Type 'TargetManager' is not assignable to type '{ targetAdded(target: Target): void; targetRemoved(target: Target): void; }'. - Property 'targetAdded' is missing in type 'TargetManager'. node_modules/chrome-devtools-frontend/front_end/sdk/TracingManager.js(13,42): error TS2694: Namespace 'SDK.TracingManager' has no exported member 'EventPayload'. node_modules/chrome-devtools-frontend/front_end/sdk/TracingManager.js(36,33): error TS2339: Property 'tracingAgent' does not exist on type 'Target'. node_modules/chrome-devtools-frontend/front_end/sdk/TracingManager.js(37,12): error TS2339: Property 'registerTracingDispatcher' does not exist on type 'Target'. @@ -10534,6 +10657,7 @@ node_modules/chrome-devtools-frontend/front_end/sdk/TracingModel.js(888,23): err node_modules/chrome-devtools-frontend/front_end/sdk/TracingModel.js(889,18): error TS2339: Property 'stableSort' does not exist on type 'any[]'. node_modules/chrome-devtools-frontend/front_end/sdk/TracingModel.js(917,18): error TS2339: Property 'remove' does not exist on type 'any[]'. node_modules/chrome-devtools-frontend/front_end/sdk/TracingModel.js(921,34): error TS2694: Namespace 'SDK.TracingManager' has no exported member 'EventPayload'. +node_modules/chrome-devtools-frontend/front_end/sdk_test_runner/PageMockTestRunner.js(17,20): error TS2554: Expected 5 arguments, but got 4. node_modules/chrome-devtools-frontend/front_end/sdk_test_runner/PageMockTestRunner.js(88,20): error TS2339: Property 'hashCode' does not exist on type 'StringConstructor'. node_modules/chrome-devtools-frontend/front_end/security/SecurityModel.js(14,34): error TS2339: Property 'securityAgent' does not exist on type 'Target'. node_modules/chrome-devtools-frontend/front_end/security/SecurityModel.js(15,12): error TS2339: Property 'registerSecurityDispatcher' does not exist on type 'Target'. @@ -10552,6 +10676,12 @@ node_modules/chrome-devtools-frontend/front_end/security/SecurityPanel.js(15,25) node_modules/chrome-devtools-frontend/front_end/security/SecurityPanel.js(21,31): error TS2694: Namespace 'Protocol' has no exported member 'Network'. node_modules/chrome-devtools-frontend/front_end/security/SecurityPanel.js(24,45): error TS2694: Namespace 'Security.SecurityPanel' has no exported member 'Origin'. node_modules/chrome-devtools-frontend/front_end/security/SecurityPanel.js(24,77): error TS2694: Namespace 'Security.SecurityPanel' has no exported member 'OriginState'. +node_modules/chrome-devtools-frontend/front_end/security/SecurityPanel.js(30,61): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Type 'SecurityPanel' is not assignable to type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Types of property 'modelAdded' are incompatible. + Type '(securityModel: SecurityModel) => void' is not assignable to type '(model: T) => void'. + Types of parameters 'securityModel' and 'model' are incompatible. + Type 'T' is not assignable to type 'SecurityModel'. node_modules/chrome-devtools-frontend/front_end/security/SecurityPanel.js(37,57): error TS2339: Property 'runtime' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/security/SecurityPanel.js(47,9): error TS2339: Property 'consume' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/security/SecurityPanel.js(60,9): error TS2339: Property 'consume' does not exist on type 'Event'. @@ -10697,11 +10827,9 @@ node_modules/chrome-devtools-frontend/front_end/settings/FrameworkBlackboxSettin node_modules/chrome-devtools-frontend/front_end/settings/SettingsScreen.js(39,25): error TS2339: Property 'tabIndex' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/settings/SettingsScreen.js(45,10): error TS2339: Property 'createChild' does not exist on type 'DocumentFragment'. node_modules/chrome-devtools-frontend/front_end/settings/SettingsScreen.js(46,24): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/settings/SettingsScreen.js(51,48): error TS2345: Argument of type 'ToolbarItem' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarItem' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/settings/SettingsScreen.js(54,43): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/settings/SettingsScreen.js(69,55): error TS2339: Property 'runtime' does not exist on type 'Window'. -node_modules/chrome-devtools-frontend/front_end/settings/SettingsScreen.js(85,5): error TS2322: Type '{ tabbedPane(): TabbedPane; enableMoreTabsButton(): void; }' is not assignable to type '{ appendApplicableItems(locationName: string): void; appendView(view: { viewId(): string; title(): string; isCloseable(): boolean; isTransient(): boolean; toolbarItems(): Promise<({ item(): any & any; } & { ...; })[]>; widget(): Promise<...>; disposeView(): void; }, insertBefore?: { ...; }): void; showView(view: { ....'. +node_modules/chrome-devtools-frontend/front_end/settings/SettingsScreen.js(85,5): error TS2322: Type '{ tabbedPane(): TabbedPane; enableMoreTabsButton(): void; }' is not assignable to type '{ appendApplicableItems(locationName: string): void; appendView(view: { viewId(): string; title(): string; isCloseable(): boolean; isTransient(): boolean; toolbarItems(): Promise; widget(): Promise<...>; disposeView(): void; }, insertBefore?: { ...; }): void; showView(view: { ...; }, insertBefore?: { ...'. Property 'appendApplicableItems' is missing in type '{ tabbedPane(): TabbedPane; enableMoreTabsButton(): void; }'. node_modules/chrome-devtools-frontend/front_end/settings/SettingsScreen.js(100,15): error TS2339: Property 'keyCode' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/settings/SettingsScreen.js(119,31): error TS2339: Property 'createChild' does not exist on type 'Element'. @@ -10722,6 +10850,12 @@ node_modules/chrome-devtools-frontend/front_end/settings/SettingsScreen.js(289,5 node_modules/chrome-devtools-frontend/front_end/settings/SettingsScreen.js(311,10): error TS2339: Property 'runtime' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/settings/SettingsScreen.js(312,10): error TS2339: Property 'runtime' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/settings/SettingsScreen.js(313,10): error TS2339: Property 'runtime' does not exist on type 'Window'. +node_modules/chrome-devtools-frontend/front_end/snippets/ScriptSnippetModel.js(53,56): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Type 'ScriptSnippetModel' is not assignable to type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Types of property 'modelAdded' are incompatible. + Type '(debuggerModel: DebuggerModel) => void' is not assignable to type '(model: T) => void'. + Types of parameters 'debuggerModel' and 'model' are incompatible. + Type 'T' is not assignable to type 'DebuggerModel'. node_modules/chrome-devtools-frontend/front_end/snippets/ScriptSnippetModel.js(70,35): error TS2339: Property 'remove' does not exist on type 'Map'. node_modules/chrome-devtools-frontend/front_end/snippets/ScriptSnippetModel.js(113,5): error TS2322: Type 'SnippetsProject' is not assignable to type '{ workspace(): Workspace; id(): string; type(): string; isServiceProject(): boolean; displayName(): string; requestMetadata(uiSourceCode: UISourceCode): Promise; ... 17 more ...; uiSourceCodes(): UISourceCode[]; }'. node_modules/chrome-devtools-frontend/front_end/snippets/ScriptSnippetModel.js(113,5): error TS2322: Type 'SnippetsProject' is not assignable to type '{ workspace(): Workspace; id(): string; type(): string; isServiceProject(): boolean; displayName(): string; requestMetadata(uiSourceCode: UISourceCode): Promise; ... 17 more ...; uiSourceCodes(): UISourceCode[]; }'. @@ -10739,11 +10873,6 @@ node_modules/chrome-devtools-frontend/front_end/snippets/ScriptSnippetModel.js(3 node_modules/chrome-devtools-frontend/front_end/snippets/SnippetStorage.js(62,27): error TS2339: Property 'valuesArray' does not exist on type 'Map'. node_modules/chrome-devtools-frontend/front_end/snippets/SnippetsQuickOpen.js(30,12): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/source_frame/FontView.js(38,11): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/source_frame/FontView.js(52,5): error TS2322: Type 'ToolbarText[]' is not assignable to type '({ item(): any & any; } & { item(): any & any; })[]'. -node_modules/chrome-devtools-frontend/front_end/source_frame/FontView.js(52,5): error TS2322: Type 'ToolbarText[]' is not assignable to type '({ item(): any & any; } & { item(): any & any; })[]'. - Type 'ToolbarText' is not assignable to type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarText' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarText'. node_modules/chrome-devtools-frontend/front_end/source_frame/FontView.js(62,16): error TS2339: Property 'sprintf' does not exist on type 'StringConstructor'. node_modules/chrome-devtools-frontend/front_end/source_frame/FontView.js(78,21): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/source_frame/FontView.js(79,19): error TS2339: Property 'createTextChild' does not exist on type 'Element'. @@ -10766,12 +10895,6 @@ node_modules/chrome-devtools-frontend/front_end/source_frame/FontView.js(152,29) node_modules/chrome-devtools-frontend/front_end/source_frame/ImageView.js(38,11): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/source_frame/ImageView.js(52,81): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/source_frame/ImageView.js(58,36): error TS2339: Property 'createChild' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/source_frame/ImageView.js(68,5): error TS2322: Type '(ToolbarSeparator | ToolbarText)[]' is not assignable to type '({ item(): any & any; } & { item(): any & any; })[]'. -node_modules/chrome-devtools-frontend/front_end/source_frame/ImageView.js(68,5): error TS2322: Type '(ToolbarSeparator | ToolbarText)[]' is not assignable to type '({ item(): any & any; } & { item(): any & any; })[]'. - Type 'ToolbarSeparator | ToolbarText' is not assignable to type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSeparator' is not assignable to type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSeparator' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarSeparator'. node_modules/chrome-devtools-frontend/front_end/source_frame/ImageView.js(105,36): error TS2339: Property 'bytesToString' does not exist on type 'NumberConstructor'. node_modules/chrome-devtools-frontend/front_end/source_frame/ImageView.js(128,49): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/source_frame/ImageView.js(131,11): error TS2555: Expected at least 2 arguments, but got 1. @@ -10786,7 +10909,6 @@ node_modules/chrome-devtools-frontend/front_end/source_frame/JSONView.js(165,28) node_modules/chrome-devtools-frontend/front_end/source_frame/JSONView.js(170,23): error TS2339: Property 'setSearchRegex' does not exist on type 'TreeElement'. node_modules/chrome-devtools-frontend/front_end/source_frame/PreviewFactory.js(14,33): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/source_frame/ResourceSourceFrame.js(51,35): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/source_frame/ResourceSourceFrame.js(69,5): error TS2554: Expected 3 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/source_frame/SourceCodeDiff.js(15,22): error TS2339: Property 'installGutter' does not exist on type 'CodeMirrorTextEditor'. node_modules/chrome-devtools-frontend/front_end/source_frame/SourceCodeDiff.js(89,28): error TS2339: Property 'toggleLineClass' does not exist on type 'CodeMirrorTextEditor'. node_modules/chrome-devtools-frontend/front_end/source_frame/SourceCodeDiff.js(110,25): error TS2694: Namespace 'Diff.Diff' has no exported member 'DiffArray'. @@ -10798,11 +10920,6 @@ node_modules/chrome-devtools-frontend/front_end/source_frame/SourceCodeDiff.js(2 node_modules/chrome-devtools-frontend/front_end/source_frame/SourceCodeDiff.js(283,22): error TS2339: Property 'setGutterDecoration' does not exist on type 'CodeMirrorTextEditor'. node_modules/chrome-devtools-frontend/front_end/source_frame/SourceCodeDiff.js(284,22): error TS2339: Property 'toggleLineClass' does not exist on type 'CodeMirrorTextEditor'. node_modules/chrome-devtools-frontend/front_end/source_frame/SourceFrame.js(41,11): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/source_frame/SourceFrame.js(115,5): error TS2322: Type 'ToolbarText[]' is not assignable to type '({ item(): any & any; } & { item(): any & any; })[]'. -node_modules/chrome-devtools-frontend/front_end/source_frame/SourceFrame.js(115,5): error TS2322: Type 'ToolbarText[]' is not assignable to type '({ item(): any & any; } & { item(): any & any; })[]'. - Type 'ToolbarText' is not assignable to type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarText' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarText'. node_modules/chrome-devtools-frontend/front_end/source_frame/SourceFrame.js(371,32): error TS2339: Property 'lowerBound' does not exist on type 'any[]'. node_modules/chrome-devtools-frontend/front_end/source_frame/SourceFrame.js(435,15): error TS2339: Property '__fromRegExpQuery' does not exist on type 'RegExp'. node_modules/chrome-devtools-frontend/front_end/source_frame/SourceFrame.js(459,15): error TS2339: Property '__fromRegExpQuery' does not exist on type 'RegExp'. @@ -11008,6 +11125,7 @@ node_modules/chrome-devtools-frontend/front_end/sources/InplaceFormatterEditorAc node_modules/chrome-devtools-frontend/front_end/sources/InplaceFormatterEditorAction.js(18,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/sources/InplaceFormatterEditorAction.js(46,41): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/sources/InplaceFormatterEditorAction.js(68,22): error TS2694: Namespace 'Common' has no exported member 'Event'. +node_modules/chrome-devtools-frontend/front_end/sources/InplaceFormatterEditorAction.js(100,37): error TS2339: Property 'selection' does not exist on type 'Widget'. node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptBreakpointsSidebarPane.js(32,27): error TS2339: Property 'removeChildren' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptBreakpointsSidebarPane.js(33,46): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptBreakpointsSidebarPane.js(34,34): error TS2555: Expected at least 2 arguments, but got 1. @@ -11037,9 +11155,6 @@ node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptCompilerPlugin node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptSourceFrame.js(60,50): error TS2345: Argument of type 'Event' is not assignable to parameter of type 'MouseEvent | KeyboardEvent'. Type 'Event' is not assignable to type 'KeyboardEvent'. node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptSourceFrame.js(107,33): error TS2339: Property 'asParsedURL' does not exist on type 'string'. -node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptSourceFrame.js(109,21): error TS2345: Argument of type 'ToolbarText' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarText' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarText'. node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptSourceFrame.js(128,59): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptSourceFrame.js(132,9): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptSourceFrame.js(134,95): error TS2339: Property 'valuesArray' does not exist on type 'Map'. @@ -11107,8 +11222,6 @@ node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptSourceFrame.js node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptSourceFrame.js(1403,54): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptSourceFrame.js(1425,56): error TS2339: Property 'valuesArray' does not exist on type 'Map'. node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptSourceFrame.js(1442,31): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptSourceFrame.js(1450,31): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptSourceFrame.js(1463,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/sources/JavaScriptSourceFrame.js(1469,63): error TS2694: Namespace 'SourceFrame.SourcesTextEditor' has no exported member 'GutterClickEventData'. node_modules/chrome-devtools-frontend/front_end/sources/NavigatorView.js(87,21): error TS2339: Property '_boostOrder' does not exist on type 'TreeElement'. @@ -11165,9 +11278,8 @@ node_modules/chrome-devtools-frontend/front_end/sources/NavigatorView.js(876,22) node_modules/chrome-devtools-frontend/front_end/sources/NavigatorView.js(951,23): error TS2339: Property '_title' does not exist on type 'NavigatorTreeNode'. node_modules/chrome-devtools-frontend/front_end/sources/NavigatorView.js(952,19): error TS2339: Property 'parent' does not exist on type 'NavigatorTreeNode'. node_modules/chrome-devtools-frontend/front_end/sources/NavigatorView.js(1023,17): error TS2339: Property 'title' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/sources/NavigatorView.js(1024,28): error TS2345: Argument of type 'Element[]' is not assignable to parameter of type 'Icon[]'. - Type 'Element' is not assignable to type 'Icon'. - Property 'createdCallback' is missing in type 'Element'. +node_modules/chrome-devtools-frontend/front_end/sources/NavigatorView.js(1024,29): error TS2322: Type 'Element' is not assignable to type 'Icon'. + Property 'createdCallback' is missing in type 'Element'. node_modules/chrome-devtools-frontend/front_end/sources/NavigatorView.js(1045,26): error TS2339: Property 'draggable' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/sources/NavigatorView.js(1055,51): error TS2339: Property 'hasFocus' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/sources/NavigatorView.js(1190,14): error TS2339: Property 'parent' does not exist on type 'NavigatorTreeNode'. @@ -11198,10 +11310,6 @@ node_modules/chrome-devtools-frontend/front_end/sources/NavigatorView.js(1614,14 node_modules/chrome-devtools-frontend/front_end/sources/NavigatorView.js(1616,40): error TS2339: Property '_treeElement' does not exist on type 'NavigatorTreeNode'. node_modules/chrome-devtools-frontend/front_end/sources/NavigatorView.js(1679,47): error TS2339: Property 'hasFocus' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/sources/ObjectEventListenersSidebarPane.js(11,48): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/sources/ObjectEventListenersSidebarPane.js(24,5): error TS2322: Type 'ToolbarButton[]' is not assignable to type '({ item(): any & any; } & { item(): any & any; })[]'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarButton'. node_modules/chrome-devtools-frontend/front_end/sources/ObjectEventListenersSidebarPane.js(84,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/sources/OutlineQuickOpen.js(32,52): error TS2694: Namespace 'Formatter.FormatterWorkerPool' has no exported member 'OutlineItem'. node_modules/chrome-devtools-frontend/front_end/sources/OutlineQuickOpen.js(118,14): error TS2555: Expected at least 2 arguments, but got 1. @@ -11220,14 +11328,10 @@ node_modules/chrome-devtools-frontend/front_end/sources/ScriptFormatterEditorAct node_modules/chrome-devtools-frontend/front_end/sources/ScriptFormatterEditorAction.js(28,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/sources/ScriptFormatterEditorAction.js(61,41): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/sources/ScriptFormatterEditorAction.js(85,22): error TS2694: Namespace 'Common' has no exported member 'Event'. +node_modules/chrome-devtools-frontend/front_end/sources/ScriptFormatterEditorAction.js(105,35): error TS2339: Property 'selection' does not exist on type 'Widget'. node_modules/chrome-devtools-frontend/front_end/sources/SimpleHistoryManager.js(37,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. node_modules/chrome-devtools-frontend/front_end/sources/SnippetsPlugin.js(41,39): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/sources/SnippetsPlugin.js(41,73): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/sources/SnippetsPlugin.js(43,5): error TS2322: Type 'ToolbarToggle[]' is not assignable to type '({ item(): any & any; } & { item(): any & any; })[]'. -node_modules/chrome-devtools-frontend/front_end/sources/SnippetsPlugin.js(43,5): error TS2322: Type 'ToolbarToggle[]' is not assignable to type '({ item(): any & any; } & { item(): any & any; })[]'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarToggle'. node_modules/chrome-devtools-frontend/front_end/sources/SourceFormatter.js(48,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/sources/SourceFormatter.js(55,32): error TS2339: Property 'remove' does not exist on type 'Map; formatData: SourceFormatData; }>'. node_modules/chrome-devtools-frontend/front_end/sources/SourceFormatter.js(67,32): error TS2339: Property 'remove' does not exist on type 'Map; formatData: SourceFormatData; }>'. @@ -11249,23 +11353,11 @@ node_modules/chrome-devtools-frontend/front_end/sources/SourceMapNamesResolver.j node_modules/chrome-devtools-frontend/front_end/sources/SourcesNavigator.js(51,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesNavigator.js(109,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesNavigator.js(145,17): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/sources/SourcesNavigator.js(149,31): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesNavigator.js(189,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesNavigator.js(211,19): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/sources/SourcesNavigator.js(214,39): error TS2345: Argument of type 'ToolbarSettingCheckbox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSettingCheckbox' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/sources/SourcesNavigator.js(216,39): error TS2345: Argument of type 'ToolbarSeparator' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSeparator' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesNavigator.js(217,46): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/sources/SourcesNavigator.js(221,39): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesNavigator.js(224,17): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/sources/SourcesNavigator.js(227,37): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesNavigator.js(272,63): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/sources/SourcesNavigator.js(274,31): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesNavigator.js(293,44): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/sources/SourcesNavigator.js(307,9): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/sources/SourcesNavigator.js(308,41): error TS2555: Expected at least 2 arguments, but got 1. @@ -11276,24 +11368,16 @@ node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(35,26): node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(38,52): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(68,29): error TS2339: Property 'tabIndex' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(78,34): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(79,49): error TS2345: Argument of type 'ToolbarMenuButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarMenuButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(92,32): error TS2339: Property 'runtime' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(122,32): error TS2339: Property 'addEventListener' does not exist on type 'typeof extensionServer'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(131,30): error TS2551: Property '_instance' does not exist on type 'typeof SourcesPanel'. Did you mean 'instance'? node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(132,35): error TS2551: Property '_instance' does not exist on type 'typeof SourcesPanel'. Did you mean 'instance'? node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(133,55): error TS2339: Property 'runtime' does not exist on type 'Window'. -node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(149,58): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(151,61): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(153,62): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(208,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(227,52): error TS2339: Property '_instance' does not exist on type 'typeof WrapperView'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(242,40): error TS2339: Property '_instance' does not exist on type 'typeof WrapperView'. -node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(257,7): error TS2322: Type '{ tabbedPane(): TabbedPane; enableMoreTabsButton(): void; }' is not assignable to type '{ appendApplicableItems(locationName: string): void; appendView(view: { viewId(): string; title(): string; isCloseable(): boolean; isTransient(): boolean; toolbarItems(): Promise<({ item(): any & any; } & { ...; })[]>; widget(): Promise<...>; disposeView(): void; }, insertBefore?: { ...; }): void; showView(view: { ....'. -node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(257,7): error TS2322: Type '{ tabbedPane(): TabbedPane; enableMoreTabsButton(): void; }' is not assignable to type '{ appendApplicableItems(locationName: string): void; appendView(view: { viewId(): string; title(): string; isCloseable(): boolean; isTransient(): boolean; toolbarItems(): Promise<({ item(): any & any; } & { ...; })[]>; widget(): Promise<...>; disposeView(): void; }, insertBefore?: { ...; }): void; showView(view: { ....'. +node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(257,7): error TS2322: Type '{ tabbedPane(): TabbedPane; enableMoreTabsButton(): void; }' is not assignable to type '{ appendApplicableItems(locationName: string): void; appendView(view: { viewId(): string; title(): string; isCloseable(): boolean; isTransient(): boolean; toolbarItems(): Promise; widget(): Promise<...>; disposeView(): void; }, insertBefore?: { ...; }): void; showView(view: { ...; }, insertBefore?: { ...'. +node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(257,7): error TS2322: Type '{ tabbedPane(): TabbedPane; enableMoreTabsButton(): void; }' is not assignable to type '{ appendApplicableItems(locationName: string): void; appendView(view: { viewId(): string; title(): string; isCloseable(): boolean; isTransient(): boolean; toolbarItems(): Promise; widget(): Promise<...>; disposeView(): void; }, insertBefore?: { ...; }): void; showView(view: { ...; }, insertBefore?: { ...'. Property 'appendApplicableItems' is missing in type '{ tabbedPane(): TabbedPane; enableMoreTabsButton(): void; }'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(277,20): error TS2339: Property 'window' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(289,22): error TS2694: Namespace 'Common' has no exported member 'Event'. @@ -11308,26 +11392,6 @@ node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(465,9): node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(550,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(596,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(689,30): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(691,36): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(694,38): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(695,38): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(696,38): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(697,38): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(699,38): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(700,38): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(701,38): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(705,36): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(709,36): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(717,17): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(795,13): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(798,13): error TS2555: Expected at least 2 arguments, but got 1. @@ -11342,11 +11406,6 @@ node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(963,21): node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(1011,45): error TS2339: Property 'offsetWidth' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(1078,60): error TS2339: Property 'sidebarPanes' does not exist on type 'typeof extensionServer'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(1093,22): error TS2694: Namespace 'Common' has no exported member 'Event'. -node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(1112,5): error TS2322: Type 'SourcesView' is not assignable to type '{ button(sourcesView: any & any): ToolbarButton; } & { button(sourcesView: any & any): ToolbarButton; }'. - Type 'SourcesView' is not assignable to type '{ button(sourcesView: any & any): ToolbarButton; }'. -node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(1112,5): error TS2322: Type 'SourcesView' is not assignable to type '{ button(sourcesView: any & any): ToolbarButton; } & { button(sourcesView: any & any): ToolbarButton; }'. - Type 'SourcesView' is not assignable to type '{ button(sourcesView: any & any): ToolbarButton; }'. - Property 'button' is missing in type 'SourcesView'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(1290,38): error TS2339: Property '_instance' does not exist on type 'typeof WrapperView'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(1298,47): error TS2339: Property '_instance' does not exist on type 'typeof WrapperView'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesPanel.js(1298,93): error TS2339: Property '_instance' does not exist on type 'typeof WrapperView'. @@ -11358,12 +11417,6 @@ node_modules/chrome-devtools-frontend/front_end/sources/SourcesSearchScope.js(16 node_modules/chrome-devtools-frontend/front_end/sources/SourcesSearchScope.js(163,19): error TS2339: Property 'mergeOrdered' does not exist on type 'string[]'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesSearchScope.js(163,51): error TS2339: Property 'naturalOrderComparator' does not exist on type 'StringConstructor'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesSearchScope.js(257,29): error TS2339: Property 'mergeOrdered' does not exist on type 'any[]'. -node_modules/chrome-devtools-frontend/front_end/sources/SourcesView.js(36,70): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ button(sourcesView: any & any): ToolbarButton; } & { button(sourcesView: any & any): ToolbarButton; }'. - Type 'SourcesView' is not assignable to type '{ button(sourcesView: any & any): ToolbarButton; } & { button(sourcesView: any & any): ToolbarButton; }'. - Type 'SourcesView' is not assignable to type '{ button(sourcesView: any & any): ToolbarButton; }'. - Type 'this' is not assignable to type '{ button(sourcesView: any & any): ToolbarButton; }'. - Type 'SourcesView' is not assignable to type '{ button(sourcesView: any & any): ToolbarButton; }'. - Property 'button' is missing in type 'SourcesView'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesView.js(38,50): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesView.js(41,10): error TS2339: Property 'runtime' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/sources/SourcesView.js(55,36): error TS2694: Namespace 'Common.EventTarget' has no exported member 'EventDescriptor'. @@ -11395,7 +11448,6 @@ node_modules/chrome-devtools-frontend/front_end/sources/TabbedEditorContainer.js node_modules/chrome-devtools-frontend/front_end/sources/TabbedEditorContainer.js(219,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/sources/TabbedEditorContainer.js(237,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/sources/TabbedEditorContainer.js(244,32): error TS2339: Property 'sourceSelectionChanged' does not exist on type 'typeof extensionServer'. -node_modules/chrome-devtools-frontend/front_end/sources/TabbedEditorContainer.js(342,7): error TS2554: Expected 3 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/sources/TabbedEditorContainer.js(473,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/sources/TabbedEditorContainer.js(485,18): error TS2339: Property 'remove' does not exist on type 'Map'. node_modules/chrome-devtools-frontend/front_end/sources/TabbedEditorContainer.js(497,22): error TS2694: Namespace 'Common' has no exported member 'Event'. @@ -11409,6 +11461,12 @@ node_modules/chrome-devtools-frontend/front_end/sources/ThreadsSidebarPane.js(16 Type '(debuggerModel: DebuggerModel) => Element' is not assignable to type '(item: T) => Element'. Types of parameters 'debuggerModel' and 'item' are incompatible. Type 'T' is not assignable to type 'DebuggerModel'. +node_modules/chrome-devtools-frontend/front_end/sources/ThreadsSidebarPane.js(20,56): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Type 'ThreadsSidebarPane' is not assignable to type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Types of property 'modelAdded' are incompatible. + Type '(debuggerModel: DebuggerModel) => void' is not assignable to type '(model: T) => void'. + Types of parameters 'debuggerModel' and 'model' are incompatible. + Type 'T' is not assignable to type 'DebuggerModel'. node_modules/chrome-devtools-frontend/front_end/sources/ThreadsSidebarPane.js(38,25): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/sources/ThreadsSidebarPane.js(39,31): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/sources/ThreadsSidebarPane.js(49,33): error TS2555: Expected at least 2 arguments, but got 1. @@ -11429,7 +11487,7 @@ node_modules/chrome-devtools-frontend/front_end/sources/UISourceCodeFrame.js(469 node_modules/chrome-devtools-frontend/front_end/sources/UISourceCodeFrame.js(483,10): error TS2339: Property 'runtime' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/sources/UISourceCodeFrame.js(488,40): error TS2339: Property 'operation' does not exist on type 'CodeMirror'. node_modules/chrome-devtools-frontend/front_end/sources/UISourceCodeFrame.js(496,32): error TS2339: Property 'runtime' does not exist on type 'Window'. -node_modules/chrome-devtools-frontend/front_end/sources/UISourceCodeFrame.js(511,24): error TS2339: Property 'pushAll' does not exist on type '({ item(): any & any; } & { item(): any & any; })[]'. +node_modules/chrome-devtools-frontend/front_end/sources/UISourceCodeFrame.js(511,24): error TS2339: Property 'pushAll' does not exist on type 'ToolbarItem[]'. node_modules/chrome-devtools-frontend/front_end/sources/UISourceCodeFrame.js(512,25): error TS2339: Property 'pushAll' does not exist on type 'any[]'. node_modules/chrome-devtools-frontend/front_end/sources/UISourceCodeFrame.js(547,31): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/sources/UISourceCodeFrame.js(550,22): error TS2339: Property 'createChild' does not exist on type 'Element'. @@ -11445,10 +11503,6 @@ node_modules/chrome-devtools-frontend/front_end/sources/UISourceCodeFrame.js(761 node_modules/chrome-devtools-frontend/front_end/sources/UISourceCodeFrame.js(767,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. node_modules/chrome-devtools-frontend/front_end/sources/WatchExpressionsSidebarPane.js(46,44): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/sources/WatchExpressionsSidebarPane.js(48,48): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/sources/WatchExpressionsSidebarPane.js(66,5): error TS2322: Type 'ToolbarButton[]' is not assignable to type '({ item(): any & any; } & { item(): any & any; })[]'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarButton'. node_modules/chrome-devtools-frontend/front_end/sources/WatchExpressionsSidebarPane.js(97,25): error TS2339: Property 'removeChildren' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/sources/WatchExpressionsSidebarPane.js(99,46): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/sources/WatchExpressionsSidebarPane.js(100,38): error TS2555: Expected at least 2 arguments, but got 1. @@ -11478,7 +11532,6 @@ node_modules/chrome-devtools-frontend/front_end/sources/WatchExpressionsSidebarP node_modules/chrome-devtools-frontend/front_end/sources/WatchExpressionsSidebarPane.js(426,49): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/sources/WatchExpressionsSidebarPane.js(428,24): error TS2339: Property 'deepElementFromPoint' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/sources/WatchExpressionsSidebarPane.js(429,38): error TS2339: Property 'isSelfOrAncestor' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/sources/WatchExpressionsSidebarPane.js(430,7): error TS2554: Expected 3 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/sources/WorkspaceMappingTip.js(28,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/sources/WorkspaceMappingTip.js(39,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/sources/WorkspaceMappingTip.js(107,25): error TS2339: Property 'asParsedURL' does not exist on type 'string'. @@ -11492,14 +11545,11 @@ node_modules/chrome-devtools-frontend/front_end/sources/WorkspaceMappingTip.js(1 node_modules/chrome-devtools-frontend/front_end/sources/WorkspaceMappingTip.js(171,41): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/sources/WorkspaceMappingTip.js(173,63): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/sources/WorkspaceMappingTip.js(174,16): error TS2339: Property 'createTextChild' does not exist on type 'Element'. +node_modules/chrome-devtools-frontend/front_end/sources/WorkspaceMappingTip.js(176,23): error TS2339: Property 'attachInfobars' does not exist on type 'Widget'. node_modules/chrome-devtools-frontend/front_end/sources/XHRBreakpointsSidebarPane.js(14,45): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/sources/XHRBreakpointsSidebarPane.js(15,46): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/sources/XHRBreakpointsSidebarPane.js(16,38): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/sources/XHRBreakpointsSidebarPane.js(21,44): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/sources/XHRBreakpointsSidebarPane.js(34,5): error TS2322: Type 'ToolbarButton[]' is not assignable to type '({ item(): any & any; } & { item(): any & any; })[]'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarButton'. node_modules/chrome-devtools-frontend/front_end/sources/XHRBreakpointsSidebarPane.js(39,45): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/sources/XHRBreakpointsSidebarPane.js(47,41): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/sources/XHRBreakpointsSidebarPane.js(49,46): error TS2339: Property 'createChild' does not exist on type 'Element'. @@ -11694,8 +11744,8 @@ node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(363,62 node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(368,34): error TS2694: Namespace 'Protocol' has no exported member 'Runtime'. node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(372,42): error TS2339: Property 'result' does not exist on type '{ response: RemoteObject; exceptionDetails: any; }'. node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(381,35): error TS2694: Namespace 'Protocol' has no exported member 'Runtime'. -node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(503,30): error TS2345: Argument of type 'Function' is not assignable to parameter of type '(value: [any, any, any, any, any, any, any, any, any, any]) => [any, any, any, any, any, any, any, any, any, any] | PromiseLike<[any, any, any, any, any, any, any, any, any, any]>'. - Type 'Function' provides no match for the signature '(value: [any, any, any, any, any, any, any, any, any, any]): [any, any, any, any, any, any, any, any, any, any] | PromiseLike<[any, any, any, any, any, any, any, any, any, any]>'. +node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(503,30): error TS2345: Argument of type 'Function' is not assignable to parameter of type '(value: any[]) => any[] | PromiseLike'. + Type 'Function' provides no match for the signature '(value: any[]): any[] | PromiseLike'. node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(641,59): error TS2339: Property 'testRunner' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(641,92): error TS2339: Property 'testRunner' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/test_runner/TestRunner.js(642,3): error TS2322: Type '1' is not assignable to type 'boolean'. @@ -11875,9 +11925,6 @@ node_modules/chrome-devtools-frontend/front_end/timeline/CountersGraph.js(334,54 node_modules/chrome-devtools-frontend/front_end/timeline/CountersGraph.js(371,43): error TS2339: Property 'withThousandsSeparator' does not exist on type 'NumberConstructor'. node_modules/chrome-devtools-frontend/front_end/timeline/CountersGraph.js(379,28): error TS2339: Property 'backgroundColor' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/timeline/CountersGraph.js(380,28): error TS2339: Property 'borderColor' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/timeline/CountersGraph.js(383,45): error TS2345: Argument of type 'ToolbarSettingCheckbox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSettingCheckbox' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarSettingCheckbox'. node_modules/chrome-devtools-frontend/front_end/timeline/CountersGraph.js(384,40): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/timeline/CountersGraph.js(394,50): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/timeline/CountersGraph.js(414,22): error TS2694: Namespace 'Common' has no exported member 'Event'. @@ -11889,11 +11936,6 @@ node_modules/chrome-devtools-frontend/front_end/timeline/EventsTimelineTreeView. node_modules/chrome-devtools-frontend/front_end/timeline/EventsTimelineTreeView.js(95,34): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/timeline/EventsTimelineTreeView.js(158,73): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/timeline/EventsTimelineTreeView.js(160,24): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/timeline/EventsTimelineTreeView.js(163,31): error TS2345: Argument of type 'ToolbarComboBox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarComboBox' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/timeline/EventsTimelineTreeView.js(176,33): error TS2345: Argument of type 'ToolbarCheckbox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarCheckbox' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarCheckbox'. node_modules/chrome-devtools-frontend/front_end/timeline/EventsTimelineTreeView.js(183,56): error TS2339: Property 'value' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/timeline/PerformanceModel.js(157,25): error TS2304: Cannot find name 'FileError'. node_modules/chrome-devtools-frontend/front_end/timeline/PerformanceMonitor.js(26,46): error TS2339: Property 'createChild' does not exist on type 'Element'. @@ -11931,6 +11973,12 @@ node_modules/chrome-devtools-frontend/front_end/timeline/PerformanceMonitor.js(4 node_modules/chrome-devtools-frontend/front_end/timeline/PerformanceMonitor.js(517,43): error TS2694: Namespace 'Timeline.PerformanceMonitor' has no exported member 'ChartInfo'. node_modules/chrome-devtools-frontend/front_end/timeline/PerformanceMonitor.js(526,27): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/timeline/PerformanceMonitor.js(539,43): error TS2694: Namespace 'Timeline.PerformanceMonitor' has no exported member 'ChartInfo'. +node_modules/chrome-devtools-frontend/front_end/timeline/TimelineController.js(28,59): error TS2345: Argument of type 'this' is not assignable to parameter of type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Type 'TimelineController' is not assignable to type '{ modelAdded(model: T): void; modelRemoved(model: T): void; }'. + Types of property 'modelAdded' are incompatible. + Type '(cpuProfilerModel: CPUProfilerModel) => void' is not assignable to type '(model: T) => void'. + Types of parameters 'cpuProfilerModel' and 'model' are incompatible. + Type 'T' is not assignable to type 'CPUProfilerModel'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineController.js(39,43): error TS2694: Namespace 'Timeline.TimelineController' has no exported member 'RecordingOptions'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineController.js(44,64): error TS2339: Property 'traceProviders' does not exist on type 'typeof extensionServer'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineController.js(137,24): error TS2694: Namespace 'Protocol' has no exported member 'Profiler'. @@ -12071,16 +12119,6 @@ node_modules/chrome-devtools-frontend/front_end/timeline/TimelineHistoryManager. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineHistoryManager.js(432,39): error TS2339: Property 'createChild' does not exist on type 'DocumentFragment'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineLayersView.js(66,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineLoader.js(43,14): error TS2339: Property '_reportErrorAndCancelLoading' does not exist on type 'typeof TimelineLoader'. -node_modules/chrome-devtools-frontend/front_end/timeline/TimelineLoader.js(45,5): error TS2322: Type 'TimelineLoader' is not assignable to type '{ loadingStarted(): void; loadingProgress(progress?: number): void; processingStarted(): void; loadingComplete(tracingModel: TracingModel): void; } & { loadingStarted(): void; loadingProgress(progress?: number): void; processingStarted(): void; loadingComplete(tracingModel: TracingModel): void; }'. - Type 'TimelineLoader' is not assignable to type '{ loadingStarted(): void; loadingProgress(progress?: number): void; processingStarted(): void; loadingComplete(tracingModel: TracingModel): void; }'. -node_modules/chrome-devtools-frontend/front_end/timeline/TimelineLoader.js(45,5): error TS2322: Type 'TimelineLoader' is not assignable to type '{ loadingStarted(): void; loadingProgress(progress?: number): void; processingStarted(): void; loadingComplete(tracingModel: TracingModel): void; } & { loadingStarted(): void; loadingProgress(progress?: number): void; processingStarted(): void; loadingComplete(tracingModel: TracingModel): void; }'. - Type 'TimelineLoader' is not assignable to type '{ loadingStarted(): void; loadingProgress(progress?: number): void; processingStarted(): void; loadingComplete(tracingModel: TracingModel): void; }'. - Property 'loadingStarted' is missing in type 'TimelineLoader'. -node_modules/chrome-devtools-frontend/front_end/timeline/TimelineLoader.js(56,5): error TS2322: Type 'TimelineLoader' is not assignable to type '{ loadingStarted(): void; loadingProgress(progress?: number): void; processingStarted(): void; loadingComplete(tracingModel: TracingModel): void; } & { loadingStarted(): void; loadingProgress(progress?: number): void; processingStarted(): void; loadingComplete(tracingModel: TracingModel): void; }'. - Type 'TimelineLoader' is not assignable to type '{ loadingStarted(): void; loadingProgress(progress?: number): void; processingStarted(): void; loadingComplete(tracingModel: TracingModel): void; }'. -node_modules/chrome-devtools-frontend/front_end/timeline/TimelineLoader.js(56,5): error TS2322: Type 'TimelineLoader' is not assignable to type '{ loadingStarted(): void; loadingProgress(progress?: number): void; processingStarted(): void; loadingComplete(tracingModel: TracingModel): void; } & { loadingStarted(): void; loadingProgress(progress?: number): void; processingStarted(): void; loadingComplete(tracingModel: TracingModel): void; }'. - Type 'TimelineLoader' is not assignable to type '{ loadingStarted(): void; loadingProgress(progress?: number): void; processingStarted(): void; loadingComplete(tracingModel: TracingModel): void; }'. - Property 'loadingStarted' is missing in type 'TimelineLoader'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineLoader.js(91,43): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineLoader.js(118,41): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineLoader.js(137,54): error TS2694: Namespace 'SDK.TracingManager' has no exported member 'EventPayload'. @@ -12099,46 +12137,16 @@ node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(111,60 node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(131,32): error TS2339: Property 'addEventListener' does not exist on type 'typeof extensionServer'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(140,57): error TS2339: Property 'runtime' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(168,22): error TS2694: Namespace 'Common' has no exported member 'Event'. -node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(206,42): error TS2345: Argument of type 'ToolbarSettingCheckbox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSettingCheckbox' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarSettingCheckbox'. -node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(207,5): error TS2322: Type 'ToolbarSettingCheckbox' is not assignable to type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSettingCheckbox' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(207,5): error TS2322: Type 'ToolbarSettingCheckbox' is not assignable to type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSettingCheckbox' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarSettingCheckbox'. -node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(212,42): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(213,42): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(214,46): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(216,42): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(219,45): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(221,45): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(224,42): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(225,42): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(230,44): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarButton'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(237,67): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(241,62): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(245,42): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(251,42): error TS2345: Argument of type 'ToolbarSettingToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSettingToggle' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarSettingToggle'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(257,67): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(274,9): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(277,9): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(284,41): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(286,48): error TS2345: Argument of type 'ToolbarComboBox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarComboBox' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(289,37): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(291,44): error TS2345: Argument of type 'ToolbarComboBox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarComboBox' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(298,23): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(340,33): error TS2339: Property 'remove' does not exist on type 'Node'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(362,37): error TS2339: Property 'toISO8601Compact' does not exist on type 'Date'. @@ -12167,7 +12175,6 @@ node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(732,42 node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(739,35): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(773,35): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(800,22): error TS2694: Namespace 'Common' has no exported member 'Event'. -node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(814,11): error TS2367: This condition will always return 'true' since the types '{ recordingProgress(usage: number): void; } & { recordingProgress(usage: number): void; }' and 'TimelineController' have no overlap. node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(850,20): error TS2339: Property 'constrain' does not exist on type 'NumberConstructor'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(878,29): error TS2339: Property 'upperBound' does not exist on type 'Event[]'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(1029,24): error TS2339: Property 'ModelSelectionData' does not exist on type 'typeof TimelinePanel'. @@ -12186,12 +12193,7 @@ node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(1224,2 node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(1234,22): error TS2339: Property 'focus' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelinePanel.js(1291,61): error TS2339: Property 'decodeURIComponent' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineTreeView.js(65,58): error TS2694: Namespace 'DataGrid.DataGrid' has no exported member 'ColumnDescriptor'. -node_modules/chrome-devtools-frontend/front_end/timeline/TimelineTreeView.js(133,31): error TS2345: Argument of type 'ToolbarComboBox' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarComboBox' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineTreeView.js(134,46): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/timeline/TimelineTreeView.js(136,31): error TS2345: Argument of type 'ToolbarInput' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarInput' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarInput'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineTreeView.js(162,76): error TS2339: Property 'value' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineTreeView.js(173,52): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineTreeView.js(280,5): error TS2322: Type 'TopDownRootNode' is not assignable to type 'Node'. @@ -12240,13 +12242,10 @@ node_modules/chrome-devtools-frontend/front_end/timeline/TimelineTreeView.js(777 node_modules/chrome-devtools-frontend/front_end/timeline/TimelineTreeView.js(779,61): error TS2345: Argument of type '{ label: any; value: string; }[]' is not assignable to parameter of type '{ value: string; label: string; title: string; default: boolean; }[]'. Type '{ label: any; value: string; }' is not assignable to type '{ value: string; label: string; title: string; default: boolean; }'. Property 'title' is missing in type '{ label: any; value: string; }'. -node_modules/chrome-devtools-frontend/front_end/timeline/TimelineTreeView.js(781,31): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineTreeView.js(781,77): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineTreeView.js(871,25): error TS2339: Property 'asParsedURL' does not exist on type 'string'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineTreeView.js(896,25): error TS2339: Property 'asParsedURL' does not exist on type 'string'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineTreeView.js(910,25): error TS2339: Property 'asParsedURL' does not exist on type 'string'. -node_modules/chrome-devtools-frontend/front_end/timeline/TimelineTreeView.js(931,5): error TS2554: Expected 3 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineTreeView.js(1019,31): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineTreeView.js(1020,26): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/timeline/TimelineTreeView.js(1022,56): error TS2694: Namespace 'DataGrid.DataGrid' has no exported member 'ColumnDescriptor'. @@ -12745,7 +12744,6 @@ node_modules/chrome-devtools-frontend/front_end/ui/ContextMenu.js(453,57): error node_modules/chrome-devtools-frontend/front_end/ui/ContextMenu.js(457,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/ui/ContextMenu.js(483,37): error TS2339: Property 'runtime' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/ui/ContextMenu.js(491,32): error TS2339: Property 'runtime' does not exist on type 'Window'. -node_modules/chrome-devtools-frontend/front_end/ui/ContextMenu.js(519,32): error TS2502: 'contextMenu' is referenced directly or indirectly in its own type annotation. node_modules/chrome-devtools-frontend/front_end/ui/Dialog.js(35,25): error TS2339: Property 'tabIndex' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/ui/Dialog.js(42,13): error TS2339: Property 'consume' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/ui/Dialog.js(55,24): error TS2339: Property '_instance' does not exist on type 'typeof Dialog'. @@ -12883,17 +12881,14 @@ node_modules/chrome-devtools-frontend/front_end/ui/InplaceEditor.js(133,22): err node_modules/chrome-devtools-frontend/front_end/ui/InplaceEditor.js(134,33): error TS2339: Property 'shiftKey' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/ui/InplaceEditor.js(185,18): error TS2339: Property 'Controller' does not exist on type 'typeof InplaceEditor'. node_modules/chrome-devtools-frontend/front_end/ui/InspectorView.js(53,50): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/ui/InspectorView.js(55,61): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarButton'. node_modules/chrome-devtools-frontend/front_end/ui/InspectorView.js(69,40): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/ui/InspectorView.js(80,24): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/ui/InspectorView.js(92,51): error TS2339: Property 'runtime' does not exist on type 'Window'. -node_modules/chrome-devtools-frontend/front_end/ui/InspectorView.js(116,7): error TS2322: Type '{ tabbedPane(): TabbedPane; enableMoreTabsButton(): void; }' is not assignable to type '{ appendApplicableItems(locationName: string): void; appendView(view: { viewId(): string; title(): string; isCloseable(): boolean; isTransient(): boolean; toolbarItems(): Promise<({ item(): any & any; } & { ...; })[]>; widget(): Promise<...>; disposeView(): void; }, insertBefore?: { ...; }): void; showView(view: { ....'. -node_modules/chrome-devtools-frontend/front_end/ui/InspectorView.js(116,7): error TS2322: Type '{ tabbedPane(): TabbedPane; enableMoreTabsButton(): void; }' is not assignable to type '{ appendApplicableItems(locationName: string): void; appendView(view: { viewId(): string; title(): string; isCloseable(): boolean; isTransient(): boolean; toolbarItems(): Promise<({ item(): any & any; } & { ...; })[]>; widget(): Promise<...>; disposeView(): void; }, insertBefore?: { ...; }): void; showView(view: { ....'. +node_modules/chrome-devtools-frontend/front_end/ui/InspectorView.js(116,7): error TS2322: Type '{ tabbedPane(): TabbedPane; enableMoreTabsButton(): void; }' is not assignable to type '{ appendApplicableItems(locationName: string): void; appendView(view: { viewId(): string; title(): string; isCloseable(): boolean; isTransient(): boolean; toolbarItems(): Promise; widget(): Promise<...>; disposeView(): void; }, insertBefore?: { ...; }): void; showView(view: { ...; }, insertBefore?: { ...'. +node_modules/chrome-devtools-frontend/front_end/ui/InspectorView.js(116,7): error TS2322: Type '{ tabbedPane(): TabbedPane; enableMoreTabsButton(): void; }' is not assignable to type '{ appendApplicableItems(locationName: string): void; appendView(view: { viewId(): string; title(): string; isCloseable(): boolean; isTransient(): boolean; toolbarItems(): Promise; widget(): Promise<...>; disposeView(): void; }, insertBefore?: { ...; }): void; showView(view: { ...; }, insertBefore?: { ...'. Property 'appendApplicableItems' is missing in type '{ tabbedPane(): TabbedPane; enableMoreTabsButton(): void; }'. -node_modules/chrome-devtools-frontend/front_end/ui/InspectorView.js(118,7): error TS2322: Type '{ tabbedPane(): TabbedPane; enableMoreTabsButton(): void; }' is not assignable to type '{ appendApplicableItems(locationName: string): void; appendView(view: { viewId(): string; title(): string; isCloseable(): boolean; isTransient(): boolean; toolbarItems(): Promise<({ item(): any & any; } & { ...; })[]>; widget(): Promise<...>; disposeView(): void; }, insertBefore?: { ...; }): void; showView(view: { ....'. -node_modules/chrome-devtools-frontend/front_end/ui/InspectorView.js(118,7): error TS2322: Type '{ tabbedPane(): TabbedPane; enableMoreTabsButton(): void; }' is not assignable to type '{ appendApplicableItems(locationName: string): void; appendView(view: { viewId(): string; title(): string; isCloseable(): boolean; isTransient(): boolean; toolbarItems(): Promise<({ item(): any & any; } & { ...; })[]>; widget(): Promise<...>; disposeView(): void; }, insertBefore?: { ...; }): void; showView(view: { ....'. +node_modules/chrome-devtools-frontend/front_end/ui/InspectorView.js(118,7): error TS2322: Type '{ tabbedPane(): TabbedPane; enableMoreTabsButton(): void; }' is not assignable to type '{ appendApplicableItems(locationName: string): void; appendView(view: { viewId(): string; title(): string; isCloseable(): boolean; isTransient(): boolean; toolbarItems(): Promise; widget(): Promise<...>; disposeView(): void; }, insertBefore?: { ...; }): void; showView(view: { ...; }, insertBefore?: { ...'. +node_modules/chrome-devtools-frontend/front_end/ui/InspectorView.js(118,7): error TS2322: Type '{ tabbedPane(): TabbedPane; enableMoreTabsButton(): void; }' is not assignable to type '{ appendApplicableItems(locationName: string): void; appendView(view: { viewId(): string; title(): string; isCloseable(): boolean; isTransient(): boolean; toolbarItems(): Promise; widget(): Promise<...>; disposeView(): void; }, insertBefore?: { ...; }): void; showView(view: { ...; }, insertBefore?: { ...'. Property 'appendApplicableItems' is missing in type '{ tabbedPane(): TabbedPane; enableMoreTabsButton(): void; }'. node_modules/chrome-devtools-frontend/front_end/ui/InspectorView.js(247,73): error TS2339: Property 'altKey' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/ui/InspectorView.js(247,89): error TS2339: Property 'shiftKey' does not exist on type 'Event'. @@ -12954,11 +12949,8 @@ node_modules/chrome-devtools-frontend/front_end/ui/ListWidget.js(17,18): error T node_modules/chrome-devtools-frontend/front_end/ui/ListWidget.js(127,14): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/ui/ListWidget.js(129,28): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/ui/ListWidget.js(133,43): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/ui/ListWidget.js(135,31): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/ui/ListWidget.js(137,45): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/ui/ListWidget.js(139,31): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. +node_modules/chrome-devtools-frontend/front_end/ui/ListWidget.js(157,20): error TS2339: Property 'focus' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/ui/ListWidget.js(203,32): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/ui/ListWidget.js(203,58): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/ui/ListWidget.js(241,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. @@ -13002,18 +12994,11 @@ node_modules/chrome-devtools-frontend/front_end/ui/RootView.js(36,20): error TS2 node_modules/chrome-devtools-frontend/front_end/ui/SearchableView.js(49,25): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/ui/SearchableView.js(50,56): error TS2339: Property 'createChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/ui/SearchableView.js(55,54): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/ui/SearchableView.js(57,44): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarToggle'. node_modules/chrome-devtools-frontend/front_end/ui/SearchableView.js(65,44): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/ui/SearchableView.js(76,47): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/ui/SearchableView.js(81,47): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/ui/SearchableView.js(89,45): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/ui/SearchableView.js(97,56): error TS2555: Expected at least 2 arguments, but got 1. -node_modules/chrome-devtools-frontend/front_end/ui/SearchableView.js(100,33): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/ui/SearchableView.js(107,33): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/ui/SearchableView.js(111,29): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/ui/SearchableView.js(117,29): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/ui/SearchableView.js(118,32): error TS2339: Property 'disabled' does not exist on type 'Element'. @@ -13305,28 +13290,10 @@ node_modules/chrome-devtools-frontend/front_end/ui/Toolbar.js(48,45): error TS23 node_modules/chrome-devtools-frontend/front_end/ui/Toolbar.js(75,24): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/ui/Toolbar.js(115,26): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/ui/Toolbar.js(134,47): error TS2339: Property 'boxInWindow' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/ui/Toolbar.js(151,38): error TS2345: Argument of type 'ToolbarButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarButton' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/ui/Toolbar.js(257,28): error TS2345: Argument of type 'ToolbarSeparator' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSeparator' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarSeparator'. -node_modules/chrome-devtools-frontend/front_end/ui/Toolbar.js(261,28): error TS2345: Argument of type 'ToolbarSeparator' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarSeparator' is not assignable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/ui/Toolbar.js(268,28): error TS2345: Argument of type 'ToolbarText' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarText' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarText'. -node_modules/chrome-devtools-frontend/front_end/ui/Toolbar.js(318,56): error TS2339: Property 'peekLast' does not exist on type '({ item(): any & any; } & { item(): any & any; })[]'. +node_modules/chrome-devtools-frontend/front_end/ui/Toolbar.js(246,10): error TS2339: Property '_toolbar' does not exist on type 'ToolbarItem'. +node_modules/chrome-devtools-frontend/front_end/ui/Toolbar.js(273,19): error TS2339: Property '_toolbar' does not exist on type 'ToolbarItem'. +node_modules/chrome-devtools-frontend/front_end/ui/Toolbar.js(318,56): error TS2339: Property 'peekLast' does not exist on type 'ToolbarItem[]'. node_modules/chrome-devtools-frontend/front_end/ui/Toolbar.js(328,27): error TS2339: Property 'runtime' does not exist on type 'Window'. -node_modules/chrome-devtools-frontend/front_end/ui/Toolbar.js(343,36): error TS2352: Conversion of type 'ToolbarSeparator' to type '{ item(): any & any; } & { item(): any & any; }' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. - Type 'ToolbarSeparator' is not comparable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/ui/Toolbar.js(343,36): error TS2352: Conversion of type 'ToolbarSeparator' to type '{ item(): any & any; } & { item(): any & any; }' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. - Type 'ToolbarSeparator' is not comparable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarSeparator'. -node_modules/chrome-devtools-frontend/front_end/ui/Toolbar.js(346,17): error TS2352: Conversion of type 'ToolbarToggle' to type '{ item(): any & any; } & { item(): any & any; }' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. - Type 'ToolbarToggle' is not comparable to type '{ item(): any & any; }'. -node_modules/chrome-devtools-frontend/front_end/ui/Toolbar.js(346,17): error TS2352: Conversion of type 'ToolbarToggle' to type '{ item(): any & any; } & { item(): any & any; }' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. - Type 'ToolbarToggle' is not comparable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarToggle'. node_modules/chrome-devtools-frontend/front_end/ui/Toolbar.js(405,53): error TS2339: Property '_toolbar' does not exist on type 'ToolbarItem'. node_modules/chrome-devtools-frontend/front_end/ui/Toolbar.js(405,70): error TS2339: Property '_toolbar' does not exist on type 'ToolbarItem'. node_modules/chrome-devtools-frontend/front_end/ui/Toolbar.js(412,18): error TS2339: Property 'disabled' does not exist on type 'Element'. @@ -13520,15 +13487,13 @@ node_modules/chrome-devtools-frontend/front_end/ui/UIUtils.js(2020,30): error TS node_modules/chrome-devtools-frontend/front_end/ui/UIUtils.js(2024,50): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/ui/UIUtils.js(2025,50): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/ui/UIUtils.js(2027,15): error TS2339: Property 'consume' does not exist on type 'Event'. -node_modules/chrome-devtools-frontend/front_end/ui/UIUtils.js(2046,29): error TS2345: Argument of type 'ToolbarToggle' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarToggle' is not assignable to type '{ item(): any & any; }'. node_modules/chrome-devtools-frontend/front_end/ui/View.js(11,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. node_modules/chrome-devtools-frontend/front_end/ui/View.js(16,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. node_modules/chrome-devtools-frontend/front_end/ui/View.js(21,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. node_modules/chrome-devtools-frontend/front_end/ui/View.js(26,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. node_modules/chrome-devtools-frontend/front_end/ui/View.js(31,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. node_modules/chrome-devtools-frontend/front_end/ui/View.js(36,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. -node_modules/chrome-devtools-frontend/front_end/ui/View.js(195,47): error TS2352: Conversion of type 'Widget' to type '{ toolbarItems(): ({ item(): any & any; } & { item(): any & any; })[]; }' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. +node_modules/chrome-devtools-frontend/front_end/ui/View.js(195,47): error TS2352: Conversion of type 'Widget' to type '{ toolbarItems(): ToolbarItem[]; }' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. Property 'toolbarItems' is missing in type 'Widget'. node_modules/chrome-devtools-frontend/front_end/ui/View.js(244,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. node_modules/chrome-devtools-frontend/front_end/ui/View.js(254,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. @@ -13536,44 +13501,41 @@ node_modules/chrome-devtools-frontend/front_end/ui/View.js(263,1): error TS8022: node_modules/chrome-devtools-frontend/front_end/ui/View.js(267,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. node_modules/chrome-devtools-frontend/front_end/ui/View.js(282,15): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. node_modules/chrome-devtools-frontend/front_end/ui/View.js(297,32): error TS2339: Property 'runtime' does not exist on type 'Window'. -node_modules/chrome-devtools-frontend/front_end/ui/View.js(299,41): error TS2345: Argument of type 'ProvidedView' is not assignable to parameter of type '{ viewId(): string; title(): string; isCloseable(): boolean; isTransient(): boolean; toolbarItems(): Promise<({ item(): any & any; } & { item(): any & any; })[]>; widget(): Promise; disposeView(): void; }'. - Property '_extension' does not exist on type '{ viewId(): string; title(): string; isCloseable(): boolean; isTransient(): boolean; toolbarItems(): Promise<({ item(): any & any; } & { item(): any & any; })[]>; widget(): Promise; disposeView(): void; }'. +node_modules/chrome-devtools-frontend/front_end/ui/View.js(299,41): error TS2345: Argument of type 'ProvidedView' is not assignable to parameter of type '{ viewId(): string; title(): string; isCloseable(): boolean; isTransient(): boolean; toolbarItems(): Promise; widget(): Promise; disposeView(): void; }'. + Property '_extension' does not exist on type '{ viewId(): string; title(): string; isCloseable(): boolean; isTransient(): boolean; toolbarItems(): Promise; widget(): Promise; disposeView(): void; }'. node_modules/chrome-devtools-frontend/front_end/ui/View.js(326,21): error TS2339: Property 'showView' does not exist on type '_Location'. node_modules/chrome-devtools-frontend/front_end/ui/View.js(371,23): error TS2339: Property 'showView' does not exist on type '_Location'. node_modules/chrome-devtools-frontend/front_end/ui/View.js(383,35): error TS2339: Property 'runtime' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/ui/View.js(401,5): error TS2322: Type '_TabbedLocation' is not assignable to type '{ tabbedPane(): TabbedPane; enableMoreTabsButton(): void; }'. node_modules/chrome-devtools-frontend/front_end/ui/View.js(401,5): error TS2322: Type '_TabbedLocation' is not assignable to type '{ tabbedPane(): TabbedPane; enableMoreTabsButton(): void; }'. Property '_tabbedPane' does not exist on type '{ tabbedPane(): TabbedPane; enableMoreTabsButton(): void; }'. -node_modules/chrome-devtools-frontend/front_end/ui/View.js(411,5): error TS2322: Type '_StackLocation' is not assignable to type '{ appendApplicableItems(locationName: string): void; appendView(view: { viewId(): string; title(): string; isCloseable(): boolean; isTransient(): boolean; toolbarItems(): Promise<({ item(): any & any; } & { ...; })[]>; widget(): Promise<...>; disposeView(): void; }, insertBefore?: { ...; }): void; showView(view: { ....'. -node_modules/chrome-devtools-frontend/front_end/ui/View.js(411,5): error TS2322: Type '_StackLocation' is not assignable to type '{ appendApplicableItems(locationName: string): void; appendView(view: { viewId(): string; title(): string; isCloseable(): boolean; isTransient(): boolean; toolbarItems(): Promise<({ item(): any & any; } & { ...; })[]>; widget(): Promise<...>; disposeView(): void; }, insertBefore?: { ...; }): void; showView(view: { ....'. - Property '_vbox' does not exist on type '{ appendApplicableItems(locationName: string): void; appendView(view: { viewId(): string; title(): string; isCloseable(): boolean; isTransient(): boolean; toolbarItems(): Promise<({ item(): any & any; } & { ...; })[]>; widget(): Promise<...>; disposeView(): void; }, insertBefore?: { ...; }): void; showView(view: { ....'. +node_modules/chrome-devtools-frontend/front_end/ui/View.js(411,5): error TS2322: Type '_StackLocation' is not assignable to type '{ appendApplicableItems(locationName: string): void; appendView(view: { viewId(): string; title(): string; isCloseable(): boolean; isTransient(): boolean; toolbarItems(): Promise; widget(): Promise<...>; disposeView(): void; }, insertBefore?: { ...; }): void; showView(view: { ...; }, insertBefore?: { ...'. +node_modules/chrome-devtools-frontend/front_end/ui/View.js(411,5): error TS2322: Type '_StackLocation' is not assignable to type '{ appendApplicableItems(locationName: string): void; appendView(view: { viewId(): string; title(): string; isCloseable(): boolean; isTransient(): boolean; toolbarItems(): Promise; widget(): Promise<...>; disposeView(): void; }, insertBefore?: { ...; }): void; showView(view: { ...; }, insertBefore?: { ...'. + Property '_vbox' does not exist on type '{ appendApplicableItems(locationName: string): void; appendView(view: { viewId(): string; title(): string; isCloseable(): boolean; isTransient(): boolean; toolbarItems(): Promise; widget(): Promise<...>; disposeView(): void; }, insertBefore?: { ...; }): void; showView(view: { ...; }, insertBefore?: { ...'. node_modules/chrome-devtools-frontend/front_end/ui/View.js(440,18): error TS2339: Property 'tabIndex' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/ui/View.js(454,38): error TS2339: Property 'hasFocus' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/ui/View.js(461,44): error TS2345: Argument of type '(Promise | Promise<({ item(): any & any; } & { item(): any & any; })[]>)[]' is not assignable to parameter of type 'Iterable>'. +node_modules/chrome-devtools-frontend/front_end/ui/View.js(461,44): error TS2345: Argument of type '(Promise | Promise)[]' is not assignable to parameter of type 'Iterable>'. Types of property '[Symbol.iterator]' are incompatible. - Type '() => IterableIterator | Promise<({ item(): any & any; } & { item(): any & any; })[]>>' is not assignable to type '() => Iterator>'. - Type 'IterableIterator | Promise<({ item(): any & any; } & { item(): any & any; })[]>>' is not assignable to type 'Iterator>'. + Type '() => IterableIterator | Promise>' is not assignable to type '() => Iterator>'. + Type 'IterableIterator | Promise>' is not assignable to type 'Iterator>'. Types of property 'next' are incompatible. - Type '{ (value?: any): IteratorResult | Promise<({ item(): any & any; } & { item(): any & any; })[]>>; (value?: any): IteratorResult | Promise<({ item(): any & any; } & { item(): any & any; })[]>>; }' is not assignable to type '{ (value?: any): IteratorResult>; (value?: any): IteratorResult>; }'. - Type 'IteratorResult | Promise<({ item(): any & any; } & { item(): any & any; })[]>>' is not assignable to type 'IteratorResult>'. - Type 'Promise | Promise<({ item(): any & any; } & { item(): any & any; })[]>' is not assignable to type 'void | PromiseLike'. - Type 'Promise<({ item(): any & any; } & { item(): any & any; })[]>' is not assignable to type 'void | PromiseLike'. - Type 'Promise<({ item(): any & any; } & { item(): any & any; })[]>' is not assignable to type 'PromiseLike'. + Type '{ (value?: any): IteratorResult | Promise>; (value?: any): IteratorResult | Promise>; }' is not assignable to type '{ (value?: any): IteratorResult>; (value?: any): IteratorResult>; }'. + Type 'IteratorResult | Promise>' is not assignable to type 'IteratorResult>'. + Type 'Promise | Promise' is not assignable to type 'void | PromiseLike'. + Type 'Promise' is not assignable to type 'void | PromiseLike'. + Type 'Promise' is not assignable to type 'PromiseLike'. Types of property 'then' are incompatible. - Type '(onfulfilled?: (value: ({ item(): any & any; } & { item(): any & any; })[]) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike<...>) => Promise<...>' is not assignable to type '(onfulfilled?: (value: void) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => PromiseLike'. + Type '(onfulfilled?: (value: ToolbarItem[]) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => Promise' is not assignable to type '(onfulfilled?: (value: void) => TResult1 | PromiseLike, onrejected?: (reason: any) => TResult2 | PromiseLike) => PromiseLike'. Types of parameters 'onfulfilled' and 'onfulfilled' are incompatible. Types of parameters 'value' and 'value' are incompatible. - Type '({ item(): any & any; } & { item(): any & any; })[]' is not assignable to type 'void'. + Type 'ToolbarItem[]' is not assignable to type 'void'. node_modules/chrome-devtools-frontend/front_end/ui/View.js(495,24): error TS2339: Property 'createTextChild' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/ui/View.js(496,24): error TS2339: Property 'tabIndex' does not exist on type 'Element'. node_modules/chrome-devtools-frontend/front_end/ui/View.js(501,25): error TS2339: Property 'createChild' does not exist on type 'Element'. -node_modules/chrome-devtools-frontend/front_end/ui/View.js(520,44): error TS2345: Argument of type '(Promise | Promise<({ item(): any & any; } & { item(): any & any; })[]>)[]' is not assignable to parameter of type 'Iterable>'. +node_modules/chrome-devtools-frontend/front_end/ui/View.js(520,44): error TS2345: Argument of type '(Promise | Promise)[]' is not assignable to parameter of type 'Iterable>'. node_modules/chrome-devtools-frontend/front_end/ui/View.js(556,36): error TS2339: Property 'keyCode' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/ui/View.js(558,22): error TS2339: Property 'key' does not exist on type 'Event'. node_modules/chrome-devtools-frontend/front_end/ui/View.js(560,22): error TS2339: Property 'key' does not exist on type 'Event'. -node_modules/chrome-devtools-frontend/front_end/ui/View.js(659,54): error TS2345: Argument of type 'ToolbarMenuButton' is not assignable to parameter of type '{ item(): any & any; } & { item(): any & any; }'. - Type 'ToolbarMenuButton' is not assignable to type '{ item(): any & any; }'. - Property 'item' is missing in type 'ToolbarMenuButton'. node_modules/chrome-devtools-frontend/front_end/ui/View.js(702,19): error TS2555: Expected at least 2 arguments, but got 1. node_modules/chrome-devtools-frontend/front_end/ui/View.js(793,22): error TS2694: Namespace 'Common' has no exported member 'Event'. node_modules/chrome-devtools-frontend/front_end/ui/View.js(802,22): error TS2694: Namespace 'Common' has no exported member 'Event'. diff --git a/tests/baselines/reference/user/npm.log b/tests/baselines/reference/user/npm.log index c9262f0f89a..231b400a980 100644 --- a/tests/baselines/reference/user/npm.log +++ b/tests/baselines/reference/user/npm.log @@ -324,7 +324,8 @@ node_modules/npm/lib/help.js(186,11): error TS2339: Property 'argv' does not exi node_modules/npm/lib/help.js(187,20): error TS2339: Property 'argv' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/help.js(196,26): error TS2339: Property 'commands' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/help.js(197,22): error TS2339: Property 'deref' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/help.js(199,14): error TS2345: Argument of type 'any[]' is not assignable to parameter of type 'never'. +node_modules/npm/lib/help.js(199,15): error TS2322: Type 'string' is not assignable to type 'never'. +node_modules/npm/lib/help.js(199,18): error TS2322: Type 'any' is not assignable to type 'never'. node_modules/npm/lib/help.js(199,22): error TS2339: Property 'commands' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/help.js(206,33): error TS2339: Property 'length' does not exist on type 'never'. node_modules/npm/lib/help.js(207,14): error TS2339: Property 'split' does not exist on type 'never'. @@ -676,11 +677,9 @@ node_modules/npm/lib/run-script.js(35,22): error TS2339: Property 'localPrefix' node_modules/npm/lib/run-script.js(46,26): error TS2339: Property 'localPrefix' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/run-script.js(56,20): error TS2339: Property 'localPrefix' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/run-script.js(66,28): error TS2339: Property 'localPrefix' does not exist on type 'typeof EventEmitter'. -node_modules/npm/lib/run-script.js(77,21): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'ConcatArray'. - Types of property 'slice' are incompatible. - Type '(start?: number | undefined, end?: number | undefined) => string[]' is not assignable to type '(start?: number | undefined, end?: number | undefined) => never[]'. - Type 'string[]' is not assignable to type 'never[]'. - Type 'string' is not assignable to type 'never'. +node_modules/npm/lib/run-script.js(77,22): error TS2322: Type 'string' is not assignable to type 'never'. +node_modules/npm/lib/run-script.js(77,33): error TS2322: Type 'string' is not assignable to type 'never'. +node_modules/npm/lib/run-script.js(77,36): error TS2322: Type 'string' is not assignable to type 'never'. node_modules/npm/lib/run-script.js(94,13): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/run-script.js(99,13): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/run-script.js(148,22): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. @@ -945,13 +944,7 @@ node_modules/npm/test/need-npm5-update/need-outdated/update-symlink.js(6,20): er node_modules/npm/test/need-npm5-update/need-outdated/update-symlink.js(8,22): error TS2307: Cannot find module '../common-tap.js'. node_modules/npm/test/need-npm5-update/outdated-depth-deep.js(3,20): error TS2307: Cannot find module 'tap'. node_modules/npm/test/need-npm5-update/outdated-depth-deep.js(5,18): error TS2307: Cannot find module 'npm-registry-mock'. -node_modules/npm/test/need-npm5-update/outdated-depth-deep.js(69,28): error TS2345: Argument of type '(string | number)[]' is not assignable to parameter of type 'string | ConcatArray'. - Type '(string | number)[]' is not assignable to type 'ConcatArray'. - Types of property 'slice' are incompatible. - Type '(start?: number | undefined, end?: number | undefined) => (string | number)[]' is not assignable to type '(start?: number | undefined, end?: number | undefined) => string[]'. - Type '(string | number)[]' is not assignable to type 'string[]'. - Type 'string | number' is not assignable to type 'string'. - Type 'number' is not assignable to type 'string'. +node_modules/npm/test/need-npm5-update/outdated-depth-deep.js(69,52): error TS2322: Type 'number' is not assignable to type 'string'. node_modules/npm/test/need-npm5-update/outdated-depth-integer.js(2,20): error TS2307: Cannot find module 'tap'. node_modules/npm/test/need-npm5-update/outdated-depth-integer.js(5,18): error TS2307: Cannot find module 'npm-registry-mock'. node_modules/npm/test/need-npm5-update/outdated-depth-integer.js(55,9): error TS2339: Property 'load' does not exist on type 'typeof EventEmitter'. diff --git a/tests/baselines/reference/user/puppeteer.log b/tests/baselines/reference/user/puppeteer.log index 5e11f2261fc..305b1ab31eb 100644 --- a/tests/baselines/reference/user/puppeteer.log +++ b/tests/baselines/reference/user/puppeteer.log @@ -1,17 +1,16 @@ Exit Code: 1 Standard output: -lib/Browser.js(71,43): error TS2345: Argument of type '() => Promise' is not assignable to parameter of type '() => Promise'. - Type 'Promise' is not assignable to type 'Promise'. - Type 'CDPSession' is not assignable to type 'Puppeteer.CDPSession'. - Types of property 'on' are incompatible. - Type '(event: string | symbol, listener: (...args: any[]) => void) => CDPSession' is not assignable to type '(event: T, listener: (arg: any) => void) => CDPSession'. - Types of parameters 'event' and 'event' are incompatible. - Type 'T' is not assignable to type 'string | symbol'. - Type 'string | number | symbol' is not assignable to type 'string | symbol'. - Type 'number' is not assignable to type 'string | symbol'. - Type 'T' is not assignable to type 'symbol'. - Type 'string | number | symbol' is not assignable to type 'symbol'. - Type 'string' is not assignable to type 'symbol'. +lib/Browser.js(71,49): error TS2322: Type 'Promise' is not assignable to type 'Promise'. + Type 'CDPSession' is not assignable to type 'Puppeteer.CDPSession'. + Types of property 'on' are incompatible. + Type '(event: string | symbol, listener: (...args: any[]) => void) => CDPSession' is not assignable to type '(event: T, listener: (arg: any) => void) => CDPSession'. + Types of parameters 'event' and 'event' are incompatible. + Type 'T' is not assignable to type 'string | symbol'. + Type 'string | number | symbol' is not assignable to type 'string | symbol'. + Type 'number' is not assignable to type 'string | symbol'. + Type 'T' is not assignable to type 'symbol'. + Type 'string | number | symbol' is not assignable to type 'symbol'. + Type 'string' is not assignable to type 'symbol'. lib/Coverage.js(109,15): error TS2503: Cannot find namespace 'Protocol'. lib/Coverage.js(196,15): error TS2503: Cannot find namespace 'Protocol'. lib/ElementHandle.js(24,15): error TS2503: Cannot find namespace 'Protocol'. From 80045ca2d80e9ef7ffd420725a1bbf8fd7164edc Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Wed, 19 Sep 2018 12:49:26 -0700 Subject: [PATCH 26/71] Add GDPR annotations (#27217) Note that these annotations are parsed by the tool in Microsoft/vscode-gdpr-tooling; the associated PR #4 adds Typescript to what the tool processes. --- src/server/editorServices.ts | 16 ++++++++++++++++ src/server/protocol.ts | 7 +++++++ 2 files changed, 23 insertions(+) diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 2f5b1d91da5..74072bfd2e6 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -44,6 +44,22 @@ namespace ts.server { readonly data: ProjectInfoTelemetryEventData; } +/* __GDPR__ + "projectInfo" : { + "fileStats": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, + "compilerOptions": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, + "extends": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, + "files": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, + "include": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, + "exclude": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, + "compileOnSave": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, + "typeAcquisition": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, + "configFileName": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, + "projectType": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, + "languageServiceEnabled": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, + "version": { "classification": "SystemMetaData", "purpose": "FeatureInsight" } + } + */ export interface ProjectInfoTelemetryEventData { /** Cryptographically secure hash of project file location. */ readonly projectId: string; diff --git a/src/server/protocol.ts b/src/server/protocol.ts index 1a4ee841014..45136c86cee 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -2737,6 +2737,13 @@ namespace ts.server.protocol { payload: TypingsInstalledTelemetryEventPayload; } +/* __GDPR__ + "typingsinstalled" : { + "installedPackages": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" }, + "installSuccess": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, + "typingsInstallerVersion": { "classification": "SystemMetaData", "purpose": "FeatureInsight" } + } + */ export interface TypingsInstalledTelemetryEventPayload { /** * Comma separated list of installed typing packages From 67d8263b30e5a8b60cc04899b8ff1b6f69544343 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 19 Sep 2018 12:57:55 -0700 Subject: [PATCH 27/71] Fix error message for class type in JSDoc missing type arguments (#27222) --- src/compiler/checker.ts | 2 +- .../jsdocClassMissingTypeArguments.errors.txt | 12 ++++++++++++ .../reference/jsdocClassMissingTypeArguments.symbols | 10 ++++++++++ .../reference/jsdocClassMissingTypeArguments.types | 10 ++++++++++ .../cases/compiler/jsdocClassMissingTypeArguments.ts | 11 +++++++++++ 5 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/jsdocClassMissingTypeArguments.errors.txt create mode 100644 tests/baselines/reference/jsdocClassMissingTypeArguments.symbols create mode 100644 tests/baselines/reference/jsdocClassMissingTypeArguments.types create mode 100644 tests/cases/compiler/jsdocClassMissingTypeArguments.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 019f6bc6307..34b72ab36f7 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -8158,7 +8158,7 @@ namespace ts { const isJs = isInJSFile(node); const isJsImplicitAny = !noImplicitAny && isJs; if (!isJsImplicitAny && (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length)) { - const missingAugmentsTag = isJs && node.parent.kind !== SyntaxKind.JSDocAugmentsTag; + const missingAugmentsTag = isJs && isExpressionWithTypeArguments(node) && !isJSDocAugmentsTag(node.parent); const diag = minTypeArgumentCount === typeParameters.length ? missingAugmentsTag ? Diagnostics.Expected_0_type_arguments_provide_these_with_an_extends_tag diff --git a/tests/baselines/reference/jsdocClassMissingTypeArguments.errors.txt b/tests/baselines/reference/jsdocClassMissingTypeArguments.errors.txt new file mode 100644 index 00000000000..ae966c3990e --- /dev/null +++ b/tests/baselines/reference/jsdocClassMissingTypeArguments.errors.txt @@ -0,0 +1,12 @@ +/a.js(4,13): error TS2314: Generic type 'C' requires 1 type argument(s). + + +==== /a.js (1 errors) ==== + /** @template T */ + class C {} + + /** @param {C} p */ + ~ +!!! error TS2314: Generic type 'C' requires 1 type argument(s). + function f(p) {} + \ No newline at end of file diff --git a/tests/baselines/reference/jsdocClassMissingTypeArguments.symbols b/tests/baselines/reference/jsdocClassMissingTypeArguments.symbols new file mode 100644 index 00000000000..26c59f13785 --- /dev/null +++ b/tests/baselines/reference/jsdocClassMissingTypeArguments.symbols @@ -0,0 +1,10 @@ +=== /a.js === +/** @template T */ +class C {} +>C : Symbol(C, Decl(a.js, 0, 0)) + +/** @param {C} p */ +function f(p) {} +>f : Symbol(f, Decl(a.js, 1, 10)) +>p : Symbol(p, Decl(a.js, 4, 11)) + diff --git a/tests/baselines/reference/jsdocClassMissingTypeArguments.types b/tests/baselines/reference/jsdocClassMissingTypeArguments.types new file mode 100644 index 00000000000..0c64fd3c5a7 --- /dev/null +++ b/tests/baselines/reference/jsdocClassMissingTypeArguments.types @@ -0,0 +1,10 @@ +=== /a.js === +/** @template T */ +class C {} +>C : C + +/** @param {C} p */ +function f(p) {} +>f : (p: C) => void +>p : C + diff --git a/tests/cases/compiler/jsdocClassMissingTypeArguments.ts b/tests/cases/compiler/jsdocClassMissingTypeArguments.ts new file mode 100644 index 00000000000..7a8606d8237 --- /dev/null +++ b/tests/cases/compiler/jsdocClassMissingTypeArguments.ts @@ -0,0 +1,11 @@ +// @allowJs: true +// @checkJs: true +// @noEmit: true +// @noImplicitAny: true + +// @Filename: /a.js +/** @template T */ +class C {} + +/** @param {C} p */ +function f(p) {} From 928bff996fb4b6a61e1c6f2af1a68772b3e7dbe8 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 20 Sep 2018 15:00:17 -0700 Subject: [PATCH 28/71] Limit inference from apparent types to one level deep (#27225) * Limit inference from apparent types to one level deep * Rename marker & use booleanness not === * Undo typo --- src/compiler/checker.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 34b72ab36f7..58717c941d9 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -13439,6 +13439,7 @@ namespace ts { let visited: Map; let contravariant = false; let propagationType: Type; + let allowComplexConstraintInference = true; inferFromTypes(originalSource, originalTarget); function inferFromTypes(source: Type, target: Type): void { @@ -13616,7 +13617,15 @@ namespace ts { // getApparentType can return _any_ type, since an indexed access or conditional may simplify to any other type. // If that occurs and it doesn't simplify to an object or intersection, we'll need to restart `inferFromTypes` // with the simplified source. - if (apparentSource !== source && !(apparentSource.flags & (TypeFlags.Object | TypeFlags.Intersection))) { + if (apparentSource !== source && allowComplexConstraintInference && !(apparentSource.flags & (TypeFlags.Object | TypeFlags.Intersection))) { + // TODO: The `allowComplexConstraintInference` flag is a hack! This forbids inference from complex constraints within constraints! + // This isn't required algorithmically, but rather is used to lower the memory burden caused by performing inference + // that is _too good_ in projects with complicated constraints (eg, fp-ts). In such cases, if we did not limit ourselves + // here, we might produce more valid inferences for types, causing us to do more checks and perform more instantiations + // (in addition to the extra stack depth here) which, in turn, can push the already close process over its limit. + // TL;DR: If we ever become generally more memory efficienct (or our resource budget ever increases), we should just + // remove this `allowComplexConstraintInference` flag. + allowComplexConstraintInference = false; return inferFromTypes(apparentSource, target); } source = apparentSource; From 5f563c99f6dc4a16d173147ad9a9337803571b7d Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 20 Sep 2018 16:45:28 -0700 Subject: [PATCH 29/71] convertToAsyncFunction: Use ReadonlyArray / ReadonlyMap where possible (#27190) --- .../codefixes/convertToAsyncFunction.ts | 80 +++++++++---------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/src/services/codefixes/convertToAsyncFunction.ts b/src/services/codefixes/convertToAsyncFunction.ts index 01aaaae65ca..42d737a9e5f 100644 --- a/src/services/codefixes/convertToAsyncFunction.ts +++ b/src/services/codefixes/convertToAsyncFunction.ts @@ -15,24 +15,24 @@ namespace ts.codefix { }); interface SynthIdentifier { - identifier: Identifier; - types: Type[]; + readonly identifier: Identifier; + readonly types: Type[]; numberOfAssignmentsOriginal: number; // number of times the variable should be assigned in the refactor } interface SymbolAndIdentifier { - identifier: Identifier; - symbol: Symbol; + readonly identifier: Identifier; + readonly symbol: Symbol; } interface Transformer { - checker: TypeChecker; - synthNamesMap: Map; // keys are the symbol id of the identifier - allVarNames: SymbolAndIdentifier[]; - setOfExpressionsToReturn: Map; // keys are the node ids of the expressions - constIdentifiers: Identifier[]; - originalTypeMap: Map; // keys are the node id of the identifier - isInJSFile: boolean; + readonly checker: TypeChecker; + readonly synthNamesMap: Map; // keys are the symbol id of the identifier + readonly allVarNames: ReadonlyArray; + readonly setOfExpressionsToReturn: ReadonlyMap; // keys are the node ids of the expressions + readonly constIdentifiers: Identifier[]; + readonly originalTypeMap: ReadonlyMap; // keys are the node id of the identifier + readonly isInJSFile: boolean; } function convertToAsyncFunction(changes: textChanges.ChangeTracker, sourceFile: SourceFile, position: number, checker: TypeChecker, context: CodeFixContextBase): void { @@ -61,7 +61,7 @@ namespace ts.codefix { const functionToConvertRenamed: FunctionLikeDeclaration = renameCollidingVarNames(functionToConvert, checker, synthNamesMap, context, setOfExpressionsToReturn, originalTypeMap, allVarNames); const constIdentifiers = getConstIdentifiers(synthNamesMap); const returnStatements = getReturnStatementsWithPromiseHandlers(functionToConvertRenamed); - const transformer = { checker, synthNamesMap, allVarNames, setOfExpressionsToReturn, constIdentifiers, originalTypeMap, isInJSFile: isInJavascript }; + const transformer: Transformer = { checker, synthNamesMap, allVarNames, setOfExpressionsToReturn, constIdentifiers, originalTypeMap, isInJSFile: isInJavascript }; if (!returnStatements.length) { return; @@ -88,7 +88,7 @@ namespace ts.codefix { } // Returns the identifiers that are never reassigned in the refactor - function getConstIdentifiers(synthNamesMap: Map): Identifier[] { + function getConstIdentifiers(synthNamesMap: ReadonlyMap): Identifier[] { const constIdentifiers: Identifier[] = []; synthNamesMap.forEach((val) => { if (val.numberOfAssignmentsOriginal === 0) { @@ -249,8 +249,8 @@ namespace ts.codefix { } } - function getNewNameIfConflict(name: Identifier, originalNames: Map): SynthIdentifier { - const numVarsSameName = (originalNames.get(name.text) || []).length; + function getNewNameIfConflict(name: Identifier, originalNames: ReadonlyMap): SynthIdentifier { + const numVarsSameName = (originalNames.get(name.text) || emptyArray).length; const numberOfAssignmentsOriginal = 0; const identifier = numVarsSameName === 0 ? name : createIdentifier(name.text + "_" + numVarsSameName); return { identifier, types: [], numberOfAssignmentsOriginal }; @@ -258,9 +258,9 @@ namespace ts.codefix { // dispatch function to recursively build the refactoring // should be kept up to date with isFixablePromiseHandler in suggestionDiagnostics.ts - function transformExpression(node: Expression, transformer: Transformer, outermostParent: CallExpression, prevArgName?: SynthIdentifier): Statement[] { + function transformExpression(node: Expression, transformer: Transformer, outermostParent: CallExpression, prevArgName?: SynthIdentifier): ReadonlyArray { if (!node) { - return []; + return emptyArray; } const originalType = isIdentifier(node) && transformer.originalTypeMap.get(getNodeId(node).toString()); @@ -280,10 +280,10 @@ namespace ts.codefix { } codeActionSucceeded = false; - return []; + return emptyArray; } - function transformCatch(node: CallExpression, transformer: Transformer, prevArgName?: SynthIdentifier): Statement[] { + function transformCatch(node: CallExpression, transformer: Transformer, prevArgName?: SynthIdentifier): ReadonlyArray { const func = node.arguments[0]; const argName = getArgName(func, transformer); const shouldReturn = transformer.setOfExpressionsToReturn.get(getNodeId(node).toString()); @@ -336,7 +336,7 @@ namespace ts.codefix { return newSynthName; } - function transformThen(node: CallExpression, transformer: Transformer, outermostParent: CallExpression, prevArgName?: SynthIdentifier): Statement[] { + function transformThen(node: CallExpression, transformer: Transformer, outermostParent: CallExpression, prevArgName?: SynthIdentifier): ReadonlyArray { const [res, rej] = node.arguments; if (!res) { @@ -356,18 +356,18 @@ namespace ts.codefix { const catchArg = argNameRej ? argNameRej.identifier.text : "e"; const catchClause = createCatchClause(catchArg, createBlock(transformationBody2)); - return [createTry(tryBlock, catchClause, /* finallyBlock */ undefined) as Statement]; + return [createTry(tryBlock, catchClause, /* finallyBlock */ undefined)]; } return transformExpression(node.expression, transformer, node, argNameRes).concat(transformationBody); } - function getFlagOfIdentifier(node: Identifier, constIdentifiers: Identifier[]): NodeFlags { + function getFlagOfIdentifier(node: Identifier, constIdentifiers: ReadonlyArray): NodeFlags { const inArr: boolean = constIdentifiers.some(elem => elem.text === node.text); return inArr ? NodeFlags.Const : NodeFlags.Let; } - function transformPromiseCall(node: Expression, transformer: Transformer, prevArgName?: SynthIdentifier): Statement[] { + function transformPromiseCall(node: Expression, transformer: Transformer, prevArgName?: SynthIdentifier): ReadonlyArray { const shouldReturn = transformer.setOfExpressionsToReturn.get(getNodeId(node).toString()); // the identifier is empty when the handler (.then()) ignores the argument - In this situation we do not need to save the result of the promise returning call const originalNodeParent = node.original ? node.original.parent : node.parent; @@ -381,23 +381,23 @@ namespace ts.codefix { return [createReturn(getSynthesizedDeepClone(node))]; } - function createTransformedStatement(prevArgName: SynthIdentifier | undefined, rightHandSide: Expression, transformer: Transformer): MutableNodeArray { + function createTransformedStatement(prevArgName: SynthIdentifier | undefined, rightHandSide: Expression, transformer: Transformer): ReadonlyArray { if (!prevArgName || prevArgName.identifier.text.length === 0) { // if there's no argName to assign to, there still might be side effects - return createNodeArray([createStatement(rightHandSide)]); + return [createStatement(rightHandSide)]; } if (prevArgName.types.length < prevArgName.numberOfAssignmentsOriginal) { // if the variable has already been declared, we don't need "let" or "const" - return createNodeArray([createStatement(createAssignment(getSynthesizedDeepClone(prevArgName.identifier), rightHandSide))]); + return [createStatement(createAssignment(getSynthesizedDeepClone(prevArgName.identifier), rightHandSide))]; } - return createNodeArray([createVariableStatement(/*modifiers*/ undefined, - (createVariableDeclarationList([createVariableDeclaration(getSynthesizedDeepClone(prevArgName.identifier), /*type*/ undefined, rightHandSide)], getFlagOfIdentifier(prevArgName.identifier, transformer.constIdentifiers))))]); + return [createVariableStatement(/*modifiers*/ undefined, + (createVariableDeclarationList([createVariableDeclaration(getSynthesizedDeepClone(prevArgName.identifier), /*type*/ undefined, rightHandSide)], getFlagOfIdentifier(prevArgName.identifier, transformer.constIdentifiers))))]; } // should be kept up to date with isFixablePromiseArgument in suggestionDiagnostics.ts - function getTransformationBody(func: Expression, prevArgName: SynthIdentifier | undefined, argName: SynthIdentifier | undefined, parent: CallExpression, transformer: Transformer): NodeArray { + function getTransformationBody(func: Expression, prevArgName: SynthIdentifier | undefined, argName: SynthIdentifier | undefined, parent: CallExpression, transformer: Transformer): ReadonlyArray { const shouldReturn = transformer.setOfExpressionsToReturn.get(getNodeId(parent).toString()); switch (func.kind) { @@ -410,9 +410,9 @@ namespace ts.codefix { break; } - const synthCall = createCall(getSynthesizedDeepClone(func) as Identifier, /*typeArguments*/ undefined, argName ? [argName.identifier] : []); + const synthCall = createCall(getSynthesizedDeepClone(func as Identifier), /*typeArguments*/ undefined, argName ? [argName.identifier] : emptyArray); if (shouldReturn) { - return createNodeArray([createReturn(synthCall)]); + return [createReturn(synthCall)]; } const type = transformer.originalTypeMap.get(getNodeId(func).toString()) || transformer.checker.getTypeAtLocation(func); @@ -450,15 +450,15 @@ namespace ts.codefix { } } - return shouldReturn ? getSynthesizedDeepClones(createNodeArray(refactoredStmts)) : - removeReturns(createNodeArray(refactoredStmts), prevArgName!.identifier, transformer, seenReturnStatement); + return shouldReturn ? refactoredStmts.map(s => getSynthesizedDeepClone(s)) : + removeReturns(refactoredStmts, prevArgName!.identifier, transformer, seenReturnStatement); } else { const innerRetStmts = getReturnStatementsWithPromiseHandlers(createReturn(funcBody)); const innerCbBody = getInnerTransformationBody(transformer, innerRetStmts, prevArgName); if (innerCbBody.length > 0) { - return createNodeArray(innerCbBody); + return innerCbBody; } if (!shouldReturn) { @@ -473,7 +473,7 @@ namespace ts.codefix { return transformedStatement; } else { - return createNodeArray([createReturn(getSynthesizedDeepClone(funcBody))]); + return [createReturn(getSynthesizedDeepClone(funcBody))]; } } } @@ -482,7 +482,7 @@ namespace ts.codefix { codeActionSucceeded = false; break; } - return createNodeArray([]); + return emptyArray; } function getLastCallSignature(type: Type, checker: TypeChecker): Signature | undefined { @@ -491,7 +491,7 @@ namespace ts.codefix { } - function removeReturns(stmts: NodeArray, prevArgName: Identifier, transformer: Transformer, seenReturnStatement: boolean): NodeArray { + function removeReturns(stmts: ReadonlyArray, prevArgName: Identifier, transformer: Transformer, seenReturnStatement: boolean): ReadonlyArray { const ret: Statement[] = []; for (const stmt of stmts) { if (isReturnStatement(stmt)) { @@ -512,15 +512,15 @@ namespace ts.codefix { (createVariableDeclarationList([createVariableDeclaration(prevArgName, /*type*/ undefined, createIdentifier("undefined"))], getFlagOfIdentifier(prevArgName, transformer.constIdentifiers))))); } - return createNodeArray(ret); + return ret; } - function getInnerTransformationBody(transformer: Transformer, innerRetStmts: Node[], prevArgName?: SynthIdentifier) { + function getInnerTransformationBody(transformer: Transformer, innerRetStmts: ReadonlyArray, prevArgName?: SynthIdentifier) { let innerCbBody: Statement[] = []; for (const stmt of innerRetStmts) { - forEachChild(stmt, function visit(node: Node) { + forEachChild(stmt, function visit(node) { if (isCallExpression(node)) { const temp = transformExpression(node, transformer, node, prevArgName); innerCbBody = innerCbBody.concat(temp); From b56854a532f67e883f866beec84a513a72788fde Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 20 Sep 2018 16:54:01 -0700 Subject: [PATCH 30/71] Set parent pointers on manufactured reference for property initialization check (#27246) --- src/compiler/checker.ts | 2 ++ .../strictBooleanMemberAssignability.js | 16 ++++++++++++++++ .../strictBooleanMemberAssignability.symbols | 14 ++++++++++++++ .../strictBooleanMemberAssignability.types | 16 ++++++++++++++++ .../compiler/strictBooleanMemberAssignability.ts | 7 +++++++ 5 files changed, 55 insertions(+) create mode 100644 tests/baselines/reference/strictBooleanMemberAssignability.js create mode 100644 tests/baselines/reference/strictBooleanMemberAssignability.symbols create mode 100644 tests/baselines/reference/strictBooleanMemberAssignability.types create mode 100644 tests/cases/compiler/strictBooleanMemberAssignability.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 58717c941d9..9cad117c576 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -26185,6 +26185,8 @@ namespace ts { function isPropertyInitializedInConstructor(propName: Identifier, propType: Type, constructor: ConstructorDeclaration) { const reference = createPropertyAccess(createThis(), propName); + reference.expression.parent = reference; + reference.parent = constructor; reference.flowNode = constructor.returnFlowNode; const flowType = getFlowTypeOfReference(reference, propType, getOptionalType(propType)); return !(getFalsyFlags(flowType) & TypeFlags.Undefined); diff --git a/tests/baselines/reference/strictBooleanMemberAssignability.js b/tests/baselines/reference/strictBooleanMemberAssignability.js new file mode 100644 index 00000000000..c19fc0b33c9 --- /dev/null +++ b/tests/baselines/reference/strictBooleanMemberAssignability.js @@ -0,0 +1,16 @@ +//// [strictBooleanMemberAssignability.ts] +class Abc { + def: boolean + constructor() { + this.def = true + } +} + +//// [strictBooleanMemberAssignability.js] +"use strict"; +var Abc = /** @class */ (function () { + function Abc() { + this.def = true; + } + return Abc; +}()); diff --git a/tests/baselines/reference/strictBooleanMemberAssignability.symbols b/tests/baselines/reference/strictBooleanMemberAssignability.symbols new file mode 100644 index 00000000000..b9c449f6051 --- /dev/null +++ b/tests/baselines/reference/strictBooleanMemberAssignability.symbols @@ -0,0 +1,14 @@ +=== tests/cases/compiler/strictBooleanMemberAssignability.ts === +class Abc { +>Abc : Symbol(Abc, Decl(strictBooleanMemberAssignability.ts, 0, 0)) + + def: boolean +>def : Symbol(Abc.def, Decl(strictBooleanMemberAssignability.ts, 0, 11)) + + constructor() { + this.def = true +>this.def : Symbol(Abc.def, Decl(strictBooleanMemberAssignability.ts, 0, 11)) +>this : Symbol(Abc, Decl(strictBooleanMemberAssignability.ts, 0, 0)) +>def : Symbol(Abc.def, Decl(strictBooleanMemberAssignability.ts, 0, 11)) + } +} diff --git a/tests/baselines/reference/strictBooleanMemberAssignability.types b/tests/baselines/reference/strictBooleanMemberAssignability.types new file mode 100644 index 00000000000..694f44f2695 --- /dev/null +++ b/tests/baselines/reference/strictBooleanMemberAssignability.types @@ -0,0 +1,16 @@ +=== tests/cases/compiler/strictBooleanMemberAssignability.ts === +class Abc { +>Abc : Abc + + def: boolean +>def : boolean + + constructor() { + this.def = true +>this.def = true : true +>this.def : boolean +>this : this +>def : boolean +>true : true + } +} diff --git a/tests/cases/compiler/strictBooleanMemberAssignability.ts b/tests/cases/compiler/strictBooleanMemberAssignability.ts new file mode 100644 index 00000000000..8b723c1de10 --- /dev/null +++ b/tests/cases/compiler/strictBooleanMemberAssignability.ts @@ -0,0 +1,7 @@ +// @strict: true +class Abc { + def: boolean + constructor() { + this.def = true + } +} \ No newline at end of file From 2b607a6ed04997ea2bbce2980055b4dceb267d9a Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 20 Sep 2018 16:56:49 -0700 Subject: [PATCH 31/71] Add release-3.1 to covered branches (#27253) --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 9479fffe763..6d000dd7165 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,7 @@ branches: - release-2.8 - release-2.9 - release-3.0 + - release-3.1 install: - npm uninstall typescript --no-save From 219bb44b4dc47aa41d1934625d409643e177b1c3 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 20 Sep 2018 17:03:34 -0700 Subject: [PATCH 32/71] Distribute indexes of indexed access types first (#27243) --- src/compiler/checker.ts | 20 ++++++-- .../contextualTypeOfIndexedAccessParameter.js | 25 ++++++++++ ...extualTypeOfIndexedAccessParameter.symbols | 47 +++++++++++++++++++ ...ntextualTypeOfIndexedAccessParameter.types | 45 ++++++++++++++++++ .../reference/infiniteConstraints.errors.txt | 8 +++- .../contextualTypeOfIndexedAccessParameter.ts | 15 ++++++ 6 files changed, 154 insertions(+), 6 deletions(-) create mode 100644 tests/baselines/reference/contextualTypeOfIndexedAccessParameter.js create mode 100644 tests/baselines/reference/contextualTypeOfIndexedAccessParameter.symbols create mode 100644 tests/baselines/reference/contextualTypeOfIndexedAccessParameter.types create mode 100644 tests/cases/compiler/contextualTypeOfIndexedAccessParameter.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 9cad117c576..dc2faa2e298 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -9369,12 +9369,24 @@ namespace ts { // '{ [P in T]: { [Q in U]: number } }[T][U]' we want to first simplify the inner indexed access type. const objectType = getSimplifiedType(type.objectType); const indexType = getSimplifiedType(type.indexType); - if (objectType.flags & TypeFlags.Union) { - return type.simplified = mapType(objectType, t => getSimplifiedType(getIndexedAccessType(t, indexType))); + // T[A | B] -> T[A] | T[B] + if (indexType.flags & TypeFlags.Union) { + return type.simplified = mapType(indexType, t => getSimplifiedType(getIndexedAccessType(objectType, t))); } - if (objectType.flags & TypeFlags.Intersection) { - return type.simplified = getIntersectionType(map((objectType as IntersectionType).types, t => getSimplifiedType(getIndexedAccessType(t, indexType)))); + // Only do the inner distributions if the index can no longer be instantiated to cause index distribution again + if (!(indexType.flags & TypeFlags.Instantiable)) { + // (T | U)[K] -> T[K] | U[K] + if (objectType.flags & TypeFlags.Union) { + return type.simplified = mapType(objectType, t => getSimplifiedType(getIndexedAccessType(t, indexType))); + } + // (T & U)[K] -> T[K] & U[K] + if (objectType.flags & TypeFlags.Intersection) { + return type.simplified = getIntersectionType(map((objectType as IntersectionType).types, t => getSimplifiedType(getIndexedAccessType(t, indexType)))); + } } + // So ultimately: + // ((A & B) | C)[K1 | K2] -> ((A & B) | C)[K1] | ((A & B) | C)[K2] -> (A & B)[K1] | C[K1] | (A & B)[K2] | C[K2] -> (A[K1] & B[K1]) | C[K1] | (A[K2] & B[K2]) | C[K2] + // If the object type is a mapped type { [P in K]: E }, where K is generic, instantiate E using a mapper // that substitutes the index type for P. For example, for an index access { [P in K]: Box }[X], we // construct the type Box. We do not further simplify the result because mapped types can be recursive diff --git a/tests/baselines/reference/contextualTypeOfIndexedAccessParameter.js b/tests/baselines/reference/contextualTypeOfIndexedAccessParameter.js new file mode 100644 index 00000000000..ec101ecd3af --- /dev/null +++ b/tests/baselines/reference/contextualTypeOfIndexedAccessParameter.js @@ -0,0 +1,25 @@ +//// [contextualTypeOfIndexedAccessParameter.ts] +type Keys = "a" | "b"; + +type OptionsForKey = { a: { cb: (p: number) => number } } & { b: {} }; + +declare function f(key: K, options: OptionsForKey[K]): void; + +f("a", { + cb: p => p, +}); + +function g< + K extends "a" | "b">(x: ({ a: string } & { b: string })[K], y: string) { + x = y; +} + + +//// [contextualTypeOfIndexedAccessParameter.js] +"use strict"; +f("a", { + cb: function (p) { return p; } +}); +function g(x, y) { + x = y; +} diff --git a/tests/baselines/reference/contextualTypeOfIndexedAccessParameter.symbols b/tests/baselines/reference/contextualTypeOfIndexedAccessParameter.symbols new file mode 100644 index 00000000000..74cc7843f87 --- /dev/null +++ b/tests/baselines/reference/contextualTypeOfIndexedAccessParameter.symbols @@ -0,0 +1,47 @@ +=== tests/cases/compiler/contextualTypeOfIndexedAccessParameter.ts === +type Keys = "a" | "b"; +>Keys : Symbol(Keys, Decl(contextualTypeOfIndexedAccessParameter.ts, 0, 0)) + +type OptionsForKey = { a: { cb: (p: number) => number } } & { b: {} }; +>OptionsForKey : Symbol(OptionsForKey, Decl(contextualTypeOfIndexedAccessParameter.ts, 0, 22)) +>a : Symbol(a, Decl(contextualTypeOfIndexedAccessParameter.ts, 2, 22)) +>cb : Symbol(cb, Decl(contextualTypeOfIndexedAccessParameter.ts, 2, 27)) +>p : Symbol(p, Decl(contextualTypeOfIndexedAccessParameter.ts, 2, 33)) +>b : Symbol(b, Decl(contextualTypeOfIndexedAccessParameter.ts, 2, 61)) + +declare function f(key: K, options: OptionsForKey[K]): void; +>f : Symbol(f, Decl(contextualTypeOfIndexedAccessParameter.ts, 2, 70)) +>K : Symbol(K, Decl(contextualTypeOfIndexedAccessParameter.ts, 4, 19)) +>Keys : Symbol(Keys, Decl(contextualTypeOfIndexedAccessParameter.ts, 0, 0)) +>key : Symbol(key, Decl(contextualTypeOfIndexedAccessParameter.ts, 4, 35)) +>K : Symbol(K, Decl(contextualTypeOfIndexedAccessParameter.ts, 4, 19)) +>options : Symbol(options, Decl(contextualTypeOfIndexedAccessParameter.ts, 4, 42)) +>OptionsForKey : Symbol(OptionsForKey, Decl(contextualTypeOfIndexedAccessParameter.ts, 0, 22)) +>K : Symbol(K, Decl(contextualTypeOfIndexedAccessParameter.ts, 4, 19)) + +f("a", { +>f : Symbol(f, Decl(contextualTypeOfIndexedAccessParameter.ts, 2, 70)) + + cb: p => p, +>cb : Symbol(cb, Decl(contextualTypeOfIndexedAccessParameter.ts, 6, 8)) +>p : Symbol(p, Decl(contextualTypeOfIndexedAccessParameter.ts, 7, 7)) +>p : Symbol(p, Decl(contextualTypeOfIndexedAccessParameter.ts, 7, 7)) + +}); + +function g< +>g : Symbol(g, Decl(contextualTypeOfIndexedAccessParameter.ts, 8, 3)) + + K extends "a" | "b">(x: ({ a: string } & { b: string })[K], y: string) { +>K : Symbol(K, Decl(contextualTypeOfIndexedAccessParameter.ts, 10, 11)) +>x : Symbol(x, Decl(contextualTypeOfIndexedAccessParameter.ts, 11, 25)) +>a : Symbol(a, Decl(contextualTypeOfIndexedAccessParameter.ts, 11, 30)) +>b : Symbol(b, Decl(contextualTypeOfIndexedAccessParameter.ts, 11, 46)) +>K : Symbol(K, Decl(contextualTypeOfIndexedAccessParameter.ts, 10, 11)) +>y : Symbol(y, Decl(contextualTypeOfIndexedAccessParameter.ts, 11, 63)) + + x = y; +>x : Symbol(x, Decl(contextualTypeOfIndexedAccessParameter.ts, 11, 25)) +>y : Symbol(y, Decl(contextualTypeOfIndexedAccessParameter.ts, 11, 63)) +} + diff --git a/tests/baselines/reference/contextualTypeOfIndexedAccessParameter.types b/tests/baselines/reference/contextualTypeOfIndexedAccessParameter.types new file mode 100644 index 00000000000..e2fe48b76e2 --- /dev/null +++ b/tests/baselines/reference/contextualTypeOfIndexedAccessParameter.types @@ -0,0 +1,45 @@ +=== tests/cases/compiler/contextualTypeOfIndexedAccessParameter.ts === +type Keys = "a" | "b"; +>Keys : Keys + +type OptionsForKey = { a: { cb: (p: number) => number } } & { b: {} }; +>OptionsForKey : OptionsForKey +>a : { cb: (p: number) => number; } +>cb : (p: number) => number +>p : number +>b : {} + +declare function f(key: K, options: OptionsForKey[K]): void; +>f : (key: K, options: OptionsForKey[K]) => void +>key : K +>options : OptionsForKey[K] + +f("a", { +>f("a", { cb: p => p,}) : void +>f : (key: K, options: OptionsForKey[K]) => void +>"a" : "a" +>{ cb: p => p,} : { cb: (p: number) => number; } + + cb: p => p, +>cb : (p: number) => number +>p => p : (p: number) => number +>p : number +>p : number + +}); + +function g< +>g : (x: ({ a: string; } & { b: string; })[K], y: string) => void + + K extends "a" | "b">(x: ({ a: string } & { b: string })[K], y: string) { +>x : ({ a: string; } & { b: string; })[K] +>a : string +>b : string +>y : string + + x = y; +>x = y : string +>x : ({ a: string; } & { b: string; })[K] +>y : string +} + diff --git a/tests/baselines/reference/infiniteConstraints.errors.txt b/tests/baselines/reference/infiniteConstraints.errors.txt index 71034e87edf..36b77b2b3f6 100644 --- a/tests/baselines/reference/infiniteConstraints.errors.txt +++ b/tests/baselines/reference/infiniteConstraints.errors.txt @@ -1,4 +1,6 @@ -error TS2321: Excessive stack depth comparing types 'Extract], Record<"val", string>>["val"]' and 'Extract>], Record<"val", string>>["val"]'. +error TS2321: Excessive stack depth comparing types 'Extract], Record<"val", string>>["val"]' and 'Extract>], Record<"val", string>>["val"]'. +error TS2321: Excessive stack depth comparing types 'Extract], Record<"val", string>>["val"]' and 'Extract>], Record<"val", string>>["val"]'. +error TS2321: Excessive stack depth comparing types 'Extract], Record<"val", string>>["val"]' and 'Extract>], Record<"val", string>>["val"]'. tests/cases/compiler/infiniteConstraints.ts(4,37): error TS2536: Type '"val"' cannot be used to index type 'B[Exclude]'. tests/cases/compiler/infiniteConstraints.ts(27,37): error TS2322: Type 'Record<"val", "test">' is not assignable to type 'never'. tests/cases/compiler/infiniteConstraints.ts(27,58): error TS2322: Type 'Record<"val", "test2">' is not assignable to type 'never'. @@ -8,7 +10,9 @@ tests/cases/compiler/infiniteConstraints.ts(31,63): error TS2322: Type 'Record<" tests/cases/compiler/infiniteConstraints.ts(36,71): error TS2536: Type '"foo"' cannot be used to index type 'T[keyof T]'. -!!! error TS2321: Excessive stack depth comparing types 'Extract], Record<"val", string>>["val"]' and 'Extract>], Record<"val", string>>["val"]'. +!!! error TS2321: Excessive stack depth comparing types 'Extract], Record<"val", string>>["val"]' and 'Extract>], Record<"val", string>>["val"]'. +!!! error TS2321: Excessive stack depth comparing types 'Extract], Record<"val", string>>["val"]' and 'Extract>], Record<"val", string>>["val"]'. +!!! error TS2321: Excessive stack depth comparing types 'Extract], Record<"val", string>>["val"]' and 'Extract>], Record<"val", string>>["val"]'. ==== tests/cases/compiler/infiniteConstraints.ts (7 errors) ==== // Both of the following types trigger the recursion limiter in getImmediateBaseConstraint diff --git a/tests/cases/compiler/contextualTypeOfIndexedAccessParameter.ts b/tests/cases/compiler/contextualTypeOfIndexedAccessParameter.ts new file mode 100644 index 00000000000..2135ed5cb29 --- /dev/null +++ b/tests/cases/compiler/contextualTypeOfIndexedAccessParameter.ts @@ -0,0 +1,15 @@ +// @strict: true +type Keys = "a" | "b"; + +type OptionsForKey = { a: { cb: (p: number) => number } } & { b: {} }; + +declare function f(key: K, options: OptionsForKey[K]): void; + +f("a", { + cb: p => p, +}); + +function g< + K extends "a" | "b">(x: ({ a: string } & { b: string })[K], y: string) { + x = y; +} From 80dba4d63b905b51fb30db55cda12ea45647747c Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Thu, 20 Sep 2018 17:33:45 -0700 Subject: [PATCH 33/71] Support promise-like types in contextual return type of async function --- src/compiler/checker.ts | 27 ++++++++++++++-- ...xtuallyTypeAsyncFunctionReturnType.symbols | 29 +++++++++++++++++ ...textuallyTypeAsyncFunctionReturnType.types | 31 +++++++++++++++++++ ...contextuallyTypeAsyncFunctionReturnType.ts | 15 +++++++++ 4 files changed, 99 insertions(+), 3 deletions(-) create mode 100644 tests/baselines/reference/contextuallyTypeAsyncFunctionReturnType.symbols create mode 100644 tests/baselines/reference/contextuallyTypeAsyncFunctionReturnType.types create mode 100644 tests/cases/conformance/types/contextualTypes/asyncFunctions/contextuallyTypeAsyncFunctionReturnType.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index dc2faa2e298..fde33463942 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -495,6 +495,7 @@ namespace ts { let deferredGlobalESSymbolType: ObjectType; let deferredGlobalTypedPropertyDescriptorType: GenericType; let deferredGlobalPromiseType: GenericType; + let deferredGlobalPromiseLikeType: GenericType; let deferredGlobalPromiseConstructorSymbol: Symbol | undefined; let deferredGlobalPromiseConstructorLikeType: ObjectType; let deferredGlobalIterableType: GenericType; @@ -8538,6 +8539,10 @@ namespace ts { return deferredGlobalPromiseType || (deferredGlobalPromiseType = getGlobalType("Promise" as __String, /*arity*/ 1, reportErrors)) || emptyGenericType; } + function getGlobalPromiseLikeType(reportErrors: boolean) { + return deferredGlobalPromiseLikeType || (deferredGlobalPromiseLikeType = getGlobalType("PromiseLike" as __String, /*arity*/ 1, reportErrors)) || emptyGenericType; + } + function getGlobalPromiseConstructorSymbol(reportErrors: boolean): Symbol | undefined { return deferredGlobalPromiseConstructorSymbol || (deferredGlobalPromiseConstructorSymbol = getGlobalValueSymbol("Promise" as __String, reportErrors)); } @@ -16393,9 +16398,13 @@ namespace ts { } const contextualReturnType = getContextualReturnType(func); - return functionFlags & FunctionFlags.Async - ? contextualReturnType && getAwaitedTypeOfPromise(contextualReturnType) // Async function - : contextualReturnType; // Regular function + if (contextualReturnType) { + if (functionFlags & FunctionFlags.Async) { // Async function + const contextualAwaitedType = getAwaitedTypeOfPromise(contextualReturnType); + return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); + } + return contextualReturnType; // Regular function + } } return undefined; } @@ -20796,6 +20805,18 @@ namespace ts { return emptyObjectType; } + function createPromiseLikeType(promisedType: Type): Type { + // creates a `PromiseLike` type where `T` is the promisedType argument + const globalPromiseLikeType = getGlobalPromiseLikeType(/*reportErrors*/ true); + if (globalPromiseLikeType !== emptyGenericType) { + // if the promised type is itself a promise, get the underlying type; otherwise, fallback to the promised type + promisedType = getAwaitedType(promisedType) || emptyObjectType; + return createTypeReference(globalPromiseLikeType, [promisedType]); + } + + return emptyObjectType; + } + function createPromiseReturnType(func: FunctionLikeDeclaration | ImportCall, promisedType: Type) { const promiseType = createPromiseType(promisedType); if (promiseType === emptyObjectType) { diff --git a/tests/baselines/reference/contextuallyTypeAsyncFunctionReturnType.symbols b/tests/baselines/reference/contextuallyTypeAsyncFunctionReturnType.symbols new file mode 100644 index 00000000000..28f80dfa1a7 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypeAsyncFunctionReturnType.symbols @@ -0,0 +1,29 @@ +=== tests/cases/conformance/types/contextualTypes/asyncFunctions/contextuallyTypeAsyncFunctionReturnType.ts === +interface Obj { key: "value"; } +>Obj : Symbol(Obj, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 0, 0)) +>key : Symbol(Obj.key, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 0, 15)) + +async function fn1(): Promise { +>fn1 : Symbol(fn1, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 0, 31)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --)) +>Obj : Symbol(Obj, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 0, 0)) + + return { key: "value" }; +>key : Symbol(key, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 3, 12)) +} + +async function fn2(): Promise { +>fn2 : Symbol(fn2, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 4, 1)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --)) +>Obj : Symbol(Obj, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 0, 0)) + + return new Promise(resolve => { +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --)) +>resolve : Symbol(resolve, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 7, 23)) + + resolve({ key: "value" }); +>resolve : Symbol(resolve, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 7, 23)) +>key : Symbol(key, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 8, 17)) + + }); +} diff --git a/tests/baselines/reference/contextuallyTypeAsyncFunctionReturnType.types b/tests/baselines/reference/contextuallyTypeAsyncFunctionReturnType.types new file mode 100644 index 00000000000..bcb58991c4d --- /dev/null +++ b/tests/baselines/reference/contextuallyTypeAsyncFunctionReturnType.types @@ -0,0 +1,31 @@ +=== tests/cases/conformance/types/contextualTypes/asyncFunctions/contextuallyTypeAsyncFunctionReturnType.ts === +interface Obj { key: "value"; } +>key : "value" + +async function fn1(): Promise { +>fn1 : () => Promise + + return { key: "value" }; +>{ key: "value" } : { key: "value"; } +>key : "value" +>"value" : "value" +} + +async function fn2(): Promise { +>fn2 : () => Promise + + return new Promise(resolve => { +>new Promise(resolve => { resolve({ key: "value" }); }) : Promise +>Promise : PromiseConstructor +>resolve => { resolve({ key: "value" }); } : (resolve: (value?: Obj | PromiseLike) => void) => void +>resolve : (value?: Obj | PromiseLike) => void + + resolve({ key: "value" }); +>resolve({ key: "value" }) : void +>resolve : (value?: Obj | PromiseLike) => void +>{ key: "value" } : { key: "value"; } +>key : "value" +>"value" : "value" + + }); +} diff --git a/tests/cases/conformance/types/contextualTypes/asyncFunctions/contextuallyTypeAsyncFunctionReturnType.ts b/tests/cases/conformance/types/contextualTypes/asyncFunctions/contextuallyTypeAsyncFunctionReturnType.ts new file mode 100644 index 00000000000..c9912e0fae1 --- /dev/null +++ b/tests/cases/conformance/types/contextualTypes/asyncFunctions/contextuallyTypeAsyncFunctionReturnType.ts @@ -0,0 +1,15 @@ +// @target: esnext +// @noImplicitAny: true +// @noEmit: true + +interface Obj { key: "value"; } + +async function fn1(): Promise { + return { key: "value" }; +} + +async function fn2(): Promise { + return new Promise(resolve => { + resolve({ key: "value" }); + }); +} \ No newline at end of file From 63adc5fb4035d5535953a490827c2fa7441c7ee5 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Fri, 21 Sep 2018 10:17:18 -0700 Subject: [PATCH 34/71] Add contextual typing for await operand --- src/compiler/checker.ts | 13 +++++++- ...xtuallyTypeAsyncFunctionReturnType.symbols | 25 ++++++++++++++++ ...textuallyTypeAsyncFunctionReturnType.types | 30 +++++++++++++++++++ ...contextuallyTypeAsyncFunctionReturnType.ts | 10 +++++++ 4 files changed, 77 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index fde33463942..8e448a10017 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -16409,6 +16409,15 @@ namespace ts { return undefined; } + function getContextualTypeForAwaitOperand(node: AwaitExpression): Type | undefined { + const contextualType = getContextualType(node); + if (contextualType) { + const contextualAwaitedType = getAwaitedType(contextualType); + return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]); + } + return undefined; + } + function getContextualTypeForYieldOperand(node: YieldExpression): Type | undefined { const func = getContainingFunction(node); if (func) { @@ -16770,7 +16779,9 @@ namespace ts { return getContextualTypeForReturnExpression(node); case SyntaxKind.YieldExpression: return getContextualTypeForYieldOperand(parent); - case SyntaxKind.CallExpression: + case SyntaxKind.AwaitExpression: + return getContextualTypeForAwaitOperand(parent); + case SyntaxKind.CallExpression: case SyntaxKind.NewExpression: return getContextualTypeForArgument(parent, node); case SyntaxKind.TypeAssertionExpression: diff --git a/tests/baselines/reference/contextuallyTypeAsyncFunctionReturnType.symbols b/tests/baselines/reference/contextuallyTypeAsyncFunctionReturnType.symbols index 28f80dfa1a7..e85fa4d0d9a 100644 --- a/tests/baselines/reference/contextuallyTypeAsyncFunctionReturnType.symbols +++ b/tests/baselines/reference/contextuallyTypeAsyncFunctionReturnType.symbols @@ -27,3 +27,28 @@ async function fn2(): Promise { }); } + +async function fn3(): Promise { +>fn3 : Symbol(fn3, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 10, 1)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --)) +>Obj : Symbol(Obj, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 0, 0)) + + return await { key: "value" }; +>key : Symbol(key, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 13, 18)) +} + +async function fn4(): Promise { +>fn4 : Symbol(fn4, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 14, 1)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --)) +>Obj : Symbol(Obj, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 0, 0)) + + return await new Promise(resolve => { +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --)) +>resolve : Symbol(resolve, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 17, 29)) + + resolve({ key: "value" }); +>resolve : Symbol(resolve, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 17, 29)) +>key : Symbol(key, Decl(contextuallyTypeAsyncFunctionReturnType.ts, 18, 17)) + + }); +} diff --git a/tests/baselines/reference/contextuallyTypeAsyncFunctionReturnType.types b/tests/baselines/reference/contextuallyTypeAsyncFunctionReturnType.types index bcb58991c4d..d47a623ffc6 100644 --- a/tests/baselines/reference/contextuallyTypeAsyncFunctionReturnType.types +++ b/tests/baselines/reference/contextuallyTypeAsyncFunctionReturnType.types @@ -29,3 +29,33 @@ async function fn2(): Promise { }); } + +async function fn3(): Promise { +>fn3 : () => Promise + + return await { key: "value" }; +>await { key: "value" } : { key: "value"; } +>{ key: "value" } : { key: "value"; } +>key : "value" +>"value" : "value" +} + +async function fn4(): Promise { +>fn4 : () => Promise + + return await new Promise(resolve => { +>await new Promise(resolve => { resolve({ key: "value" }); }) : Obj +>new Promise(resolve => { resolve({ key: "value" }); }) : Promise +>Promise : PromiseConstructor +>resolve => { resolve({ key: "value" }); } : (resolve: (value?: Obj | PromiseLike) => void) => void +>resolve : (value?: Obj | PromiseLike) => void + + resolve({ key: "value" }); +>resolve({ key: "value" }) : void +>resolve : (value?: Obj | PromiseLike) => void +>{ key: "value" } : { key: "value"; } +>key : "value" +>"value" : "value" + + }); +} diff --git a/tests/cases/conformance/types/contextualTypes/asyncFunctions/contextuallyTypeAsyncFunctionReturnType.ts b/tests/cases/conformance/types/contextualTypes/asyncFunctions/contextuallyTypeAsyncFunctionReturnType.ts index c9912e0fae1..b2239b9bda6 100644 --- a/tests/cases/conformance/types/contextualTypes/asyncFunctions/contextuallyTypeAsyncFunctionReturnType.ts +++ b/tests/cases/conformance/types/contextualTypes/asyncFunctions/contextuallyTypeAsyncFunctionReturnType.ts @@ -12,4 +12,14 @@ async function fn2(): Promise { return new Promise(resolve => { resolve({ key: "value" }); }); +} + +async function fn3(): Promise { + return await { key: "value" }; +} + +async function fn4(): Promise { + return await new Promise(resolve => { + resolve({ key: "value" }); + }); } \ No newline at end of file From 3a4d0b237f1fa1ba21a5773a92bda95611a74220 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Fri, 21 Sep 2018 10:24:54 -0700 Subject: [PATCH 35/71] Add more tests for await --- ...uallyTypeAsyncFunctionAwaitOperand.symbols | 27 +++++++++++++++ ...xtuallyTypeAsyncFunctionAwaitOperand.types | 34 +++++++++++++++++++ ...ntextuallyTypeAsyncFunctionAwaitOperand.ts | 11 ++++++ 3 files changed, 72 insertions(+) create mode 100644 tests/baselines/reference/contextuallyTypeAsyncFunctionAwaitOperand.symbols create mode 100644 tests/baselines/reference/contextuallyTypeAsyncFunctionAwaitOperand.types create mode 100644 tests/cases/conformance/types/contextualTypes/asyncFunctions/contextuallyTypeAsyncFunctionAwaitOperand.ts diff --git a/tests/baselines/reference/contextuallyTypeAsyncFunctionAwaitOperand.symbols b/tests/baselines/reference/contextuallyTypeAsyncFunctionAwaitOperand.symbols new file mode 100644 index 00000000000..123cceea15a --- /dev/null +++ b/tests/baselines/reference/contextuallyTypeAsyncFunctionAwaitOperand.symbols @@ -0,0 +1,27 @@ +=== tests/cases/conformance/types/contextualTypes/asyncFunctions/contextuallyTypeAsyncFunctionAwaitOperand.ts === +interface Obj { key: "value"; } +>Obj : Symbol(Obj, Decl(contextuallyTypeAsyncFunctionAwaitOperand.ts, 0, 0)) +>key : Symbol(Obj.key, Decl(contextuallyTypeAsyncFunctionAwaitOperand.ts, 0, 15)) + +async function fn1(): Promise { +>fn1 : Symbol(fn1, Decl(contextuallyTypeAsyncFunctionAwaitOperand.ts, 0, 31)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --)) +>Obj : Symbol(Obj, Decl(contextuallyTypeAsyncFunctionAwaitOperand.ts, 0, 0)) + + const obj1: Obj = await { key: "value" }; +>obj1 : Symbol(obj1, Decl(contextuallyTypeAsyncFunctionAwaitOperand.ts, 3, 9)) +>Obj : Symbol(Obj, Decl(contextuallyTypeAsyncFunctionAwaitOperand.ts, 0, 0)) +>key : Symbol(key, Decl(contextuallyTypeAsyncFunctionAwaitOperand.ts, 3, 29)) + + const obj2: Obj = await new Promise(resolve => resolve({ key: "value" })); +>obj2 : Symbol(obj2, Decl(contextuallyTypeAsyncFunctionAwaitOperand.ts, 4, 9)) +>Obj : Symbol(Obj, Decl(contextuallyTypeAsyncFunctionAwaitOperand.ts, 0, 0)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --)) +>resolve : Symbol(resolve, Decl(contextuallyTypeAsyncFunctionAwaitOperand.ts, 4, 40)) +>resolve : Symbol(resolve, Decl(contextuallyTypeAsyncFunctionAwaitOperand.ts, 4, 40)) +>key : Symbol(key, Decl(contextuallyTypeAsyncFunctionAwaitOperand.ts, 4, 60)) + + return await { key: "value" }; +>key : Symbol(key, Decl(contextuallyTypeAsyncFunctionAwaitOperand.ts, 5, 18)) +} + diff --git a/tests/baselines/reference/contextuallyTypeAsyncFunctionAwaitOperand.types b/tests/baselines/reference/contextuallyTypeAsyncFunctionAwaitOperand.types new file mode 100644 index 00000000000..377f7c15ae3 --- /dev/null +++ b/tests/baselines/reference/contextuallyTypeAsyncFunctionAwaitOperand.types @@ -0,0 +1,34 @@ +=== tests/cases/conformance/types/contextualTypes/asyncFunctions/contextuallyTypeAsyncFunctionAwaitOperand.ts === +interface Obj { key: "value"; } +>key : "value" + +async function fn1(): Promise { +>fn1 : () => Promise + + const obj1: Obj = await { key: "value" }; +>obj1 : Obj +>await { key: "value" } : { key: "value"; } +>{ key: "value" } : { key: "value"; } +>key : "value" +>"value" : "value" + + const obj2: Obj = await new Promise(resolve => resolve({ key: "value" })); +>obj2 : Obj +>await new Promise(resolve => resolve({ key: "value" })) : Obj +>new Promise(resolve => resolve({ key: "value" })) : Promise +>Promise : PromiseConstructor +>resolve => resolve({ key: "value" }) : (resolve: (value?: Obj | PromiseLike) => void) => void +>resolve : (value?: Obj | PromiseLike) => void +>resolve({ key: "value" }) : void +>resolve : (value?: Obj | PromiseLike) => void +>{ key: "value" } : { key: "value"; } +>key : "value" +>"value" : "value" + + return await { key: "value" }; +>await { key: "value" } : { key: "value"; } +>{ key: "value" } : { key: "value"; } +>key : "value" +>"value" : "value" +} + diff --git a/tests/cases/conformance/types/contextualTypes/asyncFunctions/contextuallyTypeAsyncFunctionAwaitOperand.ts b/tests/cases/conformance/types/contextualTypes/asyncFunctions/contextuallyTypeAsyncFunctionAwaitOperand.ts new file mode 100644 index 00000000000..81ef725a45b --- /dev/null +++ b/tests/cases/conformance/types/contextualTypes/asyncFunctions/contextuallyTypeAsyncFunctionAwaitOperand.ts @@ -0,0 +1,11 @@ +// @target: esnext +// @noImplicitAny: true +// @noEmit: true + +interface Obj { key: "value"; } + +async function fn1(): Promise { + const obj1: Obj = await { key: "value" }; + const obj2: Obj = await new Promise(resolve => resolve({ key: "value" })); + return await { key: "value" }; +} From 112fe6e2cc3bdb60add0a1e4d44d38f842484d07 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Thu, 20 Sep 2018 15:58:40 -0700 Subject: [PATCH 36/71] Fix iterated type in for-await-of --- src/compiler/checker.ts | 16 ++++--- .../reference/types.forAwait.esnext.1.symbols | 45 ++++++++++++++----- .../reference/types.forAwait.esnext.1.types | 19 ++++++++ .../types/forAwait/types.forAwait.esnext.1.ts | 9 ++++ 4 files changed, 72 insertions(+), 17 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index dc2faa2e298..b074e561650 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -25281,14 +25281,18 @@ namespace ts { if (allowSyncIterables) { if (typeAsIterable.iteratedTypeOfIterable) { - return typeAsIterable.iteratedTypeOfIterable; + return allowAsyncIterables + ? typeAsIterable.iteratedTypeOfAsyncIterable = getAwaitedType(typeAsIterable.iteratedTypeOfIterable) + : typeAsIterable.iteratedTypeOfIterable; } // As an optimization, if the type is an instantiation of the global `Iterable` or // `IterableIterator` then just grab its type argument. if (isReferenceToType(type, getGlobalIterableType(/*reportErrors*/ false)) || isReferenceToType(type, getGlobalIterableIteratorType(/*reportErrors*/ false))) { - return typeAsIterable.iteratedTypeOfIterable = (type).typeArguments![0]; + return allowAsyncIterables + ? typeAsIterable.iteratedTypeOfAsyncIterable = getAwaitedType((type).typeArguments![0]) + : typeAsIterable.iteratedTypeOfIterable = (type).typeArguments![0]; } } @@ -25319,9 +25323,11 @@ namespace ts { : createIterableType(iteratedType), errorNode); } - return asyncMethodType - ? typeAsIterable.iteratedTypeOfAsyncIterable = iteratedType - : typeAsIterable.iteratedTypeOfIterable = iteratedType; + if (iteratedType) { + return allowAsyncIterables + ? typeAsIterable.iteratedTypeOfAsyncIterable = asyncMethodType ? iteratedType : getAwaitedType(iteratedType) + : typeAsIterable.iteratedTypeOfIterable = iteratedType; + } } } diff --git a/tests/baselines/reference/types.forAwait.esnext.1.symbols b/tests/baselines/reference/types.forAwait.esnext.1.symbols index 286f0a8555c..c3c10c42109 100644 --- a/tests/baselines/reference/types.forAwait.esnext.1.symbols +++ b/tests/baselines/reference/types.forAwait.esnext.1.symbols @@ -7,49 +7,70 @@ declare const iterable: Iterable; >iterable : Symbol(iterable, Decl(types.forAwait.esnext.1.ts, 1, 13)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +declare const iterableOfPromise: Iterable>; +>iterableOfPromise : Symbol(iterableOfPromise, Decl(types.forAwait.esnext.1.ts, 2, 13)) +>Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --)) + async function f1() { ->f1 : Symbol(f1, Decl(types.forAwait.esnext.1.ts, 1, 41)) +>f1 : Symbol(f1, Decl(types.forAwait.esnext.1.ts, 2, 59)) let y: number; ->y : Symbol(y, Decl(types.forAwait.esnext.1.ts, 3, 7)) +>y : Symbol(y, Decl(types.forAwait.esnext.1.ts, 4, 7)) for await (const x of asyncIterable) { ->x : Symbol(x, Decl(types.forAwait.esnext.1.ts, 4, 20)) +>x : Symbol(x, Decl(types.forAwait.esnext.1.ts, 5, 20)) >asyncIterable : Symbol(asyncIterable, Decl(types.forAwait.esnext.1.ts, 0, 13)) } for await (const x of iterable) { ->x : Symbol(x, Decl(types.forAwait.esnext.1.ts, 6, 20)) +>x : Symbol(x, Decl(types.forAwait.esnext.1.ts, 7, 20)) >iterable : Symbol(iterable, Decl(types.forAwait.esnext.1.ts, 1, 13)) + } + for await (const x of iterableOfPromise) { +>x : Symbol(x, Decl(types.forAwait.esnext.1.ts, 9, 20)) +>iterableOfPromise : Symbol(iterableOfPromise, Decl(types.forAwait.esnext.1.ts, 2, 13)) } for await (y of asyncIterable) { ->y : Symbol(y, Decl(types.forAwait.esnext.1.ts, 3, 7)) +>y : Symbol(y, Decl(types.forAwait.esnext.1.ts, 4, 7)) >asyncIterable : Symbol(asyncIterable, Decl(types.forAwait.esnext.1.ts, 0, 13)) } for await (y of iterable) { ->y : Symbol(y, Decl(types.forAwait.esnext.1.ts, 3, 7)) +>y : Symbol(y, Decl(types.forAwait.esnext.1.ts, 4, 7)) >iterable : Symbol(iterable, Decl(types.forAwait.esnext.1.ts, 1, 13)) } + for await (y of iterableOfPromise) { +>y : Symbol(y, Decl(types.forAwait.esnext.1.ts, 4, 7)) +>iterableOfPromise : Symbol(iterableOfPromise, Decl(types.forAwait.esnext.1.ts, 2, 13)) + } } async function * f2() { ->f2 : Symbol(f2, Decl(types.forAwait.esnext.1.ts, 12, 1)) +>f2 : Symbol(f2, Decl(types.forAwait.esnext.1.ts, 17, 1)) let y: number; ->y : Symbol(y, Decl(types.forAwait.esnext.1.ts, 14, 7)) +>y : Symbol(y, Decl(types.forAwait.esnext.1.ts, 19, 7)) for await (const x of asyncIterable) { ->x : Symbol(x, Decl(types.forAwait.esnext.1.ts, 15, 20)) +>x : Symbol(x, Decl(types.forAwait.esnext.1.ts, 20, 20)) >asyncIterable : Symbol(asyncIterable, Decl(types.forAwait.esnext.1.ts, 0, 13)) } for await (const x of iterable) { ->x : Symbol(x, Decl(types.forAwait.esnext.1.ts, 17, 20)) +>x : Symbol(x, Decl(types.forAwait.esnext.1.ts, 22, 20)) >iterable : Symbol(iterable, Decl(types.forAwait.esnext.1.ts, 1, 13)) + } + for await (const x of iterableOfPromise) { +>x : Symbol(x, Decl(types.forAwait.esnext.1.ts, 24, 20)) +>iterableOfPromise : Symbol(iterableOfPromise, Decl(types.forAwait.esnext.1.ts, 2, 13)) } for await (y of asyncIterable) { ->y : Symbol(y, Decl(types.forAwait.esnext.1.ts, 14, 7)) +>y : Symbol(y, Decl(types.forAwait.esnext.1.ts, 19, 7)) >asyncIterable : Symbol(asyncIterable, Decl(types.forAwait.esnext.1.ts, 0, 13)) } for await (y of iterable) { ->y : Symbol(y, Decl(types.forAwait.esnext.1.ts, 14, 7)) +>y : Symbol(y, Decl(types.forAwait.esnext.1.ts, 19, 7)) >iterable : Symbol(iterable, Decl(types.forAwait.esnext.1.ts, 1, 13)) } + for await (y of iterableOfPromise) { +>y : Symbol(y, Decl(types.forAwait.esnext.1.ts, 19, 7)) +>iterableOfPromise : Symbol(iterableOfPromise, Decl(types.forAwait.esnext.1.ts, 2, 13)) + } } diff --git a/tests/baselines/reference/types.forAwait.esnext.1.types b/tests/baselines/reference/types.forAwait.esnext.1.types index f001b39a071..69403b40593 100644 --- a/tests/baselines/reference/types.forAwait.esnext.1.types +++ b/tests/baselines/reference/types.forAwait.esnext.1.types @@ -5,6 +5,9 @@ declare const asyncIterable: AsyncIterable; declare const iterable: Iterable; >iterable : Iterable +declare const iterableOfPromise: Iterable>; +>iterableOfPromise : Iterable> + async function f1() { >f1 : () => Promise @@ -18,6 +21,10 @@ async function f1() { for await (const x of iterable) { >x : number >iterable : Iterable + } + for await (const x of iterableOfPromise) { +>x : number +>iterableOfPromise : Iterable> } for await (y of asyncIterable) { >y : number @@ -27,6 +34,10 @@ async function f1() { >y : number >iterable : Iterable } + for await (y of iterableOfPromise) { +>y : number +>iterableOfPromise : Iterable> + } } async function * f2() { >f2 : () => AsyncIterableIterator @@ -41,6 +52,10 @@ async function * f2() { for await (const x of iterable) { >x : number >iterable : Iterable + } + for await (const x of iterableOfPromise) { +>x : number +>iterableOfPromise : Iterable> } for await (y of asyncIterable) { >y : number @@ -50,4 +65,8 @@ async function * f2() { >y : number >iterable : Iterable } + for await (y of iterableOfPromise) { +>y : number +>iterableOfPromise : Iterable> + } } diff --git a/tests/cases/conformance/types/forAwait/types.forAwait.esnext.1.ts b/tests/cases/conformance/types/forAwait/types.forAwait.esnext.1.ts index 4537e09a048..8b5157250b8 100644 --- a/tests/cases/conformance/types/forAwait/types.forAwait.esnext.1.ts +++ b/tests/cases/conformance/types/forAwait/types.forAwait.esnext.1.ts @@ -3,16 +3,21 @@ // @noEmit: true declare const asyncIterable: AsyncIterable; declare const iterable: Iterable; +declare const iterableOfPromise: Iterable>; async function f1() { let y: number; for await (const x of asyncIterable) { } for await (const x of iterable) { } + for await (const x of iterableOfPromise) { + } for await (y of asyncIterable) { } for await (y of iterable) { } + for await (y of iterableOfPromise) { + } } async function * f2() { let y: number; @@ -20,8 +25,12 @@ async function * f2() { } for await (const x of iterable) { } + for await (const x of iterableOfPromise) { + } for await (y of asyncIterable) { } for await (y of iterable) { } + for await (y of iterableOfPromise) { + } } \ No newline at end of file From 336be239a9c6cd3ed58ad17e122d70b28ddfbaa4 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Fri, 21 Sep 2018 10:55:20 -0700 Subject: [PATCH 37/71] Update GDPR annotations (#27242) * Use TypeScriptCommonProperties and add projectInfo * Improve projectId field 1. Add quotes where missing. 2. Fix name, which was projectInfo by mistake. 3. Add an endpoint of "ProjectId". --- src/server/editorServices.ts | 2 ++ src/server/protocol.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 74072bfd2e6..293c09b3b1c 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -46,6 +46,8 @@ namespace ts.server { /* __GDPR__ "projectInfo" : { + "${include}": ["${TypeScriptCommonProperties}"], + "projectId": { "classification": "EndUserPseudonymizedInformation", "purpose": "FeatureInsight", "endpoint": "ProjectId" }, "fileStats": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, "compilerOptions": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, "extends": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, diff --git a/src/server/protocol.ts b/src/server/protocol.ts index 45136c86cee..68c855eecca 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -2739,6 +2739,7 @@ namespace ts.server.protocol { /* __GDPR__ "typingsinstalled" : { + "${include}": ["${TypeScriptCommonProperties}"], "installedPackages": { "classification": "PublicNonPersonalData", "purpose": "FeatureInsight" }, "installSuccess": { "classification": "SystemMetaData", "purpose": "FeatureInsight" }, "typingsInstallerVersion": { "classification": "SystemMetaData", "purpose": "FeatureInsight" } From 8bd7f4e3f85022a5f5aa6aef398829c81aa478b5 Mon Sep 17 00:00:00 2001 From: Valera Rozuvan Date: Fri, 21 Sep 2018 11:11:41 +0300 Subject: [PATCH 38/71] Fix 27086. Ignore directories starting with a dot. --- src/compiler/moduleNameResolver.ts | 9 +++++++-- ...moduleResolution_automaticTypeDirectiveNames.js | 14 ++++++++++++++ ...eResolution_automaticTypeDirectiveNames.symbols | 8 ++++++++ ...uleResolution_automaticTypeDirectiveNames.types | 8 ++++++++ .../reference/moduleResolution_noLeadingDot.js | 11 +++++++++++ .../moduleResolution_noLeadingDot.symbols | 4 ++++ .../reference/moduleResolution_noLeadingDot.types | 4 ++++ ...moduleResolution_automaticTypeDirectiveNames.ts | 10 ++++++++++ .../compiler/moduleResolution_noLeadingDot.ts | 7 +++++++ 9 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 tests/baselines/reference/moduleResolution_automaticTypeDirectiveNames.js create mode 100644 tests/baselines/reference/moduleResolution_automaticTypeDirectiveNames.symbols create mode 100644 tests/baselines/reference/moduleResolution_automaticTypeDirectiveNames.types create mode 100644 tests/baselines/reference/moduleResolution_noLeadingDot.js create mode 100644 tests/baselines/reference/moduleResolution_noLeadingDot.symbols create mode 100644 tests/baselines/reference/moduleResolution_noLeadingDot.types create mode 100644 tests/cases/compiler/moduleResolution_automaticTypeDirectiveNames.ts create mode 100644 tests/cases/compiler/moduleResolution_noLeadingDot.ts diff --git a/src/compiler/moduleNameResolver.ts b/src/compiler/moduleNameResolver.ts index 1d912faa116..ad4334487b7 100644 --- a/src/compiler/moduleNameResolver.ts +++ b/src/compiler/moduleNameResolver.ts @@ -381,8 +381,13 @@ namespace ts { // tslint:disable-next-line:no-null-keyword const isNotNeededPackage = host.fileExists(packageJsonPath) && (readJson(packageJsonPath, host) as PackageJson).typings === null; if (!isNotNeededPackage) { - // Return just the type directive names - result.push(getBaseFileName(normalized)); + const baseFileName = getBaseFileName(normalized); + + // At this stage, skip results with leading dot. + if (baseFileName.charCodeAt(0) !== CharacterCodes.dot) { + // Return just the type directive names + result.push(baseFileName); + } } } } diff --git a/tests/baselines/reference/moduleResolution_automaticTypeDirectiveNames.js b/tests/baselines/reference/moduleResolution_automaticTypeDirectiveNames.js new file mode 100644 index 00000000000..14e34f6d7ed --- /dev/null +++ b/tests/baselines/reference/moduleResolution_automaticTypeDirectiveNames.js @@ -0,0 +1,14 @@ +//// [tests/cases/compiler/moduleResolution_automaticTypeDirectiveNames.ts] //// + +//// [index.d.ts] +declare const a: number; + +//// [index.d.ts] +declare const a: string; + +//// [a.ts] +a; + + +//// [a.js] +a; diff --git a/tests/baselines/reference/moduleResolution_automaticTypeDirectiveNames.symbols b/tests/baselines/reference/moduleResolution_automaticTypeDirectiveNames.symbols new file mode 100644 index 00000000000..83074ddb6b5 --- /dev/null +++ b/tests/baselines/reference/moduleResolution_automaticTypeDirectiveNames.symbols @@ -0,0 +1,8 @@ +=== /a.ts === +a; +>a : Symbol(a, Decl(index.d.ts, 0, 13)) + +=== /node_modules/@types/a/index.d.ts === +declare const a: string; +>a : Symbol(a, Decl(index.d.ts, 0, 13)) + diff --git a/tests/baselines/reference/moduleResolution_automaticTypeDirectiveNames.types b/tests/baselines/reference/moduleResolution_automaticTypeDirectiveNames.types new file mode 100644 index 00000000000..fee11fb8b06 --- /dev/null +++ b/tests/baselines/reference/moduleResolution_automaticTypeDirectiveNames.types @@ -0,0 +1,8 @@ +=== /a.ts === +a; +>a : string + +=== /node_modules/@types/a/index.d.ts === +declare const a: string; +>a : string + diff --git a/tests/baselines/reference/moduleResolution_noLeadingDot.js b/tests/baselines/reference/moduleResolution_noLeadingDot.js new file mode 100644 index 00000000000..9e2cbaa736e --- /dev/null +++ b/tests/baselines/reference/moduleResolution_noLeadingDot.js @@ -0,0 +1,11 @@ +//// [tests/cases/compiler/moduleResolution_noLeadingDot.ts] //// + +//// [README.md] +This is a test. + +//// [a.ts] +true; + + +//// [a.js] +true; diff --git a/tests/baselines/reference/moduleResolution_noLeadingDot.symbols b/tests/baselines/reference/moduleResolution_noLeadingDot.symbols new file mode 100644 index 00000000000..a7ee88bd3ff --- /dev/null +++ b/tests/baselines/reference/moduleResolution_noLeadingDot.symbols @@ -0,0 +1,4 @@ +=== /a.ts === +true; +No type information for this code. +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/moduleResolution_noLeadingDot.types b/tests/baselines/reference/moduleResolution_noLeadingDot.types new file mode 100644 index 00000000000..829e8be6f64 --- /dev/null +++ b/tests/baselines/reference/moduleResolution_noLeadingDot.types @@ -0,0 +1,4 @@ +=== /a.ts === +true; +>true : true + diff --git a/tests/cases/compiler/moduleResolution_automaticTypeDirectiveNames.ts b/tests/cases/compiler/moduleResolution_automaticTypeDirectiveNames.ts new file mode 100644 index 00000000000..b5baa1bbe16 --- /dev/null +++ b/tests/cases/compiler/moduleResolution_automaticTypeDirectiveNames.ts @@ -0,0 +1,10 @@ +// @noImplicitReferences: true + +// @Filename: /node_modules/@types/.a/index.d.ts +declare const a: number; + +// @Filename: /node_modules/@types/a/index.d.ts +declare const a: string; + +// @Filename: /a.ts +a; diff --git a/tests/cases/compiler/moduleResolution_noLeadingDot.ts b/tests/cases/compiler/moduleResolution_noLeadingDot.ts new file mode 100644 index 00000000000..eee17136b11 --- /dev/null +++ b/tests/cases/compiler/moduleResolution_noLeadingDot.ts @@ -0,0 +1,7 @@ +// @noImplicitReferences: true + +// @Filename: /node_modules/@types/.svn/README.md +This is a test. + +// @Filename: /a.ts +true; From 03af10767264c8a247fe3f125db4a7ce10e8556d Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Mon, 24 Sep 2018 08:25:59 -0700 Subject: [PATCH 39/71] Update user baselines (#27309) --- tests/baselines/reference/user/jimp.log | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/baselines/reference/user/jimp.log b/tests/baselines/reference/user/jimp.log index 40b0797489e..0498af334c2 100644 --- a/tests/baselines/reference/user/jimp.log +++ b/tests/baselines/reference/user/jimp.log @@ -1,8 +1,9 @@ Exit Code: 1 Standard output: -node_modules/jimp/jimp.d.ts(497,12): error TS7010: 'appendConstructorOption', which lacks return-type annotation, implicitly has an 'any' return type. -node_modules/jimp/jimp.d.ts(539,12): error TS7010: 'measureText', which lacks return-type annotation, implicitly has an 'any' return type. -node_modules/jimp/jimp.d.ts(540,12): error TS7010: 'measureTextHeight', which lacks return-type annotation, implicitly has an 'any' return type. +node_modules/jimp/jimp.d.ts(248,5): error TS7010: 'parseBitmap', which lacks return-type annotation, implicitly has an 'any' return type. +node_modules/jimp/jimp.d.ts(505,12): error TS7010: 'appendConstructorOption', which lacks return-type annotation, implicitly has an 'any' return type. +node_modules/jimp/jimp.d.ts(555,12): error TS7010: 'measureText', which lacks return-type annotation, implicitly has an 'any' return type. +node_modules/jimp/jimp.d.ts(556,12): error TS7010: 'measureTextHeight', which lacks return-type annotation, implicitly has an 'any' return type. From b7fc0924044731377ef586ff82bc8bf3530fa463 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Mon, 24 Sep 2018 10:38:39 -0700 Subject: [PATCH 40/71] Fix non-selfclosing JSX tag contextual types (#27251) --- src/compiler/checker.ts | 6 + ...xChildrenGenericContextualTypes.errors.txt | 30 ++-- .../jsxChildrenGenericContextualTypes.types | 4 +- ...actDefaultPropsInferenceSuccess.errors.txt | 44 ++++- .../reactDefaultPropsInferenceSuccess.js | 35 +++- .../reactDefaultPropsInferenceSuccess.symbols | 165 ++++++++++++------ .../reactDefaultPropsInferenceSuccess.types | 65 ++++++- .../reactDefaultPropsInferenceSuccess.tsx | 18 +- 8 files changed, 280 insertions(+), 87 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index cecc70c3e2d..67dcac2834b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -16827,6 +16827,12 @@ namespace ts { } function getContextualJsxElementAttributesType(node: JsxOpeningLikeElement) { + if (isJsxOpeningElement(node) && node.parent.contextualType) { + // Contextually applied type is moved from attributes up to the outer jsx attributes so when walking up from the children they get hit + // _However_ to hit them from the _attributes_ we must look for them here; otherwise we'll used the declared type + // (as below) instead! + return node.parent.contextualType; + } if (isJsxIntrinsicIdentifier(node.tagName)) { return getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node); } diff --git a/tests/baselines/reference/jsxChildrenGenericContextualTypes.errors.txt b/tests/baselines/reference/jsxChildrenGenericContextualTypes.errors.txt index 68837c6e1fb..fca81df6a6a 100644 --- a/tests/baselines/reference/jsxChildrenGenericContextualTypes.errors.txt +++ b/tests/baselines/reference/jsxChildrenGenericContextualTypes.errors.txt @@ -1,14 +1,13 @@ tests/cases/compiler/jsxChildrenGenericContextualTypes.tsx(20,46): error TS2322: Type '"y"' is not assignable to type '"x"'. -tests/cases/compiler/jsxChildrenGenericContextualTypes.tsx(21,19): error TS2322: Type '{ children: (p: IntrinsicAttributes & LitProps<"x">) => "y"; prop: "x"; }' is not assignable to type 'IntrinsicAttributes & LitProps<"x" | "y">'. - Type '{ children: (p: IntrinsicAttributes & LitProps<"x">) => "y"; prop: "x"; }' is not assignable to type 'LitProps<"x" | "y">'. +tests/cases/compiler/jsxChildrenGenericContextualTypes.tsx(21,19): error TS2322: Type '{ children: (p: LitProps<"x">) => "y"; prop: "x"; }' is not assignable to type 'IntrinsicAttributes & LitProps<"x" | "y">'. + Type '{ children: (p: LitProps<"x">) => "y"; prop: "x"; }' is not assignable to type 'LitProps<"x" | "y">'. Types of property 'children' are incompatible. - Type '(p: IntrinsicAttributes & LitProps<"x">) => "y"' is not assignable to type '(x: LitProps<"x" | "y">) => "x" | "y"'. + Type '(p: LitProps<"x">) => "y"' is not assignable to type '(x: LitProps<"x" | "y">) => "x" | "y"'. Types of parameters 'p' and 'x' are incompatible. - Type 'LitProps<"x" | "y">' is not assignable to type 'IntrinsicAttributes & LitProps<"x">'. - Type 'LitProps<"x" | "y">' is not assignable to type 'LitProps<"x">'. - Types of property 'prop' are incompatible. - Type '"x" | "y"' is not assignable to type '"x"'. - Type '"y"' is not assignable to type '"x"'. + Type 'LitProps<"x" | "y">' is not assignable to type 'LitProps<"x">'. + Types of property 'prop' are incompatible. + Type '"x" | "y"' is not assignable to type '"x"'. + Type '"y"' is not assignable to type '"x"'. tests/cases/compiler/jsxChildrenGenericContextualTypes.tsx(22,21): error TS2322: Type '{ children: () => number; prop: "x"; }' is not assignable to type 'IntrinsicAttributes & LitProps<"x">'. Type '{ children: () => number; prop: "x"; }' is not assignable to type 'LitProps<"x">'. Types of property 'children' are incompatible. @@ -42,16 +41,15 @@ tests/cases/compiler/jsxChildrenGenericContextualTypes.tsx(22,21): error TS2322: !!! related TS6502 tests/cases/compiler/jsxChildrenGenericContextualTypes.tsx:13:44: The expected type comes from the return type of this signature. const argchild = {p => "y"} ~~~~~~~ -!!! error TS2322: Type '{ children: (p: IntrinsicAttributes & LitProps<"x">) => "y"; prop: "x"; }' is not assignable to type 'IntrinsicAttributes & LitProps<"x" | "y">'. -!!! error TS2322: Type '{ children: (p: IntrinsicAttributes & LitProps<"x">) => "y"; prop: "x"; }' is not assignable to type 'LitProps<"x" | "y">'. +!!! error TS2322: Type '{ children: (p: LitProps<"x">) => "y"; prop: "x"; }' is not assignable to type 'IntrinsicAttributes & LitProps<"x" | "y">'. +!!! error TS2322: Type '{ children: (p: LitProps<"x">) => "y"; prop: "x"; }' is not assignable to type 'LitProps<"x" | "y">'. !!! error TS2322: Types of property 'children' are incompatible. -!!! error TS2322: Type '(p: IntrinsicAttributes & LitProps<"x">) => "y"' is not assignable to type '(x: LitProps<"x" | "y">) => "x" | "y"'. +!!! error TS2322: Type '(p: LitProps<"x">) => "y"' is not assignable to type '(x: LitProps<"x" | "y">) => "x" | "y"'. !!! error TS2322: Types of parameters 'p' and 'x' are incompatible. -!!! error TS2322: Type 'LitProps<"x" | "y">' is not assignable to type 'IntrinsicAttributes & LitProps<"x">'. -!!! error TS2322: Type 'LitProps<"x" | "y">' is not assignable to type 'LitProps<"x">'. -!!! error TS2322: Types of property 'prop' are incompatible. -!!! error TS2322: Type '"x" | "y"' is not assignable to type '"x"'. -!!! error TS2322: Type '"y"' is not assignable to type '"x"'. +!!! error TS2322: Type 'LitProps<"x" | "y">' is not assignable to type 'LitProps<"x">'. +!!! error TS2322: Types of property 'prop' are incompatible. +!!! error TS2322: Type '"x" | "y"' is not assignable to type '"x"'. +!!! error TS2322: Type '"y"' is not assignable to type '"x"'. const mismatched = {() => 12} ~~~~~~~ !!! error TS2322: Type '{ children: () => number; prop: "x"; }' is not assignable to type 'IntrinsicAttributes & LitProps<"x">'. diff --git a/tests/baselines/reference/jsxChildrenGenericContextualTypes.types b/tests/baselines/reference/jsxChildrenGenericContextualTypes.types index 0e5cf26d4c7..12d1431920e 100644 --- a/tests/baselines/reference/jsxChildrenGenericContextualTypes.types +++ b/tests/baselines/reference/jsxChildrenGenericContextualTypes.types @@ -127,8 +127,8 @@ const argchild = {p => "y"} >{p => "y"} : JSX.Element >ElemLit : (p: LitProps) => JSX.Element >prop : "x" ->p => "y" : (p: JSX.IntrinsicAttributes & LitProps<"x">) => "y" ->p : JSX.IntrinsicAttributes & LitProps<"x"> +>p => "y" : (p: LitProps<"x">) => "y" +>p : LitProps<"x"> >"y" : "y" >ElemLit : (p: LitProps) => JSX.Element diff --git a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt index 2ec0fc09c92..dbc1e42c572 100644 --- a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt +++ b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.errors.txt @@ -1,16 +1,21 @@ -tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(26,36): error TS2322: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. - Type 'void' is not assignable to type 'boolean'. -tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(48,37): error TS2322: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(27,36): error TS2322: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. + Type 'void' is not assignable to type 'boolean'. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(43,41): error TS2322: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. + Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. + Type 'void' is not assignable to type 'boolean'. +tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(64,37): error TS2322: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. Type 'void' is not assignable to type 'boolean'. -==== tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx (2 errors) ==== +==== tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx (3 errors) ==== /// import React from 'react'; interface BaseProps { - when?: (value: string) => boolean; + when?: ((value: string) => boolean) | "a" | "b"; + error?: boolean; } interface Props extends BaseProps { @@ -32,10 +37,31 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(48,37): error TS2322: // Error: Void not assignable to boolean const Test2 = () => console.log(value)} />; ~~~~ -!!! error TS2322: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. -!!! error TS2322: Type 'void' is not assignable to type 'boolean'. -!!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' +!!! error TS2322: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. +!!! error TS2322: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! error TS2322: Type 'void' is not assignable to type 'boolean'. +!!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' + class FieldFeedbackBeta

extends React.Component

{ + static defaultProps: BaseProps = { + when: () => true + }; + + render() { + return

Hello
; + } + } + + // OK + const Test1a = () => !!value} error>Hah; + + // Error: Void not assignable to boolean + const Test2a = () => console.log(value)} error>Hah; + ~~~~ +!!! error TS2322: Type '(value: string) => void' is not assignable to type '"a" | "b" | ((value: string) => boolean) | undefined'. +!!! error TS2322: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. +!!! error TS2322: Type 'void' is not assignable to type 'boolean'. +!!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:6:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children"> & Partial & Readonly, "when" | "error">> & Partial>' interface MyPropsProps extends Props { when: (value: string) => boolean; @@ -60,7 +86,7 @@ tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx(48,37): error TS2322: ~~~~ !!! error TS2322: Type '(value: string) => void' is not assignable to type '(value: string) => boolean'. !!! error TS2322: Type 'void' is not assignable to type 'boolean'. -!!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:30:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' +!!! related TS6500 tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx:46:3: The expected type comes from property 'when' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes> & Pick & Readonly, "children" | "error"> & Partial & Readonly, "when">> & Partial boolean; }, never>>' // OK const Test5 = () => ; diff --git a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.js b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.js index 84db36ee4da..34d370ca2a2 100644 --- a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.js +++ b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.js @@ -4,7 +4,8 @@ import React from 'react'; interface BaseProps { - when?: (value: string) => boolean; + when?: ((value: string) => boolean) | "a" | "b"; + error?: boolean; } interface Props extends BaseProps { @@ -26,6 +27,21 @@ const Test1 = () => !!value} />; // Error: Void not assignable to boolean const Test2 = () => console.log(value)} />; +class FieldFeedbackBeta

extends React.Component

{ + static defaultProps: BaseProps = { + when: () => true + }; + + render() { + return

Hello
; + } +} + +// OK +const Test1a = () => !!value} error>Hah; + +// Error: Void not assignable to boolean +const Test2a = () => console.log(value)} error>Hah; interface MyPropsProps extends Props { when: (value: string) => boolean; @@ -90,6 +106,23 @@ var FieldFeedback = /** @class */ (function (_super) { var Test1 = function () { return react_1["default"].createElement(FieldFeedback, { when: function (value) { return !!value; } }); }; // Error: Void not assignable to boolean var Test2 = function () { return react_1["default"].createElement(FieldFeedback, { when: function (value) { return console.log(value); } }); }; +var FieldFeedbackBeta = /** @class */ (function (_super) { + __extends(FieldFeedbackBeta, _super); + function FieldFeedbackBeta() { + return _super !== null && _super.apply(this, arguments) || this; + } + FieldFeedbackBeta.prototype.render = function () { + return react_1["default"].createElement("div", null, "Hello"); + }; + FieldFeedbackBeta.defaultProps = { + when: function () { return true; } + }; + return FieldFeedbackBeta; +}(react_1["default"].Component)); +// OK +var Test1a = function () { return react_1["default"].createElement(FieldFeedbackBeta, { when: function (value) { return !!value; }, error: true }, "Hah"); }; +// Error: Void not assignable to boolean +var Test2a = function () { return react_1["default"].createElement(FieldFeedbackBeta, { when: function (value) { return console.log(value); }, error: true }, "Hah"); }; var FieldFeedback2 = /** @class */ (function (_super) { __extends(FieldFeedback2, _super); function FieldFeedback2() { diff --git a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.symbols b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.symbols index dadaf9ea745..f5cff116a4c 100644 --- a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.symbols +++ b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.symbols @@ -7,36 +7,39 @@ import React from 'react'; interface BaseProps { >BaseProps : Symbol(BaseProps, Decl(reactDefaultPropsInferenceSuccess.tsx, 2, 26)) - when?: (value: string) => boolean; + when?: ((value: string) => boolean) | "a" | "b"; >when : Symbol(BaseProps.when, Decl(reactDefaultPropsInferenceSuccess.tsx, 4, 21)) ->value : Symbol(value, Decl(reactDefaultPropsInferenceSuccess.tsx, 5, 10)) +>value : Symbol(value, Decl(reactDefaultPropsInferenceSuccess.tsx, 5, 11)) + + error?: boolean; +>error : Symbol(BaseProps.error, Decl(reactDefaultPropsInferenceSuccess.tsx, 5, 50)) } interface Props extends BaseProps { ->Props : Symbol(Props, Decl(reactDefaultPropsInferenceSuccess.tsx, 6, 1)) +>Props : Symbol(Props, Decl(reactDefaultPropsInferenceSuccess.tsx, 7, 1)) >BaseProps : Symbol(BaseProps, Decl(reactDefaultPropsInferenceSuccess.tsx, 2, 26)) } class FieldFeedback

extends React.Component

{ ->FieldFeedback : Symbol(FieldFeedback, Decl(reactDefaultPropsInferenceSuccess.tsx, 9, 1)) ->P : Symbol(P, Decl(reactDefaultPropsInferenceSuccess.tsx, 11, 20)) ->Props : Symbol(Props, Decl(reactDefaultPropsInferenceSuccess.tsx, 6, 1)) +>FieldFeedback : Symbol(FieldFeedback, Decl(reactDefaultPropsInferenceSuccess.tsx, 10, 1)) +>P : Symbol(P, Decl(reactDefaultPropsInferenceSuccess.tsx, 12, 20)) +>Props : Symbol(Props, Decl(reactDefaultPropsInferenceSuccess.tsx, 7, 1)) >BaseProps : Symbol(BaseProps, Decl(reactDefaultPropsInferenceSuccess.tsx, 2, 26)) >React.Component : Symbol(React.Component, Decl(react16.d.ts, 345, 54), Decl(react16.d.ts, 349, 94)) >React : Symbol(React, Decl(reactDefaultPropsInferenceSuccess.tsx, 2, 6)) >Component : Symbol(React.Component, Decl(react16.d.ts, 345, 54), Decl(react16.d.ts, 349, 94)) ->P : Symbol(P, Decl(reactDefaultPropsInferenceSuccess.tsx, 11, 20)) +>P : Symbol(P, Decl(reactDefaultPropsInferenceSuccess.tsx, 12, 20)) static defaultProps = { ->defaultProps : Symbol(FieldFeedback.defaultProps, Decl(reactDefaultPropsInferenceSuccess.tsx, 11, 77)) +>defaultProps : Symbol(FieldFeedback.defaultProps, Decl(reactDefaultPropsInferenceSuccess.tsx, 12, 77)) when: () => true ->when : Symbol(when, Decl(reactDefaultPropsInferenceSuccess.tsx, 12, 25)) +>when : Symbol(when, Decl(reactDefaultPropsInferenceSuccess.tsx, 13, 25)) }; render() { ->render : Symbol(FieldFeedback.render, Decl(reactDefaultPropsInferenceSuccess.tsx, 14, 4)) +>render : Symbol(FieldFeedback.render, Decl(reactDefaultPropsInferenceSuccess.tsx, 15, 4)) return

Hello
; >div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2420, 114)) @@ -46,58 +49,108 @@ class FieldFeedback

extends React.Component

{ // OK const Test1 = () => !!value} />; ->Test1 : Symbol(Test1, Decl(reactDefaultPropsInferenceSuccess.tsx, 22, 5)) ->FieldFeedback : Symbol(FieldFeedback, Decl(reactDefaultPropsInferenceSuccess.tsx, 9, 1)) ->when : Symbol(when, Decl(reactDefaultPropsInferenceSuccess.tsx, 22, 34)) ->value : Symbol(value, Decl(reactDefaultPropsInferenceSuccess.tsx, 22, 41)) ->value : Symbol(value, Decl(reactDefaultPropsInferenceSuccess.tsx, 22, 41)) +>Test1 : Symbol(Test1, Decl(reactDefaultPropsInferenceSuccess.tsx, 23, 5)) +>FieldFeedback : Symbol(FieldFeedback, Decl(reactDefaultPropsInferenceSuccess.tsx, 10, 1)) +>when : Symbol(when, Decl(reactDefaultPropsInferenceSuccess.tsx, 23, 34)) +>value : Symbol(value, Decl(reactDefaultPropsInferenceSuccess.tsx, 23, 41)) +>value : Symbol(value, Decl(reactDefaultPropsInferenceSuccess.tsx, 23, 41)) // Error: Void not assignable to boolean const Test2 = () => console.log(value)} />; ->Test2 : Symbol(Test2, Decl(reactDefaultPropsInferenceSuccess.tsx, 25, 5)) ->FieldFeedback : Symbol(FieldFeedback, Decl(reactDefaultPropsInferenceSuccess.tsx, 9, 1)) ->when : Symbol(when, Decl(reactDefaultPropsInferenceSuccess.tsx, 25, 34)) ->value : Symbol(value, Decl(reactDefaultPropsInferenceSuccess.tsx, 25, 41)) +>Test2 : Symbol(Test2, Decl(reactDefaultPropsInferenceSuccess.tsx, 26, 5)) +>FieldFeedback : Symbol(FieldFeedback, Decl(reactDefaultPropsInferenceSuccess.tsx, 10, 1)) +>when : Symbol(when, Decl(reactDefaultPropsInferenceSuccess.tsx, 26, 34)) +>value : Symbol(value, Decl(reactDefaultPropsInferenceSuccess.tsx, 26, 41)) >console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) >console : Symbol(console, Decl(lib.dom.d.ts, --, --)) >log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->value : Symbol(value, Decl(reactDefaultPropsInferenceSuccess.tsx, 25, 41)) +>value : Symbol(value, Decl(reactDefaultPropsInferenceSuccess.tsx, 26, 41)) +class FieldFeedbackBeta

extends React.Component

{ +>FieldFeedbackBeta : Symbol(FieldFeedbackBeta, Decl(reactDefaultPropsInferenceSuccess.tsx, 26, 73)) +>P : Symbol(P, Decl(reactDefaultPropsInferenceSuccess.tsx, 28, 24)) +>Props : Symbol(Props, Decl(reactDefaultPropsInferenceSuccess.tsx, 7, 1)) +>BaseProps : Symbol(BaseProps, Decl(reactDefaultPropsInferenceSuccess.tsx, 2, 26)) +>React.Component : Symbol(React.Component, Decl(react16.d.ts, 345, 54), Decl(react16.d.ts, 349, 94)) +>React : Symbol(React, Decl(reactDefaultPropsInferenceSuccess.tsx, 2, 6)) +>Component : Symbol(React.Component, Decl(react16.d.ts, 345, 54), Decl(react16.d.ts, 349, 94)) +>P : Symbol(P, Decl(reactDefaultPropsInferenceSuccess.tsx, 28, 24)) -interface MyPropsProps extends Props { ->MyPropsProps : Symbol(MyPropsProps, Decl(reactDefaultPropsInferenceSuccess.tsx, 25, 73)) ->Props : Symbol(Props, Decl(reactDefaultPropsInferenceSuccess.tsx, 6, 1)) - - when: (value: string) => boolean; ->when : Symbol(MyPropsProps.when, Decl(reactDefaultPropsInferenceSuccess.tsx, 28, 38)) ->value : Symbol(value, Decl(reactDefaultPropsInferenceSuccess.tsx, 29, 9)) -} - -class FieldFeedback2

extends FieldFeedback

{ ->FieldFeedback2 : Symbol(FieldFeedback2, Decl(reactDefaultPropsInferenceSuccess.tsx, 30, 1)) ->P : Symbol(P, Decl(reactDefaultPropsInferenceSuccess.tsx, 32, 21)) ->MyPropsProps : Symbol(MyPropsProps, Decl(reactDefaultPropsInferenceSuccess.tsx, 25, 73)) ->MyPropsProps : Symbol(MyPropsProps, Decl(reactDefaultPropsInferenceSuccess.tsx, 25, 73)) ->FieldFeedback : Symbol(FieldFeedback, Decl(reactDefaultPropsInferenceSuccess.tsx, 9, 1)) ->P : Symbol(P, Decl(reactDefaultPropsInferenceSuccess.tsx, 32, 21)) - - static defaultProps = { ->defaultProps : Symbol(FieldFeedback2.defaultProps, Decl(reactDefaultPropsInferenceSuccess.tsx, 32, 86)) + static defaultProps: BaseProps = { +>defaultProps : Symbol(FieldFeedbackBeta.defaultProps, Decl(reactDefaultPropsInferenceSuccess.tsx, 28, 81)) +>BaseProps : Symbol(BaseProps, Decl(reactDefaultPropsInferenceSuccess.tsx, 2, 26)) when: () => true ->when : Symbol(when, Decl(reactDefaultPropsInferenceSuccess.tsx, 33, 25)) +>when : Symbol(when, Decl(reactDefaultPropsInferenceSuccess.tsx, 29, 36)) }; render() { ->render : Symbol(FieldFeedback2.render, Decl(reactDefaultPropsInferenceSuccess.tsx, 35, 4)) +>render : Symbol(FieldFeedbackBeta.render, Decl(reactDefaultPropsInferenceSuccess.tsx, 31, 4)) + + return

Hello
; +>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2420, 114)) +>div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2420, 114)) + } +} + +// OK +const Test1a = () => !!value} error>Hah; +>Test1a : Symbol(Test1a, Decl(reactDefaultPropsInferenceSuccess.tsx, 39, 5)) +>FieldFeedbackBeta : Symbol(FieldFeedbackBeta, Decl(reactDefaultPropsInferenceSuccess.tsx, 26, 73)) +>when : Symbol(when, Decl(reactDefaultPropsInferenceSuccess.tsx, 39, 39)) +>value : Symbol(value, Decl(reactDefaultPropsInferenceSuccess.tsx, 39, 46)) +>value : Symbol(value, Decl(reactDefaultPropsInferenceSuccess.tsx, 39, 46)) +>error : Symbol(error, Decl(reactDefaultPropsInferenceSuccess.tsx, 39, 63)) +>FieldFeedbackBeta : Symbol(FieldFeedbackBeta, Decl(reactDefaultPropsInferenceSuccess.tsx, 26, 73)) + +// Error: Void not assignable to boolean +const Test2a = () => console.log(value)} error>Hah; +>Test2a : Symbol(Test2a, Decl(reactDefaultPropsInferenceSuccess.tsx, 42, 5)) +>FieldFeedbackBeta : Symbol(FieldFeedbackBeta, Decl(reactDefaultPropsInferenceSuccess.tsx, 26, 73)) +>when : Symbol(when, Decl(reactDefaultPropsInferenceSuccess.tsx, 42, 39)) +>value : Symbol(value, Decl(reactDefaultPropsInferenceSuccess.tsx, 42, 46)) +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>value : Symbol(value, Decl(reactDefaultPropsInferenceSuccess.tsx, 42, 46)) +>error : Symbol(error, Decl(reactDefaultPropsInferenceSuccess.tsx, 42, 74)) +>FieldFeedbackBeta : Symbol(FieldFeedbackBeta, Decl(reactDefaultPropsInferenceSuccess.tsx, 26, 73)) + +interface MyPropsProps extends Props { +>MyPropsProps : Symbol(MyPropsProps, Decl(reactDefaultPropsInferenceSuccess.tsx, 42, 105)) +>Props : Symbol(Props, Decl(reactDefaultPropsInferenceSuccess.tsx, 7, 1)) + + when: (value: string) => boolean; +>when : Symbol(MyPropsProps.when, Decl(reactDefaultPropsInferenceSuccess.tsx, 44, 38)) +>value : Symbol(value, Decl(reactDefaultPropsInferenceSuccess.tsx, 45, 9)) +} + +class FieldFeedback2

extends FieldFeedback

{ +>FieldFeedback2 : Symbol(FieldFeedback2, Decl(reactDefaultPropsInferenceSuccess.tsx, 46, 1)) +>P : Symbol(P, Decl(reactDefaultPropsInferenceSuccess.tsx, 48, 21)) +>MyPropsProps : Symbol(MyPropsProps, Decl(reactDefaultPropsInferenceSuccess.tsx, 42, 105)) +>MyPropsProps : Symbol(MyPropsProps, Decl(reactDefaultPropsInferenceSuccess.tsx, 42, 105)) +>FieldFeedback : Symbol(FieldFeedback, Decl(reactDefaultPropsInferenceSuccess.tsx, 10, 1)) +>P : Symbol(P, Decl(reactDefaultPropsInferenceSuccess.tsx, 48, 21)) + + static defaultProps = { +>defaultProps : Symbol(FieldFeedback2.defaultProps, Decl(reactDefaultPropsInferenceSuccess.tsx, 48, 86)) + + when: () => true +>when : Symbol(when, Decl(reactDefaultPropsInferenceSuccess.tsx, 49, 25)) + + }; + + render() { +>render : Symbol(FieldFeedback2.render, Decl(reactDefaultPropsInferenceSuccess.tsx, 51, 4)) this.props.when("now"); // OK, always defined ->this.props.when : Symbol(when, Decl(reactDefaultPropsInferenceSuccess.tsx, 28, 38)) +>this.props.when : Symbol(when, Decl(reactDefaultPropsInferenceSuccess.tsx, 44, 38)) >this.props : Symbol(React.Component.props, Decl(react16.d.ts, 367, 32)) ->this : Symbol(FieldFeedback2, Decl(reactDefaultPropsInferenceSuccess.tsx, 30, 1)) +>this : Symbol(FieldFeedback2, Decl(reactDefaultPropsInferenceSuccess.tsx, 46, 1)) >props : Symbol(React.Component.props, Decl(react16.d.ts, 367, 32)) ->when : Symbol(when, Decl(reactDefaultPropsInferenceSuccess.tsx, 28, 38)) +>when : Symbol(when, Decl(reactDefaultPropsInferenceSuccess.tsx, 44, 38)) return

Hello
; >div : Symbol(JSX.IntrinsicElements.div, Decl(react16.d.ts, 2420, 114)) @@ -107,25 +160,25 @@ class FieldFeedback2

extends FieldFeedbac // OK const Test3 = () => !!value} />; ->Test3 : Symbol(Test3, Decl(reactDefaultPropsInferenceSuccess.tsx, 44, 5)) ->FieldFeedback2 : Symbol(FieldFeedback2, Decl(reactDefaultPropsInferenceSuccess.tsx, 30, 1)) ->when : Symbol(when, Decl(reactDefaultPropsInferenceSuccess.tsx, 44, 35)) ->value : Symbol(value, Decl(reactDefaultPropsInferenceSuccess.tsx, 44, 42)) ->value : Symbol(value, Decl(reactDefaultPropsInferenceSuccess.tsx, 44, 42)) +>Test3 : Symbol(Test3, Decl(reactDefaultPropsInferenceSuccess.tsx, 60, 5)) +>FieldFeedback2 : Symbol(FieldFeedback2, Decl(reactDefaultPropsInferenceSuccess.tsx, 46, 1)) +>when : Symbol(when, Decl(reactDefaultPropsInferenceSuccess.tsx, 60, 35)) +>value : Symbol(value, Decl(reactDefaultPropsInferenceSuccess.tsx, 60, 42)) +>value : Symbol(value, Decl(reactDefaultPropsInferenceSuccess.tsx, 60, 42)) // Error: Void not assignable to boolean const Test4 = () => console.log(value)} />; ->Test4 : Symbol(Test4, Decl(reactDefaultPropsInferenceSuccess.tsx, 47, 5)) ->FieldFeedback2 : Symbol(FieldFeedback2, Decl(reactDefaultPropsInferenceSuccess.tsx, 30, 1)) ->when : Symbol(when, Decl(reactDefaultPropsInferenceSuccess.tsx, 47, 35)) ->value : Symbol(value, Decl(reactDefaultPropsInferenceSuccess.tsx, 47, 42)) +>Test4 : Symbol(Test4, Decl(reactDefaultPropsInferenceSuccess.tsx, 63, 5)) +>FieldFeedback2 : Symbol(FieldFeedback2, Decl(reactDefaultPropsInferenceSuccess.tsx, 46, 1)) +>when : Symbol(when, Decl(reactDefaultPropsInferenceSuccess.tsx, 63, 35)) +>value : Symbol(value, Decl(reactDefaultPropsInferenceSuccess.tsx, 63, 42)) >console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) >console : Symbol(console, Decl(lib.dom.d.ts, --, --)) >log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->value : Symbol(value, Decl(reactDefaultPropsInferenceSuccess.tsx, 47, 42)) +>value : Symbol(value, Decl(reactDefaultPropsInferenceSuccess.tsx, 63, 42)) // OK const Test5 = () => ; ->Test5 : Symbol(Test5, Decl(reactDefaultPropsInferenceSuccess.tsx, 50, 5)) ->FieldFeedback2 : Symbol(FieldFeedback2, Decl(reactDefaultPropsInferenceSuccess.tsx, 30, 1)) +>Test5 : Symbol(Test5, Decl(reactDefaultPropsInferenceSuccess.tsx, 66, 5)) +>FieldFeedback2 : Symbol(FieldFeedback2, Decl(reactDefaultPropsInferenceSuccess.tsx, 46, 1)) diff --git a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.types b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.types index 91d918b0923..bca297d3a1d 100644 --- a/tests/baselines/reference/reactDefaultPropsInferenceSuccess.types +++ b/tests/baselines/reference/reactDefaultPropsInferenceSuccess.types @@ -5,9 +5,12 @@ import React from 'react'; >React : typeof React interface BaseProps { - when?: (value: string) => boolean; ->when : ((value: string) => boolean) | undefined + when?: ((value: string) => boolean) | "a" | "b"; +>when : "a" | "b" | ((value: string) => boolean) | undefined >value : string + + error?: boolean; +>error : boolean | undefined } interface Props extends BaseProps { @@ -68,6 +71,64 @@ const Test2 = () => console.log(value)} />; >log : (message?: any, ...optionalParams: any[]) => void >value : string +class FieldFeedbackBeta

extends React.Component

{ +>FieldFeedbackBeta : FieldFeedbackBeta

+>React.Component : React.Component +>React : typeof React +>Component : typeof React.Component + + static defaultProps: BaseProps = { +>defaultProps : BaseProps +>{ when: () => true } : { when: () => true; } + + when: () => true +>when : () => true +>() => true : () => true +>true : true + + }; + + render() { +>render : () => JSX.Element + + return

Hello
; +>
Hello
: JSX.Element +>div : any +>div : any + } +} + +// OK +const Test1a = () => !!value} error>Hah; +>Test1a : () => JSX.Element +>() => !!value} error>Hah : () => JSX.Element +> !!value} error>Hah : JSX.Element +>FieldFeedbackBeta : typeof FieldFeedbackBeta +>when : (value: string) => boolean +>value => !!value : (value: string) => boolean +>value : string +>!!value : boolean +>!value : boolean +>value : string +>error : true +>FieldFeedbackBeta : typeof FieldFeedbackBeta + +// Error: Void not assignable to boolean +const Test2a = () => console.log(value)} error>Hah; +>Test2a : () => JSX.Element +>() => console.log(value)} error>Hah : () => JSX.Element +> console.log(value)} error>Hah : JSX.Element +>FieldFeedbackBeta : typeof FieldFeedbackBeta +>when : (value: string) => void +>value => console.log(value) : (value: string) => void +>value : string +>console.log(value) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void +>value : string +>error : true +>FieldFeedbackBeta : typeof FieldFeedbackBeta interface MyPropsProps extends Props { when: (value: string) => boolean; diff --git a/tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx b/tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx index 9de13d119df..d1ee95995b9 100644 --- a/tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx +++ b/tests/cases/compiler/reactDefaultPropsInferenceSuccess.tsx @@ -6,7 +6,8 @@ import React from 'react'; interface BaseProps { - when?: (value: string) => boolean; + when?: ((value: string) => boolean) | "a" | "b"; + error?: boolean; } interface Props extends BaseProps { @@ -28,6 +29,21 @@ const Test1 = () => !!value} />; // Error: Void not assignable to boolean const Test2 = () => console.log(value)} />; +class FieldFeedbackBeta

extends React.Component

{ + static defaultProps: BaseProps = { + when: () => true + }; + + render() { + return

Hello
; + } +} + +// OK +const Test1a = () => !!value} error>Hah; + +// Error: Void not assignable to boolean +const Test2a = () => console.log(value)} error>Hah; interface MyPropsProps extends Props { when: (value: string) => boolean; From e1c8dc2768c958cf29dce8db1feac471c5e6cf33 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Mon, 24 Sep 2018 12:37:13 -0700 Subject: [PATCH 41/71] Limit the narrow-to-fresh rule added with boolean literals to only boolean literals (#27274) * Remove the narrow-to-fresh rule added with boolean literals * Revert "Remove the narrow-to-fresh rule added with boolean literals" This reverts commit 9f96fe5da33f9297157b326c37680a964b23d7eb. * Only apply freshness to booleans for now * Add largeish example from issue * Should be AND not OR * Add minor improvements suggested by @ahejelsberg * Reorder conditional a bit --- src/compiler/checker.ts | 8 +- ...FreshnessPropagationOnNarrowing.errors.txt | 72 +++++++ .../literalFreshnessPropagationOnNarrowing.js | 114 ++++++++++++ ...ralFreshnessPropagationOnNarrowing.symbols | 150 +++++++++++++++ ...teralFreshnessPropagationOnNarrowing.types | 175 ++++++++++++++++++ .../literalFreshnessPropagationOnNarrowing.ts | 61 ++++++ 6 files changed, 576 insertions(+), 4 deletions(-) create mode 100644 tests/baselines/reference/literalFreshnessPropagationOnNarrowing.errors.txt create mode 100644 tests/baselines/reference/literalFreshnessPropagationOnNarrowing.js create mode 100644 tests/baselines/reference/literalFreshnessPropagationOnNarrowing.symbols create mode 100644 tests/baselines/reference/literalFreshnessPropagationOnNarrowing.types create mode 100644 tests/cases/compiler/literalFreshnessPropagationOnNarrowing.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 67dcac2834b..691b994daae 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -8873,7 +8873,7 @@ namespace ts { } switch (unionReduction) { case UnionReduction.Literal: - if (includes & TypeFlags.StringOrNumberLiteralOrUnique) { + if (includes & TypeFlags.StringOrNumberLiteralOrUnique | TypeFlags.BooleanLiteral) { removeRedundantLiteralTypes(typeSet, includes); } break; @@ -12938,8 +12938,8 @@ namespace ts { function getDefinitelyFalsyPartOfType(type: Type): Type { return type.flags & TypeFlags.String ? emptyStringType : type.flags & TypeFlags.Number ? zeroType : - type.flags & TypeFlags.Boolean || type === regularFalseType ? regularFalseType : - type === falseType ? falseType : + type === regularFalseType || + type === falseType || type.flags & (TypeFlags.Void | TypeFlags.Undefined | TypeFlags.Null) || type.flags & TypeFlags.StringLiteral && (type).value === "" || type.flags & TypeFlags.NumberLiteral && (type).value === 0 ? type : @@ -14214,7 +14214,7 @@ namespace ts { return assignedType; } let reducedType = filterType(declaredType, t => typeMaybeAssignableTo(assignedType, t)); - if (assignedType.flags & (TypeFlags.FreshLiteral | TypeFlags.Literal)) { + if (assignedType.flags & TypeFlags.FreshLiteral && assignedType.flags & TypeFlags.BooleanLiteral) { reducedType = mapType(reducedType, getFreshTypeOfLiteralType); // Ensure that if the assignment is a fresh type, that we narrow to fresh types } // Our crude heuristic produces an invalid result in some cases: see GH#26130. diff --git a/tests/baselines/reference/literalFreshnessPropagationOnNarrowing.errors.txt b/tests/baselines/reference/literalFreshnessPropagationOnNarrowing.errors.txt new file mode 100644 index 00000000000..63e68d79d89 --- /dev/null +++ b/tests/baselines/reference/literalFreshnessPropagationOnNarrowing.errors.txt @@ -0,0 +1,72 @@ +tests/cases/compiler/literalFreshnessPropagationOnNarrowing.ts(37,5): error TS2322: Type '"y"' is not assignable to type '"x"'. +tests/cases/compiler/literalFreshnessPropagationOnNarrowing.ts(60,5): error TS2322: Type 'string[]' is not assignable to type 'XY[]'. + Type 'string' is not assignable to type 'XY'. + + +==== tests/cases/compiler/literalFreshnessPropagationOnNarrowing.ts (2 errors) ==== + function f1() { + let b = true; + let obj = { b }; + // Desired: OK + // 3.0: OK + // 3.1 as-is: OK + // 3.1 minus widening propagation: error + obj.b = false; + } + + function f2() { + type Element = (string | false); + type ElementOrArray = Element | Element[]; + let el: Element = null as any; + let arr: Element[] = null as any; + let elOrA: ElementOrArray = null as any; + + // Desired/actual: All OK + let a1: ElementOrArray = el; + let a2: ElementOrArray = arr; + let a3: ElementOrArray = [el]; + let a4: ElementOrArray = Array.isArray(elOrA) ? elOrA : [elOrA]; + + // Desired: OK + // 3.0: Error + // 3.1: OK + let a5: ElementOrArray = [...Array.isArray(elOrA) ? elOrA : [elOrA]]; + } + + function f3() { + type XY = 'x' | 'y'; + const x: XY = 'x'; + let x2 = x; + // Desired: OK (up for debate?) + // 3.0: Error + // 3.1 as-is: OK + x2 = 'y'; + ~~ +!!! error TS2322: Type '"y"' is not assignable to type '"x"'. + + // Desired/actual: All OK + let x3: XY = x; + x3 = 'y'; + } + + function f4() { + const x: boolean = true; + let x1 = x; + // Desired: OK + // 3.0: OK + // 3.1: OK + // 3.1 minus widening propagation: error + x1 = false; + } + + function f5() { + type XY = 'x' | 'y'; + let arr: XY[] = ['x']; + arr = ['y']; + // Desired: OK + // Error in all extant branches + arr = [...['y']]; + ~~~ +!!! error TS2322: Type 'string[]' is not assignable to type 'XY[]'. +!!! error TS2322: Type 'string' is not assignable to type 'XY'. + } \ No newline at end of file diff --git a/tests/baselines/reference/literalFreshnessPropagationOnNarrowing.js b/tests/baselines/reference/literalFreshnessPropagationOnNarrowing.js new file mode 100644 index 00000000000..a4ab83607cf --- /dev/null +++ b/tests/baselines/reference/literalFreshnessPropagationOnNarrowing.js @@ -0,0 +1,114 @@ +//// [literalFreshnessPropagationOnNarrowing.ts] +function f1() { + let b = true; + let obj = { b }; + // Desired: OK + // 3.0: OK + // 3.1 as-is: OK + // 3.1 minus widening propagation: error + obj.b = false; +} + +function f2() { + type Element = (string | false); + type ElementOrArray = Element | Element[]; + let el: Element = null as any; + let arr: Element[] = null as any; + let elOrA: ElementOrArray = null as any; + + // Desired/actual: All OK + let a1: ElementOrArray = el; + let a2: ElementOrArray = arr; + let a3: ElementOrArray = [el]; + let a4: ElementOrArray = Array.isArray(elOrA) ? elOrA : [elOrA]; + + // Desired: OK + // 3.0: Error + // 3.1: OK + let a5: ElementOrArray = [...Array.isArray(elOrA) ? elOrA : [elOrA]]; +} + +function f3() { + type XY = 'x' | 'y'; + const x: XY = 'x'; + let x2 = x; + // Desired: OK (up for debate?) + // 3.0: Error + // 3.1 as-is: OK + x2 = 'y'; + + // Desired/actual: All OK + let x3: XY = x; + x3 = 'y'; +} + +function f4() { + const x: boolean = true; + let x1 = x; + // Desired: OK + // 3.0: OK + // 3.1: OK + // 3.1 minus widening propagation: error + x1 = false; +} + +function f5() { + type XY = 'x' | 'y'; + let arr: XY[] = ['x']; + arr = ['y']; + // Desired: OK + // Error in all extant branches + arr = [...['y']]; +} + +//// [literalFreshnessPropagationOnNarrowing.js] +function f1() { + var b = true; + var obj = { b: b }; + // Desired: OK + // 3.0: OK + // 3.1 as-is: OK + // 3.1 minus widening propagation: error + obj.b = false; +} +function f2() { + var el = null; + var arr = null; + var elOrA = null; + // Desired/actual: All OK + var a1 = el; + var a2 = arr; + var a3 = [el]; + var a4 = Array.isArray(elOrA) ? elOrA : [elOrA]; + // Desired: OK + // 3.0: Error + // 3.1: OK + var a5 = (Array.isArray(elOrA) ? elOrA : [elOrA]).slice(); +} +function f3() { + var x = 'x'; + var x2 = x; + // Desired: OK (up for debate?) + // 3.0: Error + // 3.1 as-is: OK + x2 = 'y'; + // Desired/actual: All OK + var x3 = x; + x3 = 'y'; +} +function f4() { + var x = true; + var x1 = x; + // Desired: OK + // 3.0: OK + // 3.1: OK + // 3.1 minus widening propagation: error + x1 = false; +} +function f5() { + var arr = ['x']; + arr = ['y']; + // Desired: OK + // Error in all extant branches + arr = ['y']; +} diff --git a/tests/baselines/reference/literalFreshnessPropagationOnNarrowing.symbols b/tests/baselines/reference/literalFreshnessPropagationOnNarrowing.symbols new file mode 100644 index 00000000000..790def0be43 --- /dev/null +++ b/tests/baselines/reference/literalFreshnessPropagationOnNarrowing.symbols @@ -0,0 +1,150 @@ +=== tests/cases/compiler/literalFreshnessPropagationOnNarrowing.ts === +function f1() { +>f1 : Symbol(f1, Decl(literalFreshnessPropagationOnNarrowing.ts, 0, 0)) + + let b = true; +>b : Symbol(b, Decl(literalFreshnessPropagationOnNarrowing.ts, 1, 7)) + + let obj = { b }; +>obj : Symbol(obj, Decl(literalFreshnessPropagationOnNarrowing.ts, 2, 7)) +>b : Symbol(b, Decl(literalFreshnessPropagationOnNarrowing.ts, 2, 15)) + + // Desired: OK + // 3.0: OK + // 3.1 as-is: OK + // 3.1 minus widening propagation: error + obj.b = false; +>obj.b : Symbol(b, Decl(literalFreshnessPropagationOnNarrowing.ts, 2, 15)) +>obj : Symbol(obj, Decl(literalFreshnessPropagationOnNarrowing.ts, 2, 7)) +>b : Symbol(b, Decl(literalFreshnessPropagationOnNarrowing.ts, 2, 15)) +} + +function f2() { +>f2 : Symbol(f2, Decl(literalFreshnessPropagationOnNarrowing.ts, 8, 1)) + + type Element = (string | false); +>Element : Symbol(Element, Decl(literalFreshnessPropagationOnNarrowing.ts, 10, 15)) + + type ElementOrArray = Element | Element[]; +>ElementOrArray : Symbol(ElementOrArray, Decl(literalFreshnessPropagationOnNarrowing.ts, 11, 36)) +>Element : Symbol(Element, Decl(literalFreshnessPropagationOnNarrowing.ts, 10, 15)) +>Element : Symbol(Element, Decl(literalFreshnessPropagationOnNarrowing.ts, 10, 15)) + + let el: Element = null as any; +>el : Symbol(el, Decl(literalFreshnessPropagationOnNarrowing.ts, 13, 7)) +>Element : Symbol(Element, Decl(literalFreshnessPropagationOnNarrowing.ts, 10, 15)) + + let arr: Element[] = null as any; +>arr : Symbol(arr, Decl(literalFreshnessPropagationOnNarrowing.ts, 14, 7)) +>Element : Symbol(Element, Decl(literalFreshnessPropagationOnNarrowing.ts, 10, 15)) + + let elOrA: ElementOrArray = null as any; +>elOrA : Symbol(elOrA, Decl(literalFreshnessPropagationOnNarrowing.ts, 15, 7)) +>ElementOrArray : Symbol(ElementOrArray, Decl(literalFreshnessPropagationOnNarrowing.ts, 11, 36)) + + // Desired/actual: All OK + let a1: ElementOrArray = el; +>a1 : Symbol(a1, Decl(literalFreshnessPropagationOnNarrowing.ts, 18, 7)) +>ElementOrArray : Symbol(ElementOrArray, Decl(literalFreshnessPropagationOnNarrowing.ts, 11, 36)) +>el : Symbol(el, Decl(literalFreshnessPropagationOnNarrowing.ts, 13, 7)) + + let a2: ElementOrArray = arr; +>a2 : Symbol(a2, Decl(literalFreshnessPropagationOnNarrowing.ts, 19, 7)) +>ElementOrArray : Symbol(ElementOrArray, Decl(literalFreshnessPropagationOnNarrowing.ts, 11, 36)) +>arr : Symbol(arr, Decl(literalFreshnessPropagationOnNarrowing.ts, 14, 7)) + + let a3: ElementOrArray = [el]; +>a3 : Symbol(a3, Decl(literalFreshnessPropagationOnNarrowing.ts, 20, 7)) +>ElementOrArray : Symbol(ElementOrArray, Decl(literalFreshnessPropagationOnNarrowing.ts, 11, 36)) +>el : Symbol(el, Decl(literalFreshnessPropagationOnNarrowing.ts, 13, 7)) + + let a4: ElementOrArray = Array.isArray(elOrA) ? elOrA : [elOrA]; +>a4 : Symbol(a4, Decl(literalFreshnessPropagationOnNarrowing.ts, 21, 7)) +>ElementOrArray : Symbol(ElementOrArray, Decl(literalFreshnessPropagationOnNarrowing.ts, 11, 36)) +>Array.isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) +>elOrA : Symbol(elOrA, Decl(literalFreshnessPropagationOnNarrowing.ts, 15, 7)) +>elOrA : Symbol(elOrA, Decl(literalFreshnessPropagationOnNarrowing.ts, 15, 7)) +>elOrA : Symbol(elOrA, Decl(literalFreshnessPropagationOnNarrowing.ts, 15, 7)) + + // Desired: OK + // 3.0: Error + // 3.1: OK + let a5: ElementOrArray = [...Array.isArray(elOrA) ? elOrA : [elOrA]]; +>a5 : Symbol(a5, Decl(literalFreshnessPropagationOnNarrowing.ts, 26, 7)) +>ElementOrArray : Symbol(ElementOrArray, Decl(literalFreshnessPropagationOnNarrowing.ts, 11, 36)) +>Array.isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>isArray : Symbol(ArrayConstructor.isArray, Decl(lib.es5.d.ts, --, --)) +>elOrA : Symbol(elOrA, Decl(literalFreshnessPropagationOnNarrowing.ts, 15, 7)) +>elOrA : Symbol(elOrA, Decl(literalFreshnessPropagationOnNarrowing.ts, 15, 7)) +>elOrA : Symbol(elOrA, Decl(literalFreshnessPropagationOnNarrowing.ts, 15, 7)) +} + +function f3() { +>f3 : Symbol(f3, Decl(literalFreshnessPropagationOnNarrowing.ts, 27, 1)) + + type XY = 'x' | 'y'; +>XY : Symbol(XY, Decl(literalFreshnessPropagationOnNarrowing.ts, 29, 15)) + + const x: XY = 'x'; +>x : Symbol(x, Decl(literalFreshnessPropagationOnNarrowing.ts, 31, 9)) +>XY : Symbol(XY, Decl(literalFreshnessPropagationOnNarrowing.ts, 29, 15)) + + let x2 = x; +>x2 : Symbol(x2, Decl(literalFreshnessPropagationOnNarrowing.ts, 32, 7)) +>x : Symbol(x, Decl(literalFreshnessPropagationOnNarrowing.ts, 31, 9)) + + // Desired: OK (up for debate?) + // 3.0: Error + // 3.1 as-is: OK + x2 = 'y'; +>x2 : Symbol(x2, Decl(literalFreshnessPropagationOnNarrowing.ts, 32, 7)) + + // Desired/actual: All OK + let x3: XY = x; +>x3 : Symbol(x3, Decl(literalFreshnessPropagationOnNarrowing.ts, 39, 7)) +>XY : Symbol(XY, Decl(literalFreshnessPropagationOnNarrowing.ts, 29, 15)) +>x : Symbol(x, Decl(literalFreshnessPropagationOnNarrowing.ts, 31, 9)) + + x3 = 'y'; +>x3 : Symbol(x3, Decl(literalFreshnessPropagationOnNarrowing.ts, 39, 7)) +} + +function f4() { +>f4 : Symbol(f4, Decl(literalFreshnessPropagationOnNarrowing.ts, 41, 1)) + + const x: boolean = true; +>x : Symbol(x, Decl(literalFreshnessPropagationOnNarrowing.ts, 44, 9)) + + let x1 = x; +>x1 : Symbol(x1, Decl(literalFreshnessPropagationOnNarrowing.ts, 45, 7)) +>x : Symbol(x, Decl(literalFreshnessPropagationOnNarrowing.ts, 44, 9)) + + // Desired: OK + // 3.0: OK + // 3.1: OK + // 3.1 minus widening propagation: error + x1 = false; +>x1 : Symbol(x1, Decl(literalFreshnessPropagationOnNarrowing.ts, 45, 7)) +} + +function f5() { +>f5 : Symbol(f5, Decl(literalFreshnessPropagationOnNarrowing.ts, 51, 1)) + + type XY = 'x' | 'y'; +>XY : Symbol(XY, Decl(literalFreshnessPropagationOnNarrowing.ts, 53, 15)) + + let arr: XY[] = ['x']; +>arr : Symbol(arr, Decl(literalFreshnessPropagationOnNarrowing.ts, 55, 7)) +>XY : Symbol(XY, Decl(literalFreshnessPropagationOnNarrowing.ts, 53, 15)) + + arr = ['y']; +>arr : Symbol(arr, Decl(literalFreshnessPropagationOnNarrowing.ts, 55, 7)) + + // Desired: OK + // Error in all extant branches + arr = [...['y']]; +>arr : Symbol(arr, Decl(literalFreshnessPropagationOnNarrowing.ts, 55, 7)) +} diff --git a/tests/baselines/reference/literalFreshnessPropagationOnNarrowing.types b/tests/baselines/reference/literalFreshnessPropagationOnNarrowing.types new file mode 100644 index 00000000000..8fb03bc413f --- /dev/null +++ b/tests/baselines/reference/literalFreshnessPropagationOnNarrowing.types @@ -0,0 +1,175 @@ +=== tests/cases/compiler/literalFreshnessPropagationOnNarrowing.ts === +function f1() { +>f1 : () => void + + let b = true; +>b : boolean +>true : true + + let obj = { b }; +>obj : { b: boolean; } +>{ b } : { b: boolean; } +>b : boolean + + // Desired: OK + // 3.0: OK + // 3.1 as-is: OK + // 3.1 minus widening propagation: error + obj.b = false; +>obj.b = false : false +>obj.b : boolean +>obj : { b: boolean; } +>b : boolean +>false : false +} + +function f2() { +>f2 : () => void + + type Element = (string | false); +>Element : string | false +>false : false + + type ElementOrArray = Element | Element[]; +>ElementOrArray : string | false | (string | false)[] + + let el: Element = null as any; +>el : string | false +>null as any : any +>null : null + + let arr: Element[] = null as any; +>arr : (string | false)[] +>null as any : any +>null : null + + let elOrA: ElementOrArray = null as any; +>elOrA : string | false | (string | false)[] +>null as any : any +>null : null + + // Desired/actual: All OK + let a1: ElementOrArray = el; +>a1 : string | false | (string | false)[] +>el : string | false + + let a2: ElementOrArray = arr; +>a2 : string | false | (string | false)[] +>arr : (string | false)[] + + let a3: ElementOrArray = [el]; +>a3 : string | false | (string | false)[] +>[el] : (string | false)[] +>el : string | false + + let a4: ElementOrArray = Array.isArray(elOrA) ? elOrA : [elOrA]; +>a4 : string | false | (string | false)[] +>Array.isArray(elOrA) ? elOrA : [elOrA] : (string | false)[] +>Array.isArray(elOrA) : boolean +>Array.isArray : (arg: any) => arg is any[] +>Array : ArrayConstructor +>isArray : (arg: any) => arg is any[] +>elOrA : string | false | (string | false)[] +>elOrA : (string | false)[] +>[elOrA] : (string | false)[] +>elOrA : string | false + + // Desired: OK + // 3.0: Error + // 3.1: OK + let a5: ElementOrArray = [...Array.isArray(elOrA) ? elOrA : [elOrA]]; +>a5 : string | false | (string | false)[] +>[...Array.isArray(elOrA) ? elOrA : [elOrA]] : (string | false)[] +>...Array.isArray(elOrA) ? elOrA : [elOrA] : string | false +>Array.isArray(elOrA) ? elOrA : [elOrA] : (string | false)[] +>Array.isArray(elOrA) : boolean +>Array.isArray : (arg: any) => arg is any[] +>Array : ArrayConstructor +>isArray : (arg: any) => arg is any[] +>elOrA : string | false | (string | false)[] +>elOrA : (string | false)[] +>[elOrA] : (string | false)[] +>elOrA : string | false +} + +function f3() { +>f3 : () => void + + type XY = 'x' | 'y'; +>XY : "x" | "y" + + const x: XY = 'x'; +>x : "x" | "y" +>'x' : "x" + + let x2 = x; +>x2 : "x" +>x : "x" + + // Desired: OK (up for debate?) + // 3.0: Error + // 3.1 as-is: OK + x2 = 'y'; +>x2 = 'y' : "y" +>x2 : "x" +>'y' : "y" + + // Desired/actual: All OK + let x3: XY = x; +>x3 : "x" | "y" +>x : "x" + + x3 = 'y'; +>x3 = 'y' : "y" +>x3 : "x" | "y" +>'y' : "y" +} + +function f4() { +>f4 : () => void + + const x: boolean = true; +>x : boolean +>true : true + + let x1 = x; +>x1 : boolean +>x : true + + // Desired: OK + // 3.0: OK + // 3.1: OK + // 3.1 minus widening propagation: error + x1 = false; +>x1 = false : false +>x1 : boolean +>false : false +} + +function f5() { +>f5 : () => void + + type XY = 'x' | 'y'; +>XY : "x" | "y" + + let arr: XY[] = ['x']; +>arr : ("x" | "y")[] +>['x'] : "x"[] +>'x' : "x" + + arr = ['y']; +>arr = ['y'] : "y"[] +>arr : ("x" | "y")[] +>['y'] : "y"[] +>'y' : "y" + + // Desired: OK + // Error in all extant branches + arr = [...['y']]; +>arr = [...['y']] : string[] +>arr : ("x" | "y")[] +>[...['y']] : string[] +>...['y'] : string +>['y'] : string[] +>'y' : "y" +} diff --git a/tests/cases/compiler/literalFreshnessPropagationOnNarrowing.ts b/tests/cases/compiler/literalFreshnessPropagationOnNarrowing.ts new file mode 100644 index 00000000000..56f14dc6b2b --- /dev/null +++ b/tests/cases/compiler/literalFreshnessPropagationOnNarrowing.ts @@ -0,0 +1,61 @@ +function f1() { + let b = true; + let obj = { b }; + // Desired: OK + // 3.0: OK + // 3.1 as-is: OK + // 3.1 minus widening propagation: error + obj.b = false; +} + +function f2() { + type Element = (string | false); + type ElementOrArray = Element | Element[]; + let el: Element = null as any; + let arr: Element[] = null as any; + let elOrA: ElementOrArray = null as any; + + // Desired/actual: All OK + let a1: ElementOrArray = el; + let a2: ElementOrArray = arr; + let a3: ElementOrArray = [el]; + let a4: ElementOrArray = Array.isArray(elOrA) ? elOrA : [elOrA]; + + // Desired: OK + // 3.0: Error + // 3.1: OK + let a5: ElementOrArray = [...Array.isArray(elOrA) ? elOrA : [elOrA]]; +} + +function f3() { + type XY = 'x' | 'y'; + const x: XY = 'x'; + let x2 = x; + // Desired: OK (up for debate?) + // 3.0: Error + // 3.1 as-is: OK + x2 = 'y'; + + // Desired/actual: All OK + let x3: XY = x; + x3 = 'y'; +} + +function f4() { + const x: boolean = true; + let x1 = x; + // Desired: OK + // 3.0: OK + // 3.1: OK + // 3.1 minus widening propagation: error + x1 = false; +} + +function f5() { + type XY = 'x' | 'y'; + let arr: XY[] = ['x']; + arr = ['y']; + // Desired: OK + // Error in all extant branches + arr = [...['y']]; +} \ No newline at end of file From 471bc646b804fea1bc9cf0a5a150d05b550ce218 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 24 Sep 2018 14:44:26 -0700 Subject: [PATCH 42/71] Ensure session passes along fileToRename (#27323) --- src/server/session.ts | 4 +-- .../unittests/tsserverProjectSystem.ts | 32 +++++++++++++++++-- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/src/server/session.ts b/src/server/session.ts index 66b8cd6e284..dd9708c1ddf 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -1167,8 +1167,8 @@ namespace ts.server { return { info: renameInfo, locs: this.toSpanGroups(locations) }; } - private mapRenameInfo({ canRename, localizedErrorMessage, displayName, fullDisplayName, kind, kindModifiers, triggerSpan }: RenameInfo, scriptInfo: ScriptInfo): protocol.RenameInfo { - return { canRename, localizedErrorMessage, displayName, fullDisplayName, kind, kindModifiers, triggerSpan: this.toLocationTextSpan(triggerSpan, scriptInfo) }; + private mapRenameInfo({ canRename, fileToRename, localizedErrorMessage, displayName, fullDisplayName, kind, kindModifiers, triggerSpan }: RenameInfo, scriptInfo: ScriptInfo): protocol.RenameInfo { + return { canRename, fileToRename, localizedErrorMessage, displayName, fullDisplayName, kind, kindModifiers, triggerSpan: this.toLocationTextSpan(triggerSpan, scriptInfo) }; } private toSpanGroups(locations: ReadonlyArray): ReadonlyArray { diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index 639cd657e0d..cb1b7f3983d 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -8294,6 +8294,7 @@ namespace ts.projectSystem { info: { canRename: true, displayName: "C", + fileToRename: undefined, fullDisplayName: '"/users/username/projects/a/c/fc".C', kind: ScriptElementKind.constElement, kindModifiers: ScriptElementKindModifier.exportedModifier, @@ -9462,8 +9463,7 @@ export function Test2() { content: "{}", }; - const host = createServerHost([aTs, bTs, tsconfig]); - const session = createSession(host); + const session = createSession(createServerHost([aTs, bTs, tsconfig])); openFilesForSession([aTs, bTs], session); const requestLocation: protocol.FileLocationRequestArgs = { @@ -9569,6 +9569,31 @@ export function Test2() { }); }); + describe("tsserverProjectSystem rename", () => { + it("works", () => { + const aTs: File = { path: "/a.ts", content: "export const a = 0;" }; + const bTs: File = { path: "/b.ts", content: 'import { a } from "./a";' }; + + const session = createSession(createServerHost([aTs, bTs])); + openFilesForSession([bTs], session); + + const response = executeSessionRequest(session, protocol.CommandTypes.Rename, protocolFileLocationFromSubstring(bTs, 'a";')); + assert.deepEqual(response, { + info: { + canRename: true, + fileToRename: aTs.path, + displayName: aTs.path, + fullDisplayName: aTs.path, + kind: ScriptElementKind.moduleElement, + kindModifiers: "", + localizedErrorMessage: undefined, + triggerSpan: protocolTextSpanFromSubstring(bTs.content, "a", { index: 1 }), + }, + locs: [{ file: bTs.path, locs: [protocolTextSpanFromSubstring(bTs.content, "./a")] }], + }); + }); + }); + describe("tsserverProjectSystem typeReferenceDirectives", () => { it("when typeReferenceDirective contains UpperCasePackage", () => { const projectLocation = "/user/username/projects/myproject"; @@ -10062,6 +10087,7 @@ declare class TestLib { info: { canRename: true, displayName: "fnA", + fileToRename: undefined, fullDisplayName: "fnA", kind: ScriptElementKind.alias, kindModifiers: ScriptElementKindModifier.none, @@ -10081,6 +10107,7 @@ declare class TestLib { info: { canRename: true, displayName: "fnA", + fileToRename: undefined, fullDisplayName: '"/a/a".fnA', kind: ScriptElementKind.functionElement, kindModifiers: ScriptElementKindModifier.exportedModifier, @@ -10110,6 +10137,7 @@ declare class TestLib { info: { canRename: true, displayName: "fnB", + fileToRename: undefined, fullDisplayName: "fnB", kind: ScriptElementKind.alias, kindModifiers: ScriptElementKindModifier.none, From b8cf9d4f94c82fe73134a2a1a7362eac1ef6d0ab Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Mon, 24 Sep 2018 16:15:30 -0700 Subject: [PATCH 43/71] Fixes the completionForStringLiteralNonrelativeImport13 test --- .../completionForStringLiteralNonrelativeImport13.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/cases/fourslash/completionForStringLiteralNonrelativeImport13.ts b/tests/cases/fourslash/completionForStringLiteralNonrelativeImport13.ts index d1e67ae9a90..59b2d7a9539 100644 --- a/tests/cases/fourslash/completionForStringLiteralNonrelativeImport13.ts +++ b/tests/cases/fourslash/completionForStringLiteralNonrelativeImport13.ts @@ -8,7 +8,7 @@ //// "version": "1.0.0", //// "types": "index", //// "typesVersions": { -//// "3.0": { "*" : ["ts3.0/*"] } +//// ">=3.1.0-0": { "*" : ["ts3.1/*"] } //// } //// } @@ -18,10 +18,10 @@ // @Filename: node_modules/ext/aaa.d.ts //// export {}; -// @Filename: node_modules/ext/ts3.0/index.d.ts +// @Filename: node_modules/ext/ts3.1/index.d.ts //// export {}; -// @Filename: node_modules/ext/ts3.0/zzz.d.ts +// @Filename: node_modules/ext/ts3.1/zzz.d.ts //// export {}; // @Filename: main.ts @@ -31,6 +31,6 @@ verify.completions({ marker: test.markerNames(), - exact: ["aaa", "index", "ts3.0", "zzz"], + exact: ["aaa", "index", "ts3.1", "zzz"], isNewIdentifierLocation: true, }); From b6e66c2df03c5c99bc5a8edb78f0e532fc4115df Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 24 Sep 2018 17:10:38 -0700 Subject: [PATCH 44/71] Accept new baselines --- ...xChildrenGenericContextualTypes.errors.txt | 24 +++++++------------ .../reference/promiseTypeInference.errors.txt | 2 +- ...wrappedAndRecursiveConstraints4.errors.txt | 2 +- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/tests/baselines/reference/jsxChildrenGenericContextualTypes.errors.txt b/tests/baselines/reference/jsxChildrenGenericContextualTypes.errors.txt index fca81df6a6a..844459e5f95 100644 --- a/tests/baselines/reference/jsxChildrenGenericContextualTypes.errors.txt +++ b/tests/baselines/reference/jsxChildrenGenericContextualTypes.errors.txt @@ -1,13 +1,9 @@ tests/cases/compiler/jsxChildrenGenericContextualTypes.tsx(20,46): error TS2322: Type '"y"' is not assignable to type '"x"'. -tests/cases/compiler/jsxChildrenGenericContextualTypes.tsx(21,19): error TS2322: Type '{ children: (p: LitProps<"x">) => "y"; prop: "x"; }' is not assignable to type 'IntrinsicAttributes & LitProps<"x" | "y">'. - Type '{ children: (p: LitProps<"x">) => "y"; prop: "x"; }' is not assignable to type 'LitProps<"x" | "y">'. +tests/cases/compiler/jsxChildrenGenericContextualTypes.tsx(21,19): error TS2322: Type '{ children: (p: LitProps<"x">) => "y"; prop: "x"; }' is not assignable to type 'IntrinsicAttributes & LitProps<"x">'. + Type '{ children: (p: LitProps<"x">) => "y"; prop: "x"; }' is not assignable to type 'LitProps<"x">'. Types of property 'children' are incompatible. - Type '(p: LitProps<"x">) => "y"' is not assignable to type '(x: LitProps<"x" | "y">) => "x" | "y"'. - Types of parameters 'p' and 'x' are incompatible. - Type 'LitProps<"x" | "y">' is not assignable to type 'LitProps<"x">'. - Types of property 'prop' are incompatible. - Type '"x" | "y"' is not assignable to type '"x"'. - Type '"y"' is not assignable to type '"x"'. + Type '(p: LitProps<"x">) => "y"' is not assignable to type '(x: LitProps<"x">) => "x"'. + Type '"y"' is not assignable to type '"x"'. tests/cases/compiler/jsxChildrenGenericContextualTypes.tsx(22,21): error TS2322: Type '{ children: () => number; prop: "x"; }' is not assignable to type 'IntrinsicAttributes & LitProps<"x">'. Type '{ children: () => number; prop: "x"; }' is not assignable to type 'LitProps<"x">'. Types of property 'children' are incompatible. @@ -41,15 +37,11 @@ tests/cases/compiler/jsxChildrenGenericContextualTypes.tsx(22,21): error TS2322: !!! related TS6502 tests/cases/compiler/jsxChildrenGenericContextualTypes.tsx:13:44: The expected type comes from the return type of this signature. const argchild = {p => "y"} ~~~~~~~ -!!! error TS2322: Type '{ children: (p: LitProps<"x">) => "y"; prop: "x"; }' is not assignable to type 'IntrinsicAttributes & LitProps<"x" | "y">'. -!!! error TS2322: Type '{ children: (p: LitProps<"x">) => "y"; prop: "x"; }' is not assignable to type 'LitProps<"x" | "y">'. +!!! error TS2322: Type '{ children: (p: LitProps<"x">) => "y"; prop: "x"; }' is not assignable to type 'IntrinsicAttributes & LitProps<"x">'. +!!! error TS2322: Type '{ children: (p: LitProps<"x">) => "y"; prop: "x"; }' is not assignable to type 'LitProps<"x">'. !!! error TS2322: Types of property 'children' are incompatible. -!!! error TS2322: Type '(p: LitProps<"x">) => "y"' is not assignable to type '(x: LitProps<"x" | "y">) => "x" | "y"'. -!!! error TS2322: Types of parameters 'p' and 'x' are incompatible. -!!! error TS2322: Type 'LitProps<"x" | "y">' is not assignable to type 'LitProps<"x">'. -!!! error TS2322: Types of property 'prop' are incompatible. -!!! error TS2322: Type '"x" | "y"' is not assignable to type '"x"'. -!!! error TS2322: Type '"y"' is not assignable to type '"x"'. +!!! error TS2322: Type '(p: LitProps<"x">) => "y"' is not assignable to type '(x: LitProps<"x">) => "x"'. +!!! error TS2322: Type '"y"' is not assignable to type '"x"'. const mismatched = {() => 12} ~~~~~~~ !!! error TS2322: Type '{ children: () => number; prop: "x"; }' is not assignable to type 'IntrinsicAttributes & LitProps<"x">'. diff --git a/tests/baselines/reference/promiseTypeInference.errors.txt b/tests/baselines/reference/promiseTypeInference.errors.txt index 0ae42f3cbbd..5edf8f5b091 100644 --- a/tests/baselines/reference/promiseTypeInference.errors.txt +++ b/tests/baselines/reference/promiseTypeInference.errors.txt @@ -26,5 +26,5 @@ tests/cases/compiler/promiseTypeInference.ts(10,39): error TS2322: Type 'IPromis !!! error TS2322: Types of parameters 'success' and 'onfulfilled' are incompatible. !!! error TS2322: Type 'TResult1 | PromiseLike' is not assignable to type 'IPromise'. !!! error TS2322: Type 'TResult1' is not assignable to type 'IPromise'. -!!! related TS6502 /.ts/lib.es5.d.ts:1336:57: The expected type comes from the return type of this signature. +!!! related TS6502 /.ts/lib.es5.d.ts:1396:57: The expected type comes from the return type of this signature. \ No newline at end of file diff --git a/tests/baselines/reference/wrappedAndRecursiveConstraints4.errors.txt b/tests/baselines/reference/wrappedAndRecursiveConstraints4.errors.txt index e904201f59d..4b19087eea0 100644 --- a/tests/baselines/reference/wrappedAndRecursiveConstraints4.errors.txt +++ b/tests/baselines/reference/wrappedAndRecursiveConstraints4.errors.txt @@ -18,4 +18,4 @@ tests/cases/conformance/types/typeParameters/typeArgumentLists/wrappedAndRecursi var r2 = r({ length: 3, charAt: (x: number) => { '' } }); // error ~~~~~~ !!! error TS2322: Type '(x: number) => void' is not assignable to type '(pos: number) => string'. -!!! error TS2322: Type 'void' is not assignable to type 'string'. +!!! error TS2322: Type 'void' is not assignable to type 'string'. \ No newline at end of file From 8e1cce4b8f094b801ba519e29f63ace987df0b05 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Mon, 24 Sep 2018 17:52:52 -0700 Subject: [PATCH 45/71] Add regression test for #25485 as it is already fixed (#27320) --- ...edAssignableToGenericMappedIntersection.js | 16 +++++++++++ ...ignableToGenericMappedIntersection.symbols | 27 +++++++++++++++++++ ...ssignableToGenericMappedIntersection.types | 22 +++++++++++++++ ...edAssignableToGenericMappedIntersection.ts | 7 +++++ 4 files changed, 72 insertions(+) create mode 100644 tests/baselines/reference/undefinedAssignableToGenericMappedIntersection.js create mode 100644 tests/baselines/reference/undefinedAssignableToGenericMappedIntersection.symbols create mode 100644 tests/baselines/reference/undefinedAssignableToGenericMappedIntersection.types create mode 100644 tests/cases/compiler/undefinedAssignableToGenericMappedIntersection.ts diff --git a/tests/baselines/reference/undefinedAssignableToGenericMappedIntersection.js b/tests/baselines/reference/undefinedAssignableToGenericMappedIntersection.js new file mode 100644 index 00000000000..468344c3e9c --- /dev/null +++ b/tests/baselines/reference/undefinedAssignableToGenericMappedIntersection.js @@ -0,0 +1,16 @@ +//// [undefinedAssignableToGenericMappedIntersection.ts] +type Errors = { [P in keyof T]: string | undefined } & {all: string | undefined}; +function foo() { + let obj!: Errors + let x!: keyof T; + obj[x] = undefined; +} + + +//// [undefinedAssignableToGenericMappedIntersection.js] +"use strict"; +function foo() { + var obj; + var x; + obj[x] = undefined; +} diff --git a/tests/baselines/reference/undefinedAssignableToGenericMappedIntersection.symbols b/tests/baselines/reference/undefinedAssignableToGenericMappedIntersection.symbols new file mode 100644 index 00000000000..613b3bcc538 --- /dev/null +++ b/tests/baselines/reference/undefinedAssignableToGenericMappedIntersection.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/undefinedAssignableToGenericMappedIntersection.ts === +type Errors = { [P in keyof T]: string | undefined } & {all: string | undefined}; +>Errors : Symbol(Errors, Decl(undefinedAssignableToGenericMappedIntersection.ts, 0, 0)) +>T : Symbol(T, Decl(undefinedAssignableToGenericMappedIntersection.ts, 0, 12)) +>P : Symbol(P, Decl(undefinedAssignableToGenericMappedIntersection.ts, 0, 20)) +>T : Symbol(T, Decl(undefinedAssignableToGenericMappedIntersection.ts, 0, 12)) +>all : Symbol(all, Decl(undefinedAssignableToGenericMappedIntersection.ts, 0, 59)) + +function foo() { +>foo : Symbol(foo, Decl(undefinedAssignableToGenericMappedIntersection.ts, 0, 84)) +>T : Symbol(T, Decl(undefinedAssignableToGenericMappedIntersection.ts, 1, 13)) + + let obj!: Errors +>obj : Symbol(obj, Decl(undefinedAssignableToGenericMappedIntersection.ts, 2, 7)) +>Errors : Symbol(Errors, Decl(undefinedAssignableToGenericMappedIntersection.ts, 0, 0)) +>T : Symbol(T, Decl(undefinedAssignableToGenericMappedIntersection.ts, 1, 13)) + + let x!: keyof T; +>x : Symbol(x, Decl(undefinedAssignableToGenericMappedIntersection.ts, 3, 7)) +>T : Symbol(T, Decl(undefinedAssignableToGenericMappedIntersection.ts, 1, 13)) + + obj[x] = undefined; +>obj : Symbol(obj, Decl(undefinedAssignableToGenericMappedIntersection.ts, 2, 7)) +>x : Symbol(x, Decl(undefinedAssignableToGenericMappedIntersection.ts, 3, 7)) +>undefined : Symbol(undefined) +} + diff --git a/tests/baselines/reference/undefinedAssignableToGenericMappedIntersection.types b/tests/baselines/reference/undefinedAssignableToGenericMappedIntersection.types new file mode 100644 index 00000000000..1bf4aae0198 --- /dev/null +++ b/tests/baselines/reference/undefinedAssignableToGenericMappedIntersection.types @@ -0,0 +1,22 @@ +=== tests/cases/compiler/undefinedAssignableToGenericMappedIntersection.ts === +type Errors = { [P in keyof T]: string | undefined } & {all: string | undefined}; +>Errors : Errors +>all : string | undefined + +function foo() { +>foo : () => void + + let obj!: Errors +>obj : Errors + + let x!: keyof T; +>x : keyof T + + obj[x] = undefined; +>obj[x] = undefined : undefined +>obj[x] : Errors[keyof T] +>obj : Errors +>x : keyof T +>undefined : undefined +} + diff --git a/tests/cases/compiler/undefinedAssignableToGenericMappedIntersection.ts b/tests/cases/compiler/undefinedAssignableToGenericMappedIntersection.ts new file mode 100644 index 00000000000..2b089164676 --- /dev/null +++ b/tests/cases/compiler/undefinedAssignableToGenericMappedIntersection.ts @@ -0,0 +1,7 @@ +// @strict: true +type Errors = { [P in keyof T]: string | undefined } & {all: string | undefined}; +function foo() { + let obj!: Errors + let x!: keyof T; + obj[x] = undefined; +} From f0018eb1075c6a3cc1124b8afe097ad3c355c41a Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Tue, 25 Sep 2018 10:32:18 -0700 Subject: [PATCH 46/71] Update user baselines (#27339) --- .../reference/user/adonis-framework.log | 19 +++++++++++++++++ tests/baselines/reference/user/bluebird.log | 5 +++++ .../user/chrome-devtools-frontend.log | 4 ++-- tests/baselines/reference/user/debug.log | 5 +++++ .../baselines/reference/user/graceful-fs.log | 11 ++++++++-- tests/baselines/reference/user/lodash.log | 8 +++++++ tests/baselines/reference/user/npm.log | 21 +++++++++++++++++-- tests/baselines/reference/user/npmlog.log | 2 ++ tests/baselines/reference/user/prettier.log | 5 +++++ tests/baselines/reference/user/uglify-js.log | 9 ++++++++ tests/baselines/reference/user/util.log | 3 +++ 11 files changed, 86 insertions(+), 6 deletions(-) diff --git a/tests/baselines/reference/user/adonis-framework.log b/tests/baselines/reference/user/adonis-framework.log index 7796b296dbe..a370c326c0a 100644 --- a/tests/baselines/reference/user/adonis-framework.log +++ b/tests/baselines/reference/user/adonis-framework.log @@ -39,10 +39,15 @@ node_modules/adonis-framework/src/Event/index.js(128,12): error TS2322: Type '() Property 'pop' is missing in type '() => {}[]'. node_modules/adonis-framework/src/Event/index.js(153,25): error TS2339: Property 'wildcard' does not exist on type 'EventEmitter2'. node_modules/adonis-framework/src/Event/index.js(188,17): error TS2304: Cannot find name 'Spread'. +node_modules/adonis-framework/src/Event/index.js(201,27): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type 'any[]'. + Property 'pop' is missing in type 'IArguments'. node_modules/adonis-framework/src/Event/index.js(207,24): error TS2304: Cannot find name 'Sring'. node_modules/adonis-framework/src/Event/index.js(256,52): error TS2345: Argument of type 'Function' is not assignable to parameter of type 'Listener'. Type 'Function' provides no match for the signature '(...values: any[]): void'. node_modules/adonis-framework/src/Event/index.js(264,28): error TS2345: Argument of type 'Function' is not assignable to parameter of type 'Listener'. +node_modules/adonis-framework/src/Event/index.js(271,25): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[string, any, TimerHandler]'. + Property '0' is missing in type 'IArguments'. +node_modules/adonis-framework/src/Event/index.js(278,25): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[string, any, TimerHandler]'. node_modules/adonis-framework/src/Event/index.js(294,30): error TS2345: Argument of type 'Function' is not assignable to parameter of type 'Listener'. node_modules/adonis-framework/src/Exceptions/index.js(13,14): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher. node_modules/adonis-framework/src/Exceptions/index.js(27,12): error TS2554: Expected 0 arguments, but got 3. @@ -107,6 +112,13 @@ node_modules/adonis-framework/src/Response/index.js(95,16): error TS2304: Cannot node_modules/adonis-framework/src/Response/index.js(172,15): error TS2304: Cannot find name 'Mixed'. node_modules/adonis-framework/src/Response/index.js(299,15): error TS2304: Cannot find name 'Mixed'. node_modules/adonis-framework/src/Response/index.js(323,15): error TS2304: Cannot find name 'Mixed'. +node_modules/adonis-framework/src/Route/ResourceCollection.js(43,40): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type 'any[]'. + Property 'pop' is missing in type 'IArguments'. +node_modules/adonis-framework/src/Route/ResourceCollection.js(56,31): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type 'any[]'. +node_modules/adonis-framework/src/Route/ResourceMember.js(43,40): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type 'any[]'. +node_modules/adonis-framework/src/Route/ResourceMember.js(56,31): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type 'any[]'. +node_modules/adonis-framework/src/Route/group.js(34,31): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type 'any[]'. +node_modules/adonis-framework/src/Route/group.js(43,41): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type 'any[]'. node_modules/adonis-framework/src/Route/helpers.js(22,13): error TS2304: Cannot find name 'Any'. node_modules/adonis-framework/src/Route/helpers.js(34,3): error TS2322: Type 'string | string[]' is not assignable to type 'string'. Type 'string[]' is not assignable to type 'string'. @@ -120,6 +132,8 @@ node_modules/adonis-framework/src/Route/index.js(259,21): error TS2345: Argument node_modules/adonis-framework/src/Route/index.js(280,21): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'string'. node_modules/adonis-framework/src/Route/index.js(321,13): error TS2304: Cannot find name 'Mixed'. node_modules/adonis-framework/src/Route/index.js(321,20): error TS8029: JSDoc '@param' tag has name 'keys', but there is no parameter with that name. It would match 'arguments' if it had an array type. +node_modules/adonis-framework/src/Route/index.js(333,29): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type 'any[]'. +node_modules/adonis-framework/src/Route/index.js(343,33): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type 'any[]'. node_modules/adonis-framework/src/Route/index.js(354,20): error TS2694: Namespace 'Route' has no exported member 'Group'. node_modules/adonis-framework/src/Route/index.js(368,3): error TS2322: Type 'null' is not assignable to type 'string'. node_modules/adonis-framework/src/Route/index.js(396,10): error TS2554: Expected 2 arguments, but got 3. @@ -133,11 +147,16 @@ node_modules/adonis-framework/src/Route/resource.js(96,25): error TS2345: Argume node_modules/adonis-framework/src/Route/resource.js(97,25): error TS2345: Argument of type 'string[]' is not assignable to parameter of type 'string'. node_modules/adonis-framework/src/Route/resource.js(172,15): error TS2304: Cannot find name 'Mixed'. node_modules/adonis-framework/src/Route/resource.js(172,22): error TS8029: JSDoc '@param' tag has name 'methods', but there is no parameter with that name. It would match 'arguments' if it had an array type. +node_modules/adonis-framework/src/Route/resource.js(183,45): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type 'any[]'. node_modules/adonis-framework/src/Route/resource.js(198,15): error TS2304: Cannot find name 'Mixed'. node_modules/adonis-framework/src/Route/resource.js(198,22): error TS8029: JSDoc '@param' tag has name 'methods', but there is no parameter with that name. It would match 'arguments' if it had an array type. +node_modules/adonis-framework/src/Route/resource.js(209,45): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type 'any[]'. node_modules/adonis-framework/src/Route/resource.js(233,15): error TS2304: Cannot find name 'Mixed'. node_modules/adonis-framework/src/Route/resource.js(261,15): error TS2304: Cannot find name 'Mixed'. +node_modules/adonis-framework/src/Route/resource.js(290,40): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any, ...any[]]'. + Property '0' is missing in type 'IArguments'. node_modules/adonis-framework/src/Route/resource.js(296,15): error TS2304: Cannot find name 'Mixed'. +node_modules/adonis-framework/src/Route/resource.js(314,62): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type 'any[]'. node_modules/adonis-framework/src/Server/helpers.js(17,29): error TS8024: JSDoc '@param' tag has name 'appNamespace', but there is no parameter with that name. node_modules/adonis-framework/src/Server/index.js(17,21): error TS2307: Cannot find module 'adonis-fold'. node_modules/adonis-framework/src/Server/index.js(54,21): error TS2554: Expected 4 arguments, but got 3. diff --git a/tests/baselines/reference/user/bluebird.log b/tests/baselines/reference/user/bluebird.log index 35d6d9ca05b..0c4d4ab75fd 100644 --- a/tests/baselines/reference/user/bluebird.log +++ b/tests/baselines/reference/user/bluebird.log @@ -20,6 +20,10 @@ node_modules/bluebird/js/release/debuggability.js(168,17): error TS2403: Subsequ node_modules/bluebird/js/release/debuggability.js(174,26): error TS2339: Property 'detail' does not exist on type 'Event'. node_modules/bluebird/js/release/debuggability.js(175,17): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any) | ((o: any, key: any, desc: any) => any)' has no compatible call signatures. node_modules/bluebird/js/release/debuggability.js(176,17): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((o: any, p: string | number | symbol, attributes: PropertyDescriptor & ThisType) => any) | ((o: any, key: any, desc: any) => any)' has no compatible call signatures. +node_modules/bluebird/js/release/debuggability.js(199,48): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '["removeListener", string, (...args: any[]) => void]'. + Property '0' is missing in type 'IArguments'. +node_modules/bluebird/js/release/debuggability.js(242,56): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type 'any[]'. + Property 'pop' is missing in type 'IArguments'. node_modules/bluebird/js/release/debuggability.js(491,19): error TS2350: Only a void function can be called with the 'new' keyword. node_modules/bluebird/js/release/debuggability.js(562,46): error TS2554: Expected 0 arguments, but got 1. node_modules/bluebird/js/release/debuggability.js(736,5): error TS2721: Cannot invoke an object which is possibly 'null'. @@ -50,6 +54,7 @@ node_modules/bluebird/js/release/map.js(111,23): error TS2339: Property '_values node_modules/bluebird/js/release/map.js(113,18): error TS2339: Property '_isResolved' does not exist on type 'MappingPromiseArray'. node_modules/bluebird/js/release/map.js(127,10): error TS2339: Property '_resolve' does not exist on type 'MappingPromiseArray'. node_modules/bluebird/js/release/map.js(156,66): error TS2339: Property 'promise' does not exist on type 'MappingPromiseArray'. +node_modules/bluebird/js/release/method.js(15,46): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type 'any[]'. node_modules/bluebird/js/release/nodeback.js(21,20): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type '((o: {}) => string[]) | ((o: any) => string[])' has no compatible call signatures. node_modules/bluebird/js/release/nodeify.js(32,19): error TS2339: Property 'cause' does not exist on type 'Error'. node_modules/bluebird/js/release/promise.js(4,12): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature. diff --git a/tests/baselines/reference/user/chrome-devtools-frontend.log b/tests/baselines/reference/user/chrome-devtools-frontend.log index 2936205dc19..2fcfcea49f0 100644 --- a/tests/baselines/reference/user/chrome-devtools-frontend.log +++ b/tests/baselines/reference/user/chrome-devtools-frontend.log @@ -11,8 +11,8 @@ Standard output: ../../../../built/local/lib.dom.d.ts(11899,13): error TS2300: Duplicate identifier 'Request'. ../../../../built/local/lib.dom.d.ts(16316,11): error TS2300: Duplicate identifier 'Window'. ../../../../built/local/lib.dom.d.ts(16447,13): error TS2300: Duplicate identifier 'Window'. -../../../../built/local/lib.es5.d.ts(1346,11): error TS2300: Duplicate identifier 'ArrayLike'. -../../../../built/local/lib.es5.d.ts(1382,6): error TS2300: Duplicate identifier 'Record'. +../../../../built/local/lib.es5.d.ts(1406,11): error TS2300: Duplicate identifier 'ArrayLike'. +../../../../built/local/lib.es5.d.ts(1442,6): error TS2300: Duplicate identifier 'Record'. ../../../../node_modules/@types/node/index.d.ts(150,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'module' must be of type '{}', but here has type 'NodeModule'. node_modules/chrome-devtools-frontend/front_end/Runtime.js(43,8): error TS2339: Property '_importScriptPathPrefix' does not exist on type 'Window'. node_modules/chrome-devtools-frontend/front_end/Runtime.js(95,28): error TS2339: Property 'response' does not exist on type 'EventTarget'. diff --git a/tests/baselines/reference/user/debug.log b/tests/baselines/reference/user/debug.log index dba95024e7c..da4e47f9207 100644 --- a/tests/baselines/reference/user/debug.log +++ b/tests/baselines/reference/user/debug.log @@ -41,6 +41,8 @@ node_modules/debug/dist/debug.js(733,74): error TS2339: Property 'process' does node_modules/debug/dist/debug.js(733,112): error TS2339: Property 'process' does not exist on type 'Window'. node_modules/debug/dist/debug.js(744,146): error TS2551: Property 'WebkitAppearance' does not exist on type 'CSSStyleDeclaration'. Did you mean 'webkitAppearance'? node_modules/debug/dist/debug.js(745,78): error TS2339: Property 'firebug' does not exist on type 'Console'. +node_modules/debug/dist/debug.js(799,156): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any?, ...any[]]'. + Property 'pop' is missing in type 'IArguments'. node_modules/debug/dist/debug.js(851,21): error TS2304: Cannot find name 'LocalStorage'. node_modules/debug/src/browser.js(3,100): error TS2539: Cannot assign to '_typeof' because it is not a variable. node_modules/debug/src/browser.js(3,165): error TS2539: Cannot assign to '_typeof' because it is not a variable. @@ -49,6 +51,7 @@ node_modules/debug/src/browser.js(34,66): error TS2339: Property 'process' does node_modules/debug/src/browser.js(34,104): error TS2339: Property 'process' does not exist on type 'Window'. node_modules/debug/src/browser.js(45,138): error TS2551: Property 'WebkitAppearance' does not exist on type 'CSSStyleDeclaration'. Did you mean 'webkitAppearance'? node_modules/debug/src/browser.js(46,70): error TS2339: Property 'firebug' does not exist on type 'Console'. +node_modules/debug/src/browser.js(100,148): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any?, ...any[]]'. node_modules/debug/src/browser.js(152,13): error TS2304: Cannot find name 'LocalStorage'. node_modules/debug/src/common.js(51,24): error TS2339: Property 'colors' does not exist on type '{ (namespace: string): Function; debug: any; default: any; coerce: (val: any) => any; disable: () => void; enable: (namespaces: string) => void; enabled: (name: string) => boolean; humanize: any; ... 4 more ...; selectColor: (namespace: string) => string | number; }'. node_modules/debug/src/common.js(51,60): error TS2339: Property 'colors' does not exist on type '{ (namespace: string): Function; debug: any; default: any; coerce: (val: any) => any; disable: () => void; enable: (namespaces: string) => void; enabled: (name: string) => boolean; humanize: any; ... 4 more ...; selectColor: (namespace: string) => string | number; }'. @@ -79,6 +82,8 @@ node_modules/debug/src/node.js(56,5): error TS2322: Type 'false' is not assignab node_modules/debug/src/node.js(58,5): error TS2322: Type 'null' is not assignable to type 'string | undefined'. node_modules/debug/src/node.js(60,5): error TS2322: Type 'number' is not assignable to type 'string | undefined'. node_modules/debug/src/node.js(71,108): error TS2339: Property 'fd' does not exist on type 'WriteStream'. +node_modules/debug/src/node.js(108,55): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any, ...any[]]'. + Property '0' is missing in type 'IArguments'. node_modules/debug/src/node.js(136,3): error TS2322: Type 'string | undefined' is not assignable to type 'string'. Type 'undefined' is not assignable to type 'string'. diff --git a/tests/baselines/reference/user/graceful-fs.log b/tests/baselines/reference/user/graceful-fs.log index a0721706f16..ef5a4e24f37 100644 --- a/tests/baselines/reference/user/graceful-fs.log +++ b/tests/baselines/reference/user/graceful-fs.log @@ -5,11 +5,18 @@ node_modules/graceful-fs/fs.js(17,38): error TS2345: Argument of type 'PropertyD Type 'undefined' is not assignable to type 'PropertyDescriptor & ThisType'. Type 'undefined' is not assignable to type 'PropertyDescriptor'. node_modules/graceful-fs/graceful-fs.js(12,3): error TS2322: Type '(msg: string, ...param: any[]) => void' is not assignable to type '() => void'. +node_modules/graceful-fs/graceful-fs.js(15,37): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any, ...any[]]'. + Property '0' is missing in type 'IArguments'. node_modules/graceful-fs/graceful-fs.js(22,5): error TS2554: Expected 0 arguments, but got 1. -node_modules/graceful-fs/graceful-fs.js(37,1): error TS2322: Type '(fd: any, cb: any) => any' is not assignable to type 'typeof close'. - Property '__promisify__' is missing in type '(fd: any, cb: any) => any'. +node_modules/graceful-fs/graceful-fs.js(37,1): error TS2322: Type '(fd: any, cb: any) => void' is not assignable to type 'typeof close'. + Property '__promisify__' is missing in type '(fd: any, cb: any) => void'. +node_modules/graceful-fs/graceful-fs.js(51,37): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[number]'. + Property '0' is missing in type 'IArguments'. node_modules/graceful-fs/graceful-fs.js(161,5): error TS2539: Cannot assign to 'ReadStream' because it is not a variable. node_modules/graceful-fs/graceful-fs.js(162,5): error TS2539: Cannot assign to 'WriteStream' because it is not a variable. +node_modules/graceful-fs/graceful-fs.js(180,68): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any?, any?, ...any[]]'. + Property 'pop' is missing in type 'IArguments'. +node_modules/graceful-fs/graceful-fs.js(203,70): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any?, any?, ...any[]]'. node_modules/graceful-fs/graceful-fs.js(252,3): error TS2554: Expected 0 arguments, but got 3. node_modules/graceful-fs/graceful-fs.js(259,5): error TS2554: Expected 0 arguments, but got 3. diff --git a/tests/baselines/reference/user/lodash.log b/tests/baselines/reference/user/lodash.log index 383dcf9fe6f..ff3d4e7cabf 100644 --- a/tests/baselines/reference/user/lodash.log +++ b/tests/baselines/reference/user/lodash.log @@ -41,6 +41,9 @@ node_modules/lodash/_baseFlatten.js(19,29): error TS2322: Type '(value: any) => node_modules/lodash/_baseFlatten.js(24,22): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'Boolean' has no compatible call signatures. node_modules/lodash/_baseFlatten.js(24,22): error TS2532: Object is possibly 'undefined'. node_modules/lodash/_baseFlatten.js(24,22): error TS2722: Cannot invoke an object which is possibly 'undefined'. +node_modules/lodash/_baseHas.js(16,56): error TS2345: Argument of type 'string | any[]' is not assignable to parameter of type 'string | number | symbol'. + Type 'any[]' is not assignable to type 'string | number | symbol'. + Type 'any[]' is not assignable to type 'symbol'. node_modules/lodash/_baseIntersection.js(53,40): error TS2345: Argument of type 'Function | undefined' is not assignable to parameter of type 'Function'. Type 'undefined' is not assignable to type 'Function'. node_modules/lodash/_baseIntersection.js(60,54): error TS2345: Argument of type 'Function | undefined' is not assignable to parameter of type 'Function'. @@ -126,6 +129,8 @@ node_modules/lodash/_createWrap.js(96,26): error TS2345: Argument of type 'Timer node_modules/lodash/_createWrap.js(97,100): error TS2532: Object is possibly 'undefined'. node_modules/lodash/_createWrap.js(98,28): error TS2345: Argument of type 'TimerHandler' is not assignable to parameter of type 'Function'. Type 'string' is not assignable to type 'Function'. +node_modules/lodash/_createWrap.js(100,44): error TS2345: Argument of type 'any[]' is not assignable to parameter of type '[TimerHandler, number, any?, (any[] | undefined)?, (any[] | undefined)?, (any[] | undefined)?, (any[] | undefined)?, (any[] | undefined)?, (number | undefined)?, (number | undefined)?]'. + Property '0' is missing in type 'any[]'. node_modules/lodash/_createWrap.js(103,51): error TS2345: Argument of type 'TimerHandler' is not assignable to parameter of type 'Function'. Type 'string' is not assignable to type 'Function'. node_modules/lodash/_customDefaultsMerge.js(22,35): error TS2345: Argument of type 'undefined' is not assignable to parameter of type 'number'. @@ -227,6 +232,9 @@ node_modules/lodash/core.js(2183,41): error TS8024: JSDoc '@param' tag has name node_modules/lodash/core.js(2473,21): error TS2554: Expected 0 arguments, but got 1. node_modules/lodash/core.js(2609,39): error TS2554: Expected 0 arguments, but got 1. node_modules/lodash/core.js(2644,12): error TS2554: Expected 3-5 arguments, but got 2. +node_modules/lodash/core.js(3245,58): error TS2345: Argument of type 'string | any[]' is not assignable to parameter of type 'string | number | symbol'. + Type 'any[]' is not assignable to type 'string | number | symbol'. + Type 'any[]' is not assignable to type 'symbol'. node_modules/lodash/core.js(3354,53): error TS2538: Type 'any[]' cannot be used as an index type. node_modules/lodash/core.js(3424,41): error TS2345: Argument of type 'Function' is not assignable to parameter of type '(substring: string, ...args: any[]) => string'. Type 'Function' provides no match for the signature '(substring: string, ...args: any[]): string'. diff --git a/tests/baselines/reference/user/npm.log b/tests/baselines/reference/user/npm.log index 231b400a980..3bdb3b1b9ec 100644 --- a/tests/baselines/reference/user/npm.log +++ b/tests/baselines/reference/user/npm.log @@ -29,6 +29,8 @@ node_modules/npm/bin/npm-cli.js(128,13): error TS2339: Property 'command' does n node_modules/npm/bin/npm-cli.js(132,17): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/bin/npm-cli.js(134,17): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/bin/npm-cli.js(136,17): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/bin/npm-cli.js(140,32): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any?]'. + Property 'pop' is missing in type 'IArguments'. node_modules/npm/html/static/toc.js(3,40): error TS2531: Object is possibly 'null'. node_modules/npm/lib/access.js(58,46): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/access.js(65,18): error TS2339: Property 'registry' does not exist on type 'typeof EventEmitter'. @@ -58,7 +60,10 @@ node_modules/npm/lib/auth/legacy.js(12,30): error TS2339: Property 'config' does node_modules/npm/lib/auth/legacy.js(35,16): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/auth/legacy.js(69,33): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/auth/oauth.js(5,7): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/auth/oauth.js(6,29): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any?, any?, any?, any?]'. + Property 'pop' is missing in type 'IArguments'. node_modules/npm/lib/auth/saml.js(5,7): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/auth/saml.js(6,29): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any?, any?, any?, any?]'. node_modules/npm/lib/auth/sso.js(7,21): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/auth/sso.js(20,7): error TS2339: Property 'registry' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/auth/sso.js(28,36): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. @@ -147,6 +152,8 @@ node_modules/npm/lib/config/core.js(333,10): error TS2339: Property 'emit' does node_modules/npm/lib/config/core.js(409,29): error TS2345: Argument of type '(orig: string, esc: any, name: any) => string | undefined' is not assignable to parameter of type '(substring: string, ...args: any[]) => string'. Type 'string | undefined' is not assignable to type 'string'. Type 'undefined' is not assignable to type 'string'. +node_modules/npm/lib/config/defaults.js(20,52): error TS2345: Argument of type 'never[]' is not assignable to parameter of type '[any, ...any[]]'. + Property '0' is missing in type 'never[]'. node_modules/npm/lib/config/gentle-fs.js(16,11): error TS2339: Property 'prefix' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/config/gentle-fs.js(17,11): error TS2339: Property 'globalPrefix' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/config/gentle-fs.js(18,11): error TS2339: Property 'dir' does not exist on type 'typeof EventEmitter'. @@ -430,8 +437,8 @@ node_modules/npm/lib/install.js(268,26): error TS2339: Property 'config' does no node_modules/npm/lib/install.js(269,9): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/install.js(272,11): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/install.js(273,7): error TS2532: Object is possibly 'undefined'. -node_modules/npm/lib/install.js(273,7): error TS2684: The 'this' context of type '((err: any, ...args: any[]) => any) | undefined' is not assignable to method's 'this' of type 'Function'. - Type 'undefined' is not assignable to type 'Function'. +node_modules/npm/lib/install.js(273,7): error TS2684: The 'this' context of type '((err: any, ...args: any[]) => any) | undefined' is not assignable to method's 'this' of type '(this: null, err?: any, ...args: any[]) => any'. + Type 'undefined' is not assignable to type '(this: null, err?: any, ...args: any[]) => any'. node_modules/npm/lib/install.js(340,25): error TS2339: Property 'failing' does not exist on type 'Installer'. node_modules/npm/lib/install.js(369,18): error TS2345: Argument of type '"time"' is not assignable to parameter of type 'Signals'. node_modules/npm/lib/install.js(376,16): error TS2345: Argument of type '"timeEnd"' is not assignable to parameter of type 'Signals'. @@ -837,6 +844,8 @@ node_modules/npm/lib/utils/metrics.js(61,31): error TS2345: Argument of type 'Bu node_modules/npm/lib/utils/metrics.js(62,7): error TS2339: Property 'load' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/utils/metrics.js(64,9): error TS2339: Property 'registry' does not exist on type 'typeof EventEmitter'. node_modules/npm/lib/utils/metrics.js(65,9): error TS2339: Property 'registry' does not exist on type 'typeof EventEmitter'. +node_modules/npm/lib/utils/output.js(6,30): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any?, ...any[]]'. + Property 'pop' is missing in type 'IArguments'. node_modules/npm/lib/utils/perf.js(9,12): error TS2345: Argument of type '"time"' is not assignable to parameter of type 'Signals'. node_modules/npm/lib/utils/perf.js(10,12): error TS2345: Argument of type '"timeEnd"' is not assignable to parameter of type 'Signals'. node_modules/npm/lib/utils/read-local-package.js(7,11): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. @@ -909,6 +918,8 @@ node_modules/npm/test/broken-under-nyc-and-travis/whoami.js(7,20): error TS2307: node_modules/npm/test/common-tap.js(5,47): error TS2339: Property '_extend' does not exist on type 'typeof import("util")'. node_modules/npm/test/common-tap.js(10,3): error TS2322: Type '(...args: any[]) => void' is not assignable to type 'typeof setImmediate'. Property '__promisify__' is missing in type '(...args: any[]) => void'. +node_modules/npm/test/common-tap.js(12,28): error TS2345: Argument of type 'any[]' is not assignable to parameter of type '[(...args: any[]) => void, number, ...any[]]'. + Property '0' is missing in type 'any[]'. node_modules/npm/test/common-tap.js(175,17): error TS2339: Property '_storage' does not exist on type 'Environment'. node_modules/npm/test/common-tap.js(181,31): error TS2339: Property '_storage' does not exist on type 'Environment'. node_modules/npm/test/common-tap.js(192,12): error TS2339: Property '_storage' does not exist on type 'Environment'. @@ -927,6 +938,8 @@ node_modules/npm/test/need-npm5-update/legacy-dir-bin.js(2,20): error TS2307: Ca node_modules/npm/test/need-npm5-update/legacy-dir-bin.js(11,21): error TS2307: Cannot find module 'tacks'. node_modules/npm/test/need-npm5-update/legacy-npm-self-install.js(2,20): error TS2307: Cannot find module 'tap'. node_modules/npm/test/need-npm5-update/legacy-npm-self-install.js(12,47): error TS2339: Property '_extend' does not exist on type 'typeof import("util")'. +node_modules/npm/test/need-npm5-update/legacy-npm-self-install.js(34,42): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type 'string[]'. + Property 'pop' is missing in type 'IArguments'. node_modules/npm/test/need-npm5-update/legacy-npm-self-install.js(48,3): error TS2322: Type 'null' is not assignable to type 'string | undefined'. node_modules/npm/test/need-npm5-update/legacy-npm-self-install.js(49,3): error TS2322: Type 'null' is not assignable to type 'string | undefined'. node_modules/npm/test/need-npm5-update/legacy-optional-deps.js(4,20): error TS2307: Cannot find module 'tap'. @@ -936,6 +949,7 @@ node_modules/npm/test/need-npm5-update/legacy-shrinkwrap.js(2,20): error TS2307: node_modules/npm/test/need-npm5-update/legacy-shrinkwrap.js(6,21): error TS2307: Cannot find module 'tacks'. node_modules/npm/test/need-npm5-update/lifecycle-signal.js(8,20): error TS2307: Cannot find module 'tap'. node_modules/npm/test/need-npm5-update/move-no-clobber-dest-node-modules.js(3,20): error TS2307: Cannot find module 'tap'. +node_modules/npm/test/need-npm5-update/move-no-clobber-dest-node-modules.js(11,48): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type 'string[]'. node_modules/npm/test/need-npm5-update/need-only-update-save-optional/update-save.js(5,18): error TS2307: Cannot find module 'npm-registry-mock'. node_modules/npm/test/need-npm5-update/need-only-update-save-optional/update-save.js(8,20): error TS2307: Cannot find module 'tap'. node_modules/npm/test/need-npm5-update/need-only-update-save-optional/update-save.js(10,22): error TS2307: Cannot find module '../common-tap.js'. @@ -1436,6 +1450,8 @@ node_modules/npm/test/tap/outdated-json.js(5,18): error TS2307: Cannot find modu node_modules/npm/test/tap/outdated-json.js(8,20): error TS2307: Cannot find module 'tap'. node_modules/npm/test/tap/outdated-long.js(5,18): error TS2307: Cannot find module 'npm-registry-mock'. node_modules/npm/test/tap/outdated-long.js(7,20): error TS2307: Cannot find module 'tap'. +node_modules/npm/test/tap/outdated-long.js(63,31): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type 'any[]'. + Property 'pop' is missing in type 'IArguments'. node_modules/npm/test/tap/outdated-long.js(66,9): error TS2339: Property 'load' does not exist on type 'typeof EventEmitter'. node_modules/npm/test/tap/outdated-long.js(74,13): error TS2339: Property 'install' does not exist on type 'typeof EventEmitter'. node_modules/npm/test/tap/outdated-long.js(76,15): error TS2339: Property 'config' does not exist on type 'typeof EventEmitter'. @@ -1444,6 +1460,7 @@ node_modules/npm/test/tap/outdated.js(5,18): error TS2307: Cannot find module 'n node_modules/npm/test/tap/outdated.js(7,20): error TS2307: Cannot find module 'tap'. node_modules/npm/test/tap/outdated.js(92,9): error TS2339: Property 'load' does not exist on type 'typeof EventEmitter'. node_modules/npm/test/tap/outdated.js(100,13): error TS2339: Property 'install' does not exist on type 'typeof EventEmitter'. +node_modules/npm/test/tap/outdated.js(103,39): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type 'any[]'. node_modules/npm/test/tap/outdated.js(105,15): error TS2339: Property 'outdated' does not exist on type 'typeof EventEmitter'. node_modules/npm/test/tap/override-bundled.js(3,20): error TS2307: Cannot find module 'tap'. node_modules/npm/test/tap/owner.js(1,18): error TS2307: Cannot find module 'npm-registry-mock'. diff --git a/tests/baselines/reference/user/npmlog.log b/tests/baselines/reference/user/npmlog.log index cdd163fa0f1..c9662cd1551 100644 --- a/tests/baselines/reference/user/npmlog.log +++ b/tests/baselines/reference/user/npmlog.log @@ -4,6 +4,8 @@ node_modules/npmlog/log.js(83,12): error TS2551: Property '_pause' does not exis node_modules/npmlog/log.js(149,8): error TS2551: Property '_paused' does not exist on type 'typeof EventEmitter'. Did you mean 'pause'? node_modules/npmlog/log.js(154,13): error TS2551: Property '_paused' does not exist on type 'typeof EventEmitter'. Did you mean 'pause'? node_modules/npmlog/log.js(155,8): error TS2551: Property '_paused' does not exist on type 'typeof EventEmitter'. Did you mean 'pause'? +node_modules/npmlog/log.js(194,37): error TS2345: Argument of type 'any[]' is not assignable to parameter of type '[any, ...any[]]'. + Property '0' is missing in type 'any[]'. node_modules/npmlog/log.js(218,12): error TS2551: Property '_paused' does not exist on type 'typeof EventEmitter'. Did you mean 'pause'? node_modules/npmlog/log.js(271,16): error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'. Type 'undefined' is not assignable to type 'string'. diff --git a/tests/baselines/reference/user/prettier.log b/tests/baselines/reference/user/prettier.log index 0fd19e0d9a7..ae8f5cee3f1 100644 --- a/tests/baselines/reference/user/prettier.log +++ b/tests/baselines/reference/user/prettier.log @@ -6,6 +6,9 @@ src/cli/util.js(262,64): error TS2339: Property 'length' does not exist on type src/cli/util.js(335,52): error TS2339: Property 'length' does not exist on type 'Ignore'. src/cli/util.js(396,46): error TS2345: Argument of type 'null' is not assignable to parameter of type 'number | undefined'. src/cli/util.js(403,39): error TS2339: Property 'grey' does not exist on type 'typeof import("../../../node_modules/chalk/types/index")'. +src/cli/util.js(454,16): error TS2339: Property 'type' does not exist on type 'never'. +src/cli/util.js(455,16): error TS2339: Property 'oppositeDescription' does not exist on type 'never'. +src/cli/util.js(456,17): error TS2339: Property 'name' does not exist on type 'never'. src/common/parser-create-error.js(8,9): error TS2339: Property 'loc' does not exist on type 'SyntaxError'. src/config/resolve-config.js(75,32): error TS2345: Argument of type '{ sync: false; }' is not assignable to parameter of type '{ cache: boolean; sync: boolean; }'. Property 'cache' is missing in type '{ sync: false; }'. @@ -14,6 +17,8 @@ src/config/resolve-config.js(82,32): error TS2345: Argument of type '{ sync: tru src/doc/doc-printer.js(213,17): error TS2532: Object is possibly 'undefined'. src/doc/doc-printer.js(214,18): error TS2532: Object is possibly 'undefined'. src/doc/doc-printer.js(215,17): error TS2532: Object is possibly 'undefined'. +src/doc/doc-printer.js(447,37): error TS2345: Argument of type 'any[][]' is not assignable to parameter of type 'never[]'. + Type 'any[]' is not assignable to type 'never'. src/language-css/clean.js(3,30): error TS2307: Cannot find module 'html-tag-names'. src/language-css/parser-postcss.js(78,32): error TS2345: Argument of type '{ groups: never[]; type: string; }' is not assignable to parameter of type 'never'. src/language-css/parser-postcss.js(88,30): error TS2345: Argument of type '{ open: null; close: null; groups: never[]; type: string; }' is not assignable to parameter of type 'never'. diff --git a/tests/baselines/reference/user/uglify-js.log b/tests/baselines/reference/user/uglify-js.log index edb65213e6e..5bd01b81213 100644 --- a/tests/baselines/reference/user/uglify-js.log +++ b/tests/baselines/reference/user/uglify-js.log @@ -22,7 +22,11 @@ node_modules/uglify-js/lib/compress.js(1316,38): error TS2554: Expected 0 argume node_modules/uglify-js/lib/compress.js(1411,38): error TS2339: Property 'parent' does not exist on type 'TreeTransformer'. node_modules/uglify-js/lib/compress.js(1519,27): error TS2554: Expected 0 arguments, but got 1. node_modules/uglify-js/lib/compress.js(1551,26): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(1652,49): error TS2345: Argument of type 'number[]' is not assignable to parameter of type '[number, number, ...never[]]'. + Property '0' is missing in type 'number[]'. node_modules/uglify-js/lib/compress.js(1975,44): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(2013,53): error TS2345: Argument of type 'any[]' is not assignable to parameter of type '[number, number, ...never[]]'. + Property '0' is missing in type 'any[]'. node_modules/uglify-js/lib/compress.js(2161,19): error TS2554: Expected 0 arguments, but got 1. node_modules/uglify-js/lib/compress.js(3214,23): error TS2554: Expected 0 arguments, but got 1. node_modules/uglify-js/lib/compress.js(3227,33): error TS2322: Type '"f"' is not assignable to type 'boolean'. @@ -39,6 +43,8 @@ node_modules/uglify-js/lib/compress.js(3988,30): error TS2554: Expected 0 argume node_modules/uglify-js/lib/compress.js(4097,18): error TS2554: Expected 0 arguments, but got 1. node_modules/uglify-js/lib/compress.js(4396,17): error TS2403: Subsequent variable declarations must have the same type. Variable 'body' must be of type 'any[]', but here has type 'any'. node_modules/uglify-js/lib/compress.js(4480,22): error TS2554: Expected 0 arguments, but got 1. +node_modules/uglify-js/lib/compress.js(4672,57): error TS2345: Argument of type 'any[]' is not assignable to parameter of type '[RegExp, (string | undefined)?]'. + Property '0' is missing in type 'any[]'. node_modules/uglify-js/lib/compress.js(4830,30): error TS2554: Expected 0 arguments, but got 1. node_modules/uglify-js/lib/compress.js(4837,25): error TS2403: Subsequent variable declarations must have the same type. Variable 'code' must be of type 'string', but here has type '{ get: () => string; toString: () => string; indent: () => void; indentation: () => number; current_width: () => number; should_break: () => boolean; has_parens: () => boolean; newline: () => void; print: (str: any) => void; ... 24 more ...; parent: (n: any) => any; }'. node_modules/uglify-js/lib/compress.js(4841,36): error TS2532: Object is possibly 'undefined'. @@ -104,6 +110,9 @@ node_modules/uglify-js/lib/sourcemap.js(55,25): error TS2304: Cannot find name ' node_modules/uglify-js/lib/sourcemap.js(61,23): error TS2304: Cannot find name 'MOZ_SourceMap'. node_modules/uglify-js/tools/exit.js(7,32): error TS2339: Property 'bufferSize' does not exist on type 'WriteStream'. node_modules/uglify-js/tools/exit.js(7,61): error TS2339: Property 'bufferSize' does not exist on type 'WriteStream'. +node_modules/uglify-js/tools/exit.js(10,37): error TS2345: Argument of type 'any[]' is not assignable to parameter of type '[(number | undefined)?]'. + Types of property 'length' are incompatible. + Type 'number' is not assignable to type '0 | 1'. node_modules/uglify-js/tools/node.js(64,26): error TS2339: Property 'minify' does not exist on type 'typeof import("/uglify-js/node_modules/uglify-js/tools/node")'. diff --git a/tests/baselines/reference/user/util.log b/tests/baselines/reference/user/util.log index 743d8d5e332..6440d2f326b 100644 --- a/tests/baselines/reference/user/util.log +++ b/tests/baselines/reference/user/util.log @@ -8,6 +8,9 @@ node_modules/util/util.js(55,20): error TS2555: Expected at least 2 arguments, b node_modules/util/util.js(73,15): error TS2339: Property 'noDeprecation' does not exist on type 'Process'. node_modules/util/util.js(80,19): error TS2339: Property 'throwDeprecation' does not exist on type 'Process'. node_modules/util/util.js(82,26): error TS2339: Property 'traceDeprecation' does not exist on type 'Process'. +node_modules/util/util.js(106,49): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any?, ...any[]]'. +node_modules/util/util.js(553,69): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any?, ...any[]]'. + Property 'pop' is missing in type 'IArguments'. From e1fd0ea53e9f0f0bbcdb0d19d1745d58a29fc70e Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Tue, 25 Sep 2018 16:48:03 -0400 Subject: [PATCH 47/71] Bump version to 3.2. --- package.json | 2 +- src/compiler/core.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 159788e697f..5a8ad595806 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "typescript", "author": "Microsoft Corp.", "homepage": "http://typescriptlang.org/", - "version": "3.1.0", + "version": "3.2.0", "license": "Apache-2.0", "description": "TypeScript is a language for application scale JavaScript development", "keywords": [ diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 22fc19bcc8a..db18d8c9551 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -1,7 +1,7 @@ namespace ts { // WARNING: The script `configureNightly.ts` uses a regexp to parse out these values. // If changing the text in this section, be sure to test `configureNightly` too. - export const versionMajorMinor = "3.1"; + export const versionMajorMinor = "3.2"; /** The version of the TypeScript compiler release */ export const version = `${versionMajorMinor}.0-dev`; } From b065902a99dd6d30c270a374909402aa3f0003e3 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 25 Sep 2018 16:11:16 -0700 Subject: [PATCH 48/71] Update API baselines (#27349) --- tests/baselines/reference/api/tsserverlibrary.d.ts | 2 +- tests/baselines/reference/api/typescript.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 39b223fef72..b71b3c90137 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -14,7 +14,7 @@ and limitations under the License. ***************************************************************************** */ declare namespace ts { - const versionMajorMinor = "3.1"; + const versionMajorMinor = "3.2"; /** The version of the TypeScript compiler release */ const version: string; } diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 2bae7734cdc..3a442e7f19c 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -14,7 +14,7 @@ and limitations under the License. ***************************************************************************** */ declare namespace ts { - const versionMajorMinor = "3.1"; + const versionMajorMinor = "3.2"; /** The version of the TypeScript compiler release */ const version: string; } From 5e551180764bdab714b55633d7a6ab0fd4da92e6 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 25 Sep 2018 18:07:51 -0700 Subject: [PATCH 49/71] Only make contravariant inferences from pure contravariant positions --- src/compiler/checker.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d7c86a59055..f3201ecf8af 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1,3 +1,6 @@ + + + /* @internal */ namespace ts { const ambientModuleSymbolRegex = /^".+"$/; @@ -13460,6 +13463,7 @@ namespace ts { let symbolStack: Symbol[]; let visited: Map; let contravariant = false; + let bivariant = false; let propagationType: Type; let allowComplexConstraintInference = true; inferFromTypes(originalSource, originalTarget); @@ -13546,7 +13550,9 @@ namespace ts { } if (priority === inference.priority) { const candidate = propagationType || source; - if (contravariant) { + // We make contravariant inferences only if we are in a pure contravariant position, + // i.e. only if we have not descended into a bivariant position. + if (contravariant && !bivariant) { inference.contraCandidates = append(inference.contraCandidates, candidate); } else { @@ -13798,7 +13804,12 @@ namespace ts { function inferFromSignature(source: Signature, target: Signature, skipParameters: boolean) { if (!skipParameters) { + const saveBivariant = bivariant; + const kind = target.declaration ? target.declaration.kind : SyntaxKind.Unknown; + // Once we descend into a bivariant signature we remain bivariant for all nested inferences + bivariant = bivariant || kind === SyntaxKind.MethodDeclaration || kind === SyntaxKind.MethodSignature || kind === SyntaxKind.Constructor; forEachMatchingParameterType(source, target, inferFromContravariantTypes); + bivariant = saveBivariant; } const sourceTypePredicate = getTypePredicateOfSignature(source); const targetTypePredicate = getTypePredicateOfSignature(target); From 4bb5cfb9bb1b371c09b08b151bb50522537726b9 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 25 Sep 2018 18:17:21 -0700 Subject: [PATCH 50/71] Add regression test --- .../typeInference/bivariantInferences.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/cases/conformance/types/typeRelationships/typeInference/bivariantInferences.ts diff --git a/tests/cases/conformance/types/typeRelationships/typeInference/bivariantInferences.ts b/tests/cases/conformance/types/typeRelationships/typeInference/bivariantInferences.ts new file mode 100644 index 00000000000..c0e2ee497d0 --- /dev/null +++ b/tests/cases/conformance/types/typeRelationships/typeInference/bivariantInferences.ts @@ -0,0 +1,12 @@ +// @strict: true + +// Repro from #27337 + +interface Array { + equalsShallow(this: ReadonlyArray, other: ReadonlyArray): boolean; +} + +declare const a: (string | number)[] | null[] | undefined[] | {}[]; +declare const b: (string | number)[] | null[] | undefined[] | {}[]; + +let x = a.equalsShallow(b); From 272157185f29e8ec94973cdd4f2e38155c175181 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 25 Sep 2018 18:17:30 -0700 Subject: [PATCH 51/71] Accept new baselines --- .../reference/bivariantInferences.js | 17 ++++++++++ .../reference/bivariantInferences.symbols | 31 +++++++++++++++++++ .../reference/bivariantInferences.types | 26 ++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 tests/baselines/reference/bivariantInferences.js create mode 100644 tests/baselines/reference/bivariantInferences.symbols create mode 100644 tests/baselines/reference/bivariantInferences.types diff --git a/tests/baselines/reference/bivariantInferences.js b/tests/baselines/reference/bivariantInferences.js new file mode 100644 index 00000000000..a910ca15e93 --- /dev/null +++ b/tests/baselines/reference/bivariantInferences.js @@ -0,0 +1,17 @@ +//// [bivariantInferences.ts] +// Repro from #27337 + +interface Array { + equalsShallow(this: ReadonlyArray, other: ReadonlyArray): boolean; +} + +declare const a: (string | number)[] | null[] | undefined[] | {}[]; +declare const b: (string | number)[] | null[] | undefined[] | {}[]; + +let x = a.equalsShallow(b); + + +//// [bivariantInferences.js] +"use strict"; +// Repro from #27337 +var x = a.equalsShallow(b); diff --git a/tests/baselines/reference/bivariantInferences.symbols b/tests/baselines/reference/bivariantInferences.symbols new file mode 100644 index 00000000000..63cc239f040 --- /dev/null +++ b/tests/baselines/reference/bivariantInferences.symbols @@ -0,0 +1,31 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/bivariantInferences.ts === +// Repro from #27337 + +interface Array { +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(bivariantInferences.ts, 0, 0)) +>T : Symbol(T, Decl(lib.es5.d.ts, --, --), Decl(bivariantInferences.ts, 2, 16)) + + equalsShallow(this: ReadonlyArray, other: ReadonlyArray): boolean; +>equalsShallow : Symbol(Array.equalsShallow, Decl(bivariantInferences.ts, 2, 20)) +>T : Symbol(T, Decl(bivariantInferences.ts, 3, 18)) +>this : Symbol(this, Decl(bivariantInferences.ts, 3, 21)) +>ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(bivariantInferences.ts, 3, 18)) +>other : Symbol(other, Decl(bivariantInferences.ts, 3, 44)) +>ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --)) +>T : Symbol(T, Decl(bivariantInferences.ts, 3, 18)) +} + +declare const a: (string | number)[] | null[] | undefined[] | {}[]; +>a : Symbol(a, Decl(bivariantInferences.ts, 6, 13)) + +declare const b: (string | number)[] | null[] | undefined[] | {}[]; +>b : Symbol(b, Decl(bivariantInferences.ts, 7, 13)) + +let x = a.equalsShallow(b); +>x : Symbol(x, Decl(bivariantInferences.ts, 9, 3)) +>a.equalsShallow : Symbol(equalsShallow, Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20)) +>a : Symbol(a, Decl(bivariantInferences.ts, 6, 13)) +>equalsShallow : Symbol(equalsShallow, Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20), Decl(bivariantInferences.ts, 2, 20)) +>b : Symbol(b, Decl(bivariantInferences.ts, 7, 13)) + diff --git a/tests/baselines/reference/bivariantInferences.types b/tests/baselines/reference/bivariantInferences.types new file mode 100644 index 00000000000..e9bf31dad8e --- /dev/null +++ b/tests/baselines/reference/bivariantInferences.types @@ -0,0 +1,26 @@ +=== tests/cases/conformance/types/typeRelationships/typeInference/bivariantInferences.ts === +// Repro from #27337 + +interface Array { + equalsShallow(this: ReadonlyArray, other: ReadonlyArray): boolean; +>equalsShallow : (this: ReadonlyArray, other: ReadonlyArray) => boolean +>this : ReadonlyArray +>other : ReadonlyArray +} + +declare const a: (string | number)[] | null[] | undefined[] | {}[]; +>a : (string | number)[] | null[] | undefined[] | {}[] +>null : null + +declare const b: (string | number)[] | null[] | undefined[] | {}[]; +>b : (string | number)[] | null[] | undefined[] | {}[] +>null : null + +let x = a.equalsShallow(b); +>x : boolean +>a.equalsShallow(b) : boolean +>a.equalsShallow : ((this: ReadonlyArray, other: ReadonlyArray) => boolean) | ((this: ReadonlyArray, other: ReadonlyArray) => boolean) | ((this: ReadonlyArray, other: ReadonlyArray) => boolean) | ((this: ReadonlyArray, other: ReadonlyArray) => boolean) +>a : (string | number)[] | null[] | undefined[] | {}[] +>equalsShallow : ((this: ReadonlyArray, other: ReadonlyArray) => boolean) | ((this: ReadonlyArray, other: ReadonlyArray) => boolean) | ((this: ReadonlyArray, other: ReadonlyArray) => boolean) | ((this: ReadonlyArray, other: ReadonlyArray) => boolean) +>b : (string | number)[] | null[] | undefined[] | {}[] + From f59229bf22098462cae5bb94778f0a47b4aaedff Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 26 Sep 2018 06:54:37 -0700 Subject: [PATCH 52/71] Only add unique inferences to candidate arrays --- src/compiler/checker.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f3201ecf8af..ef367e86405 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1,6 +1,3 @@ - - - /* @internal */ namespace ts { const ambientModuleSymbolRegex = /^".+"$/; @@ -13553,10 +13550,10 @@ namespace ts { // We make contravariant inferences only if we are in a pure contravariant position, // i.e. only if we have not descended into a bivariant position. if (contravariant && !bivariant) { - inference.contraCandidates = append(inference.contraCandidates, candidate); + inference.contraCandidates = appendIfUnique(inference.contraCandidates, candidate); } else { - inference.candidates = append(inference.candidates, candidate); + inference.candidates = appendIfUnique(inference.candidates, candidate); } } if (!(priority & InferencePriority.ReturnType) && target.flags & TypeFlags.TypeParameter && !isTypeParameterAtTopLevel(originalTarget, target)) { From 4fac5f26dc2ff95ba2e3f10cc048c4d3682f3971 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Wed, 26 Sep 2018 09:05:18 -0700 Subject: [PATCH 53/71] Fix crash in use-before-def checking of enum tag (#27350) (#27354) --- src/compiler/checker.ts | 4 +++- .../reference/enumTagUseBeforeDefCrash.symbols | 13 +++++++++++++ .../reference/enumTagUseBeforeDefCrash.types | 14 ++++++++++++++ .../conformance/jsdoc/enumTagUseBeforeDefCrash.ts | 13 +++++++++++++ 4 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/enumTagUseBeforeDefCrash.symbols create mode 100644 tests/baselines/reference/enumTagUseBeforeDefCrash.types create mode 100644 tests/cases/conformance/jsdoc/enumTagUseBeforeDefCrash.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d7c86a59055..a000bf1f7a7 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -1711,7 +1711,9 @@ namespace ts { function checkResolvedBlockScopedVariable(result: Symbol, errorLocation: Node): void { Debug.assert(!!(result.flags & SymbolFlags.BlockScopedVariable || result.flags & SymbolFlags.Class || result.flags & SymbolFlags.Enum)); // Block-scoped variables cannot be used before their definition - const declaration = forEach(result.declarations, d => isBlockOrCatchScoped(d) || isClassLike(d) || (d.kind === SyntaxKind.EnumDeclaration) ? d : undefined); + const declaration = find( + result.declarations, + d => isBlockOrCatchScoped(d) || isClassLike(d) || (d.kind === SyntaxKind.EnumDeclaration) || isInJSFile(d) && !!getJSDocEnumTag(d)); if (declaration === undefined) return Debug.fail("Declaration to checkResolvedBlockScopedVariable is undefined"); diff --git a/tests/baselines/reference/enumTagUseBeforeDefCrash.symbols b/tests/baselines/reference/enumTagUseBeforeDefCrash.symbols new file mode 100644 index 00000000000..1cef96a9823 --- /dev/null +++ b/tests/baselines/reference/enumTagUseBeforeDefCrash.symbols @@ -0,0 +1,13 @@ +=== tests/cases/conformance/jsdoc/bug27134.js === +/** + * @enum {number} + */ +var foo = { }; +>foo : Symbol(foo, Decl(bug27134.js, 3, 3)) + +/** + * @type {foo} + */ +var s; +>s : Symbol(s, Decl(bug27134.js, 8, 3)) + diff --git a/tests/baselines/reference/enumTagUseBeforeDefCrash.types b/tests/baselines/reference/enumTagUseBeforeDefCrash.types new file mode 100644 index 00000000000..159781fee05 --- /dev/null +++ b/tests/baselines/reference/enumTagUseBeforeDefCrash.types @@ -0,0 +1,14 @@ +=== tests/cases/conformance/jsdoc/bug27134.js === +/** + * @enum {number} + */ +var foo = { }; +>foo : typeof foo +>{ } : {} + +/** + * @type {foo} + */ +var s; +>s : number + diff --git a/tests/cases/conformance/jsdoc/enumTagUseBeforeDefCrash.ts b/tests/cases/conformance/jsdoc/enumTagUseBeforeDefCrash.ts new file mode 100644 index 00000000000..f8f92b7bcc1 --- /dev/null +++ b/tests/cases/conformance/jsdoc/enumTagUseBeforeDefCrash.ts @@ -0,0 +1,13 @@ +// @noEmit: true +// @allowJs: true +// @checkJs: true +// @Filename: bug27134.js +/** + * @enum {number} + */ +var foo = { }; + +/** + * @type {foo} + */ +var s; From 1b880f8ad445c778911a71b8cdec94ae885299bf Mon Sep 17 00:00:00 2001 From: Jordi Oliveras Rovira Date: Wed, 26 Sep 2018 18:38:37 +0200 Subject: [PATCH 54/71] Update bug report issue template TypeScript version to 3.2. (#27361) --- .github/ISSUE_TEMPLATE/Bug_report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md index fe94434490c..6add1cccb58 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.md +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -16,7 +16,7 @@ Please fill in the *entire* template below. --> -**TypeScript Version:** 3.1.0-dev.201xxxxx +**TypeScript Version:** 3.2.0-dev.201xxxxx **Search Terms:** From d4d947e48854563fd11ce5388d823d64ac005391 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 26 Sep 2018 11:22:08 -0700 Subject: [PATCH 55/71] Fix bug: Allow completions after '@' with no contextToken (#27325) --- src/services/completions.ts | 12 ++++++------ tests/cases/fourslash/completionsTriggerCharacter.ts | 2 ++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/services/completions.ts b/src/services/completions.ts index 7744186126a..8164a35f4f1 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -43,7 +43,7 @@ namespace ts.Completions { } const contextToken = findPrecedingToken(position, sourceFile); - if (triggerCharacter && (!contextToken || !isValidTrigger(sourceFile, triggerCharacter, contextToken, position))) return undefined; + if (triggerCharacter && !isValidTrigger(sourceFile, triggerCharacter, contextToken, position)) return undefined; if (isInString(sourceFile, position, contextToken)) { return !contextToken || !isStringLiteralLike(contextToken) @@ -2272,7 +2272,7 @@ namespace ts.Completions { return !!type.getStringIndexType() || !!type.getNumberIndexType(); } - function isValidTrigger(sourceFile: SourceFile, triggerCharacter: CompletionsTriggerCharacter, contextToken: Node, position: number): boolean { + function isValidTrigger(sourceFile: SourceFile, triggerCharacter: CompletionsTriggerCharacter, contextToken: Node | undefined, position: number): boolean { switch (triggerCharacter) { case ".": case "@": @@ -2281,14 +2281,14 @@ namespace ts.Completions { case "'": case "`": // Only automatically bring up completions if this is an opening quote. - return isStringLiteralOrTemplate(contextToken) && position === contextToken.getStart(sourceFile) + 1; + return !!contextToken && isStringLiteralOrTemplate(contextToken) && position === contextToken.getStart(sourceFile) + 1; case "<": // Opening JSX tag - return contextToken.kind === SyntaxKind.LessThanToken && (!isBinaryExpression(contextToken.parent) || binaryExpressionMayBeOpenTag(contextToken.parent)); + return !!contextToken && contextToken.kind === SyntaxKind.LessThanToken && (!isBinaryExpression(contextToken.parent) || binaryExpressionMayBeOpenTag(contextToken.parent)); case "/": - return isStringLiteralLike(contextToken) + return !!contextToken && (isStringLiteralLike(contextToken) ? !!tryGetImportFromModuleSpecifier(contextToken) - : contextToken.kind === SyntaxKind.SlashToken && isJsxClosingElement(contextToken.parent); + : contextToken.kind === SyntaxKind.SlashToken && isJsxClosingElement(contextToken.parent)); default: return Debug.assertNever(triggerCharacter); } diff --git a/tests/cases/fourslash/completionsTriggerCharacter.ts b/tests/cases/fourslash/completionsTriggerCharacter.ts index a58ff2edc5f..ad3d633371f 100644 --- a/tests/cases/fourslash/completionsTriggerCharacter.ts +++ b/tests/cases/fourslash/completionsTriggerCharacter.ts @@ -2,6 +2,7 @@ // @jsx: preserve +/////** @/*tag*/ */ ////// Date: Wed, 26 Sep 2018 11:22:27 -0700 Subject: [PATCH 56/71] Support completions after 'async' in object literal (#27250) --- src/services/completions.ts | 6 +++++- .../cases/fourslash/completionsAfterAsyncInObjectLiteral.ts | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 tests/cases/fourslash/completionsAfterAsyncInObjectLiteral.ts diff --git a/src/services/completions.ts b/src/services/completions.ts index 8164a35f4f1..30331746d10 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -1713,6 +1713,9 @@ namespace ts.Completions { break; case SyntaxKind.AsteriskToken: return isMethodDeclaration(parent) ? tryCast(parent.parent, isObjectLiteralExpression) : undefined; + case SyntaxKind.Identifier: + return (contextToken as Identifier).text === "async" && isShorthandPropertyAssignment(contextToken.parent) + ? contextToken.parent.parent : undefined; } } @@ -1928,7 +1931,6 @@ namespace ts.Completions { // Previous token may have been a keyword that was converted to an identifier. switch (keywordForNode(contextToken)) { case SyntaxKind.AbstractKeyword: - case SyntaxKind.AsyncKeyword: case SyntaxKind.ClassKeyword: case SyntaxKind.ConstKeyword: case SyntaxKind.DeclareKeyword: @@ -1943,6 +1945,8 @@ namespace ts.Completions { case SyntaxKind.VarKeyword: case SyntaxKind.YieldKeyword: return true; + case SyntaxKind.AsyncKeyword: + return isPropertyDeclaration(contextToken.parent); } return isDeclarationName(contextToken) diff --git a/tests/cases/fourslash/completionsAfterAsyncInObjectLiteral.ts b/tests/cases/fourslash/completionsAfterAsyncInObjectLiteral.ts new file mode 100644 index 00000000000..fa1d9a60fc6 --- /dev/null +++ b/tests/cases/fourslash/completionsAfterAsyncInObjectLiteral.ts @@ -0,0 +1,5 @@ +/// + +////const x: { m(): Promise } = { async /**/ }; + +verify.completions({ marker: "", exact: "m" }); From 48559203147b3ff9d2a6987ddb632b061dc5581d Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 26 Sep 2018 11:22:44 -0700 Subject: [PATCH 57/71] navigationBar/Tree: Better description for anonymous function (#27063) --- src/services/navigationBar.ts | 38 +++++++++++++++---- ...BarAnonymousClassAndFunctionExpressions.ts | 22 ++++++++++- 2 files changed, 50 insertions(+), 10 deletions(-) diff --git a/src/services/navigationBar.ts b/src/services/navigationBar.ts index ab7c4327bb5..03d2aec13c5 100644 --- a/src/services/navigationBar.ts +++ b/src/services/navigationBar.ts @@ -631,28 +631,50 @@ namespace ts.NavigationBar { } function getFunctionOrClassName(node: FunctionExpression | FunctionDeclaration | ArrowFunction | ClassLikeDeclaration): string { + const { parent } = node; if (node.name && getFullWidth(node.name) > 0) { return declarationNameToString(node.name); } // See if it is a var initializer. If so, use the var name. - else if (node.parent.kind === SyntaxKind.VariableDeclaration) { - return declarationNameToString((node.parent as VariableDeclaration).name); + else if (isVariableDeclaration(parent)) { + return declarationNameToString(parent.name); } // See if it is of the form " = function(){...}". If so, use the text from the left-hand side. - else if (node.parent.kind === SyntaxKind.BinaryExpression && - (node.parent as BinaryExpression).operatorToken.kind === SyntaxKind.EqualsToken) { - return nodeText((node.parent as BinaryExpression).left).replace(whiteSpaceRegex, ""); + else if (isBinaryExpression(parent) && parent.operatorToken.kind === SyntaxKind.EqualsToken) { + return nodeText(parent.left).replace(whiteSpaceRegex, ""); } // See if it is a property assignment, and if so use the property name - else if (node.parent.kind === SyntaxKind.PropertyAssignment && (node.parent as PropertyAssignment).name) { - return nodeText((node.parent as PropertyAssignment).name); + else if (isPropertyAssignment(parent)) { + return nodeText(parent.name); } // Default exports are named "default" else if (getModifierFlags(node) & ModifierFlags.Default) { return "default"; } + else if (isClassLike(node)) { + return ""; + } + else if (isCallExpression(parent)) { + const name = getCalledExpressionName(parent.expression); + if (name !== undefined) { + const args = mapDefined(parent.arguments, a => isStringLiteral(a) ? a.getText(curSourceFile) : undefined).join(", "); + return `${name}(${args}) callback`; + } + } + return ""; + } + + function getCalledExpressionName(expr: Expression): string | undefined { + if (isIdentifier(expr)) { + return expr.text; + } + else if (isPropertyAccessExpression(expr)) { + const left = getCalledExpressionName(expr.expression); + const right = expr.name.text; + return left === undefined ? right : `${left}.${right}`; + } else { - return isClassLike(node) ? "" : ""; + return undefined; } } diff --git a/tests/cases/fourslash/navigationBarAnonymousClassAndFunctionExpressions.ts b/tests/cases/fourslash/navigationBarAnonymousClassAndFunctionExpressions.ts index c0753bc7159..23fe81fe48e 100644 --- a/tests/cases/fourslash/navigationBarAnonymousClassAndFunctionExpressions.ts +++ b/tests/cases/fourslash/navigationBarAnonymousClassAndFunctionExpressions.ts @@ -18,6 +18,8 @@ //// // These will only show up as childItems. //// function z() {} //// console.log(function() {}) +//// describe("this", 'function', () => {}); +//// [].map(() => {}); ////}) ////(function classes() { //// // Classes show up in top-level regardless of whether they have names or inner declarations. @@ -71,7 +73,15 @@ verify.navigationTree({ "kind": "function", "childItems": [ { - "text": "", + "text": "console.log() callback", + "kind": "function" + }, + { + "text": `describe("this", 'function') callback`, + "kind": "function" + }, + { + "text": `map() callback`, "kind": "function" }, { @@ -185,7 +195,15 @@ verify.navigationBar([ "kind": "function", "childItems": [ { - "text": "", + "text": "console.log() callback", + "kind": "function" + }, + { + "text": `describe("this", 'function') callback`, + "kind": "function" + }, + { + "text": `map() callback`, "kind": "function" }, { From c435d1c9a4988c29900a486e14a749cd8dc46164 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 26 Sep 2018 11:31:59 -0700 Subject: [PATCH 58/71] Log text of relevant file after an exception (#27006) * Log text of relevant file after an exception * Require LogLevel.verbose --- src/server/session.ts | 23 +++++++++++++++++-- src/server/utilities.ts | 6 +++-- .../reference/api/tsserverlibrary.d.ts | 1 + 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/src/server/session.ts b/src/server/session.ts index dd9708c1ddf..dddf705e55c 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -621,7 +621,11 @@ namespace ts.server { } } - public logError(err: Error, cmd: string) { + public logError(err: Error, cmd: string): void { + this.logErrorWorker(err, cmd); + } + + private logErrorWorker(err: Error, cmd: string, fileRequest?: protocol.FileRequestArgs): void { let msg = "Exception on executing command " + cmd; if (err.message) { msg += ":\n" + indent(err.message); @@ -629,6 +633,19 @@ namespace ts.server { msg += "\n" + indent((err).stack!); } } + + if (fileRequest && this.logger.hasLevel(LogLevel.verbose)) { + try { + const { file, project } = this.getFileAndProject(fileRequest); + const scriptInfo = project.getScriptInfoForNormalizedPath(file); + if (scriptInfo) { + const text = getSnapshotText(scriptInfo.getSnapshot()); + msg += `\n\nFile text of ${fileRequest.file}:${indent(text)}\n`; + } + } + catch {} // tslint:disable-line no-empty + } + this.logger.msg(msg, Msg.Err); } @@ -2323,8 +2340,10 @@ namespace ts.server { } let request: protocol.Request | undefined; + let relevantFile: protocol.FileRequestArgs | undefined; try { request = JSON.parse(message); + relevantFile = request.arguments && (request as protocol.FileRequest).arguments.file ? (request as protocol.FileRequest).arguments : undefined; const { response, responseRequired } = this.executeCommand(request); if (this.logger.hasLevel(LogLevel.requestTime)) { @@ -2350,7 +2369,7 @@ namespace ts.server { this.doOutput({ canceled: true }, request!.command, request!.seq, /*success*/ true); return; } - this.logError(err, message); + this.logErrorWorker(err, message, relevantFile); this.doOutput( /*info*/ undefined, request ? request.command : CommandNames.Unknown, diff --git a/src/server/utilities.ts b/src/server/utilities.ts index 615361cdcd8..d6cfe269c8d 100644 --- a/src/server/utilities.ts +++ b/src/server/utilities.ts @@ -246,14 +246,16 @@ namespace ts.server { return index === 0 || value !== array[index - 1]; } + const indentStr = "\n "; + /* @internal */ export function indent(str: string): string { - return "\n " + str; + return indentStr + str.replace(/\n/g, indentStr); } /** Put stringified JSON on the next line, indented. */ /* @internal */ export function stringifyIndented(json: {}): string { - return "\n " + JSON.stringify(json); + return indentStr + JSON.stringify(json); } } diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index b71b3c90137..7b3731ef281 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -8703,6 +8703,7 @@ declare namespace ts.server { private defaultEventHandler; private projectsUpdatedInBackgroundEvent; logError(err: Error, cmd: string): void; + private logErrorWorker; send(msg: protocol.Message): void; event(body: T, eventName: string): void; /** @deprecated */ From 98ec1e87306e8981ab2031150def01fdc4c25c82 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Wed, 26 Sep 2018 12:40:30 -0700 Subject: [PATCH 59/71] Fix commonjs export= merging (#27368) (#27371) I'm surprised we haven't seen more of this; I suspect it's because the mixed `module.exports=` + `export.foo=` pattern isn't that common. However, it'll happen any time that the exported symbol is unknown; getCommonJsExportEquals blithely clones unknownSymbol and proceeds to stick the `exports.foo=` properties onto it. This causes problems later, because the compiler checks for unknownSymbol with `===`. The fix is to not stick properties onto a clone of unknownSymbol. This makes the correct errors appear and removes the crash. --- src/compiler/checker.ts | 2 +- .../moduleExportAliasUnknown.errors.txt | 12 ++++++++++++ .../reference/moduleExportAliasUnknown.symbols | 11 +++++++++++ .../reference/moduleExportAliasUnknown.types | 17 +++++++++++++++++ .../salsa/moduleExportAliasUnknown.ts | 6 ++++++ 5 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 tests/baselines/reference/moduleExportAliasUnknown.errors.txt create mode 100644 tests/baselines/reference/moduleExportAliasUnknown.symbols create mode 100644 tests/baselines/reference/moduleExportAliasUnknown.types create mode 100644 tests/cases/conformance/salsa/moduleExportAliasUnknown.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a000bf1f7a7..a66a7edcf18 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -2344,7 +2344,7 @@ namespace ts { } function getCommonJsExportEquals(exported: Symbol | undefined, moduleSymbol: Symbol): Symbol | undefined { - if (!exported || moduleSymbol.exports!.size === 1) { + if (!exported || exported === unknownSymbol || moduleSymbol.exports!.size === 1) { return exported; } const merged = cloneSymbol(exported); diff --git a/tests/baselines/reference/moduleExportAliasUnknown.errors.txt b/tests/baselines/reference/moduleExportAliasUnknown.errors.txt new file mode 100644 index 00000000000..83d04dfefb7 --- /dev/null +++ b/tests/baselines/reference/moduleExportAliasUnknown.errors.txt @@ -0,0 +1,12 @@ +tests/cases/conformance/salsa/bug27025.js(1,25): error TS2339: Property 'nonprop' does not exist on type 'Window'. +tests/cases/conformance/salsa/bug27025.js(2,15): error TS2304: Cannot find name 'bar'. + + +==== tests/cases/conformance/salsa/bug27025.js (2 errors) ==== + module.exports = window.nonprop; + ~~~~~~~ +!!! error TS2339: Property 'nonprop' does not exist on type 'Window'. + exports.foo = bar; + ~~~ +!!! error TS2304: Cannot find name 'bar'. + \ No newline at end of file diff --git a/tests/baselines/reference/moduleExportAliasUnknown.symbols b/tests/baselines/reference/moduleExportAliasUnknown.symbols new file mode 100644 index 00000000000..2913a704e10 --- /dev/null +++ b/tests/baselines/reference/moduleExportAliasUnknown.symbols @@ -0,0 +1,11 @@ +=== tests/cases/conformance/salsa/bug27025.js === +module.exports = window.nonprop; +>module.exports : Symbol("tests/cases/conformance/salsa/bug27025", Decl(bug27025.js, 0, 0)) +>module : Symbol(export=, Decl(bug27025.js, 0, 0)) +>exports : Symbol(export=, Decl(bug27025.js, 0, 0)) +>window : Symbol(window, Decl(lib.dom.d.ts, --, --)) + +exports.foo = bar; +>exports : Symbol(foo, Decl(bug27025.js, 0, 32)) +>foo : Symbol(foo, Decl(bug27025.js, 0, 32)) + diff --git a/tests/baselines/reference/moduleExportAliasUnknown.types b/tests/baselines/reference/moduleExportAliasUnknown.types new file mode 100644 index 00000000000..60fae1456d1 --- /dev/null +++ b/tests/baselines/reference/moduleExportAliasUnknown.types @@ -0,0 +1,17 @@ +=== tests/cases/conformance/salsa/bug27025.js === +module.exports = window.nonprop; +>module.exports = window.nonprop : any +>module.exports : any +>module : { "tests/cases/conformance/salsa/bug27025": any; } +>exports : any +>window.nonprop : any +>window : Window +>nonprop : any + +exports.foo = bar; +>exports.foo = bar : any +>exports.foo : any +>exports : any +>foo : any +>bar : any + diff --git a/tests/cases/conformance/salsa/moduleExportAliasUnknown.ts b/tests/cases/conformance/salsa/moduleExportAliasUnknown.ts new file mode 100644 index 00000000000..f2fdb384e61 --- /dev/null +++ b/tests/cases/conformance/salsa/moduleExportAliasUnknown.ts @@ -0,0 +1,6 @@ +// @allowJs: true +// @noEmit: true +// @checkJs: true +// @Filename: bug27025.js +module.exports = window.nonprop; +exports.foo = bar; From 3f98c51db0b8611cef93241fe6308794b8fbd706 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 26 Sep 2018 15:51:55 -0700 Subject: [PATCH 60/71] Skip default lib checking in all tsbuild tests (#27380) --- tests/projects/empty-files/core/tsconfig.json | 3 ++- tests/projects/empty-files/no-references/tsconfig.json | 3 ++- tests/projects/empty-files/with-references/tsconfig.json | 3 ++- tests/projects/outfile-concat/first/tsconfig.json | 3 ++- tests/projects/outfile-concat/second/tsconfig.json | 3 ++- tests/projects/outfile-concat/third/tsconfig.json | 3 ++- .../projectReferenceWithRootDirInParent/tsconfig.base.json | 3 ++- .../tests/tsconfig_withFiles.json | 3 ++- .../tests/tsconfig_withInclude.json | 3 ++- .../tests/tsconfig_withIncludeAndFiles.json | 3 ++- tests/projects/sample1/core/tsconfig.json | 3 ++- tests/projects/sample1/logic/tsconfig.json | 3 ++- tests/projects/sample1/tests/tsconfig.json | 3 ++- tests/projects/sample1/ui/tsconfig.json | 3 +++ 14 files changed, 29 insertions(+), 13 deletions(-) diff --git a/tests/projects/empty-files/core/tsconfig.json b/tests/projects/empty-files/core/tsconfig.json index 0e8205977dd..bbbd3aa889f 100644 --- a/tests/projects/empty-files/core/tsconfig.json +++ b/tests/projects/empty-files/core/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "composite": true, "declaration": true, - "declarationMap": true + "declarationMap": true, + "skipDefaultLibCheck": true } } diff --git a/tests/projects/empty-files/no-references/tsconfig.json b/tests/projects/empty-files/no-references/tsconfig.json index c6b8f1a43d7..719a64cff48 100644 --- a/tests/projects/empty-files/no-references/tsconfig.json +++ b/tests/projects/empty-files/no-references/tsconfig.json @@ -4,6 +4,7 @@ "compilerOptions": { "composite": true, "declaration": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true } } diff --git a/tests/projects/empty-files/with-references/tsconfig.json b/tests/projects/empty-files/with-references/tsconfig.json index 3a55cad1b1c..d4179967205 100644 --- a/tests/projects/empty-files/with-references/tsconfig.json +++ b/tests/projects/empty-files/with-references/tsconfig.json @@ -6,6 +6,7 @@ "compilerOptions": { "composite": true, "declaration": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true } } diff --git a/tests/projects/outfile-concat/first/tsconfig.json b/tests/projects/outfile-concat/first/tsconfig.json index 8d63a0c4a06..625e7a7d038 100644 --- a/tests/projects/outfile-concat/first/tsconfig.json +++ b/tests/projects/outfile-concat/first/tsconfig.json @@ -6,7 +6,8 @@ "strict": false, "sourceMap": true, "declarationMap": true, - "outFile": "./bin/first-output.js" + "outFile": "./bin/first-output.js", + "skipDefaultLibCheck": true }, "files": [ "first_PART1.ts", diff --git a/tests/projects/outfile-concat/second/tsconfig.json b/tests/projects/outfile-concat/second/tsconfig.json index d835cff6d66..7ea38db3486 100644 --- a/tests/projects/outfile-concat/second/tsconfig.json +++ b/tests/projects/outfile-concat/second/tsconfig.json @@ -7,7 +7,8 @@ "sourceMap": true, "declarationMap": true, "declaration": true, - "outFile": "../2/second-output.js" + "outFile": "../2/second-output.js", + "skipDefaultLibCheck": true }, "references": [ ] diff --git a/tests/projects/outfile-concat/third/tsconfig.json b/tests/projects/outfile-concat/third/tsconfig.json index fef85ce8927..efaea2dc603 100644 --- a/tests/projects/outfile-concat/third/tsconfig.json +++ b/tests/projects/outfile-concat/third/tsconfig.json @@ -7,7 +7,8 @@ "sourceMap": true, "declarationMap": true, "declaration": true, - "outFile": "./thirdjs/output/third-output.js" + "outFile": "./thirdjs/output/third-output.js", + "skipDefaultLibCheck": true }, "files": [ "third_part1.ts" diff --git a/tests/projects/projectReferenceWithRootDirInParent/tsconfig.base.json b/tests/projects/projectReferenceWithRootDirInParent/tsconfig.base.json index 966eb3f3b8e..be7756d8bc2 100644 --- a/tests/projects/projectReferenceWithRootDirInParent/tsconfig.base.json +++ b/tests/projects/projectReferenceWithRootDirInParent/tsconfig.base.json @@ -3,7 +3,8 @@ "composite": true, "declaration": true, "rootDir": "./src/", - "outDir": "./dist/" + "outDir": "./dist/", + "skipDefaultLibCheck": true }, "exclude": [ "node_modules" diff --git a/tests/projects/resolveJsonModuleAndComposite/tests/tsconfig_withFiles.json b/tests/projects/resolveJsonModuleAndComposite/tests/tsconfig_withFiles.json index 14a0614cb35..71097850dbf 100644 --- a/tests/projects/resolveJsonModuleAndComposite/tests/tsconfig_withFiles.json +++ b/tests/projects/resolveJsonModuleAndComposite/tests/tsconfig_withFiles.json @@ -7,7 +7,8 @@ "resolveJsonModule": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, - "outDir": "dist" + "outDir": "dist", + "skipDefaultLibCheck": true }, "files": [ "src/index.ts", "src/hello.json" diff --git a/tests/projects/resolveJsonModuleAndComposite/tests/tsconfig_withInclude.json b/tests/projects/resolveJsonModuleAndComposite/tests/tsconfig_withInclude.json index b65aa324446..5efdbe28ac4 100644 --- a/tests/projects/resolveJsonModuleAndComposite/tests/tsconfig_withInclude.json +++ b/tests/projects/resolveJsonModuleAndComposite/tests/tsconfig_withInclude.json @@ -7,7 +7,8 @@ "resolveJsonModule": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, - "outDir": "dist" + "outDir": "dist", + "skipDefaultLibCheck": true }, "include": [ "src/**/*" diff --git a/tests/projects/resolveJsonModuleAndComposite/tests/tsconfig_withIncludeAndFiles.json b/tests/projects/resolveJsonModuleAndComposite/tests/tsconfig_withIncludeAndFiles.json index c9819ed3ca1..f50c629bac5 100644 --- a/tests/projects/resolveJsonModuleAndComposite/tests/tsconfig_withIncludeAndFiles.json +++ b/tests/projects/resolveJsonModuleAndComposite/tests/tsconfig_withIncludeAndFiles.json @@ -7,7 +7,8 @@ "resolveJsonModule": true, "esModuleInterop": true, "allowSyntheticDefaultImports": true, - "outDir": "dist" + "outDir": "dist", + "skipDefaultLibCheck": true }, "files": [ "src/hello.json" diff --git a/tests/projects/sample1/core/tsconfig.json b/tests/projects/sample1/core/tsconfig.json index 24b64bc7b2c..316de7dfdee 100644 --- a/tests/projects/sample1/core/tsconfig.json +++ b/tests/projects/sample1/core/tsconfig.json @@ -2,6 +2,7 @@ "compilerOptions": { "composite": true, "declaration": true, - "declarationMap": true + "declarationMap": true, + "skipDefaultLibCheck": true } } \ No newline at end of file diff --git a/tests/projects/sample1/logic/tsconfig.json b/tests/projects/sample1/logic/tsconfig.json index 939e6f5659b..13d6bb3a188 100644 --- a/tests/projects/sample1/logic/tsconfig.json +++ b/tests/projects/sample1/logic/tsconfig.json @@ -3,7 +3,8 @@ "composite": true, "declaration": true, "sourceMap": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true }, "references": [ { "path": "../core" } diff --git a/tests/projects/sample1/tests/tsconfig.json b/tests/projects/sample1/tests/tsconfig.json index c686b3824ab..c49e3a30e2d 100644 --- a/tests/projects/sample1/tests/tsconfig.json +++ b/tests/projects/sample1/tests/tsconfig.json @@ -7,6 +7,7 @@ "compilerOptions": { "composite": true, "declaration": true, - "forceConsistentCasingInFileNames": true + "forceConsistentCasingInFileNames": true, + "skipDefaultLibCheck": true } } \ No newline at end of file diff --git a/tests/projects/sample1/ui/tsconfig.json b/tests/projects/sample1/ui/tsconfig.json index d843e35c549..0894bd94ade 100644 --- a/tests/projects/sample1/ui/tsconfig.json +++ b/tests/projects/sample1/ui/tsconfig.json @@ -1,4 +1,7 @@ { + "compilerOptions": { + "skipDefaultLibCheck": true + }, "references": [ { "path": "../logic/index" } ] From bf3cea7f6d0262502e90967fed2372c78f66cb7a Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 26 Sep 2018 16:36:47 -0700 Subject: [PATCH 61/71] Remove project tests from default compiler flag --- src/testRunner/runner.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/testRunner/runner.ts b/src/testRunner/runner.ts index 6e430b08734..e528678ab83 100644 --- a/src/testRunner/runner.ts +++ b/src/testRunner/runner.ts @@ -138,7 +138,6 @@ function handleTestConfig() { case "compiler": runners.push(new CompilerBaselineRunner(CompilerTestType.Conformance)); runners.push(new CompilerBaselineRunner(CompilerTestType.Regressions)); - runners.push(new project.ProjectRunner()); break; case "conformance": runners.push(new CompilerBaselineRunner(CompilerTestType.Conformance)); From 0a97663843e11f745d9998d54db0970ee3bfb748 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 26 Sep 2018 16:58:01 -0700 Subject: [PATCH 62/71] Add 'prefixText' and 'suffixText' when renaming shorthand properties (#27356) * Add 'prefixText' and 'suffixText' when renaming shorthand properties * Make prefixText and suffixText missing instead of undefined * Fix test --- src/harness/client.ts | 4 +- src/harness/fourslash.ts | 16 +- src/server/protocol.ts | 7 +- src/server/session.ts | 5 +- src/services/codefixes/inferFromUsage.ts | 2 +- src/services/findAllReferences.ts | 207 +++++++++++------- .../generateGetAccessorAndSetAccessor.ts | 2 +- src/services/refactors/moveToNewFile.ts | 2 +- src/services/services.ts | 12 +- src/services/types.ts | 2 + src/services/utilities.ts | 11 +- .../unittests/tsserverProjectSystem.ts | 74 +++++-- .../reference/api/tsserverlibrary.d.ts | 8 +- tests/baselines/reference/api/typescript.d.ts | 2 + .../findAllReferencesDynamicImport3.ts | 3 +- .../fourslash/findAllRefsDestructureGetter.ts | 10 +- ...lRefsObjectBindingElementPropertyName04.ts | 8 +- tests/cases/fourslash/fourslash.ts | 9 +- ...OccurrencesIsDefinitionOfBindingPattern.ts | 10 +- .../renameDestructuringAssignmentInFor.ts | 10 +- .../renameDestructuringAssignmentInFor2.ts | 20 -- .../renameDestructuringAssignmentInForOf.ts | 10 +- .../renameDestructuringAssignmentInForOf2.ts | 20 -- ...ructuringAssignmentNestedInArrayLiteral.ts | 8 +- ...ucturingAssignmentNestedInArrayLiteral2.ts | 15 -- ...enameDestructuringAssignmentNestedInFor.ts | 12 +- ...nameDestructuringAssignmentNestedInFor2.ts | 12 +- ...ameDestructuringAssignmentNestedInForOf.ts | 12 +- ...meDestructuringAssignmentNestedInForOf2.ts | 5 +- .../renameDestructuringClassProperty.ts | 5 +- .../renameDestructuringDeclarationInFor.ts | 4 +- .../renameDestructuringDeclarationInForOf.ts | 4 +- .../renameDestructuringFunctionParameter.ts | 6 +- ...renameDestructuringNestedBindingElement.ts | 4 +- .../fourslash/renameImportAndShorthand.ts | 3 +- .../renameImportNamespaceAndShorthand.ts | 3 +- tests/cases/fourslash/renameImportRequire.ts | 4 +- .../renameParameterPropertyDeclaration4.ts | 3 +- 38 files changed, 327 insertions(+), 227 deletions(-) delete mode 100644 tests/cases/fourslash/renameDestructuringAssignmentInFor2.ts delete mode 100644 tests/cases/fourslash/renameDestructuringAssignmentInForOf2.ts delete mode 100644 tests/cases/fourslash/renameDestructuringAssignmentNestedInArrayLiteral2.ts diff --git a/src/harness/client.ts b/src/harness/client.ts index d873cd9b4fe..f8841eaa6b0 100644 --- a/src/harness/client.ts +++ b/src/harness/client.ts @@ -390,8 +390,8 @@ namespace ts.server { const locations: RenameLocation[] = []; for (const entry of body.locs) { const fileName = entry.file; - for (const loc of entry.locs) { - locations.push({ textSpan: this.decodeSpan(loc, fileName), fileName }); + for (const { start, end, ...prefixSuffixText } of entry.locs) { + locations.push({ textSpan: this.decodeSpan({ start, end }, fileName), fileName, ...prefixSuffixText }); } } diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index c06e95339f1..b7ce7437f3c 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -1395,7 +1395,7 @@ Actual: ${stringify(fullActual)}`); } } - public verifyRenameLocations(startRanges: ArrayOrSingle, options: ReadonlyArray | { findInStrings?: boolean, findInComments?: boolean, ranges: ReadonlyArray }) { + public verifyRenameLocations(startRanges: ArrayOrSingle, options: FourSlashInterface.RenameLocationsOptions) { const { findInStrings = false, findInComments = false, ranges = this.getRanges() } = ts.isArray(options) ? { findInStrings: false, findInComments: false, ranges: options } : options; for (const startRange of toArray(startRanges)) { @@ -1412,7 +1412,10 @@ Actual: ${stringify(fullActual)}`); const sort = (locations: ReadonlyArray | undefined) => locations && ts.sort(locations, (r1, r2) => ts.compareStringsCaseSensitive(r1.fileName, r2.fileName) || r1.textSpan.start - r2.textSpan.start); - assert.deepEqual(sort(references), sort(ranges.map((r): ts.RenameLocation => ({ fileName: r.fileName, textSpan: ts.createTextSpanFromRange(r) })))); + assert.deepEqual(sort(references), sort(ranges.map((rangeOrOptions): ts.RenameLocation => { + const { range, ...prefixSuffixText } = "range" in rangeOrOptions ? rangeOrOptions : { range: rangeOrOptions }; + return { fileName: range.fileName, textSpan: ts.createTextSpanFromRange(range), ...prefixSuffixText }; + }))); } } @@ -4484,7 +4487,7 @@ namespace FourSlashInterface { this.state.verifyRenameInfoFailed(message); } - public renameLocations(startRanges: ArrayOrSingle, options: FourSlash.Range[] | { findInStrings?: boolean, findInComments?: boolean, ranges: FourSlash.Range[] }) { + public renameLocations(startRanges: ArrayOrSingle, options: RenameLocationsOptions) { this.state.verifyRenameLocations(startRanges, options); } @@ -4959,4 +4962,11 @@ namespace FourSlashInterface { readonly newFileContents: { readonly [fileName: string]: string }; readonly preferences?: ts.UserPreferences; } + + export type RenameLocationsOptions = ReadonlyArray | { + readonly findInStrings?: boolean; + readonly findInComments?: boolean; + readonly ranges: ReadonlyArray; + }; + export type RenameLocationOptions = FourSlash.Range | { readonly range: FourSlash.Range, readonly prefixText?: string, readonly suffixText?: string }; } diff --git a/src/server/protocol.ts b/src/server/protocol.ts index 68c855eecca..52389c9e0d6 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -1135,7 +1135,12 @@ namespace ts.server.protocol { /** The file to which the spans apply */ file: string; /** The text spans in this group */ - locs: TextSpan[]; + locs: RenameTextSpan[]; + } + + export interface RenameTextSpan extends TextSpan { + readonly prefixText?: string; + readonly suffixText?: string; } export interface RenameResponseBody { diff --git a/src/server/session.ts b/src/server/session.ts index dddf705e55c..744cfe04927 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -1190,10 +1190,11 @@ namespace ts.server { private toSpanGroups(locations: ReadonlyArray): ReadonlyArray { const map = createMap(); - for (const { fileName, textSpan } of locations) { + for (const { fileName, textSpan, originalTextSpan: _, originalFileName: _1, ...prefixSuffixText } of locations) { let group = map.get(fileName); if (!group) map.set(fileName, group = { file: fileName, locs: [] }); - group.locs.push(this.toLocationTextSpan(textSpan, Debug.assertDefined(this.projectService.getScriptInfo(fileName)))); + const scriptInfo = Debug.assertDefined(this.projectService.getScriptInfo(fileName)); + group.locs.push({ ...this.toLocationTextSpan(textSpan, scriptInfo), ...prefixSuffixText }); } return arrayFrom(map.values()); } diff --git a/src/services/codefixes/inferFromUsage.ts b/src/services/codefixes/inferFromUsage.ts index f924208e321..ed8939079e3 100644 --- a/src/services/codefixes/inferFromUsage.ts +++ b/src/services/codefixes/inferFromUsage.ts @@ -196,7 +196,7 @@ namespace ts.codefix { function getReferences(token: PropertyName | Token, program: Program, cancellationToken: CancellationToken): ReadonlyArray { // Position shouldn't matter since token is not a SourceFile. return mapDefined(FindAllReferences.getReferenceEntriesForNode(-1, token, program, program.getSourceFiles(), cancellationToken), entry => - entry.type === "node" ? tryCast(entry.node, isIdentifier) : undefined); + entry.kind !== FindAllReferences.EntryKind.Span ? tryCast(entry.node, isIdentifier) : undefined); } function inferTypeForVariableFromUsage(token: Identifier, program: Program, cancellationToken: CancellationToken): Type | undefined { diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts index b857a05dffb..9fde734049c 100644 --- a/src/services/findAllReferences.ts +++ b/src/services/findAllReferences.ts @@ -13,19 +13,20 @@ namespace ts.FindAllReferences { | { readonly type: DefinitionKind.This; readonly node: Node } | { readonly type: DefinitionKind.String; readonly node: StringLiteral }; + export const enum EntryKind { Span, Node, StringLiteral, SearchedLocalFoundProperty, SearchedPropertyFoundLocal } + export type NodeEntryKind = EntryKind.Node | EntryKind.StringLiteral | EntryKind.SearchedLocalFoundProperty | EntryKind.SearchedPropertyFoundLocal; export type Entry = NodeEntry | SpanEntry; export interface NodeEntry { - type: "node"; - node: Node; - isInString?: true; + readonly kind: NodeEntryKind; + readonly node: Node; } export interface SpanEntry { - type: "span"; - fileName: string; - textSpan: TextSpan; + readonly kind: EntryKind.Span; + readonly fileName: string; + readonly textSpan: TextSpan; } - export function nodeEntry(node: Node, isInString?: true): NodeEntry { - return { type: "node", node: (node as NamedDeclaration).name || node, isInString }; + export function nodeEntry(node: Node, kind: NodeEntryKind = EntryKind.Node): NodeEntry { + return { kind, node: (node as NamedDeclaration).name || node }; } export interface Options { @@ -33,7 +34,7 @@ namespace ts.FindAllReferences { readonly findInComments?: boolean; /** * True if we are renaming the symbol. - * If so, we will find fewer references -- if it is referenced by several different names, we sill only find references for the original name. + * If so, we will find fewer references -- if it is referenced by several different names, we still only find references for the original name. */ readonly isForRename?: boolean; /** True if we are searching for implementations. We will have a different method of adding references if so. */ @@ -84,10 +85,15 @@ namespace ts.FindAllReferences { } } - export function findReferencedEntries(program: Program, cancellationToken: CancellationToken, sourceFiles: ReadonlyArray, node: Node, position: number, options: Options | undefined): ReferenceEntry[] | undefined { - return map(flattenEntries(Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options)), toReferenceEntry); + export function findReferenceOrRenameEntries( + program: Program, cancellationToken: CancellationToken, sourceFiles: ReadonlyArray, node: Node, position: number, options: Options | undefined, + convertEntry: ToReferenceOrRenameEntry, + ): T[] | undefined { + return map(flattenEntries(Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options)), entry => convertEntry(entry, node)); } + export type ToReferenceOrRenameEntry = (entry: Entry, originalNode: Node) => T; + export function getReferenceEntriesForNode(position: number, node: Node, program: Program, sourceFiles: ReadonlyArray, cancellationToken: CancellationToken, options: Options = {}, sourceFilesSet: ReadonlyMap = arrayToSet(sourceFiles, f => f.fileName)): Entry[] | undefined { return flattenEntries(Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options, sourceFilesSet)); } @@ -143,26 +149,64 @@ namespace ts.FindAllReferences { return { displayParts, kind: symbolKind }; } - function toReferenceEntry(entry: Entry): ReferenceEntry { - if (entry.type === "span") { - return { textSpan: entry.textSpan, fileName: entry.fileName, isWriteAccess: false, isDefinition: false }; - } + export function toRenameLocation(entry: Entry, originalNode: Node): RenameLocation { + return { ...entryToDocumentSpan(entry), ...getPrefixAndSuffixText(entry, originalNode) }; + } - const { node, isInString } = entry; - const sourceFile = node.getSourceFile(); + export function toReferenceEntry(entry: Entry): ReferenceEntry { + const { textSpan, fileName } = entryToDocumentSpan(entry); + if (entry.kind === EntryKind.Span) { + return { textSpan, fileName, isWriteAccess: false, isDefinition: false }; + } + const { kind, node } = entry; return { - fileName: sourceFile.fileName, - textSpan: getTextSpan(node, sourceFile), + textSpan, + fileName, isWriteAccess: isWriteAccessForReference(node), isDefinition: node.kind === SyntaxKind.DefaultKeyword || !!getDeclarationFromName(node) || isLiteralComputedPropertyDeclarationName(node), - isInString, + isInString: kind === EntryKind.StringLiteral ? true : undefined, }; } + function entryToDocumentSpan(entry: Entry): DocumentSpan { + if (entry.kind === EntryKind.Span) { + return { textSpan: entry.textSpan, fileName: entry.fileName }; + } + else { + const sourceFile = entry.node.getSourceFile(); + return { textSpan: getTextSpan(entry.node, sourceFile), fileName: sourceFile.fileName }; + } + } + + function getPrefixAndSuffixText(entry: Entry, originalNode: Node): { readonly prefixText?: string, readonly suffixText?: string } { + if (entry.kind !== EntryKind.Span && isIdentifier(originalNode)) { + const { node, kind } = entry; + const name = originalNode.text; + const isShorthandAssignment = isShorthandPropertyAssignment(node.parent); + if (isShorthandAssignment || isObjectBindingElementWithoutPropertyName(node.parent)) { + if (kind === EntryKind.SearchedLocalFoundProperty) { + return { prefixText: name + ": " }; + } + else if (kind === EntryKind.SearchedPropertyFoundLocal) { + return { suffixText: ": " + name }; + } + else { + return isShorthandAssignment + // In `const o = { x }; o.x`, symbolAtLocation at `x` in `{ x }` is the property symbol. + ? { suffixText: ": " + name } + // For a binding element `const { x } = o;`, symbolAtLocation at `x` is the property symbol. + : { prefixText: name + ": " }; + } + } + } + + return emptyOptions; + } + function toImplementationLocation(entry: Entry, checker: TypeChecker): ImplementationLocation { - if (entry.type === "node") { + if (entry.kind !== EntryKind.Span) { const { node } = entry; const sourceFile = node.getSourceFile(); return { textSpan: getTextSpan(node, sourceFile), fileName: sourceFile.fileName, ...implementationKindDisplayParts(node, checker) }; @@ -196,18 +240,18 @@ namespace ts.FindAllReferences { } export function toHighlightSpan(entry: Entry): { fileName: string, span: HighlightSpan } { - if (entry.type === "span") { + if (entry.kind === EntryKind.Span) { const { fileName, textSpan } = entry; return { fileName, span: { textSpan, kind: HighlightSpanKind.reference } }; } - const { node, isInString } = entry; + const { node, kind } = entry; const sourceFile = node.getSourceFile(); const writeAccess = isWriteAccessForReference(node); const span: HighlightSpan = { textSpan: getTextSpan(node, sourceFile), kind: writeAccess ? HighlightSpanKind.writtenReference : HighlightSpanKind.reference, - isInString + isInString: kind === EntryKind.StringLiteral ? true : undefined, }; return { fileName: sourceFile.fileName, span }; } @@ -348,11 +392,11 @@ namespace ts.FindAllReferences.Core { } } // import("foo") with no qualifier will reference the `export =` of the module, which may be referenced anyway. - return { type: "node", node: reference.literal }; + return nodeEntry(reference.literal); } else { return { - type: "span", + kind: EntryKind.Span, fileName: reference.referencingFile.fileName, textSpan: createTextSpanFromRange(reference.ref), }; @@ -366,7 +410,7 @@ namespace ts.FindAllReferences.Core { break; case SyntaxKind.ModuleDeclaration: if (sourceFilesSet.has(decl.getSourceFile().fileName)) { - references.push({ type: "node", node: (decl as ModuleDeclaration).name }); + references.push(nodeEntry((decl as ModuleDeclaration).name)); } break; default: @@ -422,7 +466,7 @@ namespace ts.FindAllReferences.Core { searchForImportsOfExport(node, symbol, { exportingModuleSymbol: Debug.assertDefined(symbol.parent, "Expected export symbol to have a parent"), exportKind: ExportKind.Default }, state); } else { - const search = state.createSearch(node, symbol, /*comingFrom*/ undefined, { allSearchSymbols: node ? populateSearchSymbolSet(symbol, node, checker, !!options.implementations) : [symbol] }); + const search = state.createSearch(node, symbol, /*comingFrom*/ undefined, { allSearchSymbols: node ? populateSearchSymbolSet(symbol, node, checker, !!options.isForRename, !!options.implementations) : [symbol] }); // Try to get the smallest valid scope that we can limit our search to; // otherwise we'll need to search globally (i.e. include each file). @@ -581,21 +625,21 @@ namespace ts.FindAllReferences.Core { * Callback to add references for a particular searched symbol. * This initializes a reference group, so only call this if you will add at least one reference. */ - referenceAdder(searchSymbol: Symbol): (node: Node) => void { + referenceAdder(searchSymbol: Symbol): (node: Node, kind?: NodeEntryKind) => void { const symbolId = getSymbolId(searchSymbol); let references = this.symbolIdToReferences[symbolId]; if (!references) { references = this.symbolIdToReferences[symbolId] = []; this.result.push({ definition: { type: DefinitionKind.Symbol, symbol: searchSymbol }, references }); } - return node => references.push(nodeEntry(node)); + return (node, kind) => references.push(nodeEntry(node, kind)); } /** Add a reference with no associated definition. */ addStringOrCommentReference(fileName: string, textSpan: TextSpan): void { this.result.push({ definition: undefined, - references: [{ type: "span", fileName, textSpan }] + references: [{ kind: EntryKind.Span, fileName, textSpan }] }); } @@ -707,21 +751,6 @@ namespace ts.FindAllReferences.Core { : undefined; } - function getObjectBindingElementWithoutPropertyName(symbol: Symbol): BindingElement & { name: Identifier } | undefined { - const bindingElement = getDeclarationOfKind(symbol, SyntaxKind.BindingElement); - if (bindingElement && - bindingElement.parent.kind === SyntaxKind.ObjectBindingPattern && - isIdentifier(bindingElement.name) && - !bindingElement.propertyName) { - return bindingElement as BindingElement & { name: Identifier }; - } - } - - function getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol: Symbol, checker: TypeChecker): Symbol | undefined { - const bindingElement = getObjectBindingElementWithoutPropertyName(symbol); - return bindingElement && getPropertySymbolFromBindingElement(checker, bindingElement); - } - /** * Determines the smallest scope in which a symbol may have named references. * Note that not every construct has been accounted for. This function can @@ -754,7 +783,7 @@ namespace ts.FindAllReferences.Core { // If symbol is of object binding pattern element without property name we would want to // look for property too and that could be anywhere - if (getObjectBindingElementWithoutPropertyName(symbol)) { + if (declarations.some(isObjectBindingElementWithoutPropertyName)) { return undefined; } @@ -1099,13 +1128,14 @@ namespace ts.FindAllReferences.Core { } } - function addReference(referenceLocation: Node, relatedSymbol: Symbol, state: State): void { - const addRef = state.referenceAdder(relatedSymbol); + function addReference(referenceLocation: Node, relatedSymbol: Symbol | RelatedSymbol, state: State): void { + const { kind, symbol } = "kind" in relatedSymbol ? relatedSymbol : { kind: undefined, symbol: relatedSymbol }; + const addRef = state.referenceAdder(symbol); if (state.options.implementations) { addImplementationReferences(referenceLocation, addRef, state); } else { - addRef(referenceLocation); + addRef(referenceLocation, kind); } } @@ -1428,7 +1458,7 @@ namespace ts.FindAllReferences.Core { const references = flatMap(sourceFiles, sourceFile => { cancellationToken.throwIfCancellationRequested(); return mapDefined(getPossibleSymbolReferenceNodes(sourceFile, node.text), ref => - isStringLiteral(ref) && ref.text === node.text ? nodeEntry(ref, /*isInString*/ true) : undefined); + isStringLiteral(ref) && ref.text === node.text ? nodeEntry(ref, EntryKind.StringLiteral) : undefined); }); return [{ @@ -1439,35 +1469,21 @@ namespace ts.FindAllReferences.Core { // For certain symbol kinds, we need to include other symbols in the search set. // This is not needed when searching for re-exports. - function populateSearchSymbolSet(symbol: Symbol, location: Node, checker: TypeChecker, implementations: boolean): Symbol[] { + function populateSearchSymbolSet(symbol: Symbol, location: Node, checker: TypeChecker, isForRename: boolean, implementations: boolean): Symbol[] { const result: Symbol[] = []; - forEachRelatedSymbol(symbol, location, checker, + forEachRelatedSymbol(symbol, location, checker, isForRename, (sym, root, base) => { result.push(base || root || sym); }, /*allowBaseTypes*/ () => !implementations); return result; } function forEachRelatedSymbol( - symbol: Symbol, location: Node, checker: TypeChecker, - cbSymbol: (symbol: Symbol, rootSymbol?: Symbol, baseSymbol?: Symbol) => T | undefined, + symbol: Symbol, location: Node, checker: TypeChecker, isForRenamePopulateSearchSymbolSet: boolean, + cbSymbol: (symbol: Symbol, rootSymbol?: Symbol, baseSymbol?: Symbol, kind?: NodeEntryKind) => T | undefined, allowBaseTypes: (rootSymbol: Symbol) => boolean, ): T | undefined { const containingObjectLiteralElement = getContainingObjectLiteralElement(location); if (containingObjectLiteralElement) { - // If the location is in a context sensitive location (i.e. in an object literal) try - // to get a contextual type for it, and add the property symbol from the contextual - // type to the search set - const contextualType = checker.getContextualType(containingObjectLiteralElement.parent); - const res = contextualType && firstDefined(getPropertySymbolsFromContextualType(containingObjectLiteralElement, checker, contextualType, /*unionSymbolOk*/ true), fromRoot); - if (res) return res; - - // If the location is name of property symbol from object literal destructuring pattern - // Search the property symbol - // for ( { property: p2 } of elems) { } - const propertySymbol = getPropertySymbolOfDestructuringAssignment(location, checker); - const res1 = propertySymbol && cbSymbol(propertySymbol); - if (res1) return res1; - /* Because in short-hand property assignment, location has two meaning : property name and as value of the property * When we do findAllReference at the position of the short-hand property assignment, we would want to have references to position of * property name and variable declaration of the identifier. @@ -1479,8 +1495,29 @@ namespace ts.FindAllReferences.Core { * so that when matching with potential reference symbol, both symbols from property declaration and variable declaration * will be included correctly. */ - const shorthandValueSymbol = checker.getShorthandAssignmentValueSymbol(location.parent); - const res2 = shorthandValueSymbol && cbSymbol(shorthandValueSymbol); + const shorthandValueSymbol = checker.getShorthandAssignmentValueSymbol(location.parent); // gets the local symbol + if (shorthandValueSymbol && isForRenamePopulateSearchSymbolSet) { + // When renaming 'x' in `const o = { x }`, just rename the local variable, not the property. + return cbSymbol(shorthandValueSymbol, /*rootSymbol*/ undefined, /*baseSymbol*/ undefined, EntryKind.SearchedLocalFoundProperty); + } + + // If the location is in a context sensitive location (i.e. in an object literal) try + // to get a contextual type for it, and add the property symbol from the contextual + // type to the search set + const contextualType = checker.getContextualType(containingObjectLiteralElement.parent); + const res = contextualType && firstDefined( + getPropertySymbolsFromContextualType(containingObjectLiteralElement, checker, contextualType, /*unionSymbolOk*/ true), + sym => fromRoot(sym, EntryKind.SearchedPropertyFoundLocal)); + if (res) return res; + + // If the location is name of property symbol from object literal destructuring pattern + // Search the property symbol + // for ( { property: p2 } of elems) { } + const propertySymbol = getPropertySymbolOfDestructuringAssignment(location, checker); + const res1 = propertySymbol && cbSymbol(propertySymbol, /*rootSymbol*/ undefined, /*baseSymbol*/ undefined, EntryKind.SearchedPropertyFoundLocal); + if (res1) return res1; + + const res2 = shorthandValueSymbol && cbSymbol(shorthandValueSymbol, /*rootSymbol*/ undefined, /*baseSymbol*/ undefined, EntryKind.SearchedLocalFoundProperty); if (res2) return res2; } @@ -1494,12 +1531,14 @@ namespace ts.FindAllReferences.Core { return fromRoot(symbol.flags & SymbolFlags.FunctionScopedVariable ? paramProps[1] : paramProps[0]); } - // If this is symbol of binding element without propertyName declaration in Object binding pattern - // Include the property in the search - const bindingElementPropertySymbol = getPropertySymbolOfObjectBindingPatternWithoutPropertyName(symbol, checker); - return bindingElementPropertySymbol && fromRoot(bindingElementPropertySymbol); + // symbolAtLocation for a binding element is the local symbol. See if the search symbol is the property. + // Don't do this when populating search set for a rename -- just rename the local. + if (!isForRenamePopulateSearchSymbolSet) { + const bindingElementPropertySymbol = isObjectBindingElementWithoutPropertyName(location.parent) ? getPropertySymbolFromBindingElement(checker, location.parent) : undefined; + return bindingElementPropertySymbol && fromRoot(bindingElementPropertySymbol, EntryKind.SearchedPropertyFoundLocal); + } - function fromRoot(sym: Symbol): T | undefined { + function fromRoot(sym: Symbol, kind?: NodeEntryKind): T | undefined { // If this is a union property: // - In populateSearchSymbolsSet we will add all the symbols from all its source symbols in all unioned types. // - In findRelatedSymbol, we will just use the union symbol if any source symbol is included in the search. @@ -1507,20 +1546,24 @@ namespace ts.FindAllReferences.Core { // - In populateSearchSymbolsSet, add the root the list // - In findRelatedSymbol, return the source symbol if that is in the search. (Do not return the instantiation symbol.) return firstDefined(checker.getRootSymbols(sym), rootSymbol => - cbSymbol(sym, rootSymbol) + cbSymbol(sym, rootSymbol, /*baseSymbol*/ undefined, kind) // Add symbol of properties/methods of the same name in base classes and implemented interfaces definitions || (rootSymbol.parent && rootSymbol.parent.flags & (SymbolFlags.Class | SymbolFlags.Interface) && allowBaseTypes(rootSymbol) - ? getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.name, checker, base => cbSymbol(sym, rootSymbol, base)) + ? getPropertySymbolsFromBaseTypes(rootSymbol.parent, rootSymbol.name, checker, base => cbSymbol(sym, rootSymbol, base, kind)) : undefined)); } } - function getRelatedSymbol(search: Search, referenceSymbol: Symbol, referenceLocation: Node, state: State): Symbol | undefined { + interface RelatedSymbol { + readonly symbol: Symbol; + readonly kind: NodeEntryKind | undefined; + } + function getRelatedSymbol(search: Search, referenceSymbol: Symbol, referenceLocation: Node, state: State): RelatedSymbol | undefined { const { checker } = state; - return forEachRelatedSymbol(referenceSymbol, referenceLocation, checker, - (sym, rootSymbol, baseSymbol) => search.includes(baseSymbol || rootSymbol || sym) + return forEachRelatedSymbol(referenceSymbol, referenceLocation, checker, /*isForRenamePopulateSearchSymbolSet*/ false, + (sym, rootSymbol, baseSymbol, kind): RelatedSymbol | undefined => search.includes(baseSymbol || rootSymbol || sym) // For a base type, use the symbol for the derived type. For a synthetic (e.g. union) property, use the union symbol. - ? rootSymbol && !(getCheckFlags(sym) & CheckFlags.Synthetic) ? rootSymbol : sym + ? { symbol: rootSymbol && !(getCheckFlags(sym) & CheckFlags.Synthetic) ? rootSymbol : sym, kind } : undefined, /*allowBaseTypes*/ rootSymbol => !(search.parents && !search.parents.some(parent => explicitlyInheritsFrom(rootSymbol.parent!, parent, state.inheritsFromCache, checker)))); diff --git a/src/services/refactors/generateGetAccessorAndSetAccessor.ts b/src/services/refactors/generateGetAccessorAndSetAccessor.ts index 57b25445f5d..96b8b1e8b06 100644 --- a/src/services/refactors/generateGetAccessorAndSetAccessor.ts +++ b/src/services/refactors/generateGetAccessorAndSetAccessor.ts @@ -226,7 +226,7 @@ namespace ts.refactor.generateGetAccessorAndSetAccessor { const { file, program, cancellationToken } = context; const referenceEntries = mapDefined(FindAllReferences.getReferenceEntriesForNode(originalName.parent.pos, originalName, program, [file], cancellationToken!), entry => // TODO: GH#18217 - (entry.type === "node" && rangeContainsRange(constructor, entry.node) && isIdentifier(entry.node) && isWriteAccess(entry.node)) ? entry.node : undefined); + (entry.kind !== FindAllReferences.EntryKind.Span && rangeContainsRange(constructor, entry.node) && isIdentifier(entry.node) && isWriteAccess(entry.node)) ? entry.node : undefined); forEach(referenceEntries, entry => { const parent = entry.parent; diff --git a/src/services/refactors/moveToNewFile.ts b/src/services/refactors/moveToNewFile.ts index 8b6af714892..693cdd9c6cb 100644 --- a/src/services/refactors/moveToNewFile.ts +++ b/src/services/refactors/moveToNewFile.ts @@ -158,7 +158,7 @@ namespace ts.refactor { const shouldMove = (name: Identifier): boolean => { const symbol = isBindingElement(name.parent) - ? getPropertySymbolFromBindingElement(checker, name.parent as BindingElement & { name: Identifier }) + ? getPropertySymbolFromBindingElement(checker, name.parent as ObjectBindingElementWithoutPropertyName) : skipAlias(checker.getSymbolAtLocation(name)!, checker); // TODO: GH#18217 return !!symbol && movedSymbols.has(symbol); }; diff --git a/src/services/services.ts b/src/services/services.ts index 542cc869873..9e08f1b14a6 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1544,20 +1544,20 @@ namespace ts { const node = getTouchingPropertyName(sourceFile, position); if (isIdentifier(node) && isJsxOpeningElement(node.parent) || isJsxClosingElement(node.parent)) { const { openingElement, closingElement } = node.parent.parent; - return [openingElement, closingElement].map((node): RenameLocation => ({ fileName: sourceFile.fileName, textSpan: createTextSpanFromNode(node.tagName, sourceFile) })); + return [openingElement, closingElement].map((node): RenameLocation => + ({ fileName: sourceFile.fileName, textSpan: createTextSpanFromNode(node.tagName, sourceFile) })); } else { - const refs = getReferences(node, position, { findInStrings, findInComments, isForRename: true }); - return refs && refs.map(({ fileName, textSpan }): RenameLocation => ({ fileName, textSpan })); + return getReferencesWorker(node, position, { findInStrings, findInComments, isForRename: true }, FindAllReferences.toRenameLocation); } } function getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[] | undefined { synchronizeHostData(); - return getReferences(getTouchingPropertyName(getValidSourceFile(fileName), position), position); + return getReferencesWorker(getTouchingPropertyName(getValidSourceFile(fileName), position), position, {}, FindAllReferences.toReferenceEntry); } - function getReferences(node: Node, position: number, options?: FindAllReferences.Options): ReferenceEntry[] | undefined { + function getReferencesWorker(node: Node, position: number, options: FindAllReferences.Options, cb: FindAllReferences.ToReferenceOrRenameEntry): T[] | undefined { synchronizeHostData(); // Exclude default library when renaming as commonly user don't want to change that file. @@ -1565,7 +1565,7 @@ namespace ts { ? program.getSourceFiles().filter(sourceFile => !program.isSourceFileDefaultLibrary(sourceFile)) : program.getSourceFiles(); - return FindAllReferences.findReferencedEntries(program, cancellationToken, sourceFiles, node, position, options); + return FindAllReferences.findReferenceOrRenameEntries(program, cancellationToken, sourceFiles, node, position, options, cb); } function findReferences(fileName: string, position: number): ReferencedSymbol[] | undefined { diff --git a/src/services/types.ts b/src/services/types.ts index dbf79cea783..ff2081d3c22 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -619,6 +619,8 @@ namespace ts { } export interface RenameLocation extends DocumentSpan { + readonly prefixText?: string; + readonly suffixText?: string; } export interface ReferenceEntry extends DocumentSpan { diff --git a/src/services/utilities.ts b/src/services/utilities.ts index a2eb2f0270c..427c31e5384 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -1325,7 +1325,16 @@ namespace ts { }); } - export function getPropertySymbolFromBindingElement(checker: TypeChecker, bindingElement: BindingElement & { name: Identifier }) { + export type ObjectBindingElementWithoutPropertyName = BindingElement & { name: Identifier }; + + export function isObjectBindingElementWithoutPropertyName(bindingElement: Node): bindingElement is ObjectBindingElementWithoutPropertyName { + return isBindingElement(bindingElement) && + isObjectBindingPattern(bindingElement.parent) && + isIdentifier(bindingElement.name) && + !bindingElement.propertyName; + } + + export function getPropertySymbolFromBindingElement(checker: TypeChecker, bindingElement: ObjectBindingElementWithoutPropertyName) { const typeOfPattern = checker.getTypeAtLocation(bindingElement.parent); const propSymbol = typeOfPattern && checker.getPropertyOfType(typeOfPattern, bindingElement.name.text); if (propSymbol && propSymbol.flags & SymbolFlags.Accessor) { diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index cb1b7f3983d..ad23e4a8323 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -449,6 +449,14 @@ namespace ts.projectSystem { const toLocation = protocolToLocation(str); return { start: toLocation(span.start), end: toLocation(textSpanEnd(span)) }; } + function protocolRenameSpanFromSubstring( + str: string, + substring: string, + options?: SpanFromSubstringOptions, + prefixSuffixText?: { readonly prefixText?: string, readonly suffixText?: string }, + ): protocol.RenameTextSpan { + return { ...protocolTextSpanFromSubstring(str, substring, options), ...prefixSuffixText }; + } function textSpanFromSubstring(str: string, substring: string, options?: SpanFromSubstringOptions): TextSpan { const start = nthIndexOf(str, substring, options ? options.index : 0); Debug.assert(start !== -1); @@ -463,6 +471,9 @@ namespace ts.projectSystem { function documentSpanFromSubstring(file: File, substring: string, options?: SpanFromSubstringOptions): DocumentSpan { return { fileName: file.path, textSpan: textSpanFromSubstring(file.content, substring, options) }; } + function renameLocation(file: File, substring: string, options?: SpanFromSubstringOptions): RenameLocation { + return documentSpanFromSubstring(file, substring, options); + } interface SpanFromSubstringOptions { readonly index: number; } @@ -8284,12 +8295,12 @@ namespace ts.projectSystem { const response = executeSessionRequest(session, protocol.CommandTypes.Rename, { file: aFc, ...protocolLocationFromSubstring(cFile.content, "C") }); assert.equal(aFile.content, bFile.content); - const abLocs: protocol.TextSpan[] = [ - protocolTextSpanFromSubstring(aFile.content, "C"), - protocolTextSpanFromSubstring(aFile.content, "C", { index: 1 }), + const abLocs: protocol.RenameTextSpan[] = [ + protocolRenameSpanFromSubstring(aFile.content, "C"), + protocolRenameSpanFromSubstring(aFile.content, "C", { index: 1 }), ]; - const span = protocolTextSpanFromSubstring(cFile.content, "C"); - const cLocs: protocol.TextSpan[] = [span]; + const span = protocolRenameSpanFromSubstring(cFile.content, "C"); + const cLocs: protocol.RenameTextSpan[] = [span]; assert.deepEqual(response, { info: { canRename: true, @@ -8299,7 +8310,7 @@ namespace ts.projectSystem { kind: ScriptElementKind.constElement, kindModifiers: ScriptElementKindModifier.exportedModifier, localizedErrorMessage: undefined, - triggerSpan: span, + triggerSpan: protocolTextSpanFromSubstring(cFile.content, "C"), }, locs: [ { file: aFc, locs: cLocs }, @@ -9570,7 +9581,7 @@ export function Test2() { }); describe("tsserverProjectSystem rename", () => { - it("works", () => { + it("works with fileToRename", () => { const aTs: File = { path: "/a.ts", content: "export const a = 0;" }; const bTs: File = { path: "/b.ts", content: 'import { a } from "./a";' }; @@ -9589,7 +9600,36 @@ export function Test2() { localizedErrorMessage: undefined, triggerSpan: protocolTextSpanFromSubstring(bTs.content, "a", { index: 1 }), }, - locs: [{ file: bTs.path, locs: [protocolTextSpanFromSubstring(bTs.content, "./a")] }], + locs: [{ file: bTs.path, locs: [protocolRenameSpanFromSubstring(bTs.content, "./a")] }], + }); + }); + + it("works with prefixText and suffixText", () => { + const aTs: File = { path: "/a.ts", content: "const x = 0; const o = { x };" }; + const session = createSession(createServerHost([aTs])); + openFilesForSession([aTs], session); + + const response = executeSessionRequest(session, protocol.CommandTypes.Rename, protocolFileLocationFromSubstring(aTs, "x")); + assert.deepEqual(response, { + info: { + canRename: true, + fileToRename: undefined, + displayName: "x", + fullDisplayName: "x", + kind: ScriptElementKind.constElement, + kindModifiers: ScriptElementKindModifier.none, + localizedErrorMessage: undefined, + triggerSpan: protocolTextSpanFromSubstring(aTs.content, "x"), + }, + locs: [ + { + file: aTs.path, + locs: [ + protocolRenameSpanFromSubstring(aTs.content, "x"), + protocolRenameSpanFromSubstring(aTs.content, "x", { index: 1 }, { prefixText: "x: " }), + ], + }, + ], }); }); }); @@ -10070,13 +10110,13 @@ declare class TestLib { const renameATs = (aTs: File): protocol.SpanGroup => ({ file: aTs.path, - locs: [protocolTextSpanFromSubstring(aTs.content, "fnA")], + locs: [protocolRenameSpanFromSubstring(aTs.content, "fnA")], }); const renameUserTs = (userTs: File): protocol.SpanGroup => ({ file: userTs.path, locs: [ - protocolTextSpanFromSubstring(userTs.content, "fnA"), - protocolTextSpanFromSubstring(userTs.content, "fnA", { index: 1 }), + protocolRenameSpanFromSubstring(userTs.content, "fnA"), + protocolRenameSpanFromSubstring(userTs.content, "fnA", { index: 1 }), ], }); @@ -10123,9 +10163,9 @@ declare class TestLib { const session = makeSampleProjects(); const response = executeSessionRequest(session, protocol.CommandTypes.RenameLocationsFull, protocolFileLocationFromSubstring(userTs, "fnA()")); assert.deepEqual>(response, [ - documentSpanFromSubstring(userTs, "fnA"), - documentSpanFromSubstring(userTs, "fnA", { index: 1 }), - documentSpanFromSubstring(aTs, "fnA"), + renameLocation(userTs, "fnA"), + renameLocation(userTs, "fnA", { index: 1 }), + renameLocation(aTs, "fnA"), ]); verifyATsConfigOriginalProject(session); }); @@ -10148,13 +10188,13 @@ declare class TestLib { { file: userTs.path, locs: [ - protocolTextSpanFromSubstring(userTs.content, "fnB"), - protocolTextSpanFromSubstring(userTs.content, "fnB", { index: 1 }), + protocolRenameSpanFromSubstring(userTs.content, "fnB"), + protocolRenameSpanFromSubstring(userTs.content, "fnB", { index: 1 }), ], }, { file: bDts.path, - locs: [protocolTextSpanFromSubstring(bDts.content, "fnB")], + locs: [protocolRenameSpanFromSubstring(bDts.content, "fnB")], } ], }); diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 7b3731ef281..61fc5dbac46 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -4960,6 +4960,8 @@ declare namespace ts { originalFileName?: string; } interface RenameLocation extends DocumentSpan { + readonly prefixText?: string; + readonly suffixText?: string; } interface ReferenceEntry extends DocumentSpan { isWriteAccess: boolean; @@ -6475,7 +6477,11 @@ declare namespace ts.server.protocol { /** The file to which the spans apply */ file: string; /** The text spans in this group */ - locs: TextSpan[]; + locs: RenameTextSpan[]; + } + interface RenameTextSpan extends TextSpan { + readonly prefixText?: string; + readonly suffixText?: string; } interface RenameResponseBody { /** diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 3a442e7f19c..54a37336d35 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -4960,6 +4960,8 @@ declare namespace ts { originalFileName?: string; } interface RenameLocation extends DocumentSpan { + readonly prefixText?: string; + readonly suffixText?: string; } interface ReferenceEntry extends DocumentSpan { isWriteAccess: boolean; diff --git a/tests/cases/fourslash/findAllReferencesDynamicImport3.ts b/tests/cases/fourslash/findAllReferencesDynamicImport3.ts index 636e640ceb3..371369ac39c 100644 --- a/tests/cases/fourslash/findAllReferencesDynamicImport3.ts +++ b/tests/cases/fourslash/findAllReferencesDynamicImport3.ts @@ -10,4 +10,5 @@ verify.referenceGroups(r1, [ { definition: "function bar(): string", ranges: [r0] }, { definition: "var bar: () => string", ranges: [r1] }, ]); -verify.rangesAreRenameLocations(); +verify.renameLocations(r0, [r0, { range: r1, suffixText: ": bar" }]); +verify.renameLocations(r1, [{ range: r1, prefixText: "bar: " }]) diff --git a/tests/cases/fourslash/findAllRefsDestructureGetter.ts b/tests/cases/fourslash/findAllRefsDestructureGetter.ts index b21e6186eb2..763d3cfb0e5 100644 --- a/tests/cases/fourslash/findAllRefsDestructureGetter.ts +++ b/tests/cases/fourslash/findAllRefsDestructureGetter.ts @@ -9,14 +9,16 @@ ////[|x|]; [|y|]; const [x0, y0, x1, y1, x2, y2] = test.ranges(); -verify.referenceGroups(x0, [{ definition: "(property) Test.x: number", ranges: [x0, x1, x2] }]); -verify.referenceGroups([x1, x2], [ +verify.referenceGroups(x0, [{ definition: "(property) Test.x: number", ranges: [x0, x1] }]); +verify.referenceGroups(x1, [ { definition: "(property) Test.x: number", ranges: [x0] }, { definition: "const x: number", ranges: [x1, x2] }, ]); +verify.referenceGroups(x2, [{ definition: "const x: number", ranges: [x1, x2] }]); -verify.referenceGroups(y0, [{ definition: "(property) Test.y: number", ranges: [y0, y1, y2] }]); -verify.referenceGroups([y1, y2], [ +verify.referenceGroups(y0, [{ definition: "(property) Test.y: number", ranges: [y0, y1] }]); +verify.referenceGroups(y1, [ { definition: "(property) Test.y: number", ranges: [y0] }, { definition: "const y: number", ranges: [y1, y2] }, ]); +verify.referenceGroups(y2, [{ definition: "const y: number", ranges: [y1, y2] }]); diff --git a/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName04.ts b/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName04.ts index fe0d659f0ec..c3bebdb2623 100644 --- a/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName04.ts +++ b/tests/cases/fourslash/findAllRefsObjectBindingElementPropertyName04.ts @@ -14,9 +14,9 @@ const ranges = test.ranges(); const [r0, r1, r2, r3] = ranges; -verify.referenceGroups([r0, r1], [{ definition: "(property) I.property1: number", ranges }]); -verify.referenceGroups([r2, r3], [ +verify.referenceGroups([r0, r1], [{ definition: "(property) I.property1: number", ranges: [r0, r1, r2] }]); +verify.referenceGroups(r2, [ { definition: "(property) I.property1: number", ranges: [r0, r1] }, - { definition: "var property1: number", ranges: [r2, r3] } + { definition: "var property1: number", ranges: [r2, r3] }, ]); - +verify.referenceGroups(r3, [{ definition: "var property1: number", ranges: [r2, r3] }]); diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index e254b2b51db..4603d61a286 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -317,7 +317,7 @@ declare namespace FourSlashInterface { }[]): void; renameInfoSucceeded(displayName?: string, fullDisplayName?: string, kind?: string, kindModifiers?: string, fileToRename?: string, range?: Range): void; renameInfoFailed(message?: string): void; - renameLocations(startRanges: ArrayOrSingle, options: Range[] | { findInStrings?: boolean, findInComments?: boolean, ranges: Range[] }): void; + renameLocations(startRanges: ArrayOrSingle, options: RenameLocationsOptions): void; /** Verify the quick info available at the current marker. */ quickInfoIs(expectedText: string, expectedDocumentation?: string): void; @@ -648,6 +648,13 @@ declare namespace FourSlashInterface { type ArrayOrSingle = T | ReadonlyArray; type NewFileContent = string | { readonly [fileName: string]: string }; + + type RenameLocationsOptions = ReadonlyArray | { + readonly findInStrings?: boolean; + readonly findInComments?: boolean; + readonly ranges: ReadonlyArray; + } + type RenameLocationOptions = Range | { readonly range: Range, readonly prefixText?: string, readonly suffixText?: string }; } declare function verifyOperationIsCancelled(f: any): void; declare var test: FourSlashInterface.test_; diff --git a/tests/cases/fourslash/getOccurrencesIsDefinitionOfBindingPattern.ts b/tests/cases/fourslash/getOccurrencesIsDefinitionOfBindingPattern.ts index 58814b45e99..32fec74d162 100644 --- a/tests/cases/fourslash/getOccurrencesIsDefinitionOfBindingPattern.ts +++ b/tests/cases/fourslash/getOccurrencesIsDefinitionOfBindingPattern.ts @@ -3,8 +3,8 @@ ////const z = [|x|]; const [r0, r1, r2] = test.ranges(); -verify.referenceGroups([r0, r2], [ - { definition: "const x: number", ranges: [r0, r2] }, - { definition: "(property) x: number", ranges: [r1] }, -]); -verify.referenceGroups(r1, [{ definition: "(property) x: number", ranges: [r0, r1, r2] }]); +const local = { definition: "const x: number", ranges: [r0, r2] }; +const prop = { definition: "(property) x: number", ranges: [r1] }; +verify.referenceGroups(r0, [local, prop]); +verify.referenceGroups(r1, [{ ...prop, ranges: [r0, r1] }]); +verify.referenceGroups(r2, [local]); diff --git a/tests/cases/fourslash/renameDestructuringAssignmentInFor.ts b/tests/cases/fourslash/renameDestructuringAssignmentInFor.ts index 0ef6f672e00..2c8ad51f486 100644 --- a/tests/cases/fourslash/renameDestructuringAssignmentInFor.ts +++ b/tests/cases/fourslash/renameDestructuringAssignmentInFor.ts @@ -6,13 +6,15 @@ ////} ////var elems: I[]; //// -////var p2: number, property1: number; +////var p2: number, [|property1|]: number; ////for ({ [|property1|] } = elems[0]; p2 < 100; p2++) { -//// p2 = property1++; +//// p2 = [|property1|]++; ////} ////for ({ [|property1|]: p2 } = elems[0]; p2 < 100; p2++) { ////} +verify.noErrors(); const ranges = test.ranges(); -const [r0, , r2] = ranges; -verify.renameLocations([r0, r2], ranges); +const [r0, r1, r2, r3, r4] = ranges; +verify.renameLocations([r0, r4], [r0, { range: r2, suffixText: ": property1" }, r4]); +verify.renameLocations([r1, r2, r3], [r1, { range: r2, prefixText: "property1: " }, r3]); diff --git a/tests/cases/fourslash/renameDestructuringAssignmentInFor2.ts b/tests/cases/fourslash/renameDestructuringAssignmentInFor2.ts deleted file mode 100644 index 17173d0da4d..00000000000 --- a/tests/cases/fourslash/renameDestructuringAssignmentInFor2.ts +++ /dev/null @@ -1,20 +0,0 @@ -/// - -////interface I { -//// [|property1|]: number; -//// property2: string; -////} -////var elems: I[]; -//// -////var p2: number, [|property1|]: number; -////for ({ [|property1|] } = elems[0]; p2 < 100; p2++) { -//// p2 = [|property1|]++; -////} -////for ({ [|property1|]: p2 } = elems[0]; p2 < 100; p2++) { -////} - -const ranges = test.ranges(); -const [r0, r1, r2, r3, r4] = ranges; -verify.renameLocations([r0, r4], [r0, r2, r4]); -verify.renameLocations([r1, r3], [r1, r2, r3]); -verify.renameLocations(r2, ranges); diff --git a/tests/cases/fourslash/renameDestructuringAssignmentInForOf.ts b/tests/cases/fourslash/renameDestructuringAssignmentInForOf.ts index b452ca7c9a7..38703a68b99 100644 --- a/tests/cases/fourslash/renameDestructuringAssignmentInForOf.ts +++ b/tests/cases/fourslash/renameDestructuringAssignmentInForOf.ts @@ -6,13 +6,15 @@ ////} ////var elems: I[]; //// -////var property1: number, p2: number; +////var [|property1|]: number, p2: number; ////for ({ [|property1|] } of elems) { -//// property1++; +//// [|property1|]++; ////} ////for ({ [|property1|]: p2 } of elems) { ////} +verify.noErrors(); const ranges = test.ranges(); -const [r0, , r2] = ranges; -verify.renameLocations([r0, r2], ranges); +const [r0, r1, r2, r3, r4] = ranges; +verify.renameLocations([r0, r4], [r0, { range: r2, suffixText: ": property1" }, r4]); +verify.renameLocations([r1, r2, r3], [r1, { range: r2, prefixText: "property1: " }, r3]); diff --git a/tests/cases/fourslash/renameDestructuringAssignmentInForOf2.ts b/tests/cases/fourslash/renameDestructuringAssignmentInForOf2.ts deleted file mode 100644 index b7432e08a26..00000000000 --- a/tests/cases/fourslash/renameDestructuringAssignmentInForOf2.ts +++ /dev/null @@ -1,20 +0,0 @@ -/// - -////interface I { -//// [|property1|]: number; -//// property2: string; -////} -////var elems: I[]; -//// -////var [|property1|]: number, p2: number; -////for ({ [|property1|] } of elems) { -//// [|property1|]++; -////} -////for ({ [|property1|]: p2 } of elems) { -////} - -const ranges = test.ranges(); -const [r0, r1, r2, r3, r4] = ranges; -verify.renameLocations([r0, r4], [r0, r2, r4]); -verify.renameLocations([r1, r3], [r1, r2, r3]); -verify.renameLocations(r2, ranges); diff --git a/tests/cases/fourslash/renameDestructuringAssignmentNestedInArrayLiteral.ts b/tests/cases/fourslash/renameDestructuringAssignmentNestedInArrayLiteral.ts index 57191e6d6ab..292aaf1bf6d 100644 --- a/tests/cases/fourslash/renameDestructuringAssignmentNestedInArrayLiteral.ts +++ b/tests/cases/fourslash/renameDestructuringAssignmentNestedInArrayLiteral.ts @@ -4,10 +4,12 @@ //// [|property1|]: number; //// property2: string; ////} -////var elems: I[], p1: number, property1: number; +////var elems: I[], p1: number, [|property1|]: number; ////[{ [|property1|]: p1 }] = elems; ////[{ [|property1|] }] = elems; const ranges = test.ranges(); -const [r0, r1] = ranges; -verify.renameLocations([r0, r1], ranges); +const [r0, r1, r2, r3] = ranges; +verify.renameLocations([r0, r2], [r0, r2, { range: r3, suffixText: ": property1" }]); +verify.renameLocations([r1, r3], [r1, { range: r3, prefixText: "property1: " }]); + diff --git a/tests/cases/fourslash/renameDestructuringAssignmentNestedInArrayLiteral2.ts b/tests/cases/fourslash/renameDestructuringAssignmentNestedInArrayLiteral2.ts deleted file mode 100644 index 1f18c443ca6..00000000000 --- a/tests/cases/fourslash/renameDestructuringAssignmentNestedInArrayLiteral2.ts +++ /dev/null @@ -1,15 +0,0 @@ -/// - -////interface I { -//// [|property1|]: number; -//// property2: string; -////} -////var elems: I[], p1: number, [|property1|]: number; -////[{ [|property1|]: p1 }] = elems; -////[{ [|property1|] }] = elems; - -const ranges = test.ranges(); -const [r0, r1, r2, r3] = ranges; -verify.renameLocations([r0, r2], [r0, r2, r3]); -verify.renameLocations(r1, [r1, r3]); -verify.renameLocations(r3, ranges); diff --git a/tests/cases/fourslash/renameDestructuringAssignmentNestedInFor.ts b/tests/cases/fourslash/renameDestructuringAssignmentNestedInFor.ts index fe8961aa18c..e83487d15d2 100644 --- a/tests/cases/fourslash/renameDestructuringAssignmentNestedInFor.ts +++ b/tests/cases/fourslash/renameDestructuringAssignmentNestedInFor.ts @@ -7,14 +7,16 @@ //// secondary: string; //// }; ////} -////let multiRobot: MultiRobot; +////let multiRobot: MultiRobot, [|primary|]: string, secondary: string, primaryA: string, secondaryA: string, i: number; ////for ({ skills: { [|primary|]: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { -//// console.log(primaryA); +//// primaryA; ////} ////for ({ skills: { [|primary|], secondary } } = multiRobot, i = 0; i < 1; i++) { -//// console.log(primary); +//// [|primary|]; ////} +verify.noErrors(); const ranges = test.ranges(); -const [r0, r1] = ranges; -verify.renameLocations([r0, r1], ranges); +const [r0, r1, r2, r3, r4] = ranges; +verify.renameLocations([r0, r2], [r0, r2, { range: r3, suffixText: ": primary" }]); +verify.renameLocations([r1, r3, r4], [r1, { range: r3, prefixText: "primary: " }, r4]); diff --git a/tests/cases/fourslash/renameDestructuringAssignmentNestedInFor2.ts b/tests/cases/fourslash/renameDestructuringAssignmentNestedInFor2.ts index c5e7212c99b..e83487d15d2 100644 --- a/tests/cases/fourslash/renameDestructuringAssignmentNestedInFor2.ts +++ b/tests/cases/fourslash/renameDestructuringAssignmentNestedInFor2.ts @@ -7,16 +7,16 @@ //// secondary: string; //// }; ////} -////let multiRobot: MultiRobot, [|primary|]: string; +////let multiRobot: MultiRobot, [|primary|]: string, secondary: string, primaryA: string, secondaryA: string, i: number; ////for ({ skills: { [|primary|]: primaryA, secondary: secondaryA } } = multiRobot, i = 0; i < 1; i++) { -//// console.log(primaryA); +//// primaryA; ////} ////for ({ skills: { [|primary|], secondary } } = multiRobot, i = 0; i < 1; i++) { -//// console.log([|primary|]); +//// [|primary|]; ////} +verify.noErrors(); const ranges = test.ranges(); const [r0, r1, r2, r3, r4] = ranges; -verify.renameLocations([r0, r2], [r0, r2, r3]); -verify.renameLocations([r1, r4], [r1, r3, r4]); -verify.renameLocations(r3, ranges); +verify.renameLocations([r0, r2], [r0, r2, { range: r3, suffixText: ": primary" }]); +verify.renameLocations([r1, r3, r4], [r1, { range: r3, prefixText: "primary: " }, r4]); diff --git a/tests/cases/fourslash/renameDestructuringAssignmentNestedInForOf.ts b/tests/cases/fourslash/renameDestructuringAssignmentNestedInForOf.ts index 7d057600748..6a9eb6235b7 100644 --- a/tests/cases/fourslash/renameDestructuringAssignmentNestedInForOf.ts +++ b/tests/cases/fourslash/renameDestructuringAssignmentNestedInForOf.ts @@ -8,13 +8,15 @@ //// }; ////} ////let multiRobots: MultiRobot[]; +////let [|primary|]: string, secondary: string, primaryA: string, secondaryA: string; ////for ({ skills: { [|primary|]: primaryA, secondary: secondaryA } } of multiRobots) { -//// console.log(primaryA); +//// primaryA; ////} ////for ({ skills: { [|primary|], secondary } } of multiRobots) { -//// console.log(primary); +//// [|primary|]; ////} -const ranges = test.ranges(); -const [r0, r1] = ranges; -verify.renameLocations([r0, r1], ranges); +verify.noErrors(); +const [r0, r1, r2, r3, r4] = test.ranges(); +verify.renameLocations([r0, r2], [r0, r2, { range: r3, suffixText: ": primary" }]); +verify.renameLocations([r1, r3, r4], [r1, { range: r3, prefixText: "primary: " }, r4]) diff --git a/tests/cases/fourslash/renameDestructuringAssignmentNestedInForOf2.ts b/tests/cases/fourslash/renameDestructuringAssignmentNestedInForOf2.ts index 74dfda39bc2..7c5c288ea78 100644 --- a/tests/cases/fourslash/renameDestructuringAssignmentNestedInForOf2.ts +++ b/tests/cases/fourslash/renameDestructuringAssignmentNestedInForOf2.ts @@ -17,6 +17,5 @@ const ranges = test.ranges(); const [r0, r1, r2, r3, r4] = ranges; -verify.renameLocations([r0, r2], [r0, r2, r3]); -verify.renameLocations([r1, r4], [r1, r3, r4]); -verify.renameLocations(r3, ranges); +verify.renameLocations([r0, r2], [r0, r2, { range: r3, suffixText: ": primary" }]); +verify.renameLocations([r1, r3, r4], [r1, { range: r3, prefixText: "primary: " }, r4]); diff --git a/tests/cases/fourslash/renameDestructuringClassProperty.ts b/tests/cases/fourslash/renameDestructuringClassProperty.ts index 11261a4df78..ac708e55471 100644 --- a/tests/cases/fourslash/renameDestructuringClassProperty.ts +++ b/tests/cases/fourslash/renameDestructuringClassProperty.ts @@ -16,4 +16,7 @@ //// } ////} -verify.rangesAreRenameLocations(); +const [r0, r1, r2, r3, r4] = test.ranges(); +verify.renameLocations([r0, r2], [r0, { range: r1, suffixText: ": foo" }, r2, { range: r3, suffixText: ": foo" }]); +verify.renameLocations(r1, [{ range: r1, prefixText: "foo: " }]); +verify.renameLocations([r3, r4], [{ range: r3, prefixText: "foo: " }, r4]); diff --git a/tests/cases/fourslash/renameDestructuringDeclarationInFor.ts b/tests/cases/fourslash/renameDestructuringDeclarationInFor.ts index 0338433ae72..02bc0f50826 100644 --- a/tests/cases/fourslash/renameDestructuringDeclarationInFor.ts +++ b/tests/cases/fourslash/renameDestructuringDeclarationInFor.ts @@ -13,4 +13,6 @@ //// [|property1|] = p2; ////} -verify.rangesAreRenameLocations(); +const [r0, r1, r2, r3] = test.ranges(); +verify.renameLocations([r0, r1], [r0, r1, { range: r2, suffixText: ": property1" }]); +verify.renameLocations([r2, r3], [{ range: r2, prefixText: "property1: " }, r3]); diff --git a/tests/cases/fourslash/renameDestructuringDeclarationInForOf.ts b/tests/cases/fourslash/renameDestructuringDeclarationInForOf.ts index fcd55a5bc20..a8e21c83cf3 100644 --- a/tests/cases/fourslash/renameDestructuringDeclarationInForOf.ts +++ b/tests/cases/fourslash/renameDestructuringDeclarationInForOf.ts @@ -12,4 +12,6 @@ ////for (let { [|property1|]: p2 } of elems) { ////} -verify.rangesAreRenameLocations(); +const [r0, r1, r2, r3] = test.ranges(); +verify.renameLocations([r0, r3], [r0, { range: r1, suffixText: ": property1" }, r3]); +verify.renameLocations([r1, r2], [{ range: r1, prefixText: "property1: " }, r2]); diff --git a/tests/cases/fourslash/renameDestructuringFunctionParameter.ts b/tests/cases/fourslash/renameDestructuringFunctionParameter.ts index 4abbabc3723..d6a732176d2 100644 --- a/tests/cases/fourslash/renameDestructuringFunctionParameter.ts +++ b/tests/cases/fourslash/renameDestructuringFunctionParameter.ts @@ -4,4 +4,8 @@ //// f({[|a|]}); ////} -verify.rangesAreRenameLocations(); +const [r0, r1, r2] = test.ranges(); +// renames the local +verify.renameLocations([r0, r2], [{ range: r0, prefixText: "a: " }, { range: r2, prefixText: "a: " }]); +// renames the property +verify.renameLocations(r1, [{ range: r0, suffixText: ": a" }, r1, { range: r2, suffixText: ": a" }]); diff --git a/tests/cases/fourslash/renameDestructuringNestedBindingElement.ts b/tests/cases/fourslash/renameDestructuringNestedBindingElement.ts index 7557744ecee..6643382f6c9 100644 --- a/tests/cases/fourslash/renameDestructuringNestedBindingElement.ts +++ b/tests/cases/fourslash/renameDestructuringNestedBindingElement.ts @@ -15,4 +15,6 @@ //// console.log([|primary|]); ////} -verify.rangesAreRenameLocations(); +const [r0, r1, r2, r3] = test.ranges(); +verify.renameLocations([r0, r1], [r0, r1, { range: r2, suffixText: ": primary" }]); +verify.renameLocations([r2, r3], [{ range: r2, prefixText: "primary: " }, r3]); diff --git a/tests/cases/fourslash/renameImportAndShorthand.ts b/tests/cases/fourslash/renameImportAndShorthand.ts index 4836d8c14fe..01be6650b3b 100644 --- a/tests/cases/fourslash/renameImportAndShorthand.ts +++ b/tests/cases/fourslash/renameImportAndShorthand.ts @@ -3,4 +3,5 @@ ////import [|foo|] from 'bar'; ////const bar = { [|foo|] }; -verify.rangesAreRenameLocations(); +const [r0, r1] = test.ranges(); +verify.renameLocations([r0, r1], [r0, { range: r1, prefixText: "foo: " }]); diff --git a/tests/cases/fourslash/renameImportNamespaceAndShorthand.ts b/tests/cases/fourslash/renameImportNamespaceAndShorthand.ts index 21cdc0fa820..e577d82d3ae 100644 --- a/tests/cases/fourslash/renameImportNamespaceAndShorthand.ts +++ b/tests/cases/fourslash/renameImportNamespaceAndShorthand.ts @@ -3,4 +3,5 @@ ////import * as [|foo|] from 'bar'; ////const bar = { [|foo|] }; -verify.rangesAreRenameLocations(); +const [r0, r1] = test.ranges(); +verify.renameLocations([r0, r1], [r0, { range: r1, prefixText: "foo: " }]); diff --git a/tests/cases/fourslash/renameImportRequire.ts b/tests/cases/fourslash/renameImportRequire.ts index 8a9aeebc328..bf29a0999b1 100644 --- a/tests/cases/fourslash/renameImportRequire.ts +++ b/tests/cases/fourslash/renameImportRequire.ts @@ -5,4 +5,6 @@ ////a = { [|e|] }; ////export { [|e|] }; -verify.rangesAreRenameLocations(); +const [r0, r1, r2, r3] = test.ranges(); +//TODO: export should have prefix/suffix too +verify.renameLocations([r0, r1, r2, r3], [r0, r1, { range: r2, prefixText: "e: " }, r3]); diff --git a/tests/cases/fourslash/renameParameterPropertyDeclaration4.ts b/tests/cases/fourslash/renameParameterPropertyDeclaration4.ts index ca201d28b2c..292c82a2d52 100644 --- a/tests/cases/fourslash/renameParameterPropertyDeclaration4.ts +++ b/tests/cases/fourslash/renameParameterPropertyDeclaration4.ts @@ -6,4 +6,5 @@ //// } //// } -verify.rangesAreRenameLocations(); +const [r0, r1] = test.ranges(); +verify.renameLocations([r0, r1], [{ range: r0, prefixText: "protectedParam: " }, r1]); From 5f2741b2ba5251f2fb131c540c85606ad6038232 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 27 Sep 2018 08:56:40 -0700 Subject: [PATCH 63/71] Make RenameInfo a union (#27382) --- src/harness/client.ts | 56 +++++++++++-------- src/harness/fourslash.ts | 5 +- src/server/protocol.ts | 18 +++--- src/server/session.ts | 11 +++- src/services/rename.ts | 17 +----- src/services/types.ts | 10 +++- .../unittests/tsserverProjectSystem.ts | 6 -- .../reference/api/tsserverlibrary.d.ts | 26 ++++++--- tests/baselines/reference/api/typescript.d.ts | 10 +++- 9 files changed, 88 insertions(+), 71 deletions(-) diff --git a/src/harness/client.ts b/src/harness/client.ts index f8841eaa6b0..f59a9ca3188 100644 --- a/src/harness/client.ts +++ b/src/harness/client.ts @@ -3,12 +3,15 @@ namespace ts.server { writeMessage(message: string): void; } - interface RenameEntry extends RenameInfo { - fileName: string; - position: number; - locations: RenameLocation[]; - findInStrings: boolean; - findInComments: boolean; + interface RenameEntry { + readonly renameInfo: RenameInfo; + readonly inputs: { + readonly fileName: string; + readonly position: number; + readonly findInStrings: boolean; + readonly findInComments: boolean; + }; + readonly locations: RenameLocation[]; } /* @internal */ @@ -395,29 +398,36 @@ namespace ts.server { } } - return this.lastRenameEntry = { - canRename: body.info.canRename, - fileToRename: body.info.fileToRename, - displayName: body.info.displayName, - fullDisplayName: body.info.fullDisplayName, - kind: body.info.kind, - kindModifiers: body.info.kindModifiers, - localizedErrorMessage: body.info.localizedErrorMessage, - triggerSpan: createTextSpanFromBounds(position, position), - fileName, - position, - findInStrings: !!findInStrings, - findInComments: !!findInComments, + const renameInfo = body.info.canRename + ? identity({ + canRename: body.info.canRename, + fileToRename: body.info.fileToRename, + displayName: body.info.displayName, + fullDisplayName: body.info.fullDisplayName, + kind: body.info.kind, + kindModifiers: body.info.kindModifiers, + triggerSpan: createTextSpanFromBounds(position, position), + }) + : identity({ canRename: false, localizedErrorMessage: body.info.localizedErrorMessage }); + this.lastRenameEntry = { + renameInfo, + inputs: { + fileName, + position, + findInStrings: !!findInStrings, + findInComments: !!findInComments, + }, locations, }; + return renameInfo; } findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[] { if (!this.lastRenameEntry || - this.lastRenameEntry.fileName !== fileName || - this.lastRenameEntry.position !== position || - this.lastRenameEntry.findInStrings !== findInStrings || - this.lastRenameEntry.findInComments !== findInComments) { + this.lastRenameEntry.inputs.fileName !== fileName || + this.lastRenameEntry.inputs.position !== position || + this.lastRenameEntry.inputs.findInStrings !== findInStrings || + this.lastRenameEntry.inputs.findInComments !== findInComments) { this.getRenameInfo(fileName, position, findInStrings, findInComments); } diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index b7ce7437f3c..ccd7aa1d067 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -1537,7 +1537,7 @@ Actual: ${stringify(fullActual)}`); public verifyRenameInfoSucceeded(displayName: string | undefined, fullDisplayName: string | undefined, kind: string | undefined, kindModifiers: string | undefined, fileToRename: string | undefined, expectedRange: Range | undefined): void { const renameInfo = this.languageService.getRenameInfo(this.activeFile.fileName, this.currentCaretPosition); if (!renameInfo.canRename) { - this.raiseError("Rename did not succeed"); + throw this.raiseError("Rename did not succeed"); } this.validate("displayName", displayName, renameInfo.displayName); @@ -1563,9 +1563,8 @@ Actual: ${stringify(fullActual)}`); public verifyRenameInfoFailed(message?: string) { const renameInfo = this.languageService.getRenameInfo(this.activeFile.fileName, this.currentCaretPosition); if (renameInfo.canRename) { - this.raiseError("Rename was expected to fail"); + throw this.raiseError("Rename was expected to fail"); } - this.validate("error", message, renameInfo.localizedErrorMessage); } diff --git a/src/server/protocol.ts b/src/server/protocol.ts index 52389c9e0d6..4a2d35503cc 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -1087,23 +1087,18 @@ namespace ts.server.protocol { /** * Information about the item to be renamed. */ - export interface RenameInfo { + export type RenameInfo = RenameInfoSuccess | RenameInfoFailure; + export interface RenameInfoSuccess { /** * True if item can be renamed. */ - canRename: boolean; - + canRename: true; /** * File or directory to rename. * If set, `getEditsForFileRename` should be called instead of `findRenameLocations`. */ fileToRename?: string; - /** - * Error message if item can not be renamed. - */ - localizedErrorMessage?: string; - /** * Display name of the item to be renamed. */ @@ -1127,6 +1122,13 @@ namespace ts.server.protocol { /** Span of text to rename. */ triggerSpan: TextSpan; } + export interface RenameInfoFailure { + canRename: false; + /** + * Error message if item can not be renamed. + */ + localizedErrorMessage: string; + } /** * A group of text spans, all in 'file'. diff --git a/src/server/session.ts b/src/server/session.ts index 744cfe04927..f664251cff6 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -1184,8 +1184,15 @@ namespace ts.server { return { info: renameInfo, locs: this.toSpanGroups(locations) }; } - private mapRenameInfo({ canRename, fileToRename, localizedErrorMessage, displayName, fullDisplayName, kind, kindModifiers, triggerSpan }: RenameInfo, scriptInfo: ScriptInfo): protocol.RenameInfo { - return { canRename, fileToRename, localizedErrorMessage, displayName, fullDisplayName, kind, kindModifiers, triggerSpan: this.toLocationTextSpan(triggerSpan, scriptInfo) }; + private mapRenameInfo(info: RenameInfo, scriptInfo: ScriptInfo): protocol.RenameInfo { + if (info.canRename) { + const { canRename, fileToRename, displayName, fullDisplayName, kind, kindModifiers, triggerSpan } = info; + return identity( + { canRename, fileToRename, displayName, fullDisplayName, kind, kindModifiers, triggerSpan: this.toLocationTextSpan(triggerSpan, scriptInfo) }); + } + else { + return info; + } } private toSpanGroups(locations: ReadonlyArray): ReadonlyArray { diff --git a/src/services/rename.ts b/src/services/rename.ts index d7f23347cb4..7ba32c91309 100644 --- a/src/services/rename.ts +++ b/src/services/rename.ts @@ -56,37 +56,26 @@ namespace ts.Rename { fileToRename: name, kind, displayName: name, - localizedErrorMessage: undefined, fullDisplayName: name, kindModifiers: ScriptElementKindModifier.none, triggerSpan, }; } - function getRenameInfoSuccess(displayName: string, fullDisplayName: string, kind: ScriptElementKind, kindModifiers: string, node: Node, sourceFile: SourceFile): RenameInfo { + function getRenameInfoSuccess(displayName: string, fullDisplayName: string, kind: ScriptElementKind, kindModifiers: string, node: Node, sourceFile: SourceFile): RenameInfoSuccess { return { canRename: true, fileToRename: undefined, kind, displayName, - localizedErrorMessage: undefined, fullDisplayName, kindModifiers, triggerSpan: createTriggerSpanForNode(node, sourceFile) }; } - function getRenameInfoError(diagnostic: DiagnosticMessage): RenameInfo { - // TODO: GH#18217 - return { - canRename: false, - localizedErrorMessage: getLocaleSpecificMessage(diagnostic), - displayName: undefined!, - fullDisplayName: undefined!, - kind: undefined!, - kindModifiers: undefined!, - triggerSpan: undefined! - }; + function getRenameInfoError(diagnostic: DiagnosticMessage): RenameInfoFailure { + return { canRename: false, localizedErrorMessage: getLocaleSpecificMessage(diagnostic) }; } function createTriggerSpanForNode(node: Node, sourceFile: SourceFile) { diff --git a/src/services/types.ts b/src/services/types.ts index ff2081d3c22..011c98f9da6 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -821,20 +821,24 @@ namespace ts { tags?: JSDocTagInfo[]; } - export interface RenameInfo { - canRename: boolean; + export type RenameInfo = RenameInfoSuccess | RenameInfoFailure; + export interface RenameInfoSuccess { + canRename: true; /** * File or directory to rename. * If set, `getEditsForFileRename` should be called instead of `findRenameLocations`. */ fileToRename?: string; - localizedErrorMessage?: string; displayName: string; fullDisplayName: string; kind: ScriptElementKind; kindModifiers: string; triggerSpan: TextSpan; } + export interface RenameInfoFailure { + canRename: false; + localizedErrorMessage: string; + } export interface SignatureHelpParameter { name: string; diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index ad23e4a8323..41a8d9f292e 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -8309,7 +8309,6 @@ namespace ts.projectSystem { fullDisplayName: '"/users/username/projects/a/c/fc".C', kind: ScriptElementKind.constElement, kindModifiers: ScriptElementKindModifier.exportedModifier, - localizedErrorMessage: undefined, triggerSpan: protocolTextSpanFromSubstring(cFile.content, "C"), }, locs: [ @@ -9597,7 +9596,6 @@ export function Test2() { fullDisplayName: aTs.path, kind: ScriptElementKind.moduleElement, kindModifiers: "", - localizedErrorMessage: undefined, triggerSpan: protocolTextSpanFromSubstring(bTs.content, "a", { index: 1 }), }, locs: [{ file: bTs.path, locs: [protocolRenameSpanFromSubstring(bTs.content, "./a")] }], @@ -9618,7 +9616,6 @@ export function Test2() { fullDisplayName: "x", kind: ScriptElementKind.constElement, kindModifiers: ScriptElementKindModifier.none, - localizedErrorMessage: undefined, triggerSpan: protocolTextSpanFromSubstring(aTs.content, "x"), }, locs: [ @@ -10131,7 +10128,6 @@ declare class TestLib { fullDisplayName: "fnA", kind: ScriptElementKind.alias, kindModifiers: ScriptElementKindModifier.none, - localizedErrorMessage: undefined, triggerSpan: protocolTextSpanFromSubstring(userTs.content, "fnA", { index: 1 }), }, locs: [renameUserTs(userTs), renameATs(aTs)], @@ -10151,7 +10147,6 @@ declare class TestLib { fullDisplayName: '"/a/a".fnA', kind: ScriptElementKind.functionElement, kindModifiers: ScriptElementKindModifier.exportedModifier, - localizedErrorMessage: undefined, triggerSpan: protocolTextSpanFromSubstring(aTs.content, "fnA"), }, locs: [renameATs(aTs), renameUserTs(userTs)], @@ -10181,7 +10176,6 @@ declare class TestLib { fullDisplayName: "fnB", kind: ScriptElementKind.alias, kindModifiers: ScriptElementKindModifier.none, - localizedErrorMessage: undefined, triggerSpan: protocolTextSpanFromSubstring(userTs.content, "fnB", { index: 1 }), }, locs: [ diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 61fc5dbac46..a454ffe3be2 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -5114,20 +5114,24 @@ declare namespace ts { documentation?: SymbolDisplayPart[]; tags?: JSDocTagInfo[]; } - interface RenameInfo { - canRename: boolean; + type RenameInfo = RenameInfoSuccess | RenameInfoFailure; + interface RenameInfoSuccess { + canRename: true; /** * File or directory to rename. * If set, `getEditsForFileRename` should be called instead of `findRenameLocations`. */ fileToRename?: string; - localizedErrorMessage?: string; displayName: string; fullDisplayName: string; kind: ScriptElementKind; kindModifiers: string; triggerSpan: TextSpan; } + interface RenameInfoFailure { + canRename: false; + localizedErrorMessage: string; + } interface SignatureHelpParameter { name: string; documentation: SymbolDisplayPart[]; @@ -6437,20 +6441,17 @@ declare namespace ts.server.protocol { /** * Information about the item to be renamed. */ - interface RenameInfo { + type RenameInfo = RenameInfoSuccess | RenameInfoFailure; + interface RenameInfoSuccess { /** * True if item can be renamed. */ - canRename: boolean; + canRename: true; /** * File or directory to rename. * If set, `getEditsForFileRename` should be called instead of `findRenameLocations`. */ fileToRename?: string; - /** - * Error message if item can not be renamed. - */ - localizedErrorMessage?: string; /** * Display name of the item to be renamed. */ @@ -6470,6 +6471,13 @@ declare namespace ts.server.protocol { /** Span of text to rename. */ triggerSpan: TextSpan; } + interface RenameInfoFailure { + canRename: false; + /** + * Error message if item can not be renamed. + */ + localizedErrorMessage: string; + } /** * A group of text spans, all in 'file'. */ diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 54a37336d35..3ee556a58dd 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -5114,20 +5114,24 @@ declare namespace ts { documentation?: SymbolDisplayPart[]; tags?: JSDocTagInfo[]; } - interface RenameInfo { - canRename: boolean; + type RenameInfo = RenameInfoSuccess | RenameInfoFailure; + interface RenameInfoSuccess { + canRename: true; /** * File or directory to rename. * If set, `getEditsForFileRename` should be called instead of `findRenameLocations`. */ fileToRename?: string; - localizedErrorMessage?: string; displayName: string; fullDisplayName: string; kind: ScriptElementKind; kindModifiers: string; triggerSpan: TextSpan; } + interface RenameInfoFailure { + canRename: false; + localizedErrorMessage: string; + } interface SignatureHelpParameter { name: string; documentation: SymbolDisplayPart[]; From 7bf382e73f069b366d47133ca3be8e70c0374dfe Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 27 Sep 2018 12:40:29 -0700 Subject: [PATCH 64/71] Allow empty files lists in tsconfigs with an extends member (#27383) --- src/compiler/commandLineParser.ts | 3 ++- src/testRunner/unittests/configurationExtension.ts | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 3ebb865a64c..9478f4504b7 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -1895,7 +1895,8 @@ namespace ts { filesSpecs = >raw.files; const hasReferences = hasProperty(raw, "references") && !isNullOrUndefined(raw.references); const hasZeroOrNoReferences = !hasReferences || raw.references.length === 0; - if (filesSpecs.length === 0 && hasZeroOrNoReferences) { + const hasExtends = hasProperty(raw, "extends"); + if (filesSpecs.length === 0 && hasZeroOrNoReferences && !hasExtends) { if (sourceFile) { const fileName = configFileName || "tsconfig.json"; const diagnosticMessage = Diagnostics.The_files_list_in_config_file_0_is_empty; diff --git a/src/testRunner/unittests/configurationExtension.ts b/src/testRunner/unittests/configurationExtension.ts index b9567b3b54d..fbb4950b9a5 100644 --- a/src/testRunner/unittests/configurationExtension.ts +++ b/src/testRunner/unittests/configurationExtension.ts @@ -96,6 +96,11 @@ namespace ts { include: null, files: ["../main.ts"] }), + "dev/configs/fifth.json": JSON.stringify({ + extends: "./fourth", + include: ["../tests/utils.ts"], + files: [] + }), "dev/extends.json": JSON.stringify({ extends: 42 }), "dev/extends2.json": JSON.stringify({ extends: "configs/base" }), "dev/main.ts": "", @@ -245,6 +250,15 @@ namespace ts { combinePaths(basePath, "main.ts") ]); + testSuccess("can overwrite top-level files using extended []", "configs/fifth.json", { + allowJs: true, + noImplicitAny: true, + strictNullChecks: true, + module: ModuleKind.System + }, [ + combinePaths(basePath, "tests/utils.ts") + ]); + it("adds extendedSourceFiles only once", () => { const sourceFile = readJsonConfigFile("configs/fourth.json", (path) => host.readFile(path)); const dir = combinePaths(basePath, "configs"); From 26eb6ab6f43d20e3924330d9b7f955661311d252 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 27 Sep 2018 15:49:51 -0700 Subject: [PATCH 65/71] Primitives should not be instanceof... anything (#27402) --- src/compiler/checker.ts | 1 + .../controlFlowInstanceOfGuardPrimitives.js | 30 ++++++++ ...ntrolFlowInstanceOfGuardPrimitives.symbols | 50 +++++++++++++ ...controlFlowInstanceOfGuardPrimitives.types | 71 +++++++++++++++++++ .../controlFlowInstanceOfGuardPrimitives.ts | 13 ++++ 5 files changed, 165 insertions(+) create mode 100644 tests/baselines/reference/controlFlowInstanceOfGuardPrimitives.js create mode 100644 tests/baselines/reference/controlFlowInstanceOfGuardPrimitives.symbols create mode 100644 tests/baselines/reference/controlFlowInstanceOfGuardPrimitives.types create mode 100644 tests/cases/conformance/controlFlow/controlFlowInstanceOfGuardPrimitives.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index abcc52652c6..d6c4cb6afeb 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -10595,6 +10595,7 @@ namespace ts { function isTypeDerivedFrom(source: Type, target: Type): boolean { return source.flags & TypeFlags.Union ? every((source).types, t => isTypeDerivedFrom(t, target)) : target.flags & TypeFlags.Union ? some((target).types, t => isTypeDerivedFrom(source, t)) : + source.flags & TypeFlags.Primitive && !(target.flags & TypeFlags.Primitive) ? false : source.flags & TypeFlags.InstantiableNonPrimitive ? isTypeDerivedFrom(getBaseConstraintOfType(source) || emptyObjectType, target) : target === globalObjectType || target === globalFunctionType ? isTypeSubtypeOf(source, target) : hasBaseType(source, getTargetType(target)); diff --git a/tests/baselines/reference/controlFlowInstanceOfGuardPrimitives.js b/tests/baselines/reference/controlFlowInstanceOfGuardPrimitives.js new file mode 100644 index 00000000000..04e3c00b518 --- /dev/null +++ b/tests/baselines/reference/controlFlowInstanceOfGuardPrimitives.js @@ -0,0 +1,30 @@ +//// [controlFlowInstanceOfGuardPrimitives.ts] +function distinguish(thing: string | number | Date) { + if (thing instanceof Object) { + console.log("Aha!! It's a Date in " + thing.getFullYear()); + } else if (typeof thing === 'string') { + console.log("Aha!! It's a string of length " + thing.length); + } else { + console.log("Aha!! It's the number " + thing.toPrecision(3)); + } +} + +distinguish(new Date()); +distinguish("beef"); +distinguish(3.14159265); + +//// [controlFlowInstanceOfGuardPrimitives.js] +function distinguish(thing) { + if (thing instanceof Object) { + console.log("Aha!! It's a Date in " + thing.getFullYear()); + } + else if (typeof thing === 'string') { + console.log("Aha!! It's a string of length " + thing.length); + } + else { + console.log("Aha!! It's the number " + thing.toPrecision(3)); + } +} +distinguish(new Date()); +distinguish("beef"); +distinguish(3.14159265); diff --git a/tests/baselines/reference/controlFlowInstanceOfGuardPrimitives.symbols b/tests/baselines/reference/controlFlowInstanceOfGuardPrimitives.symbols new file mode 100644 index 00000000000..6b51a85d0f2 --- /dev/null +++ b/tests/baselines/reference/controlFlowInstanceOfGuardPrimitives.symbols @@ -0,0 +1,50 @@ +=== tests/cases/conformance/controlFlow/controlFlowInstanceOfGuardPrimitives.ts === +function distinguish(thing: string | number | Date) { +>distinguish : Symbol(distinguish, Decl(controlFlowInstanceOfGuardPrimitives.ts, 0, 0)) +>thing : Symbol(thing, Decl(controlFlowInstanceOfGuardPrimitives.ts, 0, 21)) +>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.scripthost.d.ts, --, --)) + + if (thing instanceof Object) { +>thing : Symbol(thing, Decl(controlFlowInstanceOfGuardPrimitives.ts, 0, 21)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + + console.log("Aha!! It's a Date in " + thing.getFullYear()); +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>thing.getFullYear : Symbol(Date.getFullYear, Decl(lib.es5.d.ts, --, --)) +>thing : Symbol(thing, Decl(controlFlowInstanceOfGuardPrimitives.ts, 0, 21)) +>getFullYear : Symbol(Date.getFullYear, Decl(lib.es5.d.ts, --, --)) + + } else if (typeof thing === 'string') { +>thing : Symbol(thing, Decl(controlFlowInstanceOfGuardPrimitives.ts, 0, 21)) + + console.log("Aha!! It's a string of length " + thing.length); +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>thing.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) +>thing : Symbol(thing, Decl(controlFlowInstanceOfGuardPrimitives.ts, 0, 21)) +>length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) + + } else { + console.log("Aha!! It's the number " + thing.toPrecision(3)); +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>thing.toPrecision : Symbol(Number.toPrecision, Decl(lib.es5.d.ts, --, --)) +>thing : Symbol(thing, Decl(controlFlowInstanceOfGuardPrimitives.ts, 0, 21)) +>toPrecision : Symbol(Number.toPrecision, Decl(lib.es5.d.ts, --, --)) + } +} + +distinguish(new Date()); +>distinguish : Symbol(distinguish, Decl(controlFlowInstanceOfGuardPrimitives.ts, 0, 0)) +>Date : Symbol(Date, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.scripthost.d.ts, --, --)) + +distinguish("beef"); +>distinguish : Symbol(distinguish, Decl(controlFlowInstanceOfGuardPrimitives.ts, 0, 0)) + +distinguish(3.14159265); +>distinguish : Symbol(distinguish, Decl(controlFlowInstanceOfGuardPrimitives.ts, 0, 0)) + diff --git a/tests/baselines/reference/controlFlowInstanceOfGuardPrimitives.types b/tests/baselines/reference/controlFlowInstanceOfGuardPrimitives.types new file mode 100644 index 00000000000..2531f6ae891 --- /dev/null +++ b/tests/baselines/reference/controlFlowInstanceOfGuardPrimitives.types @@ -0,0 +1,71 @@ +=== tests/cases/conformance/controlFlow/controlFlowInstanceOfGuardPrimitives.ts === +function distinguish(thing: string | number | Date) { +>distinguish : (thing: string | number | Date) => void +>thing : string | number | Date + + if (thing instanceof Object) { +>thing instanceof Object : boolean +>thing : string | number | Date +>Object : ObjectConstructor + + console.log("Aha!! It's a Date in " + thing.getFullYear()); +>console.log("Aha!! It's a Date in " + thing.getFullYear()) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void +>"Aha!! It's a Date in " + thing.getFullYear() : string +>"Aha!! It's a Date in " : "Aha!! It's a Date in " +>thing.getFullYear() : number +>thing.getFullYear : () => number +>thing : Date +>getFullYear : () => number + + } else if (typeof thing === 'string') { +>typeof thing === 'string' : boolean +>typeof thing : "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function" +>thing : string | number +>'string' : "string" + + console.log("Aha!! It's a string of length " + thing.length); +>console.log("Aha!! It's a string of length " + thing.length) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void +>"Aha!! It's a string of length " + thing.length : string +>"Aha!! It's a string of length " : "Aha!! It's a string of length " +>thing.length : number +>thing : string +>length : number + + } else { + console.log("Aha!! It's the number " + thing.toPrecision(3)); +>console.log("Aha!! It's the number " + thing.toPrecision(3)) : void +>console.log : (message?: any, ...optionalParams: any[]) => void +>console : Console +>log : (message?: any, ...optionalParams: any[]) => void +>"Aha!! It's the number " + thing.toPrecision(3) : string +>"Aha!! It's the number " : "Aha!! It's the number " +>thing.toPrecision(3) : string +>thing.toPrecision : (precision?: number) => string +>thing : number +>toPrecision : (precision?: number) => string +>3 : 3 + } +} + +distinguish(new Date()); +>distinguish(new Date()) : void +>distinguish : (thing: string | number | Date) => void +>new Date() : Date +>Date : DateConstructor + +distinguish("beef"); +>distinguish("beef") : void +>distinguish : (thing: string | number | Date) => void +>"beef" : "beef" + +distinguish(3.14159265); +>distinguish(3.14159265) : void +>distinguish : (thing: string | number | Date) => void +>3.14159265 : 3.14159265 + diff --git a/tests/cases/conformance/controlFlow/controlFlowInstanceOfGuardPrimitives.ts b/tests/cases/conformance/controlFlow/controlFlowInstanceOfGuardPrimitives.ts new file mode 100644 index 00000000000..516c6b62774 --- /dev/null +++ b/tests/cases/conformance/controlFlow/controlFlowInstanceOfGuardPrimitives.ts @@ -0,0 +1,13 @@ +function distinguish(thing: string | number | Date) { + if (thing instanceof Object) { + console.log("Aha!! It's a Date in " + thing.getFullYear()); + } else if (typeof thing === 'string') { + console.log("Aha!! It's a string of length " + thing.length); + } else { + console.log("Aha!! It's the number " + thing.toPrecision(3)); + } +} + +distinguish(new Date()); +distinguish("beef"); +distinguish(3.14159265); \ No newline at end of file From 19af881f94c908c3da4ee6b2aecc0046499ef2d4 Mon Sep 17 00:00:00 2001 From: Andy Date: Thu, 27 Sep 2018 18:26:57 -0700 Subject: [PATCH 66/71] ExpressionWithTypeArguments parent may be a JSDocAugmentsTag (#27229) --- src/compiler/checker.ts | 16 +++-------- .../transformers/declarations/diagnostics.ts | 4 +-- src/compiler/types.ts | 2 +- src/compiler/utilities.ts | 28 +++++++++---------- .../reference/api/tsserverlibrary.d.ts | 2 +- tests/baselines/reference/api/typescript.d.ts | 2 +- 6 files changed, 23 insertions(+), 31 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d6c4cb6afeb..611b6c4d4b0 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -27940,24 +27940,20 @@ namespace ts { return errorType; } + const classDecl = tryGetClassImplementingOrExtendingExpressionWithTypeArguments(node); + const classType = classDecl && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(classDecl.class)); if (isPartOfTypeNode(node)) { const typeFromTypeNode = getTypeFromTypeNode(node); - - if (isExpressionWithTypeArgumentsInClassImplementsClause(node)) { - return getTypeWithThisArgument(typeFromTypeNode, getTypeOfClassContainingHeritageClause(node).thisType); - } - - return typeFromTypeNode; + return classType ? getTypeWithThisArgument(typeFromTypeNode, classType.thisType) : typeFromTypeNode; } if (isExpressionNode(node)) { return getRegularTypeOfExpression(node); } - if (isExpressionWithTypeArgumentsInClassExtendsClause(node)) { + if (classType && !classDecl!.isImplements) { // A SyntaxKind.ExpressionWithTypeArguments is considered a type node, except when it occurs in the // extends clause of a class. We handle that case here. - const classType = getTypeOfClassContainingHeritageClause(node); const baseType = firstOrUndefined(getBaseTypes(classType)); return baseType ? getTypeWithThisArgument(baseType, classType.thisType) : errorType; } @@ -27999,10 +27995,6 @@ namespace ts { return errorType; } - function getTypeOfClassContainingHeritageClause(node: ExpressionWithTypeArguments): InterfaceType { - return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node.parent.parent)); - } - // Gets the type of object literal or array literal of destructuring assignment. // { a } from // for ( { a } of elems) { diff --git a/src/compiler/transformers/declarations/diagnostics.ts b/src/compiler/transformers/declarations/diagnostics.ts index 0865861414e..53b5750a1ed 100644 --- a/src/compiler/transformers/declarations/diagnostics.ts +++ b/src/compiler/transformers/declarations/diagnostics.ts @@ -434,7 +434,7 @@ namespace ts { // Heritage clause is written by user so it can always be named if (node.parent.parent.kind === SyntaxKind.ClassDeclaration) { // Class or Interface implemented/extended is inaccessible - diagnosticMessage = (node as ExpressionWithTypeArguments).parent.token === SyntaxKind.ImplementsKeyword ? + diagnosticMessage = isHeritageClause(node.parent) && node.parent.token === SyntaxKind.ImplementsKeyword ? Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1; } @@ -446,7 +446,7 @@ namespace ts { return { diagnosticMessage, errorNode: node, - typeName: getNameOfDeclaration((node as ExpressionWithTypeArguments).parent.parent) + typeName: getNameOfDeclaration(node.parent.parent as Declaration) }; } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 9b1c57b2097..d5480e09796 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -1708,7 +1708,7 @@ namespace ts { export interface ExpressionWithTypeArguments extends NodeWithTypeArguments { kind: SyntaxKind.ExpressionWithTypeArguments; - parent: HeritageClause; + parent: HeritageClause | JSDocAugmentsTag; expression: LeftHandSideExpression; } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 60a7d759b68..d4c28ee94c6 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -3734,11 +3734,20 @@ namespace ts { /** Get `C` given `N` if `N` is in the position `class C extends N` where `N` is an ExpressionWithTypeArguments. */ export function tryGetClassExtendingExpressionWithTypeArguments(node: Node): ClassLikeDeclaration | undefined { - if (isExpressionWithTypeArguments(node) && - node.parent.token === SyntaxKind.ExtendsKeyword && - isClassLike(node.parent.parent)) { - return node.parent.parent; - } + const cls = tryGetClassImplementingOrExtendingExpressionWithTypeArguments(node); + return cls && !cls.isImplements ? cls.class : undefined; + } + + export interface ClassImplementingOrExtendingExpressionWithTypeArguments { + readonly class: ClassLikeDeclaration; + readonly isImplements: boolean; + } + export function tryGetClassImplementingOrExtendingExpressionWithTypeArguments(node: Node): ClassImplementingOrExtendingExpressionWithTypeArguments | undefined { + return isExpressionWithTypeArguments(node) + && isHeritageClause(node.parent) + && isClassLike(node.parent.parent) + ? { class: node.parent.parent, isImplements: node.parent.token === SyntaxKind.ImplementsKeyword } + : undefined; } export function isAssignmentExpression(node: Node, excludeCompoundAssignment: true): node is AssignmentExpression; @@ -3765,15 +3774,6 @@ namespace ts { return tryGetClassExtendingExpressionWithTypeArguments(node) !== undefined; } - export function isExpressionWithTypeArgumentsInClassImplementsClause(node: Node): node is ExpressionWithTypeArguments { - return node.kind === SyntaxKind.ExpressionWithTypeArguments - && isEntityNameExpression((node as ExpressionWithTypeArguments).expression) - && node.parent - && (node.parent).token === SyntaxKind.ImplementsKeyword - && node.parent.parent - && isClassLike(node.parent.parent); - } - export function isEntityNameExpression(node: Node): node is EntityNameExpression { return node.kind === SyntaxKind.Identifier || isPropertyAccessEntityNameExpression(node); } diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index a454ffe3be2..a90f40f9ac7 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -1082,7 +1082,7 @@ declare namespace ts { } interface ExpressionWithTypeArguments extends NodeWithTypeArguments { kind: SyntaxKind.ExpressionWithTypeArguments; - parent: HeritageClause; + parent: HeritageClause | JSDocAugmentsTag; expression: LeftHandSideExpression; } interface NewExpression extends PrimaryExpression, Declaration { diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 3ee556a58dd..d6bd508999d 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -1082,7 +1082,7 @@ declare namespace ts { } interface ExpressionWithTypeArguments extends NodeWithTypeArguments { kind: SyntaxKind.ExpressionWithTypeArguments; - parent: HeritageClause; + parent: HeritageClause | JSDocAugmentsTag; expression: LeftHandSideExpression; } interface NewExpression extends PrimaryExpression, Declaration { From bde81deed29c92b941a366531602c4abdf13e29d Mon Sep 17 00:00:00 2001 From: Dhruv Rajvanshi Date: Fri, 28 Sep 2018 07:26:37 +0530 Subject: [PATCH 67/71] Issue #27301: Fixed crash when converting function to async (#27396) --- .../codefixes/convertToAsyncFunction.ts | 19 ++++++++---- .../unittests/convertToAsyncFunction.ts | 15 +++++++++- .../convertToAsyncFunction_noArgs.js | 30 +++++++++++++++++++ .../convertToAsyncFunction_noArgs.ts | 30 +++++++++++++++++++ 4 files changed, 88 insertions(+), 6 deletions(-) create mode 100644 tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_noArgs.js create mode 100644 tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_noArgs.ts diff --git a/src/services/codefixes/convertToAsyncFunction.ts b/src/services/codefixes/convertToAsyncFunction.ts index 42d737a9e5f..fbaf0178d2f 100644 --- a/src/services/codefixes/convertToAsyncFunction.ts +++ b/src/services/codefixes/convertToAsyncFunction.ts @@ -451,7 +451,11 @@ namespace ts.codefix { } return shouldReturn ? refactoredStmts.map(s => getSynthesizedDeepClone(s)) : - removeReturns(refactoredStmts, prevArgName!.identifier, transformer, seenReturnStatement); + removeReturns( + refactoredStmts, + prevArgName === undefined ? undefined : prevArgName.identifier, + transformer, + seenReturnStatement); } else { const innerRetStmts = getReturnStatementsWithPromiseHandlers(createReturn(funcBody)); @@ -491,14 +495,19 @@ namespace ts.codefix { } - function removeReturns(stmts: ReadonlyArray, prevArgName: Identifier, transformer: Transformer, seenReturnStatement: boolean): ReadonlyArray { + function removeReturns(stmts: ReadonlyArray, prevArgName: Identifier | undefined, transformer: Transformer, seenReturnStatement: boolean): ReadonlyArray { const ret: Statement[] = []; for (const stmt of stmts) { if (isReturnStatement(stmt)) { if (stmt.expression) { const possiblyAwaitedExpression = isPromiseReturningExpression(stmt.expression, transformer.checker) ? createAwait(stmt.expression) : stmt.expression; - ret.push(createVariableStatement(/*modifiers*/ undefined, - (createVariableDeclarationList([createVariableDeclaration(prevArgName, /*type*/ undefined, possiblyAwaitedExpression)], getFlagOfIdentifier(prevArgName, transformer.constIdentifiers))))); + if (prevArgName === undefined) { + ret.push(createExpressionStatement(possiblyAwaitedExpression)); + } + else { + ret.push(createVariableStatement(/*modifiers*/ undefined, + (createVariableDeclarationList([createVariableDeclaration(prevArgName, /*type*/ undefined, possiblyAwaitedExpression)], getFlagOfIdentifier(prevArgName, transformer.constIdentifiers))))); + } } } else { @@ -507,7 +516,7 @@ namespace ts.codefix { } // if block has no return statement, need to define prevArgName as undefined to prevent undeclared variables - if (!seenReturnStatement) { + if (!seenReturnStatement && prevArgName !== undefined) { ret.push(createVariableStatement(/*modifiers*/ undefined, (createVariableDeclarationList([createVariableDeclaration(prevArgName, /*type*/ undefined, createIdentifier("undefined"))], getFlagOfIdentifier(prevArgName, transformer.constIdentifiers))))); } diff --git a/src/testRunner/unittests/convertToAsyncFunction.ts b/src/testRunner/unittests/convertToAsyncFunction.ts index c1a08b3319c..162b3578478 100644 --- a/src/testRunner/unittests/convertToAsyncFunction.ts +++ b/src/testRunner/unittests/convertToAsyncFunction.ts @@ -1241,6 +1241,19 @@ _testConvertToAsyncFunction("convertToAsyncFunction_nestedPromises", ` function [#|f|]() { return fetch('https://typescriptlang.org').then(x => Promise.resolve(3).then(y => Promise.resolve(x.statusText.length + y))); } +`); +_testConvertToAsyncFunction("convertToAsyncFunction_noArgs", ` +function delay(millis: number): Promise { + throw "no" +} + +function [#|main2|]() { + console.log("Please wait. Loading."); + return delay(500) + .then(() => { console.log("."); return delay(500); }) + .then(() => { console.log("."); return delay(500); }) + .then(() => { console.log("."); return delay(500); }) +} `); }); @@ -1251,4 +1264,4 @@ function [#|f|]() { function _testConvertToAsyncFunctionFailed(caption: string, text: string) { testConvertToAsyncFunction(caption, text, "convertToAsyncFunction", /*includeLib*/ true, /*expectFailure*/ true); } -} \ No newline at end of file +} diff --git a/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_noArgs.js b/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_noArgs.js new file mode 100644 index 00000000000..8cda2c9dc94 --- /dev/null +++ b/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_noArgs.js @@ -0,0 +1,30 @@ +// ==ORIGINAL== + +function delay(millis) { + throw "no" +} + +function /*[#|*/main2/*|]*/() { + console.log("Please wait. Loading."); + return delay(500) + .then(() => { console.log("."); return delay(500); }) + .then(() => { console.log("."); return delay(500); }) + .then(() => { console.log("."); return delay(500); }) +} + +// ==ASYNC FUNCTION::Convert to async function== + +function delay(millis) { + throw "no" +} + +async function main2() { + console.log("Please wait. Loading."); + await delay(500); + console.log("."); + await delay(500); + console.log("."); + await delay(500); + console.log("."); + return delay(500); +} diff --git a/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_noArgs.ts b/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_noArgs.ts new file mode 100644 index 00000000000..088bf9f828e --- /dev/null +++ b/tests/baselines/reference/convertToAsyncFunction/convertToAsyncFunction_noArgs.ts @@ -0,0 +1,30 @@ +// ==ORIGINAL== + +function delay(millis: number): Promise { + throw "no" +} + +function /*[#|*/main2/*|]*/() { + console.log("Please wait. Loading."); + return delay(500) + .then(() => { console.log("."); return delay(500); }) + .then(() => { console.log("."); return delay(500); }) + .then(() => { console.log("."); return delay(500); }) +} + +// ==ASYNC FUNCTION::Convert to async function== + +function delay(millis: number): Promise { + throw "no" +} + +async function main2() { + console.log("Please wait. Loading."); + await delay(500); + console.log("."); + await delay(500); + console.log("."); + await delay(500); + console.log("."); + return delay(500); +} From 6d92a2942fc00bd8a6bd78e70d5d8d95f5d429b6 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Fri, 28 Sep 2018 08:31:56 -0700 Subject: [PATCH 68/71] Fix parent points in unreachable code (#27400) (#27406) In the binder, unreachable code mistakenly skips the `bindJSDoc` call in `bindChildrenWorker`, which sets parent pointers. The fix is to call `bindJSDoc` in the case of unreachable code as well. --- src/compiler/binder.ts | 1 + .../jsdocBindingInUnreachableCode.symbols | 12 ++++++++++++ .../reference/jsdocBindingInUnreachableCode.types | 15 +++++++++++++++ .../jsdoc/jsdocBindingInUnreachableCode.ts | 11 +++++++++++ 4 files changed, 39 insertions(+) create mode 100644 tests/baselines/reference/jsdocBindingInUnreachableCode.symbols create mode 100644 tests/baselines/reference/jsdocBindingInUnreachableCode.types create mode 100644 tests/cases/conformance/jsdoc/jsdocBindingInUnreachableCode.ts diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 38d6f558242..b7d0d6f0f0e 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -640,6 +640,7 @@ namespace ts { function bindChildrenWorker(node: Node): void { if (checkUnreachable(node)) { bindEachChild(node); + bindJSDoc(node); return; } switch (node.kind) { diff --git a/tests/baselines/reference/jsdocBindingInUnreachableCode.symbols b/tests/baselines/reference/jsdocBindingInUnreachableCode.symbols new file mode 100644 index 00000000000..62ef96f854a --- /dev/null +++ b/tests/baselines/reference/jsdocBindingInUnreachableCode.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/jsdoc/bug27341.js === +if (false) { + /** + * @param {string} s + */ + const x = function (s) { +>x : Symbol(x, Decl(bug27341.js, 4, 9)) +>s : Symbol(s, Decl(bug27341.js, 4, 24)) + + }; +} + diff --git a/tests/baselines/reference/jsdocBindingInUnreachableCode.types b/tests/baselines/reference/jsdocBindingInUnreachableCode.types new file mode 100644 index 00000000000..d1d01d17e96 --- /dev/null +++ b/tests/baselines/reference/jsdocBindingInUnreachableCode.types @@ -0,0 +1,15 @@ +=== tests/cases/conformance/jsdoc/bug27341.js === +if (false) { +>false : false + + /** + * @param {string} s + */ + const x = function (s) { +>x : (s: string) => void +>function (s) { } : (s: string) => void +>s : string + + }; +} + diff --git a/tests/cases/conformance/jsdoc/jsdocBindingInUnreachableCode.ts b/tests/cases/conformance/jsdoc/jsdocBindingInUnreachableCode.ts new file mode 100644 index 00000000000..2c4accf993b --- /dev/null +++ b/tests/cases/conformance/jsdoc/jsdocBindingInUnreachableCode.ts @@ -0,0 +1,11 @@ +// @allowJs: true +// @noEmit: true +// @checkJs: true +// @Filename: bug27341.js +if (false) { + /** + * @param {string} s + */ + const x = function (s) { + }; +} From 21148b3b0aeac9402fb25f87bb066e83814875af Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Fri, 28 Sep 2018 10:39:30 -0700 Subject: [PATCH 69/71] Fix typo in PseudoPragma* types (#27437) --- src/compiler/parser.ts | 24 ++++++++++++------------ src/compiler/types.ts | 18 +++++++++--------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 33829fccb7a..847c6307f79 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -7725,7 +7725,7 @@ namespace ts { /*@internal*/ export function processCommentPragmas(context: PragmaContext, sourceText: string): void { const triviaScanner = createScanner(context.languageVersion, /*skipTrivia*/ false, LanguageVariant.Standard, sourceText); - const pragmas: PragmaPsuedoMapEntry[] = []; + const pragmas: PragmaPseudoMapEntry[] = []; // Keep scanning all the leading trivia in the file until we get to something that // isn't trivia. Any single line comment will be analyzed to see if it is a @@ -7780,7 +7780,7 @@ namespace ts { const referencedFiles = context.referencedFiles; const typeReferenceDirectives = context.typeReferenceDirectives; const libReferenceDirectives = context.libReferenceDirectives; - forEach(toArray(entryOrList), (arg: PragmaPsuedoMap["reference"]) => { + forEach(toArray(entryOrList), (arg: PragmaPseudoMap["reference"]) => { // TODO: GH#18217 if (arg!.arguments["no-default-lib"]) { context.hasNoDefaultLib = true; @@ -7803,7 +7803,7 @@ namespace ts { case "amd-dependency": { context.amdDependencies = map( toArray(entryOrList), - (x: PragmaPsuedoMap["amd-dependency"]) => ({ name: x!.arguments.name!, path: x!.arguments.path })); // TODO: GH#18217 + (x: PragmaPseudoMap["amd-dependency"]) => ({ name: x!.arguments.name!, path: x!.arguments.path })); // TODO: GH#18217 break; } case "amd-module": { @@ -7813,11 +7813,11 @@ namespace ts { // TODO: It's probably fine to issue this diagnostic on all instances of the pragma reportDiagnostic(entry!.range.pos, entry!.range.end - entry!.range.pos, Diagnostics.An_AMD_module_cannot_have_multiple_name_assignments); } - context.moduleName = (entry as PragmaPsuedoMap["amd-module"])!.arguments.name; + context.moduleName = (entry as PragmaPseudoMap["amd-module"])!.arguments.name; } } else { - context.moduleName = (entryOrList as PragmaPsuedoMap["amd-module"])!.arguments.name; + context.moduleName = (entryOrList as PragmaPseudoMap["amd-module"])!.arguments.name; } break; } @@ -7853,10 +7853,10 @@ namespace ts { const tripleSlashXMLCommentStartRegEx = /^\/\/\/\s*<(\S+)\s.*?\/>/im; const singleLinePragmaRegEx = /^\/\/\/?\s*@(\S+)\s*(.*)\s*$/im; - function extractPragmas(pragmas: PragmaPsuedoMapEntry[], range: CommentRange, text: string) { + function extractPragmas(pragmas: PragmaPseudoMapEntry[], range: CommentRange, text: string) { const tripleSlash = range.kind === SyntaxKind.SingleLineCommentTrivia && tripleSlashXMLCommentStartRegEx.exec(text); if (tripleSlash) { - const name = tripleSlash[1].toLowerCase() as keyof PragmaPsuedoMap; // Technically unsafe cast, but we do it so the below check to make it safe typechecks + const name = tripleSlash[1].toLowerCase() as keyof PragmaPseudoMap; // Technically unsafe cast, but we do it so the below check to make it safe typechecks const pragma = commentPragmas[name] as PragmaDefinition; if (!pragma || !(pragma.kind! & PragmaKindFlags.TripleSlashXML)) { return; @@ -7883,10 +7883,10 @@ namespace ts { } } } - pragmas.push({ name, args: { arguments: argument, range } } as PragmaPsuedoMapEntry); + pragmas.push({ name, args: { arguments: argument, range } } as PragmaPseudoMapEntry); } else { - pragmas.push({ name, args: { arguments: {}, range } } as PragmaPsuedoMapEntry); + pragmas.push({ name, args: { arguments: {}, range } } as PragmaPseudoMapEntry); } return; } @@ -7905,9 +7905,9 @@ namespace ts { } } - function addPragmaForMatch(pragmas: PragmaPsuedoMapEntry[], range: CommentRange, kind: PragmaKindFlags, match: RegExpExecArray) { + function addPragmaForMatch(pragmas: PragmaPseudoMapEntry[], range: CommentRange, kind: PragmaKindFlags, match: RegExpExecArray) { if (!match) return; - const name = match[1].toLowerCase() as keyof PragmaPsuedoMap; // Technically unsafe cast, but we do it so they below check to make it safe typechecks + const name = match[1].toLowerCase() as keyof PragmaPseudoMap; // Technically unsafe cast, but we do it so they below check to make it safe typechecks const pragma = commentPragmas[name] as PragmaDefinition; if (!pragma || !(pragma.kind! & kind)) { return; @@ -7915,7 +7915,7 @@ namespace ts { const args = match[2]; // Split on spaces and match up positionally with definition const argument = getNamedPragmaArguments(pragma, args); if (argument === "fail") return; // Missing required argument, fail to parse it - pragmas.push({ name, args: { arguments: argument, range } } as PragmaPsuedoMapEntry); + pragmas.push({ name, args: { arguments: argument, range } } as PragmaPseudoMapEntry); return; } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index d5480e09796..2e55f578c42 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -5616,15 +5616,15 @@ namespace ts { type ConcretePragmaSpecs = typeof commentPragmas; /* @internal */ - export type PragmaPsuedoMap = {[K in keyof ConcretePragmaSpecs]?: {arguments: PragmaArgumentType, range: CommentRange}}; + export type PragmaPseudoMap = {[K in keyof ConcretePragmaSpecs]?: {arguments: PragmaArgumentType, range: CommentRange}}; /* @internal */ - export type PragmaPsuedoMapEntry = {[K in keyof PragmaPsuedoMap]: {name: K, args: PragmaPsuedoMap[K]}}[keyof PragmaPsuedoMap]; + export type PragmaPseudoMapEntry = {[K in keyof PragmaPseudoMap]: {name: K, args: PragmaPseudoMap[K]}}[keyof PragmaPseudoMap]; /* @internal */ - export interface ReadonlyPragmaMap extends ReadonlyMap { - get(key: TKey): PragmaPsuedoMap[TKey] | PragmaPsuedoMap[TKey][]; - forEach(action: (value: PragmaPsuedoMap[TKey] | PragmaPsuedoMap[TKey][], key: TKey) => void): void; + export interface ReadonlyPragmaMap extends ReadonlyMap { + get(key: TKey): PragmaPseudoMap[TKey] | PragmaPseudoMap[TKey][]; + forEach(action: (value: PragmaPseudoMap[TKey] | PragmaPseudoMap[TKey][], key: TKey) => void): void; } /** @@ -5633,10 +5633,10 @@ namespace ts { * in multiple places */ /* @internal */ - export interface PragmaMap extends Map, ReadonlyPragmaMap { - set(key: TKey, value: PragmaPsuedoMap[TKey] | PragmaPsuedoMap[TKey][]): this; - get(key: TKey): PragmaPsuedoMap[TKey] | PragmaPsuedoMap[TKey][]; - forEach(action: (value: PragmaPsuedoMap[TKey] | PragmaPsuedoMap[TKey][], key: TKey) => void): void; + export interface PragmaMap extends Map, ReadonlyPragmaMap { + set(key: TKey, value: PragmaPseudoMap[TKey] | PragmaPseudoMap[TKey][]): this; + get(key: TKey): PragmaPseudoMap[TKey] | PragmaPseudoMap[TKey][]; + forEach(action: (value: PragmaPseudoMap[TKey] | PragmaPseudoMap[TKey][], key: TKey) => void): void; } export interface UserPreferences { From 0245c2d35efd391edc94a1726bfd1f2772529481 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 28 Sep 2018 13:49:00 -0700 Subject: [PATCH 70/71] Only copy non error values in array when converting the json Fixes #27432 --- src/compiler/commandLineParser.ts | 7 +- .../convertCompilerOptionsFromJson.ts | 128 ++++++++++++++++-- 2 files changed, 125 insertions(+), 10 deletions(-) diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 9478f4504b7..10d32a2c187 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -1529,7 +1529,12 @@ namespace ts { elements: NodeArray, elementOption: CommandLineOption | undefined ): any[] | void { - return (returnValue ? elements.map : elements.forEach).call(elements, (element: Expression) => convertPropertyValueToJson(element, elementOption)); + if (!returnValue) { + return elements.forEach(element => convertPropertyValueToJson(element, elementOption)); + } + + // Filter out invalid values + return filter(elements.map(element => convertPropertyValueToJson(element, elementOption)), v => v !== undefined); } function convertPropertyValueToJson(valueExpression: Expression, option: CommandLineOption | undefined): any { diff --git a/src/testRunner/unittests/convertCompilerOptionsFromJson.ts b/src/testRunner/unittests/convertCompilerOptionsFromJson.ts index 3b422e9a645..fbbf68e9dc7 100644 --- a/src/testRunner/unittests/convertCompilerOptionsFromJson.ts +++ b/src/testRunner/unittests/convertCompilerOptionsFromJson.ts @@ -1,5 +1,10 @@ namespace ts { describe("convertCompilerOptionsFromJson", () => { + const formatDiagnosticHost: FormatDiagnosticsHost = { + getCurrentDirectory: () => "/apath/", + getCanonicalFileName: createGetCanonicalFileName(/*useCaseSensitiveFileNames*/ true), + getNewLine: () => "\n" + }; function assertCompilerOptions(json: any, configFileName: string, expectedResult: { compilerOptions: CompilerOptions, errors: Diagnostic[] }) { assertCompilerOptionsWithJson(json, configFileName, expectedResult); assertCompilerOptionsWithJsonNode(json, configFileName, expectedResult); @@ -24,9 +29,11 @@ namespace ts { } function assertCompilerOptionsWithJsonNode(json: any, configFileName: string, expectedResult: { compilerOptions: CompilerOptions, errors: Diagnostic[] }) { - const fileText = JSON.stringify(json); + assertCompilerOptionsWithJsonText(JSON.stringify(json), configFileName, expectedResult); + } + + function assertCompilerOptionsWithJsonText(fileText: string, configFileName: string, expectedResult: { compilerOptions: CompilerOptions, errors: (Diagnostic | string)[] }) { const result = parseJsonText(configFileName, fileText); - assert(!result.parseDiagnostics.length); assert(!!result.endOfFileToken); const host: ParseConfigHost = new fakes.ParseConfigHost(new vfs.FileSystem(/*ignoreCase*/ false, { cwd: "/apath/" })); const { options: actualCompilerOptions, errors: actualParseErrors } = parseJsonSourceFileConfigFileContent(result, host, "/apath/", /*existingOptions*/ undefined, configFileName); @@ -37,20 +44,29 @@ namespace ts { assert.equal(parsedCompilerOptions, expectedCompilerOptions); assert.equal(actualCompilerOptions.configFile, result); - const actualErrors = filter(actualParseErrors, error => error.code !== Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code); + const actualErrors = (result.parseDiagnostics as Diagnostic[]).concat(actualParseErrors.filter(error => error.code !== Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code)); const expectedErrors = expectedResult.errors; - assert.isTrue(expectedResult.errors.length === actualErrors.length, `Expected error: ${JSON.stringify(expectedResult.errors)}. Actual error: ${JSON.stringify(actualErrors)}.`); + assert.isTrue(expectedErrors.length === actualErrors.length, `Expected error: ${JSON.stringify(expectedErrors.map(e => isString(e) ? e : getDiagnosticString(e)), undefined, " ")}. Actual error: ${JSON.stringify(actualErrors.map(getDiagnosticString), undefined, " ")}.`); for (let i = 0; i < actualErrors.length; i++) { const actualError = actualErrors[i]; const expectedError = expectedErrors[i]; - assert.equal(actualError.code, expectedError.code, `Expected error-code: ${JSON.stringify(expectedError.code)}. Actual error-code: ${JSON.stringify(actualError.code)}.`); - assert.equal(actualError.category, expectedError.category, `Expected error-category: ${JSON.stringify(expectedError.category)}. Actual error-category: ${JSON.stringify(actualError.category)}.`); - assert(actualError.file); - assert(actualError.start); - assert(actualError.length); + if (isString(expectedError)) { + assert.equal(getDiagnosticString(actualError), expectedError); + } + else { + assert.equal(actualError.code, expectedError.code, `Expected error-code: ${JSON.stringify(expectedError.code)}. Actual error-code: ${JSON.stringify(actualError.code)}.`); + assert.equal(actualError.category, expectedError.category, `Expected error-category: ${JSON.stringify(expectedError.category)}. Actual error-category: ${JSON.stringify(actualError.category)}.`); + assert(actualError.file); + assert(actualError.start); + assert(actualError.length); + } } } + function getDiagnosticString(diagnostic: Diagnostic) { + return formatDiagnostic(diagnostic, formatDiagnosticHost); + } + // tsconfig.json tests it("Convert correctly format tsconfig.json to compiler-options ", () => { assertCompilerOptions( @@ -539,5 +555,99 @@ namespace ts { } ); }); + + it("Convert tsconfig options when there are multiple invalid strings", () => { + assertCompilerOptionsWithJsonText(`{ + "compilerOptions": { + "target": "<%- options.useTsWithBabel ? 'esnext' : 'es5' %>", + "module": "esnext", + <%_ if (options.classComponent) { _%> + "experimentalDecorators": true, + <%_ } _%> + "sourceMap": true, + "types": [ + "webpack-env"<% if (hasMocha || hasJest) { %>,<% } %> + <%_ if (hasMocha) { _%> + "mocha", + "chai" + <%_ } else if (hasJest) { _%> + "jest" + <%_ } _%> + ] + } +} +`, "tsconfig.json", + { + compilerOptions: { + target: undefined, + module: ModuleKind.ESNext, + types: [] + }, + errors: [ + "tsconfig.json(5,5): error TS1136: Property assignment expected.\n", + "tsconfig.json(5,6): error TS1136: Property assignment expected.\n", + "tsconfig.json(5,9): error TS1005: ':' expected.\n", + "tsconfig.json(5,20): error TS1005: ',' expected.\n", + "tsconfig.json(5,41): error TS1109: Expression expected.\n", + "tsconfig.json(6,29): error TS1005: ';' expected.\n", + "tsconfig.json(7,5): error TS1109: Expression expected.\n", + "tsconfig.json(7,6): error TS1109: Expression expected.\n", + "tsconfig.json(7,11): error TS1005: ',' expected.\n", + "tsconfig.json(7,12): error TS1005: ':' expected.\n", + "tsconfig.json(7,13): error TS1109: Expression expected.\n", + "tsconfig.json(8,16): error TS1005: ',' expected.\n", + "tsconfig.json(8,22): error TS1005: ':' expected.\n", + "tsconfig.json(10,21): error TS1109: Expression expected.\n", + "tsconfig.json(10,23): error TS1109: Expression expected.\n", + "tsconfig.json(10,36): error TS1005: ',' expected.\n", + "tsconfig.json(10,50): error TS1109: Expression expected.\n", + "tsconfig.json(10,51): error TS1109: Expression expected.\n", + "tsconfig.json(10,52): error TS1109: Expression expected.\n", + "tsconfig.json(10,53): error TS1109: Expression expected.\n", + "tsconfig.json(10,54): error TS1109: Expression expected.\n", + "tsconfig.json(10,56): error TS1109: Expression expected.\n", + "tsconfig.json(10,58): error TS1005: ',' expected.\n", + "tsconfig.json(10,59): error TS1136: Property assignment expected.\n", + "tsconfig.json(11,7): error TS1136: Property assignment expected.\n", + "tsconfig.json(11,8): error TS1136: Property assignment expected.\n", + "tsconfig.json(11,11): error TS1005: ':' expected.\n", + "tsconfig.json(11,29): error TS1109: Expression expected.\n", + "tsconfig.json(14,8): error TS1109: Expression expected.\n", + "tsconfig.json(14,13): error TS1005: ',' expected.\n", + "tsconfig.json(14,18): error TS1005: ':' expected.\n", + "tsconfig.json(14,35): error TS1109: Expression expected.\n", + "tsconfig.json(16,8): error TS1109: Expression expected.\n", + "tsconfig.json(16,13): error TS1005: ',' expected.\n", + "tsconfig.json(16,14): error TS1005: ':' expected.\n", + "tsconfig.json(16,15): error TS1109: Expression expected.\n", + "tsconfig.json(17,5): error TS1109: Expression expected.\n", + "tsconfig.json(3,15): error TS6046: Argument for '--target' option must be: 'es3', 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'esnext'.\n", + "tsconfig.json(5,7): error TS1327: String literal with double quotes expected.\n", + "tsconfig.json(5,7): error TS5023: Unknown compiler option '_'.\n", + "tsconfig.json(5,8): error TS1328: Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal.\n", + "tsconfig.json(5,9): error TS1136: Property assignment expected.\n", + "tsconfig.json(7,11): error TS1327: String literal with double quotes expected.\n", + "tsconfig.json(7,11): error TS5023: Unknown compiler option '_'.\n", + "tsconfig.json(7,12): error TS1328: Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal.\n", + "tsconfig.json(8,18): error TS1327: String literal with double quotes expected.\n", + "tsconfig.json(8,18): error TS5023: Unknown compiler option 'true'.\n", + "tsconfig.json(8,22): error TS1328: Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal.\n", + "tsconfig.json(10,7): error TS5024: Compiler option 'types' requires a value of type string.\n", + "tsconfig.json(10,23): error TS1136: Property assignment expected.\n", + "tsconfig.json(11,9): error TS1327: String literal with double quotes expected.\n", + "tsconfig.json(11,9): error TS5023: Unknown compiler option '_'.\n", + "tsconfig.json(11,10): error TS1328: Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal.\n", + "tsconfig.json(11,11): error TS1136: Property assignment expected.\n", + "tsconfig.json(14,13): error TS1327: String literal with double quotes expected.\n", + "tsconfig.json(14,13): error TS5023: Unknown compiler option 'else'.\n", + "tsconfig.json(14,17): error TS1328: Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal.\n", + "tsconfig.json(14,18): error TS1136: Property assignment expected.\n", + "tsconfig.json(16,13): error TS1327: String literal with double quotes expected.\n", + "tsconfig.json(16,13): error TS5023: Unknown compiler option '_'.\n", + "tsconfig.json(16,14): error TS1328: Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal.\n" + ] + } + ); + }); }); } From 552777d70e81c8e07b4c891dc9d68a47266c561d Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 28 Sep 2018 15:27:35 -0700 Subject: [PATCH 71/71] When there is parse error do not verify actual errors --- .../convertCompilerOptionsFromJson.ts | 132 ++++++------------ 1 file changed, 43 insertions(+), 89 deletions(-) diff --git a/src/testRunner/unittests/convertCompilerOptionsFromJson.ts b/src/testRunner/unittests/convertCompilerOptionsFromJson.ts index fbbf68e9dc7..6140ab72eee 100644 --- a/src/testRunner/unittests/convertCompilerOptionsFromJson.ts +++ b/src/testRunner/unittests/convertCompilerOptionsFromJson.ts @@ -5,36 +5,46 @@ namespace ts { getCanonicalFileName: createGetCanonicalFileName(/*useCaseSensitiveFileNames*/ true), getNewLine: () => "\n" }; - function assertCompilerOptions(json: any, configFileName: string, expectedResult: { compilerOptions: CompilerOptions, errors: Diagnostic[] }) { + + interface ExpectedResultWithParsingSuccess { + compilerOptions: CompilerOptions; + errors: ReadonlyArray; + } + + interface ExpectedResultWithParsingFailure { + compilerOptions: CompilerOptions; + hasParseErrors: true; + } + + type ExpectedResult = ExpectedResultWithParsingSuccess | ExpectedResultWithParsingFailure; + + function isExpectedResultWithParsingFailure(expectedResult: ExpectedResult): expectedResult is ExpectedResultWithParsingFailure { + return !!(expectedResult as ExpectedResultWithParsingFailure).hasParseErrors; + } + + function assertCompilerOptions(json: any, configFileName: string, expectedResult: ExpectedResultWithParsingSuccess) { assertCompilerOptionsWithJson(json, configFileName, expectedResult); assertCompilerOptionsWithJsonNode(json, configFileName, expectedResult); } - function assertCompilerOptionsWithJson(json: any, configFileName: string, expectedResult: { compilerOptions: CompilerOptions, errors: Diagnostic[] }) { - const { options: actualCompilerOptions, errors: actualErrors} = convertCompilerOptionsFromJson(json.compilerOptions, "/apath/", configFileName); + function assertCompilerOptionsWithJson(json: any, configFileName: string, expectedResult: ExpectedResultWithParsingSuccess) { + const { options: actualCompilerOptions, errors: actualErrors } = convertCompilerOptionsFromJson(json.compilerOptions, "/apath/", configFileName); const parsedCompilerOptions = JSON.stringify(actualCompilerOptions); const expectedCompilerOptions = JSON.stringify({ ...expectedResult.compilerOptions, configFilePath: configFileName }); assert.equal(parsedCompilerOptions, expectedCompilerOptions); - const expectedErrors = expectedResult.errors; - assert.isTrue(expectedResult.errors.length === actualErrors.length, `Expected error: ${JSON.stringify(expectedResult.errors)}. Actual error: ${JSON.stringify(actualErrors)}.`); - for (let i = 0; i < actualErrors.length; i++) { - const actualError = actualErrors[i]; - const expectedError = expectedErrors[i]; - assert.equal(actualError.code, expectedError.code); - assert.equal(actualError.category, expectedError.category); - assert.equal(actualError.messageText, expectedError.messageText); - } + verifyErrors(actualErrors, expectedResult.errors, /*ignoreLocation*/ true); } - function assertCompilerOptionsWithJsonNode(json: any, configFileName: string, expectedResult: { compilerOptions: CompilerOptions, errors: Diagnostic[] }) { + function assertCompilerOptionsWithJsonNode(json: any, configFileName: string, expectedResult: ExpectedResultWithParsingSuccess) { assertCompilerOptionsWithJsonText(JSON.stringify(json), configFileName, expectedResult); } - function assertCompilerOptionsWithJsonText(fileText: string, configFileName: string, expectedResult: { compilerOptions: CompilerOptions, errors: (Diagnostic | string)[] }) { + function assertCompilerOptionsWithJsonText(fileText: string, configFileName: string, expectedResult: ExpectedResult) { const result = parseJsonText(configFileName, fileText); assert(!!result.endOfFileToken); + assert.equal(!!result.parseDiagnostics.length, isExpectedResultWithParsingFailure(expectedResult)); const host: ParseConfigHost = new fakes.ParseConfigHost(new vfs.FileSystem(/*ignoreCase*/ false, { cwd: "/apath/" })); const { options: actualCompilerOptions, errors: actualParseErrors } = parseJsonSourceFileConfigFileContent(result, host, "/apath/", /*existingOptions*/ undefined, configFileName); expectedResult.compilerOptions.configFilePath = configFileName; @@ -44,27 +54,33 @@ namespace ts { assert.equal(parsedCompilerOptions, expectedCompilerOptions); assert.equal(actualCompilerOptions.configFile, result); - const actualErrors = (result.parseDiagnostics as Diagnostic[]).concat(actualParseErrors.filter(error => error.code !== Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code)); - const expectedErrors = expectedResult.errors; - assert.isTrue(expectedErrors.length === actualErrors.length, `Expected error: ${JSON.stringify(expectedErrors.map(e => isString(e) ? e : getDiagnosticString(e)), undefined, " ")}. Actual error: ${JSON.stringify(actualErrors.map(getDiagnosticString), undefined, " ")}.`); + if (!isExpectedResultWithParsingFailure(expectedResult)) { + verifyErrors(actualParseErrors.filter(error => error.code !== Diagnostics.No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2.code), expectedResult.errors); + } + } + + function verifyErrors(actualErrors: Diagnostic[], expectedErrors: ReadonlyArray, ignoreLocation?: boolean) { + assert.isTrue(expectedErrors.length === actualErrors.length, `Expected error: ${JSON.stringify(expectedErrors.map(getDiagnosticString), undefined, " ")}. Actual error: ${JSON.stringify(actualErrors.map(getDiagnosticString), undefined, " ")}.`); for (let i = 0; i < actualErrors.length; i++) { const actualError = actualErrors[i]; const expectedError = expectedErrors[i]; - if (isString(expectedError)) { - assert.equal(getDiagnosticString(actualError), expectedError); - } - else { - assert.equal(actualError.code, expectedError.code, `Expected error-code: ${JSON.stringify(expectedError.code)}. Actual error-code: ${JSON.stringify(actualError.code)}.`); - assert.equal(actualError.category, expectedError.category, `Expected error-category: ${JSON.stringify(expectedError.category)}. Actual error-category: ${JSON.stringify(actualError.category)}.`); + + assert.equal(actualError.code, expectedError.code, `Expected error-code: ${JSON.stringify(expectedError.code)}. Actual error-code: ${JSON.stringify(actualError.code)}.`); + assert.equal(actualError.category, expectedError.category, `Expected error-category: ${JSON.stringify(expectedError.category)}. Actual error-category: ${JSON.stringify(actualError.category)}.`); + if (!ignoreLocation) { assert(actualError.file); assert(actualError.start); assert(actualError.length); } } - } - function getDiagnosticString(diagnostic: Diagnostic) { - return formatDiagnostic(diagnostic, formatDiagnosticHost); + function getDiagnosticString(diagnostic: Diagnostic) { + if (ignoreLocation) { + const { file, ...rest } = diagnostic; + diagnostic = { file: undefined, ...rest }; + } + return formatDiagnostic(diagnostic, formatDiagnosticHost); + } } // tsconfig.json tests @@ -583,69 +599,7 @@ namespace ts { module: ModuleKind.ESNext, types: [] }, - errors: [ - "tsconfig.json(5,5): error TS1136: Property assignment expected.\n", - "tsconfig.json(5,6): error TS1136: Property assignment expected.\n", - "tsconfig.json(5,9): error TS1005: ':' expected.\n", - "tsconfig.json(5,20): error TS1005: ',' expected.\n", - "tsconfig.json(5,41): error TS1109: Expression expected.\n", - "tsconfig.json(6,29): error TS1005: ';' expected.\n", - "tsconfig.json(7,5): error TS1109: Expression expected.\n", - "tsconfig.json(7,6): error TS1109: Expression expected.\n", - "tsconfig.json(7,11): error TS1005: ',' expected.\n", - "tsconfig.json(7,12): error TS1005: ':' expected.\n", - "tsconfig.json(7,13): error TS1109: Expression expected.\n", - "tsconfig.json(8,16): error TS1005: ',' expected.\n", - "tsconfig.json(8,22): error TS1005: ':' expected.\n", - "tsconfig.json(10,21): error TS1109: Expression expected.\n", - "tsconfig.json(10,23): error TS1109: Expression expected.\n", - "tsconfig.json(10,36): error TS1005: ',' expected.\n", - "tsconfig.json(10,50): error TS1109: Expression expected.\n", - "tsconfig.json(10,51): error TS1109: Expression expected.\n", - "tsconfig.json(10,52): error TS1109: Expression expected.\n", - "tsconfig.json(10,53): error TS1109: Expression expected.\n", - "tsconfig.json(10,54): error TS1109: Expression expected.\n", - "tsconfig.json(10,56): error TS1109: Expression expected.\n", - "tsconfig.json(10,58): error TS1005: ',' expected.\n", - "tsconfig.json(10,59): error TS1136: Property assignment expected.\n", - "tsconfig.json(11,7): error TS1136: Property assignment expected.\n", - "tsconfig.json(11,8): error TS1136: Property assignment expected.\n", - "tsconfig.json(11,11): error TS1005: ':' expected.\n", - "tsconfig.json(11,29): error TS1109: Expression expected.\n", - "tsconfig.json(14,8): error TS1109: Expression expected.\n", - "tsconfig.json(14,13): error TS1005: ',' expected.\n", - "tsconfig.json(14,18): error TS1005: ':' expected.\n", - "tsconfig.json(14,35): error TS1109: Expression expected.\n", - "tsconfig.json(16,8): error TS1109: Expression expected.\n", - "tsconfig.json(16,13): error TS1005: ',' expected.\n", - "tsconfig.json(16,14): error TS1005: ':' expected.\n", - "tsconfig.json(16,15): error TS1109: Expression expected.\n", - "tsconfig.json(17,5): error TS1109: Expression expected.\n", - "tsconfig.json(3,15): error TS6046: Argument for '--target' option must be: 'es3', 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'esnext'.\n", - "tsconfig.json(5,7): error TS1327: String literal with double quotes expected.\n", - "tsconfig.json(5,7): error TS5023: Unknown compiler option '_'.\n", - "tsconfig.json(5,8): error TS1328: Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal.\n", - "tsconfig.json(5,9): error TS1136: Property assignment expected.\n", - "tsconfig.json(7,11): error TS1327: String literal with double quotes expected.\n", - "tsconfig.json(7,11): error TS5023: Unknown compiler option '_'.\n", - "tsconfig.json(7,12): error TS1328: Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal.\n", - "tsconfig.json(8,18): error TS1327: String literal with double quotes expected.\n", - "tsconfig.json(8,18): error TS5023: Unknown compiler option 'true'.\n", - "tsconfig.json(8,22): error TS1328: Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal.\n", - "tsconfig.json(10,7): error TS5024: Compiler option 'types' requires a value of type string.\n", - "tsconfig.json(10,23): error TS1136: Property assignment expected.\n", - "tsconfig.json(11,9): error TS1327: String literal with double quotes expected.\n", - "tsconfig.json(11,9): error TS5023: Unknown compiler option '_'.\n", - "tsconfig.json(11,10): error TS1328: Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal.\n", - "tsconfig.json(11,11): error TS1136: Property assignment expected.\n", - "tsconfig.json(14,13): error TS1327: String literal with double quotes expected.\n", - "tsconfig.json(14,13): error TS5023: Unknown compiler option 'else'.\n", - "tsconfig.json(14,17): error TS1328: Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal.\n", - "tsconfig.json(14,18): error TS1136: Property assignment expected.\n", - "tsconfig.json(16,13): error TS1327: String literal with double quotes expected.\n", - "tsconfig.json(16,13): error TS5023: Unknown compiler option '_'.\n", - "tsconfig.json(16,14): error TS1328: Property value can only be string literal, numeric literal, 'true', 'false', 'null', object literal or array literal.\n" - ] + hasParseErrors: true } ); });