From 595cb11f22d4bb3fe4bbf3e4d0366c6b5903c57a Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Thu, 8 Jun 2017 11:01:32 -0700 Subject: [PATCH 001/137] Excess property checks for discriminated unions This uses the same code as #14006, which improves error messages for discriminated unions. --- src/compiler/checker.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 266fbe573be..ddfebd84ad6 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -8964,6 +8964,13 @@ namespace ts { (isTypeSubsetOf(globalObjectType, target) || (!isComparingJsxAttributes && isEmptyObjectType(target)))) { return false; } + if (target.flags & TypeFlags.Union) { + const discriminantType = findMatchingDiscriminantType(source, target as UnionType); + if (discriminantType) { + // check excess properties against discriminant type only, not the entire union + return hasExcessProperties(source, discriminantType, reportErrors); + } + } for (const prop of getPropertiesOfObjectType(source)) { if (!isKnownProperty(target, prop.name, isComparingJsxAttributes)) { if (reportErrors) { From 8302ebcd8b2f493539abf6fd1d9f9f3718af252c Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Thu, 8 Jun 2017 11:03:52 -0700 Subject: [PATCH 002/137] Test:excess property checks--discriminated unions --- .../discriminatedUnionErrorMessage.errors.txt | 12 +++---- .../excessPropertyCheckWithUnions.errors.txt | 33 +++++++++++++++++++ .../excessPropertyCheckWithUnions.js | 19 +++++++++++ .../compiler/excessPropertyCheckWithUnions.ts | 12 +++++++ 4 files changed, 69 insertions(+), 7 deletions(-) create mode 100644 tests/baselines/reference/excessPropertyCheckWithUnions.errors.txt create mode 100644 tests/baselines/reference/excessPropertyCheckWithUnions.js create mode 100644 tests/cases/compiler/excessPropertyCheckWithUnions.ts diff --git a/tests/baselines/reference/discriminatedUnionErrorMessage.errors.txt b/tests/baselines/reference/discriminatedUnionErrorMessage.errors.txt index 6f1eb511d37..e54727befd0 100644 --- a/tests/baselines/reference/discriminatedUnionErrorMessage.errors.txt +++ b/tests/baselines/reference/discriminatedUnionErrorMessage.errors.txt @@ -1,6 +1,5 @@ -tests/cases/compiler/discriminatedUnionErrorMessage.ts(8,5): error TS2322: Type '{ kind: "sq"; x: number; y: number; }' is not assignable to type 'Shape'. - Type '{ kind: "sq"; x: number; y: number; }' is not assignable to type 'Square'. - Property 'size' is missing in type '{ kind: "sq"; x: number; y: number; }'. +tests/cases/compiler/discriminatedUnionErrorMessage.ts(10,5): error TS2322: Type '{ kind: "sq"; x: number; y: number; }' is not assignable to type 'Shape'. + Object literal may only specify known properties, and 'x' does not exist in type 'Square'. ==== tests/cases/compiler/discriminatedUnionErrorMessage.ts (1 errors) ==== @@ -12,12 +11,11 @@ tests/cases/compiler/discriminatedUnionErrorMessage.ts(8,5): error TS2322: Type | Rectangle | Circle; let shape: Shape = { - ~~~~~ -!!! error TS2322: Type '{ kind: "sq"; x: number; y: number; }' is not assignable to type 'Shape'. -!!! error TS2322: Type '{ kind: "sq"; x: number; y: number; }' is not assignable to type 'Square'. -!!! error TS2322: Property 'size' is missing in type '{ kind: "sq"; x: number; y: number; }'. kind: "sq", x: 12, + ~~~~~ +!!! error TS2322: Type '{ kind: "sq"; x: number; y: number; }' is not assignable to type 'Shape'. +!!! error TS2322: Object literal may only specify known properties, and 'x' does not exist in type 'Square'. y: 13, } \ No newline at end of file diff --git a/tests/baselines/reference/excessPropertyCheckWithUnions.errors.txt b/tests/baselines/reference/excessPropertyCheckWithUnions.errors.txt new file mode 100644 index 00000000000..1a01f8cb5b8 --- /dev/null +++ b/tests/baselines/reference/excessPropertyCheckWithUnions.errors.txt @@ -0,0 +1,33 @@ +tests/cases/compiler/excessPropertyCheckWithUnions.ts(10,30): error TS2322: Type '{ tag: "T"; a1: string; }' is not assignable to type 'ADT'. + Object literal may only specify known properties, and 'a1' does not exist in type '{ tag: "T"; }'. +tests/cases/compiler/excessPropertyCheckWithUnions.ts(11,21): error TS2322: Type '{ tag: "A"; d20: 12; }' is not assignable to type 'ADT'. + Object literal may only specify known properties, and 'd20' does not exist in type '{ tag: "A"; a1: string; }'. +tests/cases/compiler/excessPropertyCheckWithUnions.ts(12,1): error TS2322: Type '{ tag: "D"; }' is not assignable to type 'ADT'. + Type '{ tag: "D"; }' is not assignable to type '{ tag: "D"; d20: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20; }'. + Property 'd20' is missing in type '{ tag: "D"; }'. + + +==== tests/cases/compiler/excessPropertyCheckWithUnions.ts (3 errors) ==== + type ADT = { + tag: "A", + a1: string + } | { + tag: "D", + d20: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 + } | { + tag: "T", + } + let wrong: ADT = { tag: "T", a1: "extra" } + ~~~~~~~~~~~ +!!! error TS2322: Type '{ tag: "T"; a1: string; }' is not assignable to type 'ADT'. +!!! error TS2322: Object literal may only specify known properties, and 'a1' does not exist in type '{ tag: "T"; }'. + wrong = { tag: "A", d20: 12 } + ~~~~~~~ +!!! error TS2322: Type '{ tag: "A"; d20: 12; }' is not assignable to type 'ADT'. +!!! error TS2322: Object literal may only specify known properties, and 'd20' does not exist in type '{ tag: "A"; a1: string; }'. + wrong = { tag: "D" } + ~~~~~ +!!! error TS2322: Type '{ tag: "D"; }' is not assignable to type 'ADT'. +!!! error TS2322: Type '{ tag: "D"; }' is not assignable to type '{ tag: "D"; d20: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20; }'. +!!! error TS2322: Property 'd20' is missing in type '{ tag: "D"; }'. + \ No newline at end of file diff --git a/tests/baselines/reference/excessPropertyCheckWithUnions.js b/tests/baselines/reference/excessPropertyCheckWithUnions.js new file mode 100644 index 00000000000..79c30bce9c7 --- /dev/null +++ b/tests/baselines/reference/excessPropertyCheckWithUnions.js @@ -0,0 +1,19 @@ +//// [excessPropertyCheckWithUnions.ts] +type ADT = { + tag: "A", + a1: string +} | { + tag: "D", + d20: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 +} | { + tag: "T", +} +let wrong: ADT = { tag: "T", a1: "extra" } +wrong = { tag: "A", d20: 12 } +wrong = { tag: "D" } + + +//// [excessPropertyCheckWithUnions.js] +var wrong = { tag: "T", a1: "extra" }; +wrong = { tag: "A", d20: 12 }; +wrong = { tag: "D" }; diff --git a/tests/cases/compiler/excessPropertyCheckWithUnions.ts b/tests/cases/compiler/excessPropertyCheckWithUnions.ts new file mode 100644 index 00000000000..8b1abf1b764 --- /dev/null +++ b/tests/cases/compiler/excessPropertyCheckWithUnions.ts @@ -0,0 +1,12 @@ +type ADT = { + tag: "A", + a1: string +} | { + tag: "D", + d20: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 +} | { + tag: "T", +} +let wrong: ADT = { tag: "T", a1: "extra" } +wrong = { tag: "A", d20: 12 } +wrong = { tag: "D" } From c8d856a5d4489860114d809c010a52a56a5f91a7 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Fri, 9 Jun 2017 09:51:07 -0700 Subject: [PATCH 003/137] Correct excess property error on ambiguous discriminated unions --- src/compiler/checker.ts | 7 ++- .../excessPropertyCheckWithUnions.errors.txt | 58 ++++++++++++++++++- .../excessPropertyCheckWithUnions.js | 41 +++++++++++++ .../compiler/excessPropertyCheckWithUnions.ts | 28 +++++++++ 4 files changed, 132 insertions(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ddfebd84ad6..559d6ae71ba 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -9029,6 +9029,7 @@ namespace ts { function findMatchingDiscriminantType(source: Type, target: UnionOrIntersectionType) { const sourceProperties = getPropertiesOfObjectType(source); + let match: Type; if (sourceProperties) { for (const sourceProperty of sourceProperties) { if (isDiscriminantProperty(target, sourceProperty.name)) { @@ -9036,12 +9037,16 @@ namespace ts { for (const type of target.types) { const targetType = getTypeOfPropertyOfType(type, sourceProperty.name); if (targetType && isRelatedTo(sourceType, targetType)) { - return type; + if (match) { + return undefined; + } + match = type; } } } } } + return match; } function typeRelatedToEachType(source: Type, target: IntersectionType, reportErrors: boolean): Ternary { diff --git a/tests/baselines/reference/excessPropertyCheckWithUnions.errors.txt b/tests/baselines/reference/excessPropertyCheckWithUnions.errors.txt index 1a01f8cb5b8..9714c90ba61 100644 --- a/tests/baselines/reference/excessPropertyCheckWithUnions.errors.txt +++ b/tests/baselines/reference/excessPropertyCheckWithUnions.errors.txt @@ -5,9 +5,21 @@ tests/cases/compiler/excessPropertyCheckWithUnions.ts(11,21): error TS2322: Type tests/cases/compiler/excessPropertyCheckWithUnions.ts(12,1): error TS2322: Type '{ tag: "D"; }' is not assignable to type 'ADT'. Type '{ tag: "D"; }' is not assignable to type '{ tag: "D"; d20: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20; }'. Property 'd20' is missing in type '{ tag: "D"; }'. +tests/cases/compiler/excessPropertyCheckWithUnions.ts(33,28): error TS2322: Type '{ tag: "A"; x: string; extra: number; }' is not assignable to type 'Ambiguous'. + Object literal may only specify known properties, and 'extra' does not exist in type 'Ambiguous'. +tests/cases/compiler/excessPropertyCheckWithUnions.ts(34,26): error TS2322: Type '{ tag: "A"; y: number; extra: number; }' is not assignable to type 'Ambiguous'. + Object literal may only specify known properties, and 'extra' does not exist in type 'Ambiguous'. +tests/cases/compiler/excessPropertyCheckWithUnions.ts(39,1): error TS2322: Type '{ tag: "A"; }' is not assignable to type 'Ambiguous'. + Type '{ tag: "A"; }' is not assignable to type '{ tag: "C"; }'. + Types of property 'tag' are incompatible. + Type '"A"' is not assignable to type '"C"'. +tests/cases/compiler/excessPropertyCheckWithUnions.ts(40,1): error TS2322: Type '{ tag: "A"; z: true; }' is not assignable to type 'Ambiguous'. + Type '{ tag: "A"; z: true; }' is not assignable to type '{ tag: "C"; }'. + Types of property 'tag' are incompatible. + Type '"A"' is not assignable to type '"C"'. -==== tests/cases/compiler/excessPropertyCheckWithUnions.ts (3 errors) ==== +==== tests/cases/compiler/excessPropertyCheckWithUnions.ts (7 errors) ==== type ADT = { tag: "A", a1: string @@ -30,4 +42,48 @@ tests/cases/compiler/excessPropertyCheckWithUnions.ts(12,1): error TS2322: Type !!! error TS2322: Type '{ tag: "D"; }' is not assignable to type 'ADT'. !!! error TS2322: Type '{ tag: "D"; }' is not assignable to type '{ tag: "D"; d20: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20; }'. !!! error TS2322: Property 'd20' is missing in type '{ tag: "D"; }'. + + type Ambiguous = { + tag: "A", + x: string + } | { + tag: "A", + y: number + } | { + tag: "B", + z: boolean + } | { + tag: "C" + } + let amb: Ambiguous + // no error for ambiguous tag, even when it could satisfy both constituents at once + amb = { tag: "A", x: "hi" } + amb = { tag: "A", y: 12 } + amb = { tag: "A", x: "hi", y: 12 } + + // correctly error on excess property 'extra', even when ambiguous + amb = { tag: "A", x: "hi", extra: 12 } + ~~~~~~~~~ +!!! error TS2322: Type '{ tag: "A"; x: string; extra: number; }' is not assignable to type 'Ambiguous'. +!!! error TS2322: Object literal may only specify known properties, and 'extra' does not exist in type 'Ambiguous'. + amb = { tag: "A", y: 12, extra: 12 } + ~~~~~~~~~ +!!! error TS2322: Type '{ tag: "A"; y: number; extra: number; }' is not assignable to type 'Ambiguous'. +!!! error TS2322: Object literal may only specify known properties, and 'extra' does not exist in type 'Ambiguous'. + + // assignability errors still work. + // But note that the error for `z: true` is the fallback one of reporting on + // the last constituent since assignability error reporting can't find a single best discriminant either. + amb = { tag: "A" } + ~~~ +!!! error TS2322: Type '{ tag: "A"; }' is not assignable to type 'Ambiguous'. +!!! error TS2322: Type '{ tag: "A"; }' is not assignable to type '{ tag: "C"; }'. +!!! error TS2322: Types of property 'tag' are incompatible. +!!! error TS2322: Type '"A"' is not assignable to type '"C"'. + amb = { tag: "A", z: true } + ~~~ +!!! error TS2322: Type '{ tag: "A"; z: true; }' is not assignable to type 'Ambiguous'. +!!! error TS2322: Type '{ tag: "A"; z: true; }' is not assignable to type '{ tag: "C"; }'. +!!! error TS2322: Types of property 'tag' are incompatible. +!!! error TS2322: Type '"A"' is not assignable to type '"C"'. \ No newline at end of file diff --git a/tests/baselines/reference/excessPropertyCheckWithUnions.js b/tests/baselines/reference/excessPropertyCheckWithUnions.js index 79c30bce9c7..fb0a5a6f819 100644 --- a/tests/baselines/reference/excessPropertyCheckWithUnions.js +++ b/tests/baselines/reference/excessPropertyCheckWithUnions.js @@ -11,9 +11,50 @@ type ADT = { let wrong: ADT = { tag: "T", a1: "extra" } wrong = { tag: "A", d20: 12 } wrong = { tag: "D" } + +type Ambiguous = { + tag: "A", + x: string +} | { + tag: "A", + y: number +} | { + tag: "B", + z: boolean +} | { + tag: "C" +} +let amb: Ambiguous +// no error for ambiguous tag, even when it could satisfy both constituents at once +amb = { tag: "A", x: "hi" } +amb = { tag: "A", y: 12 } +amb = { tag: "A", x: "hi", y: 12 } + +// correctly error on excess property 'extra', even when ambiguous +amb = { tag: "A", x: "hi", extra: 12 } +amb = { tag: "A", y: 12, extra: 12 } + +// assignability errors still work. +// But note that the error for `z: true` is the fallback one of reporting on +// the last constituent since assignability error reporting can't find a single best discriminant either. +amb = { tag: "A" } +amb = { tag: "A", z: true } //// [excessPropertyCheckWithUnions.js] var wrong = { tag: "T", a1: "extra" }; wrong = { tag: "A", d20: 12 }; wrong = { tag: "D" }; +var amb; +// no error for ambiguous tag, even when it could satisfy both constituents at once +amb = { tag: "A", x: "hi" }; +amb = { tag: "A", y: 12 }; +amb = { tag: "A", x: "hi", y: 12 }; +// correctly error on excess property 'extra', even when ambiguous +amb = { tag: "A", x: "hi", extra: 12 }; +amb = { tag: "A", y: 12, extra: 12 }; +// assignability errors still work. +// But note that the error for `z: true` is the fallback one of reporting on +// the last constituent since assignability error reporting can't find a single best discriminant either. +amb = { tag: "A" }; +amb = { tag: "A", z: true }; diff --git a/tests/cases/compiler/excessPropertyCheckWithUnions.ts b/tests/cases/compiler/excessPropertyCheckWithUnions.ts index 8b1abf1b764..51f36d137fd 100644 --- a/tests/cases/compiler/excessPropertyCheckWithUnions.ts +++ b/tests/cases/compiler/excessPropertyCheckWithUnions.ts @@ -10,3 +10,31 @@ type ADT = { let wrong: ADT = { tag: "T", a1: "extra" } wrong = { tag: "A", d20: 12 } wrong = { tag: "D" } + +type Ambiguous = { + tag: "A", + x: string +} | { + tag: "A", + y: number +} | { + tag: "B", + z: boolean +} | { + tag: "C" +} +let amb: Ambiguous +// no error for ambiguous tag, even when it could satisfy both constituents at once +amb = { tag: "A", x: "hi" } +amb = { tag: "A", y: 12 } +amb = { tag: "A", x: "hi", y: 12 } + +// correctly error on excess property 'extra', even when ambiguous +amb = { tag: "A", x: "hi", extra: 12 } +amb = { tag: "A", y: 12, extra: 12 } + +// assignability errors still work. +// But note that the error for `z: true` is the fallback one of reporting on +// the last constituent since assignability error reporting can't find a single best discriminant either. +amb = { tag: "A" } +amb = { tag: "A", z: true } From d04f4a93a7fff465eaf2da93931f1949f6e49a22 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Fri, 9 Jun 2017 15:42:14 -0700 Subject: [PATCH 004/137] Do not check excess properties for multi-discriminant unions --- src/compiler/checker.ts | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 559d6ae71ba..f79e74746d4 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -9028,20 +9028,19 @@ namespace ts { } function findMatchingDiscriminantType(source: Type, target: UnionOrIntersectionType) { - const sourceProperties = getPropertiesOfObjectType(source); let match: Type; + const sourceProperties = getPropertiesOfObjectType(source); if (sourceProperties) { - for (const sourceProperty of sourceProperties) { - if (isDiscriminantProperty(target, sourceProperty.name)) { - const sourceType = getTypeOfSymbol(sourceProperty); - for (const type of target.types) { - const targetType = getTypeOfPropertyOfType(type, sourceProperty.name); - if (targetType && isRelatedTo(sourceType, targetType)) { - if (match) { - return undefined; - } - match = type; + const sourceProperty = findSingleDiscriminantProperty(sourceProperties, target); + if (sourceProperty) { + const sourceType = getTypeOfSymbol(sourceProperty); + for (const type of target.types) { + const targetType = getTypeOfPropertyOfType(type, sourceProperty.name); + if (targetType && isRelatedTo(sourceType, targetType)) { + if (match) { + return undefined; } + match = type; } } } @@ -10839,6 +10838,19 @@ namespace ts { return false; } + function findSingleDiscriminantProperty(sourceProperties: Symbol[], target: Type): Symbol | undefined { + let result: Symbol; + for (const sourceProperty of sourceProperties) { + if (isDiscriminantProperty(target, sourceProperty.name)) { + if (result) { + return undefined; + } + result = sourceProperty; + } + } + return result; + } + function isOrContainsMatchingReference(source: Node, target: Node) { return isMatchingReference(source, target) || containsMatchingReference(source, target); } From 8a7186d1901197e9d050b1a200470c1cd1a065c5 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Fri, 9 Jun 2017 15:47:57 -0700 Subject: [PATCH 005/137] Add more excess property check tests for unions --- .../excessPropertyCheckWithUnions.errors.txt | 10 ++++++++++ .../reference/excessPropertyCheckWithUnions.js | 14 ++++++++++++++ .../compiler/excessPropertyCheckWithUnions.ts | 10 ++++++++++ 3 files changed, 34 insertions(+) diff --git a/tests/baselines/reference/excessPropertyCheckWithUnions.errors.txt b/tests/baselines/reference/excessPropertyCheckWithUnions.errors.txt index 9714c90ba61..3b7e5a787d2 100644 --- a/tests/baselines/reference/excessPropertyCheckWithUnions.errors.txt +++ b/tests/baselines/reference/excessPropertyCheckWithUnions.errors.txt @@ -86,4 +86,14 @@ tests/cases/compiler/excessPropertyCheckWithUnions.ts(40,1): error TS2322: Type !!! error TS2322: Type '{ tag: "A"; z: true; }' is not assignable to type '{ tag: "C"; }'. !!! error TS2322: Types of property 'tag' are incompatible. !!! error TS2322: Type '"A"' is not assignable to type '"C"'. + + type Overlapping = + | { a: 1, b: 1, first: string } + | { a: 2, second: string } + | { b: 3, third: string } + let over: Overlapping + + // these two are not reported because there are two discriminant properties + over = { a: 1, b: 1, first: "ok", second: "error" } + over = { a: 1, b: 1, first: "ok", third: "error" } \ No newline at end of file diff --git a/tests/baselines/reference/excessPropertyCheckWithUnions.js b/tests/baselines/reference/excessPropertyCheckWithUnions.js index fb0a5a6f819..c6da660b52d 100644 --- a/tests/baselines/reference/excessPropertyCheckWithUnions.js +++ b/tests/baselines/reference/excessPropertyCheckWithUnions.js @@ -39,6 +39,16 @@ amb = { tag: "A", y: 12, extra: 12 } // the last constituent since assignability error reporting can't find a single best discriminant either. amb = { tag: "A" } amb = { tag: "A", z: true } + +type Overlapping = + | { a: 1, b: 1, first: string } + | { a: 2, second: string } + | { b: 3, third: string } +let over: Overlapping + +// these two are not reported because there are two discriminant properties +over = { a: 1, b: 1, first: "ok", second: "error" } +over = { a: 1, b: 1, first: "ok", third: "error" } //// [excessPropertyCheckWithUnions.js] @@ -58,3 +68,7 @@ amb = { tag: "A", y: 12, extra: 12 }; // the last constituent since assignability error reporting can't find a single best discriminant either. amb = { tag: "A" }; amb = { tag: "A", z: true }; +var over; +// these two are not reported because there are two discriminant properties +over = { a: 1, b: 1, first: "ok", second: "error" }; +over = { a: 1, b: 1, first: "ok", third: "error" }; diff --git a/tests/cases/compiler/excessPropertyCheckWithUnions.ts b/tests/cases/compiler/excessPropertyCheckWithUnions.ts index 51f36d137fd..9a7968fe511 100644 --- a/tests/cases/compiler/excessPropertyCheckWithUnions.ts +++ b/tests/cases/compiler/excessPropertyCheckWithUnions.ts @@ -38,3 +38,13 @@ amb = { tag: "A", y: 12, extra: 12 } // the last constituent since assignability error reporting can't find a single best discriminant either. amb = { tag: "A" } amb = { tag: "A", z: true } + +type Overlapping = + | { a: 1, b: 1, first: string } + | { a: 2, second: string } + | { b: 3, third: string } +let over: Overlapping + +// these two are not reported because there are two discriminant properties +over = { a: 1, b: 1, first: "ok", second: "error" } +over = { a: 1, b: 1, first: "ok", third: "error" } From 4de96abd8fc5d678d6b494a953d3127dd2acf871 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Fri, 16 Jun 2017 14:37:39 -0700 Subject: [PATCH 006/137] Use the same logic of getting current directory as the one used when emitting files through project It means we would use currentDirectory as project Root or script info's directory as the current directory Fixes issue reported in https://developercommunity.visualstudio.com/content/problem/57099/typescript-generated-source-maps-have-invalid-path.html --- src/compiler/program.ts | 12 +++---- src/compiler/types.ts | 6 +++- src/harness/unittests/compileOnSave.ts | 45 +++++++++++++++++++++++++- src/server/builder.ts | 4 +-- src/server/project.ts | 11 ++++++- src/services/services.ts | 4 +-- src/services/transpile.ts | 2 +- src/services/types.ts | 2 +- 8 files changed, 71 insertions(+), 15 deletions(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index bbc0fa09780..30c61f50dff 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -874,12 +874,12 @@ namespace ts { return oldProgram.structureIsReused = StructureIsReused.Completely; } - function getEmitHost(writeFileCallback?: WriteFileCallback): EmitHost { + function getEmitHost(writeFileCallback?: WriteFileCallback, getCurrentDirectoryCallback?: GetCurrentDirectoryCallback): EmitHost { return { getCanonicalFileName, getCommonSourceDirectory: program.getCommonSourceDirectory, getCompilerOptions: program.getCompilerOptions, - getCurrentDirectory: () => currentDirectory, + getCurrentDirectory: getCurrentDirectoryCallback || (() => currentDirectory), getNewLine: () => host.getNewLine(), getSourceFile: program.getSourceFile, getSourceFileByPath: program.getSourceFileByPath, @@ -907,15 +907,15 @@ namespace ts { return noDiagnosticsTypeChecker || (noDiagnosticsTypeChecker = createTypeChecker(program, /*produceDiagnostics:*/ false)); } - function emit(sourceFile?: SourceFile, writeFileCallback?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, transformers?: CustomTransformers): EmitResult { - return runWithCancellationToken(() => emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers)); + function emit(sourceFile?: SourceFile, writeFileCallback?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, transformers?: CustomTransformers, getCurrentDirectoryCallback?: GetCurrentDirectoryCallback): EmitResult { + return runWithCancellationToken(() => emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers, getCurrentDirectoryCallback)); } function isEmitBlocked(emitFileName: string): boolean { return hasEmitBlockingDiagnostics.contains(toPath(emitFileName, currentDirectory, getCanonicalFileName)); } - function emitWorker(program: Program, sourceFile: SourceFile, writeFileCallback: WriteFileCallback, cancellationToken: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult { + function emitWorker(program: Program, sourceFile: SourceFile, writeFileCallback: WriteFileCallback, cancellationToken: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers, getCurrentDirectoryCallback?: GetCurrentDirectoryCallback): EmitResult { let declarationDiagnostics: Diagnostic[] = []; if (options.noEmit) { @@ -960,7 +960,7 @@ namespace ts { const transformers = emitOnlyDtsFiles ? [] : getTransformers(options, customTransformers); const emitResult = emitFiles( emitResolver, - getEmitHost(writeFileCallback), + getEmitHost(writeFileCallback, getCurrentDirectoryCallback), sourceFile, emitOnlyDtsFiles, transformers); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index ac64624e1a6..ac5de153226 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2405,6 +2405,10 @@ namespace ts { (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void, sourceFiles?: SourceFile[]): void; } + export interface GetCurrentDirectoryCallback { + (): string; + } + export class OperationCanceledException { } export interface CancellationToken { @@ -2436,7 +2440,7 @@ namespace ts { * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter * will be invoked when writing the JavaScript and declaration files. */ - emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult; + emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers, getCurrentDirectoryCallback?: GetCurrentDirectoryCallback): EmitResult; getOptionsDiagnostics(cancellationToken?: CancellationToken): Diagnostic[]; getGlobalDiagnostics(cancellationToken?: CancellationToken): Diagnostic[]; diff --git a/src/harness/unittests/compileOnSave.ts b/src/harness/unittests/compileOnSave.ts index 7e262a1b257..3183ffd71b0 100644 --- a/src/harness/unittests/compileOnSave.ts +++ b/src/harness/unittests/compileOnSave.ts @@ -600,5 +600,48 @@ namespace ts.projectSystem { assert.isTrue(outFileContent.indexOf(file2.content) === -1); assert.isTrue(outFileContent.indexOf(file3.content) === -1); }); + + it("should use project root as current directory so that compile on save results in correct file mapping", () => { + const inputFileName = "Foo.ts"; + const file1 = { + path: `/root/TypeScriptProject3/TypeScriptProject3/${inputFileName}`, + content: "consonle.log('file1');" + }; + const externalProjectName = "/root/TypeScriptProject3/TypeScriptProject3/TypeScriptProject3.csproj"; + const host = createServerHost([file1, libFile]); + const session = createSession(host); + const projectService = session.getProjectService(); + + const outFileName = "bar.js"; + projectService.openExternalProject({ + rootFiles: toExternalFiles([file1.path]), + options: { + outFile: outFileName, + sourceMap: true, + compileOnSave: true + }, + projectFileName: externalProjectName + }); + + const emitRequest = makeSessionRequest(CommandNames.CompileOnSaveEmitFile, { file: file1.path }); + session.executeCommand(emitRequest); + + // Verify js file + const expectedOutFileName = "/root/TypeScriptProject3/TypeScriptProject3/" + outFileName; + assert.isTrue(host.fileExists(expectedOutFileName)); + const outFileContent = host.readFile(expectedOutFileName); + verifyContentHasString(outFileContent, file1.content); + verifyContentHasString(outFileContent, `//# sourceMappingURL=${outFileName}.map`); + + // Verify map file + const expectedMapFileName = expectedOutFileName + ".map"; + assert.isTrue(host.fileExists(expectedMapFileName)); + const mapFileContent = host.readFile(expectedMapFileName); + verifyContentHasString(mapFileContent, `"sources":["${inputFileName}"]`); + + function verifyContentHasString(content: string, string: string) { + assert.isTrue(content.indexOf(string) !== -1, `Expected "${content}" to have "${string}"`); + } + }); }); -} \ No newline at end of file +} diff --git a/src/server/builder.ts b/src/server/builder.ts index 895732ebece..711045d0ae6 100644 --- a/src/server/builder.ts +++ b/src/server/builder.ts @@ -148,9 +148,9 @@ namespace ts.server { const { emitSkipped, outputFiles } = this.project.getFileEmitOutput(fileInfo.scriptInfo, /*emitOnlyDtsFiles*/ false); if (!emitSkipped) { - const projectRootPath = this.project.getProjectRootPath(); + const currentDirectoryForEmit = this.project.getCurrentDirectoryForScriptInfoEmit(scriptInfo); for (const outputFile of outputFiles) { - const outputFileAbsoluteFileName = getNormalizedAbsolutePath(outputFile.name, projectRootPath ? projectRootPath : getDirectoryPath(scriptInfo.fileName)); + const outputFileAbsoluteFileName = getNormalizedAbsolutePath(outputFile.name, currentDirectoryForEmit); writeFile(outputFileAbsoluteFileName, outputFile.text, outputFile.writeByteOrderMark); } } diff --git a/src/server/project.ts b/src/server/project.ts index ac040a77ace..a7d8605315b 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -367,7 +367,16 @@ namespace ts.server { if (!this.languageServiceEnabled) { return undefined; } - return this.getLanguageService().getEmitOutput(info.fileName, emitOnlyDtsFiles); + + const getCurrentDirectoryCallback = memoize( + () => this.getCurrentDirectoryForScriptInfoEmit(info) + ); + return this.getLanguageService().getEmitOutput(info.fileName, emitOnlyDtsFiles, getCurrentDirectoryCallback); + } + + getCurrentDirectoryForScriptInfoEmit(info: ScriptInfo) { + const projectRootPath = this.getProjectRootPath(); + return projectRootPath || getDirectoryPath(info.fileName); } getFileNames(excludeFilesFromExternalLibraries?: boolean, excludeConfigFiles?: boolean) { diff --git a/src/services/services.ts b/src/services/services.ts index b508285b182..11061181ee6 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1528,7 +1528,7 @@ namespace ts { return ts.NavigateTo.getNavigateToItems(sourceFiles, program.getTypeChecker(), cancellationToken, searchValue, maxResultCount, excludeDtsFiles); } - function getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean): EmitOutput { + function getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean, getCurrentDirectoryCallback?: GetCurrentDirectoryCallback): EmitOutput { synchronizeHostData(); const sourceFile = getValidSourceFile(fileName); @@ -1543,7 +1543,7 @@ namespace ts { } const customTransformers = host.getCustomTransformers && host.getCustomTransformers(); - const emitOutput = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); + const emitOutput = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers, getCurrentDirectoryCallback); return { outputFiles, diff --git a/src/services/transpile.ts b/src/services/transpile.ts index 561c188c6cd..5ba393a90c9 100644 --- a/src/services/transpile.ts +++ b/src/services/transpile.ts @@ -104,7 +104,7 @@ namespace ts { addRange(/*to*/ diagnostics, /*from*/ program.getOptionsDiagnostics()); } // Emit - program.emit(/*targetSourceFile*/ undefined, /*writeFile*/ undefined, /*cancellationToken*/ undefined, /*emitOnlyDtsFiles*/ undefined, transpileOptions.transformers); + program.emit(/*targetSourceFile*/ undefined, /*writeFile*/ undefined, /*cancellationToken*/ undefined, /*emitOnlyDtsFiles*/ undefined, transpileOptions.transformers, /*getCurrentDirectoryCallback*/ undefined); Debug.assert(outputText !== undefined, "Output generation failed"); diff --git a/src/services/types.ts b/src/services/types.ts index 2d47da2fd1d..07aaaeeb4b4 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -269,7 +269,7 @@ namespace ts { getApplicableRefactors(fileName: string, positionOrRaneg: number | TextRange): ApplicableRefactorInfo[]; getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string): RefactorEditInfo | undefined; - getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean): EmitOutput; + getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean, getCurrentDirectoryCallBack?: GetCurrentDirectoryCallback): EmitOutput; getProgram(): Program; From db78d5a5875becd3859aa414263c9ca6f91aabc2 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Thu, 21 Sep 2017 16:53:38 -0700 Subject: [PATCH 007/137] add error message test --- src/harness/unittests/session.ts | 55 ++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/src/harness/unittests/session.ts b/src/harness/unittests/session.ts index 18109cfa9db..58d8c1b66d8 100644 --- a/src/harness/unittests/session.ts +++ b/src/harness/unittests/session.ts @@ -386,6 +386,61 @@ namespace ts.server { }); }); + describe("exceptions", () => { + const command = "testhandler"; + class TestSession extends Session { + lastSent: protocol.Message; + private exceptionRaisingHandler(_request: protocol.Request): { response?: any, responseRequired: boolean } { + f1(); + return; + function f1() { + throw new Error("myMessage"); + } + } + + constructor() { + super({ + host: mockHost, + cancellationToken: nullCancellationToken, + useSingleInferredProject: false, + useInferredProjectPerProjectRoot: false, + typingsInstaller: undefined, + byteLength: Utils.byteLength, + hrtime: process.hrtime, + logger: projectSystem.nullLogger, + canUseEvents: true + }); + this.addProtocolHandler(command, this.exceptionRaisingHandler); + } + send(msg: protocol.Message) { + this.lastSent = msg; + } + } + + it("raised in a protocol handler generate an event", () => { + + const session = new TestSession(); + + const request = { + command, + seq: 0, + type: "request" + }; + + session.onMessage(JSON.stringify(request)); + const lastSent = session.lastSent as protocol.Response; + + expect(lastSent).to.contain({ + seq: 0, + type: "response", + command, + success: false + }); + + expect(lastSent.message).has.string("myMessage").and.has.string("f1"); + }); + }); + describe("how Session is extendable via subclassing", () => { class TestSession extends Session { lastSent: protocol.Message; From b21c46b9b56d1d8cf7a6ebe71dd26f43015fc552 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Fri, 22 Sep 2017 16:21:31 -0700 Subject: [PATCH 008/137] support @extends in jsdoc --- src/compiler/checker.ts | 4 +- src/compiler/parser.ts | 12 +- src/compiler/types.ts | 11 +- src/compiler/utilities.ts | 8 +- src/services/completions.ts | 4 +- tests/baselines/reference/APISample_jsdoc.js | 4 +- tests/cases/compiler/APISample_jsdoc.ts | 232 +++++++++---------- tests/cases/fourslash/jsDocAugments.ts | 3 +- tests/cases/fourslash/jsDocExtends.ts | 22 ++ 9 files changed, 164 insertions(+), 136 deletions(-) create mode 100644 tests/cases/fourslash/jsDocExtends.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 5c835582da0..2dbfa6bd409 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4986,10 +4986,10 @@ namespace ts { baseType = getReturnTypeOfSignature(constructors[0]); } - // In a JS file, you can use the @augments jsdoc tag to specify a base type with type parameters + // In a JS file, you can use the @augments and @extends jsdoc tags to specify a base type with type parameters const valueDecl = type.symbol.valueDeclaration; if (valueDecl && isInJavaScriptFile(valueDecl)) { - const augTag = getJSDocAugmentsTag(type.symbol.valueDeclaration); + const augTag = getJSDocAugmentsOrExtendsTag(type.symbol.valueDeclaration); if (augTag) { baseType = getTypeFromTypeNode(augTag.typeExpression.type); } diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index 3809a071421..7e9ac8c5804 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -423,8 +423,9 @@ namespace ts { return visitNode(cbNode, (node).typeExpression); case SyntaxKind.JSDocTypeTag: return visitNode(cbNode, (node).typeExpression); - case SyntaxKind.JSDocAugmentsTag: - return visitNode(cbNode, (node).typeExpression); + case SyntaxKind.JSDocAugmentsOrExtendsTag: + case SyntaxKind.JSDocExtendsTag: + return visitNode(cbNode, (node).typeExpression); case SyntaxKind.JSDocTemplateTag: return visitNodes(cbNode, cbNodes, (node).typeParameters); case SyntaxKind.JSDocTypedefTag: @@ -6366,7 +6367,8 @@ namespace ts { if (tagName) { switch (tagName.escapedText) { case "augments": - tag = parseAugmentsTag(atToken, tagName); + case "extends": + tag = parseAugmentsOrExtendsTag(atToken, tagName); break; case "class": case "constructor": @@ -6603,10 +6605,10 @@ namespace ts { return finishNode(result); } - function parseAugmentsTag(atToken: AtToken, tagName: Identifier): JSDocAugmentsTag { + function parseAugmentsOrExtendsTag(atToken: AtToken, tagName: Identifier): JSDocAugmentsOrExtendsTag { const typeExpression = tryParseTypeExpression(); - const result = createNode(SyntaxKind.JSDocAugmentsTag, atToken.pos); + const result = createNode(SyntaxKind.JSDocAugmentsOrExtendsTag, atToken.pos); result.atToken = atToken; result.tagName = tagName; result.typeExpression = typeExpression; diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 4e5ca9f07e7..e8f54236798 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -363,7 +363,8 @@ namespace ts { JSDocVariadicType, JSDocComment, JSDocTag, - JSDocAugmentsTag, + JSDocAugmentsOrExtendsTag, + JSDocExtendsTag, JSDocClassTag, JSDocParameterTag, JSDocReturnTag, @@ -2159,8 +2160,12 @@ namespace ts { kind: SyntaxKind.JSDocTag; } - export interface JSDocAugmentsTag extends JSDocTag { - kind: SyntaxKind.JSDocAugmentsTag; + /** + * Note that `@extends` is a synonym of `@augments`. + * Both are covered by this interface. + */ + export interface JSDocAugmentsOrExtendsTag extends JSDocTag { + kind: SyntaxKind.JSDocAugmentsOrExtendsTag; typeExpression: JSDocTypeExpression; } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 674215b0583..f9a0c4c38ab 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -4072,8 +4072,8 @@ namespace ts { } /** Gets the JSDoc augments tag for the node if present */ - export function getJSDocAugmentsTag(node: Node): JSDocAugmentsTag | undefined { - return getFirstJSDocTag(node, SyntaxKind.JSDocAugmentsTag) as JSDocAugmentsTag; + export function getJSDocAugmentsOrExtendsTag(node: Node): JSDocAugmentsOrExtendsTag | undefined { + return getFirstJSDocTag(node, SyntaxKind.JSDocAugmentsOrExtendsTag) as JSDocAugmentsOrExtendsTag; } /** Gets the JSDoc class tag for the node if present */ @@ -4765,8 +4765,8 @@ namespace ts { return node.kind === SyntaxKind.JSDocComment; } - export function isJSDocAugmentsTag(node: Node): node is JSDocAugmentsTag { - return node.kind === SyntaxKind.JSDocAugmentsTag; + export function isJSDocAugmentsOrExtendsTag(node: Node): node is JSDocAugmentsOrExtendsTag { + return node.kind === SyntaxKind.JSDocAugmentsOrExtendsTag; } export function isJSDocParameterTag(node: Node): node is JSDocParameterTag { diff --git a/src/services/completions.ts b/src/services/completions.ts index e271ef12104..a954f687cb5 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -581,11 +581,11 @@ namespace ts.Completions { return { symbols, isGlobalCompletion, isMemberCompletion, allowStringLiteral, isNewIdentifierLocation, location, isRightOfDot: (isRightOfDot || isRightOfOpenTag), request, keywordFilters }; - type JSDocTagWithTypeExpression = JSDocAugmentsTag | JSDocParameterTag | JSDocPropertyTag | JSDocReturnTag | JSDocTypeTag | JSDocTypedefTag; + type JSDocTagWithTypeExpression = JSDocAugmentsOrExtendsTag | JSDocParameterTag | JSDocPropertyTag | JSDocReturnTag | JSDocTypeTag | JSDocTypedefTag; function isTagWithTypeExpression(tag: JSDocTag): tag is JSDocTagWithTypeExpression { switch (tag.kind) { - case SyntaxKind.JSDocAugmentsTag: + case SyntaxKind.JSDocAugmentsOrExtendsTag: case SyntaxKind.JSDocParameterTag: case SyntaxKind.JSDocPropertyTag: case SyntaxKind.JSDocReturnTag: diff --git a/tests/baselines/reference/APISample_jsdoc.js b/tests/baselines/reference/APISample_jsdoc.js index c74e188f38b..33857d06a6a 100644 --- a/tests/baselines/reference/APISample_jsdoc.js +++ b/tests/baselines/reference/APISample_jsdoc.js @@ -101,7 +101,7 @@ function getAllTags(node: ts.Node) { function getSomeOtherTags(node: ts.Node) { const tags: (ts.JSDocTag | undefined)[] = []; - tags.push(ts.getJSDocAugmentsTag(node)); + tags.push(ts.getJSDocAugmentsOrExtendsTag(node)); tags.push(ts.getJSDocClassTag(node)); tags.push(ts.getJSDocReturnTag(node)); const type = ts.getJSDocTypeTag(node); @@ -200,7 +200,7 @@ function getAllTags(node) { } function getSomeOtherTags(node) { var tags = []; - tags.push(ts.getJSDocAugmentsTag(node)); + tags.push(ts.getJSDocAugmentsOrExtendsTag(node)); tags.push(ts.getJSDocClassTag(node)); tags.push(ts.getJSDocReturnTag(node)); var type = ts.getJSDocTypeTag(node); diff --git a/tests/cases/compiler/APISample_jsdoc.ts b/tests/cases/compiler/APISample_jsdoc.ts index 70b814ffff4..491ff2b7a20 100644 --- a/tests/cases/compiler/APISample_jsdoc.ts +++ b/tests/cases/compiler/APISample_jsdoc.ts @@ -1,116 +1,116 @@ -// @module: commonjs -// @includebuiltfile: typescript_standalone.d.ts -// @strict:true - -/* - * Note: This test is a public API sample. The original sources can be found - * at: https://github.com/YousefED/typescript-json-schema - * https://github.com/vega/ts-json-schema-generator - * Please log a "breaking change" issue for any API breaking change affecting this issue - */ - -declare var console: any; - -import * as ts from "typescript"; - -// excerpted from https://github.com/YousefED/typescript-json-schema -// (converted from a method and modified; for example, `this: any` to compensate, among other changes) -function parseCommentsIntoDefinition(this: any, - symbol: ts.Symbol, - definition: {description?: string, [s: string]: string | undefined}, - otherAnnotations: { [s: string]: true}): void { - if (!symbol) { - return; - } - - // the comments for a symbol - let comments = symbol.getDocumentationComment(); - - if (comments.length) { - definition.description = comments.map(comment => comment.kind === "lineBreak" ? comment.text : comment.text.trim().replace(/\r\n/g, "\n")).join(""); - } - - // jsdocs are separate from comments - const jsdocs = symbol.getJsDocTags(); - jsdocs.forEach(doc => { - // if we have @TJS-... annotations, we have to parse them - const { name, text } = doc; - if (this.userValidationKeywords[name]) { - definition[name] = this.parseValue(text); - } else { - // special annotations - otherAnnotations[doc.name] = true; - } - }); -} - - -// excerpted from https://github.com/vega/ts-json-schema-generator -export interface Annotations { - [name: string]: any; -} -function getAnnotations(this: any, node: ts.Node): Annotations | undefined { - const symbol: ts.Symbol = (node as any).symbol; - if (!symbol) { - return undefined; - } - - const jsDocTags: ts.JSDocTagInfo[] = symbol.getJsDocTags(); - if (!jsDocTags || !jsDocTags.length) { - return undefined; - } - - const annotations: Annotations = jsDocTags.reduce((result: Annotations, jsDocTag: ts.JSDocTagInfo) => { - const value = this.parseJsDocTag(jsDocTag); - if (value !== undefined) { - result[jsDocTag.name] = value; - } - - return result; - }, {}); - return Object.keys(annotations).length ? annotations : undefined; -} - -// these examples are artificial and mostly nonsensical -function parseSpecificTags(node: ts.Node) { - if (node.kind === ts.SyntaxKind.Parameter) { - return ts.getJSDocParameterTags(node as ts.ParameterDeclaration); - } - if (node.kind === ts.SyntaxKind.FunctionDeclaration) { - const func = node as ts.FunctionDeclaration; - if (ts.hasJSDocParameterTags(func)) { - const flat: ts.JSDocTag[] = []; - for (const tags of func.parameters.map(ts.getJSDocParameterTags)) { - if (tags) flat.push(...tags); - } - return flat; - } - } -} - -function getReturnTypeFromJSDoc(node: ts.Node) { - if (node.kind === ts.SyntaxKind.FunctionDeclaration) { - return ts.getJSDocReturnType(node); - } - let type = ts.getJSDocType(node); - if (type && type.kind === ts.SyntaxKind.FunctionType) { - return (type as ts.FunctionTypeNode).type; - } -} - -function getAllTags(node: ts.Node) { - ts.getJSDocTags(node); -} - -function getSomeOtherTags(node: ts.Node) { - const tags: (ts.JSDocTag | undefined)[] = []; - tags.push(ts.getJSDocAugmentsTag(node)); - tags.push(ts.getJSDocClassTag(node)); - tags.push(ts.getJSDocReturnTag(node)); - const type = ts.getJSDocTypeTag(node); - if (type) { - tags.push(type); - } - tags.push(ts.getJSDocTemplateTag(node)); - return tags; -} +// @module: commonjs +// @includebuiltfile: typescript_standalone.d.ts +// @strict:true + +/* + * Note: This test is a public API sample. The original sources can be found + * at: https://github.com/YousefED/typescript-json-schema + * https://github.com/vega/ts-json-schema-generator + * Please log a "breaking change" issue for any API breaking change affecting this issue + */ + +declare var console: any; + +import * as ts from "typescript"; + +// excerpted from https://github.com/YousefED/typescript-json-schema +// (converted from a method and modified; for example, `this: any` to compensate, among other changes) +function parseCommentsIntoDefinition(this: any, + symbol: ts.Symbol, + definition: {description?: string, [s: string]: string | undefined}, + otherAnnotations: { [s: string]: true}): void { + if (!symbol) { + return; + } + + // the comments for a symbol + let comments = symbol.getDocumentationComment(); + + if (comments.length) { + definition.description = comments.map(comment => comment.kind === "lineBreak" ? comment.text : comment.text.trim().replace(/\r\n/g, "\n")).join(""); + } + + // jsdocs are separate from comments + const jsdocs = symbol.getJsDocTags(); + jsdocs.forEach(doc => { + // if we have @TJS-... annotations, we have to parse them + const { name, text } = doc; + if (this.userValidationKeywords[name]) { + definition[name] = this.parseValue(text); + } else { + // special annotations + otherAnnotations[doc.name] = true; + } + }); +} + + +// excerpted from https://github.com/vega/ts-json-schema-generator +export interface Annotations { + [name: string]: any; +} +function getAnnotations(this: any, node: ts.Node): Annotations | undefined { + const symbol: ts.Symbol = (node as any).symbol; + if (!symbol) { + return undefined; + } + + const jsDocTags: ts.JSDocTagInfo[] = symbol.getJsDocTags(); + if (!jsDocTags || !jsDocTags.length) { + return undefined; + } + + const annotations: Annotations = jsDocTags.reduce((result: Annotations, jsDocTag: ts.JSDocTagInfo) => { + const value = this.parseJsDocTag(jsDocTag); + if (value !== undefined) { + result[jsDocTag.name] = value; + } + + return result; + }, {}); + return Object.keys(annotations).length ? annotations : undefined; +} + +// these examples are artificial and mostly nonsensical +function parseSpecificTags(node: ts.Node) { + if (node.kind === ts.SyntaxKind.Parameter) { + return ts.getJSDocParameterTags(node as ts.ParameterDeclaration); + } + if (node.kind === ts.SyntaxKind.FunctionDeclaration) { + const func = node as ts.FunctionDeclaration; + if (ts.hasJSDocParameterTags(func)) { + const flat: ts.JSDocTag[] = []; + for (const tags of func.parameters.map(ts.getJSDocParameterTags)) { + if (tags) flat.push(...tags); + } + return flat; + } + } +} + +function getReturnTypeFromJSDoc(node: ts.Node) { + if (node.kind === ts.SyntaxKind.FunctionDeclaration) { + return ts.getJSDocReturnType(node); + } + let type = ts.getJSDocType(node); + if (type && type.kind === ts.SyntaxKind.FunctionType) { + return (type as ts.FunctionTypeNode).type; + } +} + +function getAllTags(node: ts.Node) { + ts.getJSDocTags(node); +} + +function getSomeOtherTags(node: ts.Node) { + const tags: (ts.JSDocTag | undefined)[] = []; + tags.push(ts.getJSDocAugmentsOrExtendsTag(node)); + tags.push(ts.getJSDocClassTag(node)); + tags.push(ts.getJSDocReturnTag(node)); + const type = ts.getJSDocTypeTag(node); + if (type) { + tags.push(type); + } + tags.push(ts.getJSDocTemplateTag(node)); + return tags; +} diff --git a/tests/cases/fourslash/jsDocAugments.ts b/tests/cases/fourslash/jsDocAugments.ts index 24458c529fb..cd2190e5486 100644 --- a/tests/cases/fourslash/jsDocAugments.ts +++ b/tests/cases/fourslash/jsDocAugments.ts @@ -15,9 +15,8 @@ // @Filename: declarations.d.ts //// declare class Thing { -//// mine: T; +//// mine: T; //// } goTo.marker(); verify.quickInfoIs("(local var) x: string"); - diff --git a/tests/cases/fourslash/jsDocExtends.ts b/tests/cases/fourslash/jsDocExtends.ts new file mode 100644 index 00000000000..6bce5569533 --- /dev/null +++ b/tests/cases/fourslash/jsDocExtends.ts @@ -0,0 +1,22 @@ +/// + +// @allowJs: true +// @Filename: dummy.js + +//// /** +//// * @extends {Thing} +//// */ +//// class MyStringThing extends Thing { +//// constructor() { +//// var x = this.mine; +//// x/**/; +//// } +//// } + +// @Filename: declarations.d.ts +//// declare class Thing { +//// mine: T; +//// } + +goTo.marker(); +verify.quickInfoIs("(local var) x: string"); From 6ba62d2d8dbfcfcbf542ab3213949ed98beaf459 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 26 Sep 2017 16:29:25 -0700 Subject: [PATCH 009/137] Revert all the changes except test case --- src/compiler/program.ts | 12 ++++++------ src/compiler/types.ts | 6 +----- src/server/builder.ts | 4 ++-- src/server/project.ts | 11 +---------- src/services/services.ts | 4 ++-- src/services/transpile.ts | 2 +- src/services/types.ts | 2 +- 7 files changed, 14 insertions(+), 27 deletions(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 30c61f50dff..bbc0fa09780 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -874,12 +874,12 @@ namespace ts { return oldProgram.structureIsReused = StructureIsReused.Completely; } - function getEmitHost(writeFileCallback?: WriteFileCallback, getCurrentDirectoryCallback?: GetCurrentDirectoryCallback): EmitHost { + function getEmitHost(writeFileCallback?: WriteFileCallback): EmitHost { return { getCanonicalFileName, getCommonSourceDirectory: program.getCommonSourceDirectory, getCompilerOptions: program.getCompilerOptions, - getCurrentDirectory: getCurrentDirectoryCallback || (() => currentDirectory), + getCurrentDirectory: () => currentDirectory, getNewLine: () => host.getNewLine(), getSourceFile: program.getSourceFile, getSourceFileByPath: program.getSourceFileByPath, @@ -907,15 +907,15 @@ namespace ts { return noDiagnosticsTypeChecker || (noDiagnosticsTypeChecker = createTypeChecker(program, /*produceDiagnostics:*/ false)); } - function emit(sourceFile?: SourceFile, writeFileCallback?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, transformers?: CustomTransformers, getCurrentDirectoryCallback?: GetCurrentDirectoryCallback): EmitResult { - return runWithCancellationToken(() => emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers, getCurrentDirectoryCallback)); + function emit(sourceFile?: SourceFile, writeFileCallback?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, transformers?: CustomTransformers): EmitResult { + return runWithCancellationToken(() => emitWorker(program, sourceFile, writeFileCallback, cancellationToken, emitOnlyDtsFiles, transformers)); } function isEmitBlocked(emitFileName: string): boolean { return hasEmitBlockingDiagnostics.contains(toPath(emitFileName, currentDirectory, getCanonicalFileName)); } - function emitWorker(program: Program, sourceFile: SourceFile, writeFileCallback: WriteFileCallback, cancellationToken: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers, getCurrentDirectoryCallback?: GetCurrentDirectoryCallback): EmitResult { + function emitWorker(program: Program, sourceFile: SourceFile, writeFileCallback: WriteFileCallback, cancellationToken: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult { let declarationDiagnostics: Diagnostic[] = []; if (options.noEmit) { @@ -960,7 +960,7 @@ namespace ts { const transformers = emitOnlyDtsFiles ? [] : getTransformers(options, customTransformers); const emitResult = emitFiles( emitResolver, - getEmitHost(writeFileCallback, getCurrentDirectoryCallback), + getEmitHost(writeFileCallback), sourceFile, emitOnlyDtsFiles, transformers); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index ac5de153226..ac64624e1a6 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2405,10 +2405,6 @@ namespace ts { (fileName: string, data: string, writeByteOrderMark: boolean, onError?: (message: string) => void, sourceFiles?: SourceFile[]): void; } - export interface GetCurrentDirectoryCallback { - (): string; - } - export class OperationCanceledException { } export interface CancellationToken { @@ -2440,7 +2436,7 @@ namespace ts { * used for writing the JavaScript and declaration files. Otherwise, the writeFile parameter * will be invoked when writing the JavaScript and declaration files. */ - emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers, getCurrentDirectoryCallback?: GetCurrentDirectoryCallback): EmitResult; + emit(targetSourceFile?: SourceFile, writeFile?: WriteFileCallback, cancellationToken?: CancellationToken, emitOnlyDtsFiles?: boolean, customTransformers?: CustomTransformers): EmitResult; getOptionsDiagnostics(cancellationToken?: CancellationToken): Diagnostic[]; getGlobalDiagnostics(cancellationToken?: CancellationToken): Diagnostic[]; diff --git a/src/server/builder.ts b/src/server/builder.ts index 711045d0ae6..895732ebece 100644 --- a/src/server/builder.ts +++ b/src/server/builder.ts @@ -148,9 +148,9 @@ namespace ts.server { const { emitSkipped, outputFiles } = this.project.getFileEmitOutput(fileInfo.scriptInfo, /*emitOnlyDtsFiles*/ false); if (!emitSkipped) { - const currentDirectoryForEmit = this.project.getCurrentDirectoryForScriptInfoEmit(scriptInfo); + const projectRootPath = this.project.getProjectRootPath(); for (const outputFile of outputFiles) { - const outputFileAbsoluteFileName = getNormalizedAbsolutePath(outputFile.name, currentDirectoryForEmit); + const outputFileAbsoluteFileName = getNormalizedAbsolutePath(outputFile.name, projectRootPath ? projectRootPath : getDirectoryPath(scriptInfo.fileName)); writeFile(outputFileAbsoluteFileName, outputFile.text, outputFile.writeByteOrderMark); } } diff --git a/src/server/project.ts b/src/server/project.ts index a7d8605315b..ac040a77ace 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -367,16 +367,7 @@ namespace ts.server { if (!this.languageServiceEnabled) { return undefined; } - - const getCurrentDirectoryCallback = memoize( - () => this.getCurrentDirectoryForScriptInfoEmit(info) - ); - return this.getLanguageService().getEmitOutput(info.fileName, emitOnlyDtsFiles, getCurrentDirectoryCallback); - } - - getCurrentDirectoryForScriptInfoEmit(info: ScriptInfo) { - const projectRootPath = this.getProjectRootPath(); - return projectRootPath || getDirectoryPath(info.fileName); + return this.getLanguageService().getEmitOutput(info.fileName, emitOnlyDtsFiles); } getFileNames(excludeFilesFromExternalLibraries?: boolean, excludeConfigFiles?: boolean) { diff --git a/src/services/services.ts b/src/services/services.ts index 11061181ee6..b508285b182 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1528,7 +1528,7 @@ namespace ts { return ts.NavigateTo.getNavigateToItems(sourceFiles, program.getTypeChecker(), cancellationToken, searchValue, maxResultCount, excludeDtsFiles); } - function getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean, getCurrentDirectoryCallback?: GetCurrentDirectoryCallback): EmitOutput { + function getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean): EmitOutput { synchronizeHostData(); const sourceFile = getValidSourceFile(fileName); @@ -1543,7 +1543,7 @@ namespace ts { } const customTransformers = host.getCustomTransformers && host.getCustomTransformers(); - const emitOutput = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers, getCurrentDirectoryCallback); + const emitOutput = program.emit(sourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers); return { outputFiles, diff --git a/src/services/transpile.ts b/src/services/transpile.ts index 5ba393a90c9..561c188c6cd 100644 --- a/src/services/transpile.ts +++ b/src/services/transpile.ts @@ -104,7 +104,7 @@ namespace ts { addRange(/*to*/ diagnostics, /*from*/ program.getOptionsDiagnostics()); } // Emit - program.emit(/*targetSourceFile*/ undefined, /*writeFile*/ undefined, /*cancellationToken*/ undefined, /*emitOnlyDtsFiles*/ undefined, transpileOptions.transformers, /*getCurrentDirectoryCallback*/ undefined); + program.emit(/*targetSourceFile*/ undefined, /*writeFile*/ undefined, /*cancellationToken*/ undefined, /*emitOnlyDtsFiles*/ undefined, transpileOptions.transformers); Debug.assert(outputText !== undefined, "Output generation failed"); diff --git a/src/services/types.ts b/src/services/types.ts index 07aaaeeb4b4..2d47da2fd1d 100644 --- a/src/services/types.ts +++ b/src/services/types.ts @@ -269,7 +269,7 @@ namespace ts { getApplicableRefactors(fileName: string, positionOrRaneg: number | TextRange): ApplicableRefactorInfo[]; getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string): RefactorEditInfo | undefined; - getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean, getCurrentDirectoryCallBack?: GetCurrentDirectoryCallback): EmitOutput; + getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean): EmitOutput; getProgram(): Program; From fad71d3dc69bc5381ba8bb17605a9660f5a05339 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 26 Sep 2017 17:29:53 -0700 Subject: [PATCH 010/137] Use project root as the current directory whenever possible to create the project --- src/compiler/program.ts | 13 +++- src/harness/unittests/compileOnSave.ts | 2 +- src/harness/unittests/session.ts | 4 +- src/server/builder.ts | 3 +- src/server/editorServices.ts | 33 ++++++++-- src/server/lsHost.ts | 4 +- src/server/project.ts | 66 +++++++++---------- tests/cases/fourslash/server/projectInfo01.ts | 8 +-- tests/cases/fourslash/server/projectInfo02.ts | 2 +- .../server/projectWithNonExistentFiles.ts | 2 +- 10 files changed, 78 insertions(+), 59 deletions(-) diff --git a/src/compiler/program.ts b/src/compiler/program.ts index c8ff2496725..1397d46af1c 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -984,11 +984,18 @@ namespace ts { return true; } - if (defaultLibraryPath && defaultLibraryPath.length !== 0) { - return containsPath(defaultLibraryPath, file.path, currentDirectory, /*ignoreCase*/ !host.useCaseSensitiveFileNames()); + if (!options.noLib) { + return false; } - return compareStrings(file.fileName, getDefaultLibraryFileName(), /*ignoreCase*/ !host.useCaseSensitiveFileNames()) === Comparison.EqualTo; + // If '--lib' is not specified, include default library file according to '--target' + // otherwise, using options specified in '--lib' instead of '--target' default library file + if (!options.lib) { + return compareStrings(file.fileName, getDefaultLibraryFileName(), /*ignoreCase*/ !host.useCaseSensitiveFileNames()) === Comparison.EqualTo; + } + else { + return forEach(options.lib, libFileName => compareStrings(file.fileName, combinePaths(defaultLibraryPath, libFileName), /*ignoreCase*/ !host.useCaseSensitiveFileNames()) === Comparison.EqualTo); + } } function getDiagnosticsProducingTypeChecker() { diff --git a/src/harness/unittests/compileOnSave.ts b/src/harness/unittests/compileOnSave.ts index 89b980f23f8..dddcd64cd39 100644 --- a/src/harness/unittests/compileOnSave.ts +++ b/src/harness/unittests/compileOnSave.ts @@ -567,7 +567,7 @@ namespace ts.projectSystem { path: "/a/b/file3.js", content: "console.log('file3');" }; - const externalProjectName = "externalproject"; + const externalProjectName = "/a/b/externalproject"; const host = createServerHost([file1, file2, file3, libFile]); const session = createSession(host); const projectService = session.getProjectService(); diff --git a/src/harness/unittests/session.ts b/src/harness/unittests/session.ts index f37c9ea2392..417591cdb6f 100644 --- a/src/harness/unittests/session.ts +++ b/src/harness/unittests/session.ts @@ -16,8 +16,8 @@ namespace ts.server { directoryExists: () => false, getDirectories: () => [], createDirectory: noop, - getExecutingFilePath(): string { return void 0; }, - getCurrentDirectory(): string { return void 0; }, + getExecutingFilePath(): string { return ""; }, + getCurrentDirectory(): string { return ""; }, getEnvironmentVariable(): string { return ""; }, readDirectory() { return []; }, exit: noop, diff --git a/src/server/builder.ts b/src/server/builder.ts index 5cf65611fb3..0279f08bfab 100644 --- a/src/server/builder.ts +++ b/src/server/builder.ts @@ -148,9 +148,8 @@ namespace ts.server { const { emitSkipped, outputFiles } = this.project.getFileEmitOutput(fileInfo.scriptInfo, /*emitOnlyDtsFiles*/ false); if (!emitSkipped) { - const projectRootPath = this.project.getProjectRootPath(); for (const outputFile of outputFiles) { - const outputFileAbsoluteFileName = getNormalizedAbsolutePath(outputFile.name, projectRootPath ? projectRootPath : getDirectoryPath(scriptInfo.fileName)); + const outputFileAbsoluteFileName = getNormalizedAbsolutePath(outputFile.name, this.project.currentDirectory); writeFile(outputFileAbsoluteFileName, outputFile.text, outputFile.writeByteOrderMark); } } diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index d86f45a9ad9..9a12c4cab7c 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -417,7 +417,7 @@ namespace ts.server { this.globalPlugins = opts.globalPlugins || emptyArray; this.pluginProbeLocations = opts.pluginProbeLocations || emptyArray; this.allowLocalPluginLoads = !!opts.allowLocalPluginLoads; - this.typesMapLocation = (opts.typesMapLocation === undefined) ? combinePaths(this.host.getExecutingFilePath(), "../typesMap.json") : opts.typesMapLocation; + this.typesMapLocation = (opts.typesMapLocation === undefined) ? combinePaths(this.getExecutingFilePath(), "../typesMap.json") : opts.typesMapLocation; Debug.assert(!!this.host.createHash, "'ServerHost.createHash' is required for ProjectService"); @@ -442,6 +442,16 @@ namespace ts.server { this.documentRegistry = createDocumentRegistry(this.host.useCaseSensitiveFileNames, this.host.getCurrentDirectory()); } + /*@internal*/ + getExecutingFilePath() { + return this.getNormalizedAbsolutePath(this.host.getExecutingFilePath()); + } + + /*@internal*/ + getNormalizedAbsolutePath(fileName: string) { + return getNormalizedAbsolutePath(fileName, this.host.getCurrentDirectory()); + } + /* @internal */ getChangedFiles_TestOnly() { return this.changedFiles; @@ -924,6 +934,14 @@ namespace ts.server { }); } + /*@internal*/ getScriptInfoPaths() { + const result: Path[] = []; + this.filenameToScriptInfo.forEach(info => { + result.push(info.path); + }); + return result; + } + /** * This function tries to search for a tsconfig.json for the given file. If we found it, * we first detect if there is already a configured project created for it: if so, we re-read @@ -1365,7 +1383,7 @@ namespace ts.server { return project; } } - return this.createInferredProject(/*isSingleInferredProject*/ false, projectRootPath); + return this.createInferredProject(projectRootPath, /*isSingleInferredProject*/ false, projectRootPath); } // we don't have an explicit root path, so we should try to find an inferred project @@ -1402,12 +1420,13 @@ namespace ts.server { return this.inferredProjects[0]; } - return this.createInferredProject(/*isSingleInferredProject*/ true); + // Single inferred project does not have a project root. + return this.createInferredProject(/*currentDirectory*/ undefined, /*isSingleInferredProject*/ true); } - private createInferredProject(isSingleInferredProject?: boolean, projectRootPath?: string): InferredProject { + private createInferredProject(currentDirectory: string | undefined, isSingleInferredProject?: boolean, projectRootPath?: string): InferredProject { const compilerOptions = projectRootPath && this.compilerOptionsForInferredProjectsPerProjectRoot.get(projectRootPath) || this.compilerOptionsForInferredProjects; - const project = new InferredProject(this, this.documentRegistry, compilerOptions, projectRootPath); + const project = new InferredProject(this, this.documentRegistry, compilerOptions, currentDirectory, projectRootPath); if (isSingleInferredProject) { this.inferredProjects.unshift(project); } @@ -1419,8 +1438,8 @@ namespace ts.server { createInferredProjectWithRootFileIfNecessary(root: ScriptInfo, projectRootPath?: string) { const project = this.getOrCreateInferredProjectForProjectRootPathIfEnabled(root, projectRootPath) || - this.getOrCreateSingleInferredProjectIfEnabled() || - this.createInferredProject(); + this.getOrCreateSingleInferredProjectIfEnabled() || + this.createInferredProject(getDirectoryPath(root.path)); project.addRoot(root); diff --git a/src/server/lsHost.ts b/src/server/lsHost.ts index 13b9505a658..08dd5000cba 100644 --- a/src/server/lsHost.ts +++ b/src/server/lsHost.ts @@ -173,7 +173,7 @@ namespace ts.server { } getDefaultLibFileName() { - const nodeModuleBinDir = getDirectoryPath(normalizePath(this.host.getExecutingFilePath())); + const nodeModuleBinDir = getDirectoryPath(this.project.projectService.getExecutingFilePath()); return combinePaths(nodeModuleBinDir, getDefaultLibFileName(this.compilationSettings)); } @@ -203,7 +203,7 @@ namespace ts.server { } getCurrentDirectory(): string { - return this.host.getCurrentDirectory(); + return this.project.currentDirectory; } resolvePath(path: string): string { diff --git a/src/server/project.ts b/src/server/project.ts index 9ef79530e51..084193a97f5 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -177,6 +177,9 @@ namespace ts.server { return result.module; } + /*@internal*/ + readonly currentDirectory: string; + constructor( private readonly projectName: string, readonly projectKind: ProjectKind, @@ -185,8 +188,9 @@ namespace ts.server { hasExplicitListOfFiles: boolean, languageServiceEnabled: boolean, private compilerOptions: CompilerOptions, - public compileOnSaveEnabled: boolean) { - + public compileOnSaveEnabled: boolean, + currentDirectory: string | undefined) { + this.currentDirectory = this.projectService.getNormalizedAbsolutePath(currentDirectory || ""); if (!this.compilerOptions) { this.compilerOptions = getDefaultCompilerOptions(); this.compilerOptions.allowNonTsExtensions = true; @@ -268,7 +272,6 @@ namespace ts.server { getProjectName() { return this.projectName; } - abstract getProjectRootPath(): string | undefined; abstract getTypeAcquisition(): TypeAcquisition; getExternalFiles(): SortedReadonlyArray { @@ -363,7 +366,7 @@ namespace ts.server { return map(this.program.getSourceFiles(), sourceFile => { const scriptInfo = this.projectService.getScriptInfoForPath(sourceFile.path); if (!scriptInfo) { - Debug.fail(`scriptInfo for a file '${sourceFile.fileName}' is missing.`); + Debug.fail(`scriptInfo for a file '${sourceFile.fileName}' Path: '${sourceFile.path}' is missing.\nProgram currentDirectory: '${this.program.getCurrentDirectory()}'\nCurrentScriptInfos: ${this.projectService.getScriptInfoPaths()}\ncurrentDirectory: ${this.projectService.host.getCurrentDirectory()}`); } return scriptInfo; }); @@ -842,8 +845,6 @@ namespace ts.server { * the file and its imports/references are put into an InferredProject. */ export class InferredProject extends Project { - public readonly projectRootPath: string | undefined; - private static readonly newName = (() => { let nextId = 1; return () => { @@ -882,7 +883,7 @@ namespace ts.server { // Used to keep track of what directories are watched for this project directoriesWatchedForTsconfig: string[] = []; - constructor(projectService: ProjectService, documentRegistry: DocumentRegistry, compilerOptions: CompilerOptions, projectRootPath?: string) { + constructor(projectService: ProjectService, documentRegistry: DocumentRegistry, compilerOptions: CompilerOptions, currentDirectory: string | undefined, readonly projectRootPath: string | undefined) { super(InferredProject.newName(), ProjectKind.Inferred, projectService, @@ -890,7 +891,8 @@ namespace ts.server { /*files*/ undefined, /*languageServiceEnabled*/ true, compilerOptions, - /*compileOnSaveEnabled*/ false); + /*compileOnSaveEnabled*/ false, + currentDirectory); this.projectRootPath = projectRootPath; } @@ -910,15 +912,6 @@ namespace ts.server { super.removeRoot(info); } - getProjectRootPath() { - // Single inferred project does not have a project root. - if (this.projectService.useSingleInferredProject) { - return undefined; - } - const rootFiles = this.getRootFiles(); - return getDirectoryPath(rootFiles[0]); - } - close() { super.close(); @@ -962,7 +955,15 @@ namespace ts.server { private wildcardDirectories: Map, languageServiceEnabled: boolean, public compileOnSaveEnabled: boolean) { - super(configFileName, ProjectKind.Configured, projectService, documentRegistry, hasExplicitListOfFiles, languageServiceEnabled, compilerOptions, compileOnSaveEnabled); + super(configFileName, + ProjectKind.Configured, + projectService, + documentRegistry, + hasExplicitListOfFiles, + languageServiceEnabled, + compilerOptions, + compileOnSaveEnabled, + getDirectoryPath(configFileName)); this.canonicalConfigFilePath = asNormalizedPath(projectService.toCanonicalFileName(configFileName)); this.enablePlugins(); } @@ -982,7 +983,7 @@ namespace ts.server { // Search our peer node_modules, then any globally-specified probe paths // ../../.. to walk from X/node_modules/typescript/lib/tsserver.js to X/node_modules/ - const searchPaths = [combinePaths(host.getExecutingFilePath(), "../../.."), ...this.projectService.pluginProbeLocations]; + const searchPaths = [combinePaths(this.projectService.getExecutingFilePath(), "../../.."), ...this.projectService.pluginProbeLocations]; if (this.projectService.allowLocalPluginLoads) { const local = getDirectoryPath(this.canonicalConfigFilePath); @@ -1062,10 +1063,6 @@ namespace ts.server { } } - getProjectRootPath() { - return getDirectoryPath(this.getConfigFilePath()); - } - setProjectErrors(projectErrors: ReadonlyArray) { this.projectErrors = projectErrors; } @@ -1196,25 +1193,22 @@ namespace ts.server { compilerOptions: CompilerOptions, languageServiceEnabled: boolean, public compileOnSaveEnabled: boolean, - private readonly projectFilePath?: string) { - super(externalProjectName, ProjectKind.External, projectService, documentRegistry, /*hasExplicitListOfFiles*/ true, languageServiceEnabled, compilerOptions, compileOnSaveEnabled); - + projectFilePath?: string) { + super(externalProjectName, + ProjectKind.External, + projectService, + documentRegistry, + /*hasExplicitListOfFiles*/ true, + languageServiceEnabled, + compilerOptions, + compileOnSaveEnabled, + getDirectoryPath(projectFilePath || normalizeSlashes(externalProjectName))); } getExcludedFiles() { return this.excludedFiles; } - getProjectRootPath() { - if (this.projectFilePath) { - return getDirectoryPath(this.projectFilePath); - } - // if the projectFilePath is not given, we make the assumption that the project name - // is the path of the project file. AS the project name is provided by VS, we need to - // normalize slashes before using it as a file name. - return getDirectoryPath(normalizeSlashes(this.getProjectName())); - } - getTypeAcquisition() { return this.typeAcquisition; } diff --git a/tests/cases/fourslash/server/projectInfo01.ts b/tests/cases/fourslash/server/projectInfo01.ts index 0d8707bf8a1..036aa5f0d4d 100644 --- a/tests/cases/fourslash/server/projectInfo01.ts +++ b/tests/cases/fourslash/server/projectInfo01.ts @@ -14,11 +14,11 @@ ////console.log("nothing"); goTo.file("a.ts") -verify.ProjectInfo(["lib.d.ts", "a.ts"]) +verify.ProjectInfo(["/lib.d.ts", "a.ts"]) goTo.file("b.ts") -verify.ProjectInfo(["lib.d.ts", "a.ts", "b.ts"]) +verify.ProjectInfo(["/lib.d.ts", "a.ts", "b.ts"]) goTo.file("c.ts") -verify.ProjectInfo(["lib.d.ts", "a.ts", "b.ts", "c.ts"]) +verify.ProjectInfo(["/lib.d.ts", "a.ts", "b.ts", "c.ts"]) goTo.file("d.ts") -verify.ProjectInfo(["lib.d.ts", "d.ts"]) +verify.ProjectInfo(["/lib.d.ts", "d.ts"]) diff --git a/tests/cases/fourslash/server/projectInfo02.ts b/tests/cases/fourslash/server/projectInfo02.ts index 3077deb453c..fb7c9cf8257 100644 --- a/tests/cases/fourslash/server/projectInfo02.ts +++ b/tests/cases/fourslash/server/projectInfo02.ts @@ -10,4 +10,4 @@ ////{ "files": ["a.ts", "b.ts"] } goTo.file("a.ts") -verify.ProjectInfo(["lib.d.ts", "a.ts", "b.ts", "tsconfig.json"]) +verify.ProjectInfo(["/lib.d.ts", "a.ts", "b.ts", "tsconfig.json"]) diff --git a/tests/cases/fourslash/server/projectWithNonExistentFiles.ts b/tests/cases/fourslash/server/projectWithNonExistentFiles.ts index 0e263d9aca6..a52c5f8918f 100644 --- a/tests/cases/fourslash/server/projectWithNonExistentFiles.ts +++ b/tests/cases/fourslash/server/projectWithNonExistentFiles.ts @@ -10,4 +10,4 @@ ////{ "files": ["a.ts", "c.ts", "b.ts"] } goTo.file("a.ts"); -verify.ProjectInfo(["lib.d.ts", "a.ts", "b.ts", "tsconfig.json"]) +verify.ProjectInfo(["/lib.d.ts", "a.ts", "b.ts", "tsconfig.json"]) From b029857528ba37ccec4d09afca69ab24cf8c8fe5 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 27 Sep 2017 20:30:10 -0700 Subject: [PATCH 011/137] Give a more helpful error message when users try decorating using expressions that take no arguments. --- src/compiler/checker.ts | 5 +++++ src/compiler/diagnosticMessages.json | 4 ++++ 2 files changed, 9 insertions(+) mode change 100644 => 100755 src/compiler/checker.ts mode change 100644 => 100755 src/compiler/diagnosticMessages.json diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts old mode 100644 new mode 100755 index d89247b70f9..b342003cb59 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -16381,6 +16381,11 @@ namespace ts { return resolveUntypedCall(node); } + if (callSignatures.length === 1 && callSignatures[0].parameters.length === 0) { + error(node, Diagnostics.A_decorator_function_must_accept_some_number_of_arguments_but_this_expression_takes_none_Did_you_mean_to_call_it_first); + return resolveErrorCall(node); + } + const headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); if (!callSignatures.length) { let errorInfo: DiagnosticMessageChain; diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json old mode 100644 new mode 100755 index bf8fcdc4f84..193c6879b13 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -907,6 +907,10 @@ "category": "Error", "code": 1328 }, + "A decorator function must accept some number of arguments, but this expression takes none. Did you mean to call it first?": { + "category": "Error", + "code": 1329 + }, "Duplicate identifier '{0}'.": { "category": "Error", From fbbf3d22e398ad894be3a79c85f2769175c41826 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Wed, 27 Sep 2017 20:56:59 -0700 Subject: [PATCH 012/137] Accepted baselines. --- tests/baselines/reference/decoratorOnClassMethod6.errors.txt | 4 ++-- .../baselines/reference/decoratorOnClassProperty11.errors.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/baselines/reference/decoratorOnClassMethod6.errors.txt b/tests/baselines/reference/decoratorOnClassMethod6.errors.txt index 530e86117ee..ab09a01f19b 100644 --- a/tests/baselines/reference/decoratorOnClassMethod6.errors.txt +++ b/tests/baselines/reference/decoratorOnClassMethod6.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/decorators/class/method/decoratorOnClassMethod6.ts(4,5): error TS1241: Unable to resolve signature of method decorator when called as an expression. +tests/cases/conformance/decorators/class/method/decoratorOnClassMethod6.ts(4,5): error TS1329: A decorator function must accept some number of arguments, but this expression takes none. Did you mean to call it first? ==== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod6.ts (1 errors) ==== @@ -7,5 +7,5 @@ tests/cases/conformance/decorators/class/method/decoratorOnClassMethod6.ts(4,5): class C { @dec ["method"]() {} ~~~~ -!!! error TS1241: Unable to resolve signature of method decorator when called as an expression. +!!! error TS1329: A decorator function must accept some number of arguments, but this expression takes none. Did you mean to call it first? } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassProperty11.errors.txt b/tests/baselines/reference/decoratorOnClassProperty11.errors.txt index 2a72fefa53e..8e778300aa6 100644 --- a/tests/baselines/reference/decoratorOnClassProperty11.errors.txt +++ b/tests/baselines/reference/decoratorOnClassProperty11.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/decorators/class/property/decoratorOnClassProperty11.ts(4,5): error TS1240: Unable to resolve signature of property decorator when called as an expression. +tests/cases/conformance/decorators/class/property/decoratorOnClassProperty11.ts(4,5): error TS1329: A decorator function must accept some number of arguments, but this expression takes none. Did you mean to call it first? ==== tests/cases/conformance/decorators/class/property/decoratorOnClassProperty11.ts (1 errors) ==== @@ -7,5 +7,5 @@ tests/cases/conformance/decorators/class/property/decoratorOnClassProperty11.ts( class C { @dec prop; ~~~~ -!!! error TS1240: Unable to resolve signature of property decorator when called as an expression. +!!! error TS1329: A decorator function must accept some number of arguments, but this expression takes none. Did you mean to call it first? } \ No newline at end of file From 966f370712a5c16a527ce098acad0ff175262926 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 29 Sep 2017 16:42:30 -0700 Subject: [PATCH 013/137] Use a better check. --- src/compiler/checker.ts | 15 +++++++++++++-- src/compiler/diagnosticMessages.json | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) mode change 100755 => 100644 src/compiler/checker.ts mode change 100755 => 100644 src/compiler/diagnosticMessages.json diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts old mode 100755 new mode 100644 index b342003cb59..3760dd6a19f --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -16381,8 +16381,8 @@ namespace ts { return resolveUntypedCall(node); } - if (callSignatures.length === 1 && callSignatures[0].parameters.length === 0) { - error(node, Diagnostics.A_decorator_function_must_accept_some_number_of_arguments_but_this_expression_takes_none_Did_you_mean_to_call_it_first); + if (isPotentiallyUncalledDecorator(node, callSignatures)) { + error(node, Diagnostics.This_function_cannot_be_used_as_a_decorator_Did_you_mean_to_call_it_first); return resolveErrorCall(node); } @@ -16398,6 +16398,17 @@ namespace ts { return resolveCall(node, callSignatures, candidatesOutArray, headMessage); } + /** + * Sometimes, we have a decorator that could accept zero arguments, + * but is receiving too many arguments as part of the decorator invocation. + * In those cases, a user may have meant to *call* the expression before using it as a decorator. + */ + function isPotentiallyUncalledDecorator(decorator: Decorator, signatures: Signature[]) { + return signatures.length && every(signatures, signature => + signature.minArgumentCount === 0 && + signature.parameters.length < getEffectiveArgumentCount(decorator, /*args*/ undefined, signature)) + } + /** * This function is similar to getResolvedSignature but is exclusively for trying to resolve JSX stateless-function component. * The main reason we have to use this function instead of getResolvedSignature because, the caller of this function will already check the type of openingLikeElement's tagName diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json old mode 100755 new mode 100644 index 193c6879b13..722985aac78 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -907,7 +907,7 @@ "category": "Error", "code": 1328 }, - "A decorator function must accept some number of arguments, but this expression takes none. Did you mean to call it first?": { + "This function cannot be used as a decorator. Did you mean to call it first?": { "category": "Error", "code": 1329 }, From 08ef6e4bea636cdabe05fd65cd07bc40f4924b9d Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 29 Sep 2017 16:42:46 -0700 Subject: [PATCH 014/137] Accepted baselines. --- src/compiler/checker.ts | 2 +- tests/baselines/reference/decoratorOnClassMethod6.errors.txt | 4 ++-- .../baselines/reference/decoratorOnClassProperty11.errors.txt | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 3760dd6a19f..a272ac15e72 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -16406,7 +16406,7 @@ namespace ts { function isPotentiallyUncalledDecorator(decorator: Decorator, signatures: Signature[]) { return signatures.length && every(signatures, signature => signature.minArgumentCount === 0 && - signature.parameters.length < getEffectiveArgumentCount(decorator, /*args*/ undefined, signature)) + signature.parameters.length < getEffectiveArgumentCount(decorator, /*args*/ undefined, signature)); } /** diff --git a/tests/baselines/reference/decoratorOnClassMethod6.errors.txt b/tests/baselines/reference/decoratorOnClassMethod6.errors.txt index ab09a01f19b..befe582025c 100644 --- a/tests/baselines/reference/decoratorOnClassMethod6.errors.txt +++ b/tests/baselines/reference/decoratorOnClassMethod6.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/decorators/class/method/decoratorOnClassMethod6.ts(4,5): error TS1329: A decorator function must accept some number of arguments, but this expression takes none. Did you mean to call it first? +tests/cases/conformance/decorators/class/method/decoratorOnClassMethod6.ts(4,5): error TS1329: This function cannot be used as a decorator. Did you mean to call it first? ==== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod6.ts (1 errors) ==== @@ -7,5 +7,5 @@ tests/cases/conformance/decorators/class/method/decoratorOnClassMethod6.ts(4,5): class C { @dec ["method"]() {} ~~~~ -!!! error TS1329: A decorator function must accept some number of arguments, but this expression takes none. Did you mean to call it first? +!!! error TS1329: This function cannot be used as a decorator. Did you mean to call it first? } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassProperty11.errors.txt b/tests/baselines/reference/decoratorOnClassProperty11.errors.txt index 8e778300aa6..771ca46b572 100644 --- a/tests/baselines/reference/decoratorOnClassProperty11.errors.txt +++ b/tests/baselines/reference/decoratorOnClassProperty11.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/decorators/class/property/decoratorOnClassProperty11.ts(4,5): error TS1329: A decorator function must accept some number of arguments, but this expression takes none. Did you mean to call it first? +tests/cases/conformance/decorators/class/property/decoratorOnClassProperty11.ts(4,5): error TS1329: This function cannot be used as a decorator. Did you mean to call it first? ==== tests/cases/conformance/decorators/class/property/decoratorOnClassProperty11.ts (1 errors) ==== @@ -7,5 +7,5 @@ tests/cases/conformance/decorators/class/property/decoratorOnClassProperty11.ts( class C { @dec prop; ~~~~ -!!! error TS1329: A decorator function must accept some number of arguments, but this expression takes none. Did you mean to call it first? +!!! error TS1329: This function cannot be used as a decorator. Did you mean to call it first? } \ No newline at end of file From 86315ed4119db22cc900b58d053f471d4d354119 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 29 Sep 2017 22:01:00 -0700 Subject: [PATCH 015/137] Added test and adjusted reporting logic. --- src/compiler/checker.ts | 3 +- src/compiler/diagnosticMessages.json | 2 +- src/compiler/emitter.ts | 0 .../compiler/potentiallyUncalledDecorators.ts | 74 +++++++++++++++++++ 4 files changed, 77 insertions(+), 2 deletions(-) mode change 100755 => 100644 src/compiler/emitter.ts create mode 100644 tests/cases/compiler/potentiallyUncalledDecorators.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a272ac15e72..23da94437ae 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -16382,7 +16382,7 @@ namespace ts { } if (isPotentiallyUncalledDecorator(node, callSignatures)) { - error(node, Diagnostics.This_function_cannot_be_used_as_a_decorator_Did_you_mean_to_call_it_first); + error(node, Diagnostics.This_value_has_type_0_which_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first, typeToString(funcType)); return resolveErrorCall(node); } @@ -16406,6 +16406,7 @@ namespace ts { function isPotentiallyUncalledDecorator(decorator: Decorator, signatures: Signature[]) { return signatures.length && every(signatures, signature => signature.minArgumentCount === 0 && + !signature.hasRestParameter && signature.parameters.length < getEffectiveArgumentCount(decorator, /*args*/ undefined, signature)); } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 722985aac78..57dc9f28834 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -907,7 +907,7 @@ "category": "Error", "code": 1328 }, - "This function cannot be used as a decorator. Did you mean to call it first?": { + "This value has type '{0}' which accepts too few arguments to be used as a decorator here. Did you mean to call it first?": { "category": "Error", "code": 1329 }, diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts old mode 100755 new mode 100644 diff --git a/tests/cases/compiler/potentiallyUncalledDecorators.ts b/tests/cases/compiler/potentiallyUncalledDecorators.ts new file mode 100644 index 00000000000..3c92a21eff0 --- /dev/null +++ b/tests/cases/compiler/potentiallyUncalledDecorators.ts @@ -0,0 +1,74 @@ +// @target: esnext +// @module: esnext +// @experimentalDecorators: true + +// Angular-style Input/Output API: +declare function Input(bindingPropertyName?: string): any; +class FooComponent { + @Input foo: string; +} + +// Glimmer-style tracked API: +declare const tracked: PropertyDecorator & { (...watchedProperties: string[]): any; } + +class Person { + @tracked person; any; +} + +class MultiplyByTwo { + args: any; + @tracked('args') + get multiplied() { + return this.args.number * 2; + } +} + +// Other fun stuff. + +interface OmniDecorator extends MethodDecorator, ClassDecorator, PropertyDecorator { +} + +declare function noArgs(): OmniDecorator; +declare function allRest(...args: any[]): OmniDecorator; +declare function oneOptional(x?: any): OmniDecorator; +declare function twoOptional(x?: any, y?: any): OmniDecorator; +declare function threeOptional(x?: any, y?: any, z?: any): OmniDecorator; +declare function oneOptionalWithRest(x?: any, ...args: any[]): OmniDecorator; + +@noArgs +class A { + @noArgs foo: any; + @noArgs bar() { } +} + +@allRest +class B { + @allRest foo: any; + @allRest bar() { } +} + +@oneOptional +class C { + @oneOptional foo: any; + @oneOptional bar() { } +} + +@twoOptional +class D { + @twoOptional foo: any; + @twoOptional bar() { } +} + +@threeOptional +class E { + @threeOptional foo: any; + @threeOptional bar() { } +} + +@oneOptionalWithRest +class F { + @oneOptionalWithRest foo: any; + @oneOptionalWithRest bar() { } +} + +export { }; From 803b5660fcf6b8d50b0751d76629de18c79540a3 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Fri, 29 Sep 2017 22:02:35 -0700 Subject: [PATCH 016/137] Accepted baselines. --- .../decoratorOnClassMethod6.errors.txt | 4 +- .../decoratorOnClassProperty11.errors.txt | 4 +- .../potentiallyUncalledDecorators.errors.txt | 167 ++++++++++++++++ .../potentiallyUncalledDecorators.js | 170 ++++++++++++++++ .../potentiallyUncalledDecorators.symbols | 182 +++++++++++++++++ .../potentiallyUncalledDecorators.types | 188 ++++++++++++++++++ 6 files changed, 711 insertions(+), 4 deletions(-) create mode 100644 tests/baselines/reference/potentiallyUncalledDecorators.errors.txt create mode 100644 tests/baselines/reference/potentiallyUncalledDecorators.js create mode 100644 tests/baselines/reference/potentiallyUncalledDecorators.symbols create mode 100644 tests/baselines/reference/potentiallyUncalledDecorators.types diff --git a/tests/baselines/reference/decoratorOnClassMethod6.errors.txt b/tests/baselines/reference/decoratorOnClassMethod6.errors.txt index befe582025c..7a9e5fea355 100644 --- a/tests/baselines/reference/decoratorOnClassMethod6.errors.txt +++ b/tests/baselines/reference/decoratorOnClassMethod6.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/decorators/class/method/decoratorOnClassMethod6.ts(4,5): error TS1329: This function cannot be used as a decorator. Did you mean to call it first? +tests/cases/conformance/decorators/class/method/decoratorOnClassMethod6.ts(4,5): error TS1329: This value has type '() => (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? ==== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod6.ts (1 errors) ==== @@ -7,5 +7,5 @@ tests/cases/conformance/decorators/class/method/decoratorOnClassMethod6.ts(4,5): class C { @dec ["method"]() {} ~~~~ -!!! error TS1329: This function cannot be used as a decorator. Did you mean to call it first? +!!! error TS1329: This value has type '() => (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassProperty11.errors.txt b/tests/baselines/reference/decoratorOnClassProperty11.errors.txt index 771ca46b572..9d16d64df41 100644 --- a/tests/baselines/reference/decoratorOnClassProperty11.errors.txt +++ b/tests/baselines/reference/decoratorOnClassProperty11.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/decorators/class/property/decoratorOnClassProperty11.ts(4,5): error TS1329: This function cannot be used as a decorator. Did you mean to call it first? +tests/cases/conformance/decorators/class/property/decoratorOnClassProperty11.ts(4,5): error TS1329: This value has type '() => (target: any, propertyKey: string) => void' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? ==== tests/cases/conformance/decorators/class/property/decoratorOnClassProperty11.ts (1 errors) ==== @@ -7,5 +7,5 @@ tests/cases/conformance/decorators/class/property/decoratorOnClassProperty11.ts( class C { @dec prop; ~~~~ -!!! error TS1329: This function cannot be used as a decorator. Did you mean to call it first? +!!! error TS1329: This value has type '() => (target: any, propertyKey: string) => void' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? } \ No newline at end of file diff --git a/tests/baselines/reference/potentiallyUncalledDecorators.errors.txt b/tests/baselines/reference/potentiallyUncalledDecorators.errors.txt new file mode 100644 index 00000000000..e2858160ba9 --- /dev/null +++ b/tests/baselines/reference/potentiallyUncalledDecorators.errors.txt @@ -0,0 +1,167 @@ +tests/cases/compiler/potentiallyUncalledDecorators.ts(4,5): error TS1329: This value has type '(bindingPropertyName?: string) => any' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? +tests/cases/compiler/potentiallyUncalledDecorators.ts(34,1): error TS1329: This value has type '() => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? +tests/cases/compiler/potentiallyUncalledDecorators.ts(36,5): error TS1329: This value has type '() => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? +tests/cases/compiler/potentiallyUncalledDecorators.ts(37,5): error TS1329: This value has type '() => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? +tests/cases/compiler/potentiallyUncalledDecorators.ts(40,1): error TS1238: Unable to resolve signature of class decorator when called as an expression. + Type 'OmniDecorator' is not assignable to type 'typeof B'. + Type 'OmniDecorator' provides no match for the signature 'new (): B'. +tests/cases/compiler/potentiallyUncalledDecorators.ts(42,5): error TS1236: The return type of a property decorator function must be either 'void' or 'any'. + Unable to resolve signature of property decorator when called as an expression. +tests/cases/compiler/potentiallyUncalledDecorators.ts(43,5): error TS1241: Unable to resolve signature of method decorator when called as an expression. + Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. +tests/cases/compiler/potentiallyUncalledDecorators.ts(46,1): error TS1238: Unable to resolve signature of class decorator when called as an expression. + Type 'OmniDecorator' is not assignable to type 'typeof C'. + Type 'OmniDecorator' provides no match for the signature 'new (): C'. +tests/cases/compiler/potentiallyUncalledDecorators.ts(48,5): error TS1329: This value has type '(x?: any) => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? +tests/cases/compiler/potentiallyUncalledDecorators.ts(49,5): error TS1329: This value has type '(x?: any) => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? +tests/cases/compiler/potentiallyUncalledDecorators.ts(52,1): error TS1238: Unable to resolve signature of class decorator when called as an expression. + Type 'OmniDecorator' is not assignable to type 'typeof D'. + Type 'OmniDecorator' provides no match for the signature 'new (): D'. +tests/cases/compiler/potentiallyUncalledDecorators.ts(54,5): error TS1236: The return type of a property decorator function must be either 'void' or 'any'. + Unable to resolve signature of property decorator when called as an expression. +tests/cases/compiler/potentiallyUncalledDecorators.ts(55,5): error TS1241: Unable to resolve signature of method decorator when called as an expression. + Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. +tests/cases/compiler/potentiallyUncalledDecorators.ts(58,1): error TS1238: Unable to resolve signature of class decorator when called as an expression. + Type 'OmniDecorator' is not assignable to type 'typeof E'. + Type 'OmniDecorator' provides no match for the signature 'new (): E'. +tests/cases/compiler/potentiallyUncalledDecorators.ts(60,5): error TS1236: The return type of a property decorator function must be either 'void' or 'any'. + Unable to resolve signature of property decorator when called as an expression. +tests/cases/compiler/potentiallyUncalledDecorators.ts(61,5): error TS1241: Unable to resolve signature of method decorator when called as an expression. + Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. +tests/cases/compiler/potentiallyUncalledDecorators.ts(64,1): error TS1238: Unable to resolve signature of class decorator when called as an expression. + Type 'OmniDecorator' is not assignable to type 'typeof F'. + Type 'OmniDecorator' provides no match for the signature 'new (): F'. +tests/cases/compiler/potentiallyUncalledDecorators.ts(66,5): error TS1236: The return type of a property decorator function must be either 'void' or 'any'. + Unable to resolve signature of property decorator when called as an expression. +tests/cases/compiler/potentiallyUncalledDecorators.ts(67,5): error TS1241: Unable to resolve signature of method decorator when called as an expression. + Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. + + +==== tests/cases/compiler/potentiallyUncalledDecorators.ts (19 errors) ==== + // Angular-style Input/Output API: + declare function Input(bindingPropertyName?: string): any; + class FooComponent { + @Input foo: string; + ~~~~~~ +!!! error TS1329: This value has type '(bindingPropertyName?: string) => any' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? + } + + // Glimmer-style tracked API: + declare const tracked: PropertyDecorator & { (...watchedProperties: string[]): any; } + + class Person { + @tracked person; any; + } + + class MultiplyByTwo { + args: any; + @tracked('args') + get multiplied() { + return this.args.number * 2; + } + } + + // Other fun stuff. + + interface OmniDecorator extends MethodDecorator, ClassDecorator, PropertyDecorator { + } + + declare function noArgs(): OmniDecorator; + declare function allRest(...args: any[]): OmniDecorator; + declare function oneOptional(x?: any): OmniDecorator; + declare function twoOptional(x?: any, y?: any): OmniDecorator; + declare function threeOptional(x?: any, y?: any, z?: any): OmniDecorator; + declare function oneOptionalWithRest(x?: any, ...args: any[]): OmniDecorator; + + @noArgs + ~~~~~~~ +!!! error TS1329: This value has type '() => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? + class A { + @noArgs foo: any; + ~~~~~~~ +!!! error TS1329: This value has type '() => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? + @noArgs bar() { } + ~~~~~~~ +!!! error TS1329: This value has type '() => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? + } + + @allRest + ~~~~~~~~ +!!! error TS1238: Unable to resolve signature of class decorator when called as an expression. +!!! error TS1238: Type 'OmniDecorator' is not assignable to type 'typeof B'. +!!! error TS1238: Type 'OmniDecorator' provides no match for the signature 'new (): B'. + class B { + @allRest foo: any; + ~~~~~~~~ +!!! error TS1236: The return type of a property decorator function must be either 'void' or 'any'. +!!! error TS1236: Unable to resolve signature of property decorator when called as an expression. + @allRest bar() { } + ~~~~~~~~ +!!! error TS1241: Unable to resolve signature of method decorator when called as an expression. +!!! error TS1241: Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. + } + + @oneOptional + ~~~~~~~~~~~~ +!!! error TS1238: Unable to resolve signature of class decorator when called as an expression. +!!! error TS1238: Type 'OmniDecorator' is not assignable to type 'typeof C'. +!!! error TS1238: Type 'OmniDecorator' provides no match for the signature 'new (): C'. + class C { + @oneOptional foo: any; + ~~~~~~~~~~~~ +!!! error TS1329: This value has type '(x?: any) => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? + @oneOptional bar() { } + ~~~~~~~~~~~~ +!!! error TS1329: This value has type '(x?: any) => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? + } + + @twoOptional + ~~~~~~~~~~~~ +!!! error TS1238: Unable to resolve signature of class decorator when called as an expression. +!!! error TS1238: Type 'OmniDecorator' is not assignable to type 'typeof D'. +!!! error TS1238: Type 'OmniDecorator' provides no match for the signature 'new (): D'. + class D { + @twoOptional foo: any; + ~~~~~~~~~~~~ +!!! error TS1236: The return type of a property decorator function must be either 'void' or 'any'. +!!! error TS1236: Unable to resolve signature of property decorator when called as an expression. + @twoOptional bar() { } + ~~~~~~~~~~~~ +!!! error TS1241: Unable to resolve signature of method decorator when called as an expression. +!!! error TS1241: Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. + } + + @threeOptional + ~~~~~~~~~~~~~~ +!!! error TS1238: Unable to resolve signature of class decorator when called as an expression. +!!! error TS1238: Type 'OmniDecorator' is not assignable to type 'typeof E'. +!!! error TS1238: Type 'OmniDecorator' provides no match for the signature 'new (): E'. + class E { + @threeOptional foo: any; + ~~~~~~~~~~~~~~ +!!! error TS1236: The return type of a property decorator function must be either 'void' or 'any'. +!!! error TS1236: Unable to resolve signature of property decorator when called as an expression. + @threeOptional bar() { } + ~~~~~~~~~~~~~~ +!!! error TS1241: Unable to resolve signature of method decorator when called as an expression. +!!! error TS1241: Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. + } + + @oneOptionalWithRest + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1238: Unable to resolve signature of class decorator when called as an expression. +!!! error TS1238: Type 'OmniDecorator' is not assignable to type 'typeof F'. +!!! error TS1238: Type 'OmniDecorator' provides no match for the signature 'new (): F'. + class F { + @oneOptionalWithRest foo: any; + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1236: The return type of a property decorator function must be either 'void' or 'any'. +!!! error TS1236: Unable to resolve signature of property decorator when called as an expression. + @oneOptionalWithRest bar() { } + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS1241: Unable to resolve signature of method decorator when called as an expression. +!!! error TS1241: Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. + } + + export { }; + \ No newline at end of file diff --git a/tests/baselines/reference/potentiallyUncalledDecorators.js b/tests/baselines/reference/potentiallyUncalledDecorators.js new file mode 100644 index 00000000000..a0dcc80ea0e --- /dev/null +++ b/tests/baselines/reference/potentiallyUncalledDecorators.js @@ -0,0 +1,170 @@ +//// [potentiallyUncalledDecorators.ts] +// Angular-style Input/Output API: +declare function Input(bindingPropertyName?: string): any; +class FooComponent { + @Input foo: string; +} + +// Glimmer-style tracked API: +declare const tracked: PropertyDecorator & { (...watchedProperties: string[]): any; } + +class Person { + @tracked person; any; +} + +class MultiplyByTwo { + args: any; + @tracked('args') + get multiplied() { + return this.args.number * 2; + } +} + +// Other fun stuff. + +interface OmniDecorator extends MethodDecorator, ClassDecorator, PropertyDecorator { +} + +declare function noArgs(): OmniDecorator; +declare function allRest(...args: any[]): OmniDecorator; +declare function oneOptional(x?: any): OmniDecorator; +declare function twoOptional(x?: any, y?: any): OmniDecorator; +declare function threeOptional(x?: any, y?: any, z?: any): OmniDecorator; +declare function oneOptionalWithRest(x?: any, ...args: any[]): OmniDecorator; + +@noArgs +class A { + @noArgs foo: any; + @noArgs bar() { } +} + +@allRest +class B { + @allRest foo: any; + @allRest bar() { } +} + +@oneOptional +class C { + @oneOptional foo: any; + @oneOptional bar() { } +} + +@twoOptional +class D { + @twoOptional foo: any; + @twoOptional bar() { } +} + +@threeOptional +class E { + @threeOptional foo: any; + @threeOptional bar() { } +} + +@oneOptionalWithRest +class F { + @oneOptionalWithRest foo: any; + @oneOptionalWithRest bar() { } +} + +export { }; + + +//// [potentiallyUncalledDecorators.js] +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +class FooComponent { +} +__decorate([ + Input +], FooComponent.prototype, "foo", void 0); +class Person { +} +__decorate([ + tracked +], Person.prototype, "person", void 0); +class MultiplyByTwo { + get multiplied() { + return this.args.number * 2; + } +} +__decorate([ + tracked('args') +], MultiplyByTwo.prototype, "multiplied", null); +let A = class A { + bar() { } +}; +__decorate([ + noArgs +], A.prototype, "foo", void 0); +__decorate([ + noArgs +], A.prototype, "bar", null); +A = __decorate([ + noArgs +], A); +let B = class B { + bar() { } +}; +__decorate([ + allRest +], B.prototype, "foo", void 0); +__decorate([ + allRest +], B.prototype, "bar", null); +B = __decorate([ + allRest +], B); +let C = class C { + bar() { } +}; +__decorate([ + oneOptional +], C.prototype, "foo", void 0); +__decorate([ + oneOptional +], C.prototype, "bar", null); +C = __decorate([ + oneOptional +], C); +let D = class D { + bar() { } +}; +__decorate([ + twoOptional +], D.prototype, "foo", void 0); +__decorate([ + twoOptional +], D.prototype, "bar", null); +D = __decorate([ + twoOptional +], D); +let E = class E { + bar() { } +}; +__decorate([ + threeOptional +], E.prototype, "foo", void 0); +__decorate([ + threeOptional +], E.prototype, "bar", null); +E = __decorate([ + threeOptional +], E); +let F = class F { + bar() { } +}; +__decorate([ + oneOptionalWithRest +], F.prototype, "foo", void 0); +__decorate([ + oneOptionalWithRest +], F.prototype, "bar", null); +F = __decorate([ + oneOptionalWithRest +], F); diff --git a/tests/baselines/reference/potentiallyUncalledDecorators.symbols b/tests/baselines/reference/potentiallyUncalledDecorators.symbols new file mode 100644 index 00000000000..ff7cc253a27 --- /dev/null +++ b/tests/baselines/reference/potentiallyUncalledDecorators.symbols @@ -0,0 +1,182 @@ +=== tests/cases/compiler/potentiallyUncalledDecorators.ts === +// Angular-style Input/Output API: +declare function Input(bindingPropertyName?: string): any; +>Input : Symbol(Input, Decl(potentiallyUncalledDecorators.ts, 0, 0)) +>bindingPropertyName : Symbol(bindingPropertyName, Decl(potentiallyUncalledDecorators.ts, 1, 23)) + +class FooComponent { +>FooComponent : Symbol(FooComponent, Decl(potentiallyUncalledDecorators.ts, 1, 58)) + + @Input foo: string; +>Input : Symbol(Input, Decl(potentiallyUncalledDecorators.ts, 0, 0)) +>foo : Symbol(FooComponent.foo, Decl(potentiallyUncalledDecorators.ts, 2, 20)) +} + +// Glimmer-style tracked API: +declare const tracked: PropertyDecorator & { (...watchedProperties: string[]): any; } +>tracked : Symbol(tracked, Decl(potentiallyUncalledDecorators.ts, 7, 13)) +>PropertyDecorator : Symbol(PropertyDecorator, Decl(lib.es5.d.ts, --, --)) +>watchedProperties : Symbol(watchedProperties, Decl(potentiallyUncalledDecorators.ts, 7, 46)) + +class Person { +>Person : Symbol(Person, Decl(potentiallyUncalledDecorators.ts, 7, 85)) + + @tracked person; any; +>tracked : Symbol(tracked, Decl(potentiallyUncalledDecorators.ts, 7, 13)) +>person : Symbol(Person.person, Decl(potentiallyUncalledDecorators.ts, 9, 14)) +>any : Symbol(Person.any, Decl(potentiallyUncalledDecorators.ts, 10, 20)) +} + +class MultiplyByTwo { +>MultiplyByTwo : Symbol(MultiplyByTwo, Decl(potentiallyUncalledDecorators.ts, 11, 1)) + + args: any; +>args : Symbol(MultiplyByTwo.args, Decl(potentiallyUncalledDecorators.ts, 13, 21)) + + @tracked('args') +>tracked : Symbol(tracked, Decl(potentiallyUncalledDecorators.ts, 7, 13)) + + get multiplied() { +>multiplied : Symbol(MultiplyByTwo.multiplied, Decl(potentiallyUncalledDecorators.ts, 14, 14)) + + return this.args.number * 2; +>this.args : Symbol(MultiplyByTwo.args, Decl(potentiallyUncalledDecorators.ts, 13, 21)) +>this : Symbol(MultiplyByTwo, Decl(potentiallyUncalledDecorators.ts, 11, 1)) +>args : Symbol(MultiplyByTwo.args, Decl(potentiallyUncalledDecorators.ts, 13, 21)) + } +} + +// Other fun stuff. + +interface OmniDecorator extends MethodDecorator, ClassDecorator, PropertyDecorator { +>OmniDecorator : Symbol(OmniDecorator, Decl(potentiallyUncalledDecorators.ts, 19, 1)) +>MethodDecorator : Symbol(MethodDecorator, Decl(lib.es5.d.ts, --, --)) +>ClassDecorator : Symbol(ClassDecorator, Decl(lib.es5.d.ts, --, --)) +>PropertyDecorator : Symbol(PropertyDecorator, Decl(lib.es5.d.ts, --, --)) +} + +declare function noArgs(): OmniDecorator; +>noArgs : Symbol(noArgs, Decl(potentiallyUncalledDecorators.ts, 24, 1)) +>OmniDecorator : Symbol(OmniDecorator, Decl(potentiallyUncalledDecorators.ts, 19, 1)) + +declare function allRest(...args: any[]): OmniDecorator; +>allRest : Symbol(allRest, Decl(potentiallyUncalledDecorators.ts, 26, 41)) +>args : Symbol(args, Decl(potentiallyUncalledDecorators.ts, 27, 25)) +>OmniDecorator : Symbol(OmniDecorator, Decl(potentiallyUncalledDecorators.ts, 19, 1)) + +declare function oneOptional(x?: any): OmniDecorator; +>oneOptional : Symbol(oneOptional, Decl(potentiallyUncalledDecorators.ts, 27, 56)) +>x : Symbol(x, Decl(potentiallyUncalledDecorators.ts, 28, 29)) +>OmniDecorator : Symbol(OmniDecorator, Decl(potentiallyUncalledDecorators.ts, 19, 1)) + +declare function twoOptional(x?: any, y?: any): OmniDecorator; +>twoOptional : Symbol(twoOptional, Decl(potentiallyUncalledDecorators.ts, 28, 53)) +>x : Symbol(x, Decl(potentiallyUncalledDecorators.ts, 29, 29)) +>y : Symbol(y, Decl(potentiallyUncalledDecorators.ts, 29, 37)) +>OmniDecorator : Symbol(OmniDecorator, Decl(potentiallyUncalledDecorators.ts, 19, 1)) + +declare function threeOptional(x?: any, y?: any, z?: any): OmniDecorator; +>threeOptional : Symbol(threeOptional, Decl(potentiallyUncalledDecorators.ts, 29, 62)) +>x : Symbol(x, Decl(potentiallyUncalledDecorators.ts, 30, 31)) +>y : Symbol(y, Decl(potentiallyUncalledDecorators.ts, 30, 39)) +>z : Symbol(z, Decl(potentiallyUncalledDecorators.ts, 30, 48)) +>OmniDecorator : Symbol(OmniDecorator, Decl(potentiallyUncalledDecorators.ts, 19, 1)) + +declare function oneOptionalWithRest(x?: any, ...args: any[]): OmniDecorator; +>oneOptionalWithRest : Symbol(oneOptionalWithRest, Decl(potentiallyUncalledDecorators.ts, 30, 73)) +>x : Symbol(x, Decl(potentiallyUncalledDecorators.ts, 31, 37)) +>args : Symbol(args, Decl(potentiallyUncalledDecorators.ts, 31, 45)) +>OmniDecorator : Symbol(OmniDecorator, Decl(potentiallyUncalledDecorators.ts, 19, 1)) + +@noArgs +>noArgs : Symbol(noArgs, Decl(potentiallyUncalledDecorators.ts, 24, 1)) + +class A { +>A : Symbol(A, Decl(potentiallyUncalledDecorators.ts, 31, 77)) + + @noArgs foo: any; +>noArgs : Symbol(noArgs, Decl(potentiallyUncalledDecorators.ts, 24, 1)) +>foo : Symbol(A.foo, Decl(potentiallyUncalledDecorators.ts, 34, 9)) + + @noArgs bar() { } +>noArgs : Symbol(noArgs, Decl(potentiallyUncalledDecorators.ts, 24, 1)) +>bar : Symbol(A.bar, Decl(potentiallyUncalledDecorators.ts, 35, 21)) +} + +@allRest +>allRest : Symbol(allRest, Decl(potentiallyUncalledDecorators.ts, 26, 41)) + +class B { +>B : Symbol(B, Decl(potentiallyUncalledDecorators.ts, 37, 1)) + + @allRest foo: any; +>allRest : Symbol(allRest, Decl(potentiallyUncalledDecorators.ts, 26, 41)) +>foo : Symbol(B.foo, Decl(potentiallyUncalledDecorators.ts, 40, 9)) + + @allRest bar() { } +>allRest : Symbol(allRest, Decl(potentiallyUncalledDecorators.ts, 26, 41)) +>bar : Symbol(B.bar, Decl(potentiallyUncalledDecorators.ts, 41, 22)) +} + +@oneOptional +>oneOptional : Symbol(oneOptional, Decl(potentiallyUncalledDecorators.ts, 27, 56)) + +class C { +>C : Symbol(C, Decl(potentiallyUncalledDecorators.ts, 43, 1)) + + @oneOptional foo: any; +>oneOptional : Symbol(oneOptional, Decl(potentiallyUncalledDecorators.ts, 27, 56)) +>foo : Symbol(C.foo, Decl(potentiallyUncalledDecorators.ts, 46, 9)) + + @oneOptional bar() { } +>oneOptional : Symbol(oneOptional, Decl(potentiallyUncalledDecorators.ts, 27, 56)) +>bar : Symbol(C.bar, Decl(potentiallyUncalledDecorators.ts, 47, 26)) +} + +@twoOptional +>twoOptional : Symbol(twoOptional, Decl(potentiallyUncalledDecorators.ts, 28, 53)) + +class D { +>D : Symbol(D, Decl(potentiallyUncalledDecorators.ts, 49, 1)) + + @twoOptional foo: any; +>twoOptional : Symbol(twoOptional, Decl(potentiallyUncalledDecorators.ts, 28, 53)) +>foo : Symbol(D.foo, Decl(potentiallyUncalledDecorators.ts, 52, 9)) + + @twoOptional bar() { } +>twoOptional : Symbol(twoOptional, Decl(potentiallyUncalledDecorators.ts, 28, 53)) +>bar : Symbol(D.bar, Decl(potentiallyUncalledDecorators.ts, 53, 26)) +} + +@threeOptional +>threeOptional : Symbol(threeOptional, Decl(potentiallyUncalledDecorators.ts, 29, 62)) + +class E { +>E : Symbol(E, Decl(potentiallyUncalledDecorators.ts, 55, 1)) + + @threeOptional foo: any; +>threeOptional : Symbol(threeOptional, Decl(potentiallyUncalledDecorators.ts, 29, 62)) +>foo : Symbol(E.foo, Decl(potentiallyUncalledDecorators.ts, 58, 9)) + + @threeOptional bar() { } +>threeOptional : Symbol(threeOptional, Decl(potentiallyUncalledDecorators.ts, 29, 62)) +>bar : Symbol(E.bar, Decl(potentiallyUncalledDecorators.ts, 59, 28)) +} + +@oneOptionalWithRest +>oneOptionalWithRest : Symbol(oneOptionalWithRest, Decl(potentiallyUncalledDecorators.ts, 30, 73)) + +class F { +>F : Symbol(F, Decl(potentiallyUncalledDecorators.ts, 61, 1)) + + @oneOptionalWithRest foo: any; +>oneOptionalWithRest : Symbol(oneOptionalWithRest, Decl(potentiallyUncalledDecorators.ts, 30, 73)) +>foo : Symbol(F.foo, Decl(potentiallyUncalledDecorators.ts, 64, 9)) + + @oneOptionalWithRest bar() { } +>oneOptionalWithRest : Symbol(oneOptionalWithRest, Decl(potentiallyUncalledDecorators.ts, 30, 73)) +>bar : Symbol(F.bar, Decl(potentiallyUncalledDecorators.ts, 65, 34)) +} + +export { }; + diff --git a/tests/baselines/reference/potentiallyUncalledDecorators.types b/tests/baselines/reference/potentiallyUncalledDecorators.types new file mode 100644 index 00000000000..d79972659d3 --- /dev/null +++ b/tests/baselines/reference/potentiallyUncalledDecorators.types @@ -0,0 +1,188 @@ +=== tests/cases/compiler/potentiallyUncalledDecorators.ts === +// Angular-style Input/Output API: +declare function Input(bindingPropertyName?: string): any; +>Input : (bindingPropertyName?: string) => any +>bindingPropertyName : string + +class FooComponent { +>FooComponent : FooComponent + + @Input foo: string; +>Input : (bindingPropertyName?: string) => any +>foo : string +} + +// Glimmer-style tracked API: +declare const tracked: PropertyDecorator & { (...watchedProperties: string[]): any; } +>tracked : PropertyDecorator & ((...watchedProperties: string[]) => any) +>PropertyDecorator : PropertyDecorator +>watchedProperties : string[] + +class Person { +>Person : Person + + @tracked person; any; +>tracked : PropertyDecorator & ((...watchedProperties: string[]) => any) +>person : any +>any : any +} + +class MultiplyByTwo { +>MultiplyByTwo : MultiplyByTwo + + args: any; +>args : any + + @tracked('args') +>tracked('args') : any +>tracked : PropertyDecorator & ((...watchedProperties: string[]) => any) +>'args' : "args" + + get multiplied() { +>multiplied : number + + return this.args.number * 2; +>this.args.number * 2 : number +>this.args.number : any +>this.args : any +>this : this +>args : any +>number : any +>2 : 2 + } +} + +// Other fun stuff. + +interface OmniDecorator extends MethodDecorator, ClassDecorator, PropertyDecorator { +>OmniDecorator : OmniDecorator +>MethodDecorator : MethodDecorator +>ClassDecorator : ClassDecorator +>PropertyDecorator : PropertyDecorator +} + +declare function noArgs(): OmniDecorator; +>noArgs : () => OmniDecorator +>OmniDecorator : OmniDecorator + +declare function allRest(...args: any[]): OmniDecorator; +>allRest : (...args: any[]) => OmniDecorator +>args : any[] +>OmniDecorator : OmniDecorator + +declare function oneOptional(x?: any): OmniDecorator; +>oneOptional : (x?: any) => OmniDecorator +>x : any +>OmniDecorator : OmniDecorator + +declare function twoOptional(x?: any, y?: any): OmniDecorator; +>twoOptional : (x?: any, y?: any) => OmniDecorator +>x : any +>y : any +>OmniDecorator : OmniDecorator + +declare function threeOptional(x?: any, y?: any, z?: any): OmniDecorator; +>threeOptional : (x?: any, y?: any, z?: any) => OmniDecorator +>x : any +>y : any +>z : any +>OmniDecorator : OmniDecorator + +declare function oneOptionalWithRest(x?: any, ...args: any[]): OmniDecorator; +>oneOptionalWithRest : (x?: any, ...args: any[]) => OmniDecorator +>x : any +>args : any[] +>OmniDecorator : OmniDecorator + +@noArgs +>noArgs : () => OmniDecorator + +class A { +>A : A + + @noArgs foo: any; +>noArgs : () => OmniDecorator +>foo : any + + @noArgs bar() { } +>noArgs : () => OmniDecorator +>bar : () => void +} + +@allRest +>allRest : (...args: any[]) => OmniDecorator + +class B { +>B : B + + @allRest foo: any; +>allRest : (...args: any[]) => OmniDecorator +>foo : any + + @allRest bar() { } +>allRest : (...args: any[]) => OmniDecorator +>bar : () => void +} + +@oneOptional +>oneOptional : (x?: any) => OmniDecorator + +class C { +>C : C + + @oneOptional foo: any; +>oneOptional : (x?: any) => OmniDecorator +>foo : any + + @oneOptional bar() { } +>oneOptional : (x?: any) => OmniDecorator +>bar : () => void +} + +@twoOptional +>twoOptional : (x?: any, y?: any) => OmniDecorator + +class D { +>D : D + + @twoOptional foo: any; +>twoOptional : (x?: any, y?: any) => OmniDecorator +>foo : any + + @twoOptional bar() { } +>twoOptional : (x?: any, y?: any) => OmniDecorator +>bar : () => void +} + +@threeOptional +>threeOptional : (x?: any, y?: any, z?: any) => OmniDecorator + +class E { +>E : E + + @threeOptional foo: any; +>threeOptional : (x?: any, y?: any, z?: any) => OmniDecorator +>foo : any + + @threeOptional bar() { } +>threeOptional : (x?: any, y?: any, z?: any) => OmniDecorator +>bar : () => void +} + +@oneOptionalWithRest +>oneOptionalWithRest : (x?: any, ...args: any[]) => OmniDecorator + +class F { +>F : F + + @oneOptionalWithRest foo: any; +>oneOptionalWithRest : (x?: any, ...args: any[]) => OmniDecorator +>foo : any + + @oneOptionalWithRest bar() { } +>oneOptionalWithRest : (x?: any, ...args: any[]) => OmniDecorator +>bar : () => void +} + +export { }; + From 96bb796730cc281a4850bfa43cffcc7929d98c6b Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 2 Oct 2017 17:56:10 -0700 Subject: [PATCH 017/137] Improve error message for uncalled decorators. --- src/compiler/checker.ts | 4 +++- src/compiler/diagnosticMessages.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 23da94437ae..c9d6c6949a9 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -16382,7 +16382,9 @@ namespace ts { } if (isPotentiallyUncalledDecorator(node, callSignatures)) { - error(node, Diagnostics.This_value_has_type_0_which_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first, typeToString(funcType)); + const printer = createPrinter({ removeComments: true }); + const nodeStr = printer.printNode(EmitHint.Expression, node.expression, getSourceFileOfNode(node)); + error(node, Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0, nodeStr); return resolveErrorCall(node); } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 57dc9f28834..eb508857e6f 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -907,7 +907,7 @@ "category": "Error", "code": 1328 }, - "This value has type '{0}' which accepts too few arguments to be used as a decorator here. Did you mean to call it first?": { + "'{0}' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@{0}()'?": { "category": "Error", "code": 1329 }, From 392cd6117bb5c8941141e18919f051f66bf0dd5c Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 2 Oct 2017 18:00:00 -0700 Subject: [PATCH 018/137] Added a test for an 'any'-type decorator. --- tests/cases/compiler/potentiallyUncalledDecorators.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/cases/compiler/potentiallyUncalledDecorators.ts b/tests/cases/compiler/potentiallyUncalledDecorators.ts index 3c92a21eff0..6e537686d0f 100644 --- a/tests/cases/compiler/potentiallyUncalledDecorators.ts +++ b/tests/cases/compiler/potentiallyUncalledDecorators.ts @@ -34,6 +34,7 @@ declare function oneOptional(x?: any): OmniDecorator; declare function twoOptional(x?: any, y?: any): OmniDecorator; declare function threeOptional(x?: any, y?: any, z?: any): OmniDecorator; declare function oneOptionalWithRest(x?: any, ...args: any[]): OmniDecorator; +declare const anyDec: any; @noArgs class A { @@ -71,4 +72,10 @@ class F { @oneOptionalWithRest bar() { } } +@anyDec +class G { + @anyDec foo: any; + @anyDec bar() { } +} + export { }; From 35cfcff0d4d0861ec27049eb32fc56075ca0642c Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 2 Oct 2017 18:09:28 -0700 Subject: [PATCH 019/137] Use 'getTextOfNode'. --- src/compiler/checker.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index c9d6c6949a9..8d8595409e8 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -16382,8 +16382,7 @@ namespace ts { } if (isPotentiallyUncalledDecorator(node, callSignatures)) { - const printer = createPrinter({ removeComments: true }); - const nodeStr = printer.printNode(EmitHint.Expression, node.expression, getSourceFileOfNode(node)); + const nodeStr = getTextOfNode(node.expression, /*includeTrivia*/ false); error(node, Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0, nodeStr); return resolveErrorCall(node); } From 7750a88957fec5c41fb286b8d59dfb4487a1b63c Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Mon, 2 Oct 2017 18:50:05 -0700 Subject: [PATCH 020/137] Accepted baselines. --- .../decoratorOnClassMethod6.errors.txt | 4 +- .../decoratorOnClassProperty11.errors.txt | 4 +- .../potentiallyUncalledDecorators.errors.txt | 57 +++++++++++-------- .../potentiallyUncalledDecorators.js | 19 +++++++ .../potentiallyUncalledDecorators.symbols | 54 ++++++++++++------ .../potentiallyUncalledDecorators.types | 18 ++++++ 6 files changed, 109 insertions(+), 47 deletions(-) diff --git a/tests/baselines/reference/decoratorOnClassMethod6.errors.txt b/tests/baselines/reference/decoratorOnClassMethod6.errors.txt index 7a9e5fea355..b863a9db72c 100644 --- a/tests/baselines/reference/decoratorOnClassMethod6.errors.txt +++ b/tests/baselines/reference/decoratorOnClassMethod6.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/decorators/class/method/decoratorOnClassMethod6.ts(4,5): error TS1329: This value has type '() => (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? +tests/cases/conformance/decorators/class/method/decoratorOnClassMethod6.ts(4,5): error TS1329: 'dec' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@dec()'? ==== tests/cases/conformance/decorators/class/method/decoratorOnClassMethod6.ts (1 errors) ==== @@ -7,5 +7,5 @@ tests/cases/conformance/decorators/class/method/decoratorOnClassMethod6.ts(4,5): class C { @dec ["method"]() {} ~~~~ -!!! error TS1329: This value has type '() => (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? +!!! error TS1329: 'dec' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@dec()'? } \ No newline at end of file diff --git a/tests/baselines/reference/decoratorOnClassProperty11.errors.txt b/tests/baselines/reference/decoratorOnClassProperty11.errors.txt index 9d16d64df41..537daaf44ea 100644 --- a/tests/baselines/reference/decoratorOnClassProperty11.errors.txt +++ b/tests/baselines/reference/decoratorOnClassProperty11.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/decorators/class/property/decoratorOnClassProperty11.ts(4,5): error TS1329: This value has type '() => (target: any, propertyKey: string) => void' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? +tests/cases/conformance/decorators/class/property/decoratorOnClassProperty11.ts(4,5): error TS1329: 'dec' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@dec()'? ==== tests/cases/conformance/decorators/class/property/decoratorOnClassProperty11.ts (1 errors) ==== @@ -7,5 +7,5 @@ tests/cases/conformance/decorators/class/property/decoratorOnClassProperty11.ts( class C { @dec prop; ~~~~ -!!! error TS1329: This value has type '() => (target: any, propertyKey: string) => void' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? +!!! error TS1329: 'dec' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@dec()'? } \ No newline at end of file diff --git a/tests/baselines/reference/potentiallyUncalledDecorators.errors.txt b/tests/baselines/reference/potentiallyUncalledDecorators.errors.txt index e2858160ba9..9028ebe0377 100644 --- a/tests/baselines/reference/potentiallyUncalledDecorators.errors.txt +++ b/tests/baselines/reference/potentiallyUncalledDecorators.errors.txt @@ -1,39 +1,39 @@ -tests/cases/compiler/potentiallyUncalledDecorators.ts(4,5): error TS1329: This value has type '(bindingPropertyName?: string) => any' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? -tests/cases/compiler/potentiallyUncalledDecorators.ts(34,1): error TS1329: This value has type '() => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? -tests/cases/compiler/potentiallyUncalledDecorators.ts(36,5): error TS1329: This value has type '() => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? -tests/cases/compiler/potentiallyUncalledDecorators.ts(37,5): error TS1329: This value has type '() => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? -tests/cases/compiler/potentiallyUncalledDecorators.ts(40,1): error TS1238: Unable to resolve signature of class decorator when called as an expression. +tests/cases/compiler/potentiallyUncalledDecorators.ts(4,5): error TS1329: 'Input' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@Input()'? +tests/cases/compiler/potentiallyUncalledDecorators.ts(35,1): error TS1329: 'noArgs' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@noArgs()'? +tests/cases/compiler/potentiallyUncalledDecorators.ts(37,5): error TS1329: 'noArgs' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@noArgs()'? +tests/cases/compiler/potentiallyUncalledDecorators.ts(38,5): error TS1329: 'noArgs' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@noArgs()'? +tests/cases/compiler/potentiallyUncalledDecorators.ts(41,1): error TS1238: Unable to resolve signature of class decorator when called as an expression. Type 'OmniDecorator' is not assignable to type 'typeof B'. Type 'OmniDecorator' provides no match for the signature 'new (): B'. -tests/cases/compiler/potentiallyUncalledDecorators.ts(42,5): error TS1236: The return type of a property decorator function must be either 'void' or 'any'. +tests/cases/compiler/potentiallyUncalledDecorators.ts(43,5): error TS1236: The return type of a property decorator function must be either 'void' or 'any'. Unable to resolve signature of property decorator when called as an expression. -tests/cases/compiler/potentiallyUncalledDecorators.ts(43,5): error TS1241: Unable to resolve signature of method decorator when called as an expression. +tests/cases/compiler/potentiallyUncalledDecorators.ts(44,5): error TS1241: Unable to resolve signature of method decorator when called as an expression. Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. -tests/cases/compiler/potentiallyUncalledDecorators.ts(46,1): error TS1238: Unable to resolve signature of class decorator when called as an expression. +tests/cases/compiler/potentiallyUncalledDecorators.ts(47,1): error TS1238: Unable to resolve signature of class decorator when called as an expression. Type 'OmniDecorator' is not assignable to type 'typeof C'. Type 'OmniDecorator' provides no match for the signature 'new (): C'. -tests/cases/compiler/potentiallyUncalledDecorators.ts(48,5): error TS1329: This value has type '(x?: any) => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? -tests/cases/compiler/potentiallyUncalledDecorators.ts(49,5): error TS1329: This value has type '(x?: any) => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? -tests/cases/compiler/potentiallyUncalledDecorators.ts(52,1): error TS1238: Unable to resolve signature of class decorator when called as an expression. +tests/cases/compiler/potentiallyUncalledDecorators.ts(49,5): error TS1329: 'oneOptional' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@oneOptional()'? +tests/cases/compiler/potentiallyUncalledDecorators.ts(50,5): error TS1329: 'oneOptional' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@oneOptional()'? +tests/cases/compiler/potentiallyUncalledDecorators.ts(53,1): error TS1238: Unable to resolve signature of class decorator when called as an expression. Type 'OmniDecorator' is not assignable to type 'typeof D'. Type 'OmniDecorator' provides no match for the signature 'new (): D'. -tests/cases/compiler/potentiallyUncalledDecorators.ts(54,5): error TS1236: The return type of a property decorator function must be either 'void' or 'any'. +tests/cases/compiler/potentiallyUncalledDecorators.ts(55,5): error TS1236: The return type of a property decorator function must be either 'void' or 'any'. Unable to resolve signature of property decorator when called as an expression. -tests/cases/compiler/potentiallyUncalledDecorators.ts(55,5): error TS1241: Unable to resolve signature of method decorator when called as an expression. +tests/cases/compiler/potentiallyUncalledDecorators.ts(56,5): error TS1241: Unable to resolve signature of method decorator when called as an expression. Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. -tests/cases/compiler/potentiallyUncalledDecorators.ts(58,1): error TS1238: Unable to resolve signature of class decorator when called as an expression. +tests/cases/compiler/potentiallyUncalledDecorators.ts(59,1): error TS1238: Unable to resolve signature of class decorator when called as an expression. Type 'OmniDecorator' is not assignable to type 'typeof E'. Type 'OmniDecorator' provides no match for the signature 'new (): E'. -tests/cases/compiler/potentiallyUncalledDecorators.ts(60,5): error TS1236: The return type of a property decorator function must be either 'void' or 'any'. +tests/cases/compiler/potentiallyUncalledDecorators.ts(61,5): error TS1236: The return type of a property decorator function must be either 'void' or 'any'. Unable to resolve signature of property decorator when called as an expression. -tests/cases/compiler/potentiallyUncalledDecorators.ts(61,5): error TS1241: Unable to resolve signature of method decorator when called as an expression. +tests/cases/compiler/potentiallyUncalledDecorators.ts(62,5): error TS1241: Unable to resolve signature of method decorator when called as an expression. Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. -tests/cases/compiler/potentiallyUncalledDecorators.ts(64,1): error TS1238: Unable to resolve signature of class decorator when called as an expression. +tests/cases/compiler/potentiallyUncalledDecorators.ts(65,1): error TS1238: Unable to resolve signature of class decorator when called as an expression. Type 'OmniDecorator' is not assignable to type 'typeof F'. Type 'OmniDecorator' provides no match for the signature 'new (): F'. -tests/cases/compiler/potentiallyUncalledDecorators.ts(66,5): error TS1236: The return type of a property decorator function must be either 'void' or 'any'. +tests/cases/compiler/potentiallyUncalledDecorators.ts(67,5): error TS1236: The return type of a property decorator function must be either 'void' or 'any'. Unable to resolve signature of property decorator when called as an expression. -tests/cases/compiler/potentiallyUncalledDecorators.ts(67,5): error TS1241: Unable to resolve signature of method decorator when called as an expression. +tests/cases/compiler/potentiallyUncalledDecorators.ts(68,5): error TS1241: Unable to resolve signature of method decorator when called as an expression. Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. @@ -43,7 +43,7 @@ tests/cases/compiler/potentiallyUncalledDecorators.ts(67,5): error TS1241: Unabl class FooComponent { @Input foo: string; ~~~~~~ -!!! error TS1329: This value has type '(bindingPropertyName?: string) => any' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? +!!! error TS1329: 'Input' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@Input()'? } // Glimmer-style tracked API: @@ -72,17 +72,18 @@ tests/cases/compiler/potentiallyUncalledDecorators.ts(67,5): error TS1241: Unabl declare function twoOptional(x?: any, y?: any): OmniDecorator; declare function threeOptional(x?: any, y?: any, z?: any): OmniDecorator; declare function oneOptionalWithRest(x?: any, ...args: any[]): OmniDecorator; + declare const anyDec: any; @noArgs ~~~~~~~ -!!! error TS1329: This value has type '() => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? +!!! error TS1329: 'noArgs' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@noArgs()'? class A { @noArgs foo: any; ~~~~~~~ -!!! error TS1329: This value has type '() => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? +!!! error TS1329: 'noArgs' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@noArgs()'? @noArgs bar() { } ~~~~~~~ -!!! error TS1329: This value has type '() => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? +!!! error TS1329: 'noArgs' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@noArgs()'? } @allRest @@ -109,10 +110,10 @@ tests/cases/compiler/potentiallyUncalledDecorators.ts(67,5): error TS1241: Unabl class C { @oneOptional foo: any; ~~~~~~~~~~~~ -!!! error TS1329: This value has type '(x?: any) => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? +!!! error TS1329: 'oneOptional' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@oneOptional()'? @oneOptional bar() { } ~~~~~~~~~~~~ -!!! error TS1329: This value has type '(x?: any) => OmniDecorator' which accepts too few arguments to be used as a decorator here. Did you mean to call it first? +!!! error TS1329: 'oneOptional' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@oneOptional()'? } @twoOptional @@ -163,5 +164,11 @@ tests/cases/compiler/potentiallyUncalledDecorators.ts(67,5): error TS1241: Unabl !!! error TS1241: Type 'OmniDecorator' has no properties in common with type 'TypedPropertyDescriptor<() => void>'. } + @anyDec + class G { + @anyDec foo: any; + @anyDec bar() { } + } + export { }; \ No newline at end of file diff --git a/tests/baselines/reference/potentiallyUncalledDecorators.js b/tests/baselines/reference/potentiallyUncalledDecorators.js index a0dcc80ea0e..b69f848a8c9 100644 --- a/tests/baselines/reference/potentiallyUncalledDecorators.js +++ b/tests/baselines/reference/potentiallyUncalledDecorators.js @@ -31,6 +31,7 @@ declare function oneOptional(x?: any): OmniDecorator; declare function twoOptional(x?: any, y?: any): OmniDecorator; declare function threeOptional(x?: any, y?: any, z?: any): OmniDecorator; declare function oneOptionalWithRest(x?: any, ...args: any[]): OmniDecorator; +declare const anyDec: any; @noArgs class A { @@ -68,6 +69,12 @@ class F { @oneOptionalWithRest bar() { } } +@anyDec +class G { + @anyDec foo: any; + @anyDec bar() { } +} + export { }; @@ -168,3 +175,15 @@ __decorate([ F = __decorate([ oneOptionalWithRest ], F); +let G = class G { + bar() { } +}; +__decorate([ + anyDec +], G.prototype, "foo", void 0); +__decorate([ + anyDec +], G.prototype, "bar", null); +G = __decorate([ + anyDec +], G); diff --git a/tests/baselines/reference/potentiallyUncalledDecorators.symbols b/tests/baselines/reference/potentiallyUncalledDecorators.symbols index ff7cc253a27..38fe3f3dc52 100644 --- a/tests/baselines/reference/potentiallyUncalledDecorators.symbols +++ b/tests/baselines/reference/potentiallyUncalledDecorators.symbols @@ -88,94 +88,112 @@ declare function oneOptionalWithRest(x?: any, ...args: any[]): OmniDecorator; >args : Symbol(args, Decl(potentiallyUncalledDecorators.ts, 31, 45)) >OmniDecorator : Symbol(OmniDecorator, Decl(potentiallyUncalledDecorators.ts, 19, 1)) +declare const anyDec: any; +>anyDec : Symbol(anyDec, Decl(potentiallyUncalledDecorators.ts, 32, 13)) + @noArgs >noArgs : Symbol(noArgs, Decl(potentiallyUncalledDecorators.ts, 24, 1)) class A { ->A : Symbol(A, Decl(potentiallyUncalledDecorators.ts, 31, 77)) +>A : Symbol(A, Decl(potentiallyUncalledDecorators.ts, 32, 26)) @noArgs foo: any; >noArgs : Symbol(noArgs, Decl(potentiallyUncalledDecorators.ts, 24, 1)) ->foo : Symbol(A.foo, Decl(potentiallyUncalledDecorators.ts, 34, 9)) +>foo : Symbol(A.foo, Decl(potentiallyUncalledDecorators.ts, 35, 9)) @noArgs bar() { } >noArgs : Symbol(noArgs, Decl(potentiallyUncalledDecorators.ts, 24, 1)) ->bar : Symbol(A.bar, Decl(potentiallyUncalledDecorators.ts, 35, 21)) +>bar : Symbol(A.bar, Decl(potentiallyUncalledDecorators.ts, 36, 21)) } @allRest >allRest : Symbol(allRest, Decl(potentiallyUncalledDecorators.ts, 26, 41)) class B { ->B : Symbol(B, Decl(potentiallyUncalledDecorators.ts, 37, 1)) +>B : Symbol(B, Decl(potentiallyUncalledDecorators.ts, 38, 1)) @allRest foo: any; >allRest : Symbol(allRest, Decl(potentiallyUncalledDecorators.ts, 26, 41)) ->foo : Symbol(B.foo, Decl(potentiallyUncalledDecorators.ts, 40, 9)) +>foo : Symbol(B.foo, Decl(potentiallyUncalledDecorators.ts, 41, 9)) @allRest bar() { } >allRest : Symbol(allRest, Decl(potentiallyUncalledDecorators.ts, 26, 41)) ->bar : Symbol(B.bar, Decl(potentiallyUncalledDecorators.ts, 41, 22)) +>bar : Symbol(B.bar, Decl(potentiallyUncalledDecorators.ts, 42, 22)) } @oneOptional >oneOptional : Symbol(oneOptional, Decl(potentiallyUncalledDecorators.ts, 27, 56)) class C { ->C : Symbol(C, Decl(potentiallyUncalledDecorators.ts, 43, 1)) +>C : Symbol(C, Decl(potentiallyUncalledDecorators.ts, 44, 1)) @oneOptional foo: any; >oneOptional : Symbol(oneOptional, Decl(potentiallyUncalledDecorators.ts, 27, 56)) ->foo : Symbol(C.foo, Decl(potentiallyUncalledDecorators.ts, 46, 9)) +>foo : Symbol(C.foo, Decl(potentiallyUncalledDecorators.ts, 47, 9)) @oneOptional bar() { } >oneOptional : Symbol(oneOptional, Decl(potentiallyUncalledDecorators.ts, 27, 56)) ->bar : Symbol(C.bar, Decl(potentiallyUncalledDecorators.ts, 47, 26)) +>bar : Symbol(C.bar, Decl(potentiallyUncalledDecorators.ts, 48, 26)) } @twoOptional >twoOptional : Symbol(twoOptional, Decl(potentiallyUncalledDecorators.ts, 28, 53)) class D { ->D : Symbol(D, Decl(potentiallyUncalledDecorators.ts, 49, 1)) +>D : Symbol(D, Decl(potentiallyUncalledDecorators.ts, 50, 1)) @twoOptional foo: any; >twoOptional : Symbol(twoOptional, Decl(potentiallyUncalledDecorators.ts, 28, 53)) ->foo : Symbol(D.foo, Decl(potentiallyUncalledDecorators.ts, 52, 9)) +>foo : Symbol(D.foo, Decl(potentiallyUncalledDecorators.ts, 53, 9)) @twoOptional bar() { } >twoOptional : Symbol(twoOptional, Decl(potentiallyUncalledDecorators.ts, 28, 53)) ->bar : Symbol(D.bar, Decl(potentiallyUncalledDecorators.ts, 53, 26)) +>bar : Symbol(D.bar, Decl(potentiallyUncalledDecorators.ts, 54, 26)) } @threeOptional >threeOptional : Symbol(threeOptional, Decl(potentiallyUncalledDecorators.ts, 29, 62)) class E { ->E : Symbol(E, Decl(potentiallyUncalledDecorators.ts, 55, 1)) +>E : Symbol(E, Decl(potentiallyUncalledDecorators.ts, 56, 1)) @threeOptional foo: any; >threeOptional : Symbol(threeOptional, Decl(potentiallyUncalledDecorators.ts, 29, 62)) ->foo : Symbol(E.foo, Decl(potentiallyUncalledDecorators.ts, 58, 9)) +>foo : Symbol(E.foo, Decl(potentiallyUncalledDecorators.ts, 59, 9)) @threeOptional bar() { } >threeOptional : Symbol(threeOptional, Decl(potentiallyUncalledDecorators.ts, 29, 62)) ->bar : Symbol(E.bar, Decl(potentiallyUncalledDecorators.ts, 59, 28)) +>bar : Symbol(E.bar, Decl(potentiallyUncalledDecorators.ts, 60, 28)) } @oneOptionalWithRest >oneOptionalWithRest : Symbol(oneOptionalWithRest, Decl(potentiallyUncalledDecorators.ts, 30, 73)) class F { ->F : Symbol(F, Decl(potentiallyUncalledDecorators.ts, 61, 1)) +>F : Symbol(F, Decl(potentiallyUncalledDecorators.ts, 62, 1)) @oneOptionalWithRest foo: any; >oneOptionalWithRest : Symbol(oneOptionalWithRest, Decl(potentiallyUncalledDecorators.ts, 30, 73)) ->foo : Symbol(F.foo, Decl(potentiallyUncalledDecorators.ts, 64, 9)) +>foo : Symbol(F.foo, Decl(potentiallyUncalledDecorators.ts, 65, 9)) @oneOptionalWithRest bar() { } >oneOptionalWithRest : Symbol(oneOptionalWithRest, Decl(potentiallyUncalledDecorators.ts, 30, 73)) ->bar : Symbol(F.bar, Decl(potentiallyUncalledDecorators.ts, 65, 34)) +>bar : Symbol(F.bar, Decl(potentiallyUncalledDecorators.ts, 66, 34)) +} + +@anyDec +>anyDec : Symbol(anyDec, Decl(potentiallyUncalledDecorators.ts, 32, 13)) + +class G { +>G : Symbol(G, Decl(potentiallyUncalledDecorators.ts, 68, 1)) + + @anyDec foo: any; +>anyDec : Symbol(anyDec, Decl(potentiallyUncalledDecorators.ts, 32, 13)) +>foo : Symbol(G.foo, Decl(potentiallyUncalledDecorators.ts, 71, 9)) + + @anyDec bar() { } +>anyDec : Symbol(anyDec, Decl(potentiallyUncalledDecorators.ts, 32, 13)) +>bar : Symbol(G.bar, Decl(potentiallyUncalledDecorators.ts, 72, 21)) } export { }; diff --git a/tests/baselines/reference/potentiallyUncalledDecorators.types b/tests/baselines/reference/potentiallyUncalledDecorators.types index d79972659d3..cad861fc7b4 100644 --- a/tests/baselines/reference/potentiallyUncalledDecorators.types +++ b/tests/baselines/reference/potentiallyUncalledDecorators.types @@ -94,6 +94,9 @@ declare function oneOptionalWithRest(x?: any, ...args: any[]): OmniDecorator; >args : any[] >OmniDecorator : OmniDecorator +declare const anyDec: any; +>anyDec : any + @noArgs >noArgs : () => OmniDecorator @@ -184,5 +187,20 @@ class F { >bar : () => void } +@anyDec +>anyDec : any + +class G { +>G : G + + @anyDec foo: any; +>anyDec : any +>foo : any + + @anyDec bar() { } +>anyDec : any +>bar : () => void +} + export { }; From 686fd1e62d0ac8ed06a77029821a9bcf21329a48 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Wed, 4 Oct 2017 11:23:58 -0700 Subject: [PATCH 021/137] Fix whitespace around inserted static property Fixes #18743 --- src/services/codefixes/fixAddMissingMember.ts | 2 +- tests/cases/fourslash/codeFixAddMissingMember5.ts | 5 +++-- tests/cases/fourslash/codeFixAddMissingMember7.ts | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/services/codefixes/fixAddMissingMember.ts b/src/services/codefixes/fixAddMissingMember.ts index a9583106fc6..9aba4c37f68 100644 --- a/src/services/codefixes/fixAddMissingMember.ts +++ b/src/services/codefixes/fixAddMissingMember.ts @@ -92,7 +92,7 @@ namespace ts.codefix { classDeclarationSourceFile, classDeclaration, staticInitialization, - { suffix: context.newLineCharacter }); + { prefix: context.newLineCharacter, suffix: context.newLineCharacter }); const initializeStaticAction = { description: formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Initialize_static_property_0), [tokenName]), changes: staticInitializationChangeTracker.getChanges() diff --git a/tests/cases/fourslash/codeFixAddMissingMember5.ts b/tests/cases/fourslash/codeFixAddMissingMember5.ts index 804a3910a8c..562c4a10f21 100644 --- a/tests/cases/fourslash/codeFixAddMissingMember5.ts +++ b/tests/cases/fourslash/codeFixAddMissingMember5.ts @@ -13,11 +13,12 @@ verify.codeFix({ description: "Initialize static property 'foo'.", index: 0, - // TODO: GH#18743 and GH#18445 + // TODO: GH#18445 newFileContent: `class C { static method() { ()=>{ this.foo === 10 }; } -}C.foo = undefined;\r +}\r +C.foo = undefined;\r ` }); diff --git a/tests/cases/fourslash/codeFixAddMissingMember7.ts b/tests/cases/fourslash/codeFixAddMissingMember7.ts index 4ed9c9293d7..014ab6102dd 100644 --- a/tests/cases/fourslash/codeFixAddMissingMember7.ts +++ b/tests/cases/fourslash/codeFixAddMissingMember7.ts @@ -11,9 +11,10 @@ verify.codeFix({ description: "Initialize static property 'foo'.", index: 2, - // TODO: GH#18743 and GH#18445 + // TODO: GH#18445 newFileContent: `class C { static p = ()=>{ this.foo === 10 }; -}C.foo = undefined;\r +}\r +C.foo = undefined;\r ` }); From 4cf289e1a57b7ff32d73efc7d9b36b932df926ec Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Wed, 4 Oct 2017 11:26:41 -0700 Subject: [PATCH 022/137] Fix whitespace around inserted property initializer Fixes #18741 --- src/services/codefixes/fixAddMissingMember.ts | 6 +++--- tests/cases/fourslash/codeFixAddMissingMember4.ts | 7 +++---- tests/cases/fourslash/codeFixAddMissingMember6.ts | 7 +++---- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/services/codefixes/fixAddMissingMember.ts b/src/services/codefixes/fixAddMissingMember.ts index 9aba4c37f68..19bd592b7a7 100644 --- a/src/services/codefixes/fixAddMissingMember.ts +++ b/src/services/codefixes/fixAddMissingMember.ts @@ -112,11 +112,11 @@ namespace ts.codefix { createIdentifier("undefined"))); const propertyInitializationChangeTracker = textChanges.ChangeTracker.fromContext(context); - propertyInitializationChangeTracker.insertNodeAt( + propertyInitializationChangeTracker.insertNodeBefore( classDeclarationSourceFile, - classConstructor.body.getEnd() - 1, + classConstructor.body.getLastToken(), propertyInitialization, - { prefix: context.newLineCharacter, suffix: context.newLineCharacter }); + { suffix: context.newLineCharacter }); const initializeAction = { description: formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Initialize_property_0_in_the_constructor), [tokenName]), diff --git a/tests/cases/fourslash/codeFixAddMissingMember4.ts b/tests/cases/fourslash/codeFixAddMissingMember4.ts index cfbec8977f6..a17b777ae5f 100644 --- a/tests/cases/fourslash/codeFixAddMissingMember4.ts +++ b/tests/cases/fourslash/codeFixAddMissingMember4.ts @@ -15,12 +15,11 @@ verify.codeFix({ description: "Initialize property 'foo' in the constructor.", index: 0, - // TODO: GH#18741 and GH#18445 + // TODO: GH#18445 newFileContent: `class C { constructor() { - \r -this.foo = undefined;\r -} + this.foo = undefined;\r + } method() { this.foo === 10; } diff --git a/tests/cases/fourslash/codeFixAddMissingMember6.ts b/tests/cases/fourslash/codeFixAddMissingMember6.ts index 2598014dde5..32525066657 100644 --- a/tests/cases/fourslash/codeFixAddMissingMember6.ts +++ b/tests/cases/fourslash/codeFixAddMissingMember6.ts @@ -13,12 +13,11 @@ verify.codeFix({ description: "Initialize property 'foo' in the constructor.", index: 0, - // TODO: GH#18741 and GH#18445 + // TODO: GH#18445 newFileContent: `class C { constructor() { - \r -this.foo = undefined;\r -} + this.foo = undefined;\r + } prop = ()=>{ this.foo === 10 }; }` }); From 648bd6e9e0436ff2da6ade805688a0daa6ce4c52 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 4 Oct 2017 14:43:35 -0700 Subject: [PATCH 023/137] Skip more lib checks, improve test execution time a bit more (#18952) * Skip more lib checks, improve test execution time a bit more * Change complexRecursiveCollections to still check * Remove way more --- .../complexRecursiveCollections.errors.txt | 10 +- .../reference/complexRecursiveCollections.js | 538 ++ .../complexRecursiveCollections.symbols | 5340 ++++++++--------- .../complexRecursiveCollections.types | 4 +- .../compiler/complexRecursiveCollections.ts | 5 +- .../jsx/checkJsxChildrenProperty1.tsx | 1 + .../jsx/checkJsxChildrenProperty13.tsx | 1 + .../jsx/checkJsxChildrenProperty2.tsx | 1 + .../jsx/checkJsxChildrenProperty4.tsx | 1 + .../jsx/checkJsxChildrenProperty6.tsx | 1 + .../jsx/checkJsxChildrenProperty7.tsx | 1 + .../jsx/checkJsxChildrenProperty8.tsx | 1 + .../jsx/checkJsxChildrenProperty9.tsx | 1 + .../jsx/commentEmittingInPreserveJsx1.tsx | 1 + .../jsx/tsxAttributeResolution15.tsx | 1 + .../jsx/tsxAttributeResolution16.tsx | 1 + .../jsx/tsxDefaultAttributesResolution1.tsx | 1 + .../jsx/tsxDefaultAttributesResolution2.tsx | 1 + .../jsx/tsxDefaultAttributesResolution3.tsx | 1 + .../jsx/tsxGenericAttributesType1.tsx | 1 + .../jsx/tsxGenericAttributesType2.tsx | 1 + .../jsx/tsxGenericAttributesType3.tsx | 1 + .../jsx/tsxGenericAttributesType5.tsx | 1 + .../jsx/tsxGenericAttributesType6.tsx | 1 + .../jsx/tsxGenericAttributesType7.tsx | 1 + .../jsx/tsxGenericAttributesType8.tsx | 1 + .../jsx/tsxGenericAttributesType9.tsx | 1 + ...eactComponentWithDefaultTypeParameter1.tsx | 1 + ...eactComponentWithDefaultTypeParameter2.tsx | 1 + ...eactComponentWithDefaultTypeParameter3.tsx | 1 + .../jsx/tsxSpreadAttributesResolution1.tsx | 1 + .../jsx/tsxSpreadAttributesResolution10.tsx | 1 + .../jsx/tsxSpreadAttributesResolution11.tsx | 1 + .../jsx/tsxSpreadAttributesResolution12.tsx | 1 + .../jsx/tsxSpreadAttributesResolution13.tsx | 1 + .../jsx/tsxSpreadAttributesResolution14.tsx | 1 + .../jsx/tsxSpreadAttributesResolution15.tsx | 1 + .../jsx/tsxSpreadAttributesResolution16.tsx | 1 + .../jsx/tsxSpreadAttributesResolution2.tsx | 1 + .../jsx/tsxSpreadAttributesResolution4.tsx | 1 + .../jsx/tsxSpreadAttributesResolution5.tsx | 1 + .../jsx/tsxSpreadAttributesResolution6.tsx | 1 + .../jsx/tsxSpreadAttributesResolution7.tsx | 1 + .../jsx/tsxSpreadAttributesResolution8.tsx | 1 + .../jsx/tsxSpreadAttributesResolution9.tsx | 1 + ...tsxStatelessFunctionComponentOverload3.tsx | 1 + ...tsxStatelessFunctionComponentOverload4.tsx | 1 + ...tsxStatelessFunctionComponentOverload5.tsx | 1 + ...tionComponentWithDefaultTypeParameter1.tsx | 1 + ...tionComponentWithDefaultTypeParameter2.tsx | 1 + .../jsx/tsxStatelessFunctionComponents2.tsx | 1 + .../jsx/tsxStatelessFunctionComponents3.tsx | 1 + ...ssFunctionComponentsWithTypeArguments1.tsx | 1 + ...ssFunctionComponentsWithTypeArguments4.tsx | 1 + ...ssFunctionComponentsWithTypeArguments5.tsx | 1 + .../conformance/jsx/tsxUnionElementType1.tsx | 1 + .../conformance/jsx/tsxUnionElementType2.tsx | 1 + .../conformance/jsx/tsxUnionElementType3.tsx | 1 + .../conformance/jsx/tsxUnionElementType4.tsx | 1 + .../conformance/jsx/tsxUnionElementType5.tsx | 1 + .../conformance/jsx/tsxUnionElementType6.tsx | 1 + .../jsx/tsxUnionTypeComponent2.tsx | 1 + ...lyTypedStringLiteralsInJsxAttributes02.tsx | 1 + 63 files changed, 3276 insertions(+), 2679 deletions(-) create mode 100644 tests/baselines/reference/complexRecursiveCollections.js diff --git a/tests/baselines/reference/complexRecursiveCollections.errors.txt b/tests/baselines/reference/complexRecursiveCollections.errors.txt index 495fca2e651..aaed4f26360 100644 --- a/tests/baselines/reference/complexRecursiveCollections.errors.txt +++ b/tests/baselines/reference/complexRecursiveCollections.errors.txt @@ -1,18 +1,18 @@ -tests/cases/compiler/immutable.d.ts(341,22): error TS2430: Interface 'Keyed' incorrectly extends interface 'Collection'. +tests/cases/compiler/immutable.ts(341,22): error TS2430: Interface 'Keyed' incorrectly extends interface 'Collection'. Types of property 'toSeq' are incompatible. Type '() => Keyed' is not assignable to type '() => this'. Type 'Keyed' is not assignable to type 'this'. -tests/cases/compiler/immutable.d.ts(359,22): error TS2430: Interface 'Indexed' incorrectly extends interface 'Collection'. +tests/cases/compiler/immutable.ts(359,22): error TS2430: Interface 'Indexed' incorrectly extends interface 'Collection'. Types of property 'toSeq' are incompatible. Type '() => Indexed' is not assignable to type '() => this'. Type 'Indexed' is not assignable to type 'this'. -tests/cases/compiler/immutable.d.ts(391,22): error TS2430: Interface 'Set' incorrectly extends interface 'Collection'. +tests/cases/compiler/immutable.ts(391,22): error TS2430: Interface 'Set' incorrectly extends interface 'Collection'. Types of property 'toSeq' are incompatible. Type '() => Set' is not assignable to type '() => this'. Type 'Set' is not assignable to type 'this'. -==== tests/cases/compiler/complex.d.ts (0 errors) ==== +==== tests/cases/compiler/complex.ts (0 errors) ==== interface Ara { t: T } interface Collection { map(mapper: (value: V, key: K, iter: this) => M): Collection; @@ -33,7 +33,7 @@ tests/cases/compiler/immutable.d.ts(391,22): error TS2430: Interface 'Set' in flatMap(mapper: (value: T, key: void, iter: this) => Ara, context?: any): N2; toSeq(): N2; } -==== tests/cases/compiler/immutable.d.ts (3 errors) ==== +==== tests/cases/compiler/immutable.ts (3 errors) ==== // Test that complex recursive collections can pass the `extends` assignability check without // running out of memory. This bug was exposed in Typescript 2.4 when more generic signatures // started being checked. diff --git a/tests/baselines/reference/complexRecursiveCollections.js b/tests/baselines/reference/complexRecursiveCollections.js new file mode 100644 index 00000000000..21b371b7d3b --- /dev/null +++ b/tests/baselines/reference/complexRecursiveCollections.js @@ -0,0 +1,538 @@ +//// [tests/cases/compiler/complexRecursiveCollections.ts] //// + +//// [complex.ts] +interface Ara { t: T } +interface Collection { + map(mapper: (value: V, key: K, iter: this) => M): Collection; + flatMap(mapper: (value: V, key: K, iter: this) => Ara, context?: any): Collection; + // these seem necessary to push it over the top for memory usage + reduce(reducer: (reduction: R, value: V, key: K, iter: this) => R, initialReduction: R, context?: any): R; + reduce(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R; + toSeq(): Seq; +} +interface Seq extends Collection { +} +interface N1 extends Collection { + map(mapper: (value: T, key: void, iter: this) => M): N1; + flatMap(mapper: (value: T, key: void, iter: this) => Ara, context?: any): N1; +} +interface N2 extends N1 { + map(mapper: (value: T, key: void, iter: this) => M): N2; + flatMap(mapper: (value: T, key: void, iter: this) => Ara, context?: any): N2; + toSeq(): N2; +} +//// [immutable.ts] +// Test that complex recursive collections can pass the `extends` assignability check without +// running out of memory. This bug was exposed in Typescript 2.4 when more generic signatures +// started being checked. +declare module Immutable { + export function fromJS(jsValue: any, reviver?: (key: string | number, sequence: Collection.Keyed | Collection.Indexed, path?: Array) => any): any; + export function is(first: any, second: any): boolean; + export function hash(value: any): number; + export function isImmutable(maybeImmutable: any): maybeImmutable is Collection; + export function isCollection(maybeCollection: any): maybeCollection is Collection; + export function isKeyed(maybeKeyed: any): maybeKeyed is Collection.Keyed; + export function isIndexed(maybeIndexed: any): maybeIndexed is Collection.Indexed; + export function isAssociative(maybeAssociative: any): maybeAssociative is Collection.Keyed | Collection.Indexed; + export function isOrdered(maybeOrdered: any): boolean; + export function isValueObject(maybeValue: any): maybeValue is ValueObject; + export interface ValueObject { + equals(other: any): boolean; + hashCode(): number; + } + export module List { + function isList(maybeList: any): maybeList is List; + function of(...values: Array): List; + } + export function List(): List; + export function List(): List; + export function List(collection: Iterable): List; + export interface List extends Collection.Indexed { + // Persistent changes + set(index: number, value: T): List; + delete(index: number): List; + remove(index: number): List; + insert(index: number, value: T): List; + clear(): List; + push(...values: Array): List; + pop(): List; + unshift(...values: Array): List; + shift(): List; + update(index: number, notSetValue: T, updater: (value: T) => T): this; + update(index: number, updater: (value: T) => T): this; + update(updater: (value: this) => R): R; + merge(...collections: Array | Array>): this; + mergeWith(merger: (oldVal: T, newVal: T, key: number) => T, ...collections: Array | Array>): this; + mergeDeep(...collections: Array | Array>): this; + mergeDeepWith(merger: (oldVal: T, newVal: T, key: number) => T, ...collections: Array | Array>): this; + setSize(size: number): List; + // Deep persistent changes + setIn(keyPath: Iterable, value: any): this; + deleteIn(keyPath: Iterable): this; + removeIn(keyPath: Iterable): this; + updateIn(keyPath: Iterable, notSetValue: any, updater: (value: any) => any): this; + updateIn(keyPath: Iterable, updater: (value: any) => any): this; + mergeIn(keyPath: Iterable, ...collections: Array): this; + mergeDeepIn(keyPath: Iterable, ...collections: Array): this; + // Transient changes + withMutations(mutator: (mutable: this) => any): this; + asMutable(): this; + asImmutable(): this; + // Sequence algorithms + concat(...valuesOrCollections: Array | C>): List; + map(mapper: (value: T, key: number, iter: this) => M, context?: any): List; + flatMap(mapper: (value: T, key: number, iter: this) => Iterable, context?: any): List; + filter(predicate: (value: T, index: number, iter: this) => value is F, context?: any): List; + filter(predicate: (value: T, index: number, iter: this) => any, context?: any): this; + } + export module Map { + function isMap(maybeMap: any): maybeMap is Map; + function of(...keyValues: Array): Map; + } + export function Map(collection: Iterable<[K, V]>): Map; + export function Map(collection: Iterable>): Map; + export function Map(obj: {[key: string]: V}): Map; + export function Map(): Map; + export function Map(): Map; + export interface Map extends Collection.Keyed { + // Persistent changes + set(key: K, value: V): this; + delete(key: K): this; + remove(key: K): this; + deleteAll(keys: Iterable): this; + removeAll(keys: Iterable): this; + clear(): this; + update(key: K, notSetValue: V, updater: (value: V) => V): this; + update(key: K, updater: (value: V) => V): this; + update(updater: (value: this) => R): R; + merge(...collections: Array | {[key: string]: V}>): this; + mergeWith(merger: (oldVal: V, newVal: V, key: K) => V, ...collections: Array | {[key: string]: V}>): this; + mergeDeep(...collections: Array | {[key: string]: V}>): this; + mergeDeepWith(merger: (oldVal: V, newVal: V, key: K) => V, ...collections: Array | {[key: string]: V}>): this; + // Deep persistent changes + setIn(keyPath: Iterable, value: any): this; + deleteIn(keyPath: Iterable): this; + removeIn(keyPath: Iterable): this; + updateIn(keyPath: Iterable, notSetValue: any, updater: (value: any) => any): this; + updateIn(keyPath: Iterable, updater: (value: any) => any): this; + mergeIn(keyPath: Iterable, ...collections: Array): this; + mergeDeepIn(keyPath: Iterable, ...collections: Array): this; + // Transient changes + withMutations(mutator: (mutable: this) => any): this; + asMutable(): this; + asImmutable(): this; + // Sequence algorithms + concat(...collections: Array>): Map; + concat(...collections: Array<{[key: string]: C}>): Map; + map(mapper: (value: V, key: K, iter: this) => M, context?: any): Map; + mapKeys(mapper: (key: K, value: V, iter: this) => M, context?: any): Map; + mapEntries(mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: any): Map; + flatMap(mapper: (value: V, key: K, iter: this) => Iterable, context?: any): Map; + filter(predicate: (value: V, key: K, iter: this) => value is F, context?: any): Map; + filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this; + } + export module OrderedMap { + function isOrderedMap(maybeOrderedMap: any): maybeOrderedMap is OrderedMap; + } + export function OrderedMap(collection: Iterable<[K, V]>): OrderedMap; + export function OrderedMap(collection: Iterable>): OrderedMap; + export function OrderedMap(obj: {[key: string]: V}): OrderedMap; + export function OrderedMap(): OrderedMap; + export function OrderedMap(): OrderedMap; + export interface OrderedMap extends Map { + // Sequence algorithms + concat(...collections: Array>): OrderedMap; + concat(...collections: Array<{[key: string]: C}>): OrderedMap; + map(mapper: (value: V, key: K, iter: this) => M, context?: any): OrderedMap; + mapKeys(mapper: (key: K, value: V, iter: this) => M, context?: any): OrderedMap; + mapEntries(mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: any): OrderedMap; + flatMap(mapper: (value: V, key: K, iter: this) => Iterable, context?: any): OrderedMap; + filter(predicate: (value: V, key: K, iter: this) => value is F, context?: any): OrderedMap; + filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this; + } + export module Set { + function isSet(maybeSet: any): maybeSet is Set; + function of(...values: Array): Set; + function fromKeys(iter: Collection): Set; + function fromKeys(obj: {[key: string]: any}): Set; + function intersect(sets: Iterable>): Set; + function union(sets: Iterable>): Set; + } + export function Set(): Set; + export function Set(): Set; + export function Set(collection: Iterable): Set; + export interface Set extends Collection.Set { + // Persistent changes + add(value: T): this; + delete(value: T): this; + remove(value: T): this; + clear(): this; + union(...collections: Array | Array>): this; + merge(...collections: Array | Array>): this; + intersect(...collections: Array | Array>): this; + subtract(...collections: Array | Array>): this; + // Transient changes + withMutations(mutator: (mutable: this) => any): this; + asMutable(): this; + asImmutable(): this; + // Sequence algorithms + concat(...valuesOrCollections: Array | C>): Set; + map(mapper: (value: T, key: never, iter: this) => M, context?: any): Set; + flatMap(mapper: (value: T, key: never, iter: this) => Iterable, context?: any): Set; + filter(predicate: (value: T, key: never, iter: this) => value is F, context?: any): Set; + filter(predicate: (value: T, key: never, iter: this) => any, context?: any): this; + } + export module OrderedSet { + function isOrderedSet(maybeOrderedSet: any): boolean; + function of(...values: Array): OrderedSet; + function fromKeys(iter: Collection): OrderedSet; + function fromKeys(obj: {[key: string]: any}): OrderedSet; + } + export function OrderedSet(): OrderedSet; + export function OrderedSet(): OrderedSet; + export function OrderedSet(collection: Iterable): OrderedSet; + export interface OrderedSet extends Set { + // Sequence algorithms + concat(...valuesOrCollections: Array | C>): OrderedSet; + map(mapper: (value: T, key: never, iter: this) => M, context?: any): OrderedSet; + flatMap(mapper: (value: T, key: never, iter: this) => Iterable, context?: any): OrderedSet; + filter(predicate: (value: T, key: never, iter: this) => value is F, context?: any): OrderedSet; + filter(predicate: (value: T, key: never, iter: this) => any, context?: any): this; + zip(...collections: Array>): OrderedSet; + zipWith(zipper: (value: T, otherValue: U) => Z, otherCollection: Collection): OrderedSet; + zipWith(zipper: (value: T, otherValue: U, thirdValue: V) => Z, otherCollection: Collection, thirdCollection: Collection): OrderedSet; + zipWith(zipper: (...any: Array) => Z, ...collections: Array>): OrderedSet; + } + export module Stack { + function isStack(maybeStack: any): maybeStack is Stack; + function of(...values: Array): Stack; + } + export function Stack(): Stack; + export function Stack(): Stack; + export function Stack(collection: Iterable): Stack; + export interface Stack extends Collection.Indexed { + // Reading values + peek(): T | undefined; + // Persistent changes + clear(): Stack; + unshift(...values: Array): Stack; + unshiftAll(iter: Iterable): Stack; + shift(): Stack; + push(...values: Array): Stack; + pushAll(iter: Iterable): Stack; + pop(): Stack; + // Transient changes + withMutations(mutator: (mutable: this) => any): this; + asMutable(): this; + asImmutable(): this; + // Sequence algorithms + concat(...valuesOrCollections: Array | C>): Stack; + map(mapper: (value: T, key: number, iter: this) => M, context?: any): Stack; + flatMap(mapper: (value: T, key: number, iter: this) => Iterable, context?: any): Stack; + filter(predicate: (value: T, index: number, iter: this) => value is F, context?: any): Set; + filter(predicate: (value: T, index: number, iter: this) => any, context?: any): this; + } + export function Range(start?: number, end?: number, step?: number): Seq.Indexed; + export function Repeat(value: T, times?: number): Seq.Indexed; + export module Record { + export function isRecord(maybeRecord: any): maybeRecord is Record.Instance; + export function getDescriptiveName(record: Instance): string; + export interface Class { + (values?: Partial | Iterable<[string, any]>): Instance & Readonly; + new (values?: Partial | Iterable<[string, any]>): Instance & Readonly; + } + export interface Instance { + readonly size: number; + // Reading values + has(key: string): boolean; + get(key: K): T[K]; + // Reading deep values + hasIn(keyPath: Iterable): boolean; + getIn(keyPath: Iterable): any; + // Value equality + equals(other: any): boolean; + hashCode(): number; + // Persistent changes + set(key: K, value: T[K]): this; + update(key: K, updater: (value: T[K]) => T[K]): this; + merge(...collections: Array | Iterable<[string, any]>>): this; + mergeDeep(...collections: Array | Iterable<[string, any]>>): this; + mergeWith(merger: (oldVal: any, newVal: any, key: keyof T) => any, ...collections: Array | Iterable<[string, any]>>): this; + mergeDeepWith(merger: (oldVal: any, newVal: any, key: any) => any, ...collections: Array | Iterable<[string, any]>>): this; + delete(key: K): this; + remove(key: K): this; + clear(): this; + // Deep persistent changes + setIn(keyPath: Iterable, value: any): this; + updateIn(keyPath: Iterable, updater: (value: any) => any): this; + mergeIn(keyPath: Iterable, ...collections: Array): this; + mergeDeepIn(keyPath: Iterable, ...collections: Array): this; + deleteIn(keyPath: Iterable): this; + removeIn(keyPath: Iterable): this; + // Conversion to JavaScript types + toJS(): { [K in keyof T]: any }; + toJSON(): T; + toObject(): T; + // Transient changes + withMutations(mutator: (mutable: this) => any): this; + asMutable(): this; + asImmutable(): this; + // Sequence algorithms + toSeq(): Seq.Keyed; + [Symbol.iterator](): IterableIterator<[keyof T, T[keyof T]]>; + } + } + export function Record(defaultValues: T, name?: string): Record.Class; + export module Seq { + function isSeq(maybeSeq: any): maybeSeq is Seq.Indexed | Seq.Keyed; + function of(...values: Array): Seq.Indexed; + export module Keyed {} + export function Keyed(collection: Iterable<[K, V]>): Seq.Keyed; + export function Keyed(obj: {[key: string]: V}): Seq.Keyed; + export function Keyed(): Seq.Keyed; + export function Keyed(): Seq.Keyed; + export interface Keyed extends Seq, Collection.Keyed { + toJS(): Object; + toJSON(): { [key: string]: V }; + toSeq(): this; + concat(...collections: Array>): Seq.Keyed; + concat(...collections: Array<{[key: string]: C}>): Seq.Keyed; + map(mapper: (value: V, key: K, iter: this) => M, context?: any): Seq.Keyed; + mapKeys(mapper: (key: K, value: V, iter: this) => M, context?: any): Seq.Keyed; + mapEntries(mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: any): Seq.Keyed; + flatMap(mapper: (value: V, key: K, iter: this) => Iterable, context?: any): Seq.Keyed; + filter(predicate: (value: V, key: K, iter: this) => value is F, context?: any): Seq.Keyed; + filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this; + } + module Indexed { + function of(...values: Array): Seq.Indexed; + } + export function Indexed(): Seq.Indexed; + export function Indexed(): Seq.Indexed; + export function Indexed(collection: Iterable): Seq.Indexed; + export interface Indexed extends Seq, Collection.Indexed { + toJS(): Array; + toJSON(): Array; + toSeq(): this; + concat(...valuesOrCollections: Array | C>): Seq.Indexed; + map(mapper: (value: T, key: number, iter: this) => M, context?: any): Seq.Indexed; + flatMap(mapper: (value: T, key: number, iter: this) => Iterable, context?: any): Seq.Indexed; + filter(predicate: (value: T, index: number, iter: this) => value is F, context?: any): Seq.Indexed; + filter(predicate: (value: T, index: number, iter: this) => any, context?: any): this; + } + export module Set { + function of(...values: Array): Seq.Set; + } + export function Set(): Seq.Set; + export function Set(): Seq.Set; + export function Set(collection: Iterable): Seq.Set; + export interface Set extends Seq, Collection.Set { + toJS(): Array; + toJSON(): Array; + toSeq(): this; + concat(...valuesOrCollections: Array | C>): Seq.Set; + map(mapper: (value: T, key: never, iter: this) => M, context?: any): Seq.Set; + flatMap(mapper: (value: T, key: never, iter: this) => Iterable, context?: any): Seq.Set; + filter(predicate: (value: T, key: never, iter: this) => value is F, context?: any): Seq.Set; + filter(predicate: (value: T, key: never, iter: this) => any, context?: any): this; + } + } + export function Seq>(seq: S): S; + export function Seq(collection: Collection.Keyed): Seq.Keyed; + export function Seq(collection: Collection.Indexed): Seq.Indexed; + export function Seq(collection: Collection.Set): Seq.Set; + export function Seq(collection: Iterable): Seq.Indexed; + export function Seq(obj: {[key: string]: V}): Seq.Keyed; + export function Seq(): Seq; + export interface Seq extends Collection { + readonly size: number | undefined; + // Force evaluation + cacheResult(): this; + // Sequence algorithms + map(mapper: (value: V, key: K, iter: this) => M, context?: any): Seq; + flatMap(mapper: (value: V, key: K, iter: this) => Iterable, context?: any): Seq; + filter(predicate: (value: V, key: K, iter: this) => value is F, context?: any): Seq; + filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this; + } + export module Collection { + function isKeyed(maybeKeyed: any): maybeKeyed is Collection.Keyed; + function isIndexed(maybeIndexed: any): maybeIndexed is Collection.Indexed; + function isAssociative(maybeAssociative: any): maybeAssociative is Collection.Keyed | Collection.Indexed; + function isOrdered(maybeOrdered: any): boolean; + export module Keyed {} + export function Keyed(collection: Iterable<[K, V]>): Collection.Keyed; + export function Keyed(obj: {[key: string]: V}): Collection.Keyed; + export interface Keyed extends Collection { + toJS(): Object; + toJSON(): { [key: string]: V }; + toSeq(): Seq.Keyed; + // Sequence functions + flip(): this; + concat(...collections: Array>): Collection.Keyed; + concat(...collections: Array<{[key: string]: C}>): Collection.Keyed; + map(mapper: (value: V, key: K, iter: this) => M, context?: any): Collection.Keyed; + mapKeys(mapper: (key: K, value: V, iter: this) => M, context?: any): Collection.Keyed; + mapEntries(mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: any): Collection.Keyed; + flatMap(mapper: (value: V, key: K, iter: this) => Iterable, context?: any): Collection.Keyed; + filter(predicate: (value: V, key: K, iter: this) => value is F, context?: any): Collection.Keyed; + filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this; + [Symbol.iterator](): IterableIterator<[K, V]>; + } + export module Indexed {} + export function Indexed(collection: Iterable): Collection.Indexed; + export interface Indexed extends Collection { + toJS(): Array; + toJSON(): Array; + // Reading values + get(index: number, notSetValue: NSV): T | NSV; + get(index: number): T | undefined; + // Conversion to Seq + toSeq(): Seq.Indexed; + fromEntrySeq(): Seq.Keyed; + // Combination + interpose(separator: T): this; + interleave(...collections: Array>): this; + splice(index: number, removeNum: number, ...values: Array): this; + zip(...collections: Array>): Collection.Indexed; + zipWith(zipper: (value: T, otherValue: U) => Z, otherCollection: Collection): Collection.Indexed; + zipWith(zipper: (value: T, otherValue: U, thirdValue: V) => Z, otherCollection: Collection, thirdCollection: Collection): Collection.Indexed; + zipWith(zipper: (...any: Array) => Z, ...collections: Array>): Collection.Indexed; + // Search for value + indexOf(searchValue: T): number; + lastIndexOf(searchValue: T): number; + findIndex(predicate: (value: T, index: number, iter: this) => boolean, context?: any): number; + findLastIndex(predicate: (value: T, index: number, iter: this) => boolean, context?: any): number; + // Sequence algorithms + concat(...valuesOrCollections: Array | C>): Collection.Indexed; + map(mapper: (value: T, key: number, iter: this) => M, context?: any): Collection.Indexed; + flatMap(mapper: (value: T, key: number, iter: this) => Iterable, context?: any): Collection.Indexed; + filter(predicate: (value: T, index: number, iter: this) => value is F, context?: any): Collection.Indexed; + filter(predicate: (value: T, index: number, iter: this) => any, context?: any): this; + [Symbol.iterator](): IterableIterator; + } + export module Set {} + export function Set(collection: Iterable): Collection.Set; + export interface Set extends Collection { + toJS(): Array; + toJSON(): Array; + toSeq(): Seq.Set; + // Sequence algorithms + concat(...valuesOrCollections: Array | C>): Collection.Set; + map(mapper: (value: T, key: never, iter: this) => M, context?: any): Collection.Set; + flatMap(mapper: (value: T, key: never, iter: this) => Iterable, context?: any): Collection.Set; + filter(predicate: (value: T, key: never, iter: this) => value is F, context?: any): Collection.Set; + filter(predicate: (value: T, key: never, iter: this) => any, context?: any): this; + [Symbol.iterator](): IterableIterator; + } + } + export function Collection>(collection: I): I; + export function Collection(collection: Iterable): Collection.Indexed; + export function Collection(obj: {[key: string]: V}): Collection.Keyed; + export interface Collection extends ValueObject { + // Value equality + equals(other: any): boolean; + hashCode(): number; + // Reading values + get(key: K, notSetValue: NSV): V | NSV; + get(key: K): V | undefined; + has(key: K): boolean; + includes(value: V): boolean; + contains(value: V): boolean; + first(): V | undefined; + last(): V | undefined; + // Reading deep values + getIn(searchKeyPath: Iterable, notSetValue?: any): any; + hasIn(searchKeyPath: Iterable): boolean; + // Persistent changes + update(updater: (value: this) => R): R; + // Conversion to JavaScript types + toJS(): Array | { [key: string]: any }; + toJSON(): Array | { [key: string]: V }; + toArray(): Array; + toObject(): { [key: string]: V }; + // Conversion to Collections + toMap(): Map; + toOrderedMap(): OrderedMap; + toSet(): Set; + toOrderedSet(): OrderedSet; + toList(): List; + toStack(): Stack; + // Conversion to Seq + toSeq(): this; + toKeyedSeq(): Seq.Keyed; + toIndexedSeq(): Seq.Indexed; + toSetSeq(): Seq.Set; + // Iterators + keys(): IterableIterator; + values(): IterableIterator; + entries(): IterableIterator<[K, V]>; + // Collections (Seq) + keySeq(): Seq.Indexed; + valueSeq(): Seq.Indexed; + entrySeq(): Seq.Indexed<[K, V]>; + // Sequence algorithms + map(mapper: (value: V, key: K, iter: this) => M, context?: any): Collection; + filter(predicate: (value: V, key: K, iter: this) => value is F, context?: any): Collection; + filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this; + filterNot(predicate: (value: V, key: K, iter: this) => boolean, context?: any): this; + reverse(): this; + sort(comparator?: (valueA: V, valueB: V) => number): this; + sortBy(comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: (valueA: C, valueB: C) => number): this; + groupBy(grouper: (value: V, key: K, iter: this) => G, context?: any): /*Map*/Seq.Keyed>; + // Side effects + forEach(sideEffect: (value: V, key: K, iter: this) => any, context?: any): number; + // Creating subsets + slice(begin?: number, end?: number): this; + rest(): this; + butLast(): this; + skip(amount: number): this; + skipLast(amount: number): this; + skipWhile(predicate: (value: V, key: K, iter: this) => boolean, context?: any): this; + skipUntil(predicate: (value: V, key: K, iter: this) => boolean, context?: any): this; + take(amount: number): this; + takeLast(amount: number): this; + takeWhile(predicate: (value: V, key: K, iter: this) => boolean, context?: any): this; + takeUntil(predicate: (value: V, key: K, iter: this) => boolean, context?: any): this; + // Combination + concat(...valuesOrCollections: Array): Collection; + flatten(depth?: number): Collection; + flatten(shallow?: boolean): Collection; + flatMap(mapper: (value: V, key: K, iter: this) => Iterable, context?: any): Collection; + // Reducing a value + reduce(reducer: (reduction: R, value: V, key: K, iter: this) => R, initialReduction: R, context?: any): R; + reduce(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R; + reduceRight(reducer: (reduction: R, value: V, key: K, iter: this) => R, initialReduction: R, context?: any): R; + reduceRight(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R; + every(predicate: (value: V, key: K, iter: this) => boolean, context?: any): boolean; + some(predicate: (value: V, key: K, iter: this) => boolean, context?: any): boolean; + join(separator?: string): string; + isEmpty(): boolean; + count(): number; + count(predicate: (value: V, key: K, iter: this) => boolean, context?: any): number; + countBy(grouper: (value: V, key: K, iter: this) => G, context?: any): Map; + // Search for value + find(predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V): V | undefined; + findLast(predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V): V | undefined; + findEntry(predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V): [K, V] | undefined; + findLastEntry(predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V): [K, V] | undefined; + findKey(predicate: (value: V, key: K, iter: this) => boolean, context?: any): K | undefined; + findLastKey(predicate: (value: V, key: K, iter: this) => boolean, context?: any): K | undefined; + keyOf(searchValue: V): K | undefined; + lastKeyOf(searchValue: V): K | undefined; + max(comparator?: (valueA: V, valueB: V) => number): V | undefined; + maxBy(comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: (valueA: C, valueB: C) => number): V | undefined; + min(comparator?: (valueA: V, valueB: V) => number): V | undefined; + minBy(comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: (valueA: C, valueB: C) => number): V | undefined; + // Comparison + isSubset(iter: Iterable): boolean; + isSuperset(iter: Iterable): boolean; + readonly size: number; + } +} +declare module "immutable" { + export = Immutable +} + + +//// [complex.js] +//// [immutable.js] diff --git a/tests/baselines/reference/complexRecursiveCollections.symbols b/tests/baselines/reference/complexRecursiveCollections.symbols index d5eee915d57..8533f5220a2 100644 --- a/tests/baselines/reference/complexRecursiveCollections.symbols +++ b/tests/baselines/reference/complexRecursiveCollections.symbols @@ -1,3806 +1,3806 @@ -=== tests/cases/compiler/complex.d.ts === +=== tests/cases/compiler/complex.ts === interface Ara { t: T } ->Ara : Symbol(Ara, Decl(complex.d.ts, 0, 0)) ->T : Symbol(T, Decl(complex.d.ts, 0, 14)) ->t : Symbol(Ara.t, Decl(complex.d.ts, 0, 18)) ->T : Symbol(T, Decl(complex.d.ts, 0, 14)) +>Ara : Symbol(Ara, Decl(complex.ts, 0, 0)) +>T : Symbol(T, Decl(complex.ts, 0, 14)) +>t : Symbol(Ara.t, Decl(complex.ts, 0, 18)) +>T : Symbol(T, Decl(complex.ts, 0, 14)) interface Collection { ->Collection : Symbol(Collection, Decl(complex.d.ts, 0, 25)) ->K : Symbol(K, Decl(complex.d.ts, 1, 21)) ->V : Symbol(V, Decl(complex.d.ts, 1, 23)) +>Collection : Symbol(Collection, Decl(complex.ts, 0, 25)) +>K : Symbol(K, Decl(complex.ts, 1, 21)) +>V : Symbol(V, Decl(complex.ts, 1, 23)) map(mapper: (value: V, key: K, iter: this) => M): Collection; ->map : Symbol(Collection.map, Decl(complex.d.ts, 1, 28)) ->M : Symbol(M, Decl(complex.d.ts, 2, 8)) ->mapper : Symbol(mapper, Decl(complex.d.ts, 2, 11)) ->value : Symbol(value, Decl(complex.d.ts, 2, 20)) ->V : Symbol(V, Decl(complex.d.ts, 1, 23)) ->key : Symbol(key, Decl(complex.d.ts, 2, 29)) ->K : Symbol(K, Decl(complex.d.ts, 1, 21)) ->iter : Symbol(iter, Decl(complex.d.ts, 2, 37)) ->M : Symbol(M, Decl(complex.d.ts, 2, 8)) ->Collection : Symbol(Collection, Decl(complex.d.ts, 0, 25)) ->K : Symbol(K, Decl(complex.d.ts, 1, 21)) ->M : Symbol(M, Decl(complex.d.ts, 2, 8)) +>map : Symbol(Collection.map, Decl(complex.ts, 1, 28)) +>M : Symbol(M, Decl(complex.ts, 2, 8)) +>mapper : Symbol(mapper, Decl(complex.ts, 2, 11)) +>value : Symbol(value, Decl(complex.ts, 2, 20)) +>V : Symbol(V, Decl(complex.ts, 1, 23)) +>key : Symbol(key, Decl(complex.ts, 2, 29)) +>K : Symbol(K, Decl(complex.ts, 1, 21)) +>iter : Symbol(iter, Decl(complex.ts, 2, 37)) +>M : Symbol(M, Decl(complex.ts, 2, 8)) +>Collection : Symbol(Collection, Decl(complex.ts, 0, 25)) +>K : Symbol(K, Decl(complex.ts, 1, 21)) +>M : Symbol(M, Decl(complex.ts, 2, 8)) flatMap(mapper: (value: V, key: K, iter: this) => Ara, context?: any): Collection; ->flatMap : Symbol(Collection.flatMap, Decl(complex.d.ts, 2, 74)) ->M : Symbol(M, Decl(complex.d.ts, 3, 12)) ->mapper : Symbol(mapper, Decl(complex.d.ts, 3, 15)) ->value : Symbol(value, Decl(complex.d.ts, 3, 24)) ->V : Symbol(V, Decl(complex.d.ts, 1, 23)) ->key : Symbol(key, Decl(complex.d.ts, 3, 33)) ->K : Symbol(K, Decl(complex.d.ts, 1, 21)) ->iter : Symbol(iter, Decl(complex.d.ts, 3, 41)) ->Ara : Symbol(Ara, Decl(complex.d.ts, 0, 0)) ->M : Symbol(M, Decl(complex.d.ts, 3, 12)) ->context : Symbol(context, Decl(complex.d.ts, 3, 64)) ->Collection : Symbol(Collection, Decl(complex.d.ts, 0, 25)) ->K : Symbol(K, Decl(complex.d.ts, 1, 21)) ->M : Symbol(M, Decl(complex.d.ts, 3, 12)) +>flatMap : Symbol(Collection.flatMap, Decl(complex.ts, 2, 74)) +>M : Symbol(M, Decl(complex.ts, 3, 12)) +>mapper : Symbol(mapper, Decl(complex.ts, 3, 15)) +>value : Symbol(value, Decl(complex.ts, 3, 24)) +>V : Symbol(V, Decl(complex.ts, 1, 23)) +>key : Symbol(key, Decl(complex.ts, 3, 33)) +>K : Symbol(K, Decl(complex.ts, 1, 21)) +>iter : Symbol(iter, Decl(complex.ts, 3, 41)) +>Ara : Symbol(Ara, Decl(complex.ts, 0, 0)) +>M : Symbol(M, Decl(complex.ts, 3, 12)) +>context : Symbol(context, Decl(complex.ts, 3, 64)) +>Collection : Symbol(Collection, Decl(complex.ts, 0, 25)) +>K : Symbol(K, Decl(complex.ts, 1, 21)) +>M : Symbol(M, Decl(complex.ts, 3, 12)) // these seem necessary to push it over the top for memory usage reduce(reducer: (reduction: R, value: V, key: K, iter: this) => R, initialReduction: R, context?: any): R; ->reduce : Symbol(Collection.reduce, Decl(complex.d.ts, 3, 98), Decl(complex.d.ts, 5, 113)) ->R : Symbol(R, Decl(complex.d.ts, 5, 11)) ->reducer : Symbol(reducer, Decl(complex.d.ts, 5, 14)) ->reduction : Symbol(reduction, Decl(complex.d.ts, 5, 24)) ->R : Symbol(R, Decl(complex.d.ts, 5, 11)) ->value : Symbol(value, Decl(complex.d.ts, 5, 37)) ->V : Symbol(V, Decl(complex.d.ts, 1, 23)) ->key : Symbol(key, Decl(complex.d.ts, 5, 47)) ->K : Symbol(K, Decl(complex.d.ts, 1, 21)) ->iter : Symbol(iter, Decl(complex.d.ts, 5, 55)) ->R : Symbol(R, Decl(complex.d.ts, 5, 11)) ->initialReduction : Symbol(initialReduction, Decl(complex.d.ts, 5, 73)) ->R : Symbol(R, Decl(complex.d.ts, 5, 11)) ->context : Symbol(context, Decl(complex.d.ts, 5, 94)) ->R : Symbol(R, Decl(complex.d.ts, 5, 11)) +>reduce : Symbol(Collection.reduce, Decl(complex.ts, 3, 98), Decl(complex.ts, 5, 113)) +>R : Symbol(R, Decl(complex.ts, 5, 11)) +>reducer : Symbol(reducer, Decl(complex.ts, 5, 14)) +>reduction : Symbol(reduction, Decl(complex.ts, 5, 24)) +>R : Symbol(R, Decl(complex.ts, 5, 11)) +>value : Symbol(value, Decl(complex.ts, 5, 37)) +>V : Symbol(V, Decl(complex.ts, 1, 23)) +>key : Symbol(key, Decl(complex.ts, 5, 47)) +>K : Symbol(K, Decl(complex.ts, 1, 21)) +>iter : Symbol(iter, Decl(complex.ts, 5, 55)) +>R : Symbol(R, Decl(complex.ts, 5, 11)) +>initialReduction : Symbol(initialReduction, Decl(complex.ts, 5, 73)) +>R : Symbol(R, Decl(complex.ts, 5, 11)) +>context : Symbol(context, Decl(complex.ts, 5, 94)) +>R : Symbol(R, Decl(complex.ts, 5, 11)) reduce(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R; ->reduce : Symbol(Collection.reduce, Decl(complex.d.ts, 3, 98), Decl(complex.d.ts, 5, 113)) ->R : Symbol(R, Decl(complex.d.ts, 6, 11)) ->reducer : Symbol(reducer, Decl(complex.d.ts, 6, 14)) ->reduction : Symbol(reduction, Decl(complex.d.ts, 6, 24)) ->V : Symbol(V, Decl(complex.d.ts, 1, 23)) ->R : Symbol(R, Decl(complex.d.ts, 6, 11)) ->value : Symbol(value, Decl(complex.d.ts, 6, 41)) ->V : Symbol(V, Decl(complex.d.ts, 1, 23)) ->key : Symbol(key, Decl(complex.d.ts, 6, 51)) ->K : Symbol(K, Decl(complex.d.ts, 1, 21)) ->iter : Symbol(iter, Decl(complex.d.ts, 6, 59)) ->R : Symbol(R, Decl(complex.d.ts, 6, 11)) ->R : Symbol(R, Decl(complex.d.ts, 6, 11)) +>reduce : Symbol(Collection.reduce, Decl(complex.ts, 3, 98), Decl(complex.ts, 5, 113)) +>R : Symbol(R, Decl(complex.ts, 6, 11)) +>reducer : Symbol(reducer, Decl(complex.ts, 6, 14)) +>reduction : Symbol(reduction, Decl(complex.ts, 6, 24)) +>V : Symbol(V, Decl(complex.ts, 1, 23)) +>R : Symbol(R, Decl(complex.ts, 6, 11)) +>value : Symbol(value, Decl(complex.ts, 6, 41)) +>V : Symbol(V, Decl(complex.ts, 1, 23)) +>key : Symbol(key, Decl(complex.ts, 6, 51)) +>K : Symbol(K, Decl(complex.ts, 1, 21)) +>iter : Symbol(iter, Decl(complex.ts, 6, 59)) +>R : Symbol(R, Decl(complex.ts, 6, 11)) +>R : Symbol(R, Decl(complex.ts, 6, 11)) toSeq(): Seq; ->toSeq : Symbol(Collection.toSeq, Decl(complex.d.ts, 6, 81)) ->Seq : Symbol(Seq, Decl(complex.d.ts, 8, 1)) ->K : Symbol(K, Decl(complex.d.ts, 1, 21)) ->V : Symbol(V, Decl(complex.d.ts, 1, 23)) +>toSeq : Symbol(Collection.toSeq, Decl(complex.ts, 6, 81)) +>Seq : Symbol(Seq, Decl(complex.ts, 8, 1)) +>K : Symbol(K, Decl(complex.ts, 1, 21)) +>V : Symbol(V, Decl(complex.ts, 1, 23)) } interface Seq extends Collection { ->Seq : Symbol(Seq, Decl(complex.d.ts, 8, 1)) ->K : Symbol(K, Decl(complex.d.ts, 9, 14)) ->V : Symbol(V, Decl(complex.d.ts, 9, 16)) ->Collection : Symbol(Collection, Decl(complex.d.ts, 0, 25)) ->K : Symbol(K, Decl(complex.d.ts, 9, 14)) ->V : Symbol(V, Decl(complex.d.ts, 9, 16)) +>Seq : Symbol(Seq, Decl(complex.ts, 8, 1)) +>K : Symbol(K, Decl(complex.ts, 9, 14)) +>V : Symbol(V, Decl(complex.ts, 9, 16)) +>Collection : Symbol(Collection, Decl(complex.ts, 0, 25)) +>K : Symbol(K, Decl(complex.ts, 9, 14)) +>V : Symbol(V, Decl(complex.ts, 9, 16)) } interface N1 extends Collection { ->N1 : Symbol(N1, Decl(complex.d.ts, 10, 1)) ->T : Symbol(T, Decl(complex.d.ts, 11, 13)) ->Collection : Symbol(Collection, Decl(complex.d.ts, 0, 25)) ->T : Symbol(T, Decl(complex.d.ts, 11, 13)) +>N1 : Symbol(N1, Decl(complex.ts, 10, 1)) +>T : Symbol(T, Decl(complex.ts, 11, 13)) +>Collection : Symbol(Collection, Decl(complex.ts, 0, 25)) +>T : Symbol(T, Decl(complex.ts, 11, 13)) map(mapper: (value: T, key: void, iter: this) => M): N1; ->map : Symbol(N1.map, Decl(complex.d.ts, 11, 45)) ->M : Symbol(M, Decl(complex.d.ts, 12, 8)) ->mapper : Symbol(mapper, Decl(complex.d.ts, 12, 11)) ->value : Symbol(value, Decl(complex.d.ts, 12, 20)) ->T : Symbol(T, Decl(complex.d.ts, 11, 13)) ->key : Symbol(key, Decl(complex.d.ts, 12, 29)) ->iter : Symbol(iter, Decl(complex.d.ts, 12, 40)) ->M : Symbol(M, Decl(complex.d.ts, 12, 8)) ->N1 : Symbol(N1, Decl(complex.d.ts, 10, 1)) ->M : Symbol(M, Decl(complex.d.ts, 12, 8)) +>map : Symbol(N1.map, Decl(complex.ts, 11, 45)) +>M : Symbol(M, Decl(complex.ts, 12, 8)) +>mapper : Symbol(mapper, Decl(complex.ts, 12, 11)) +>value : Symbol(value, Decl(complex.ts, 12, 20)) +>T : Symbol(T, Decl(complex.ts, 11, 13)) +>key : Symbol(key, Decl(complex.ts, 12, 29)) +>iter : Symbol(iter, Decl(complex.ts, 12, 40)) +>M : Symbol(M, Decl(complex.ts, 12, 8)) +>N1 : Symbol(N1, Decl(complex.ts, 10, 1)) +>M : Symbol(M, Decl(complex.ts, 12, 8)) flatMap(mapper: (value: T, key: void, iter: this) => Ara, context?: any): N1; ->flatMap : Symbol(N1.flatMap, Decl(complex.d.ts, 12, 66)) ->M : Symbol(M, Decl(complex.d.ts, 13, 12)) ->mapper : Symbol(mapper, Decl(complex.d.ts, 13, 15)) ->value : Symbol(value, Decl(complex.d.ts, 13, 24)) ->T : Symbol(T, Decl(complex.d.ts, 11, 13)) ->key : Symbol(key, Decl(complex.d.ts, 13, 33)) ->iter : Symbol(iter, Decl(complex.d.ts, 13, 44)) ->Ara : Symbol(Ara, Decl(complex.d.ts, 0, 0)) ->M : Symbol(M, Decl(complex.d.ts, 13, 12)) ->context : Symbol(context, Decl(complex.d.ts, 13, 67)) ->N1 : Symbol(N1, Decl(complex.d.ts, 10, 1)) ->M : Symbol(M, Decl(complex.d.ts, 13, 12)) +>flatMap : Symbol(N1.flatMap, Decl(complex.ts, 12, 66)) +>M : Symbol(M, Decl(complex.ts, 13, 12)) +>mapper : Symbol(mapper, Decl(complex.ts, 13, 15)) +>value : Symbol(value, Decl(complex.ts, 13, 24)) +>T : Symbol(T, Decl(complex.ts, 11, 13)) +>key : Symbol(key, Decl(complex.ts, 13, 33)) +>iter : Symbol(iter, Decl(complex.ts, 13, 44)) +>Ara : Symbol(Ara, Decl(complex.ts, 0, 0)) +>M : Symbol(M, Decl(complex.ts, 13, 12)) +>context : Symbol(context, Decl(complex.ts, 13, 67)) +>N1 : Symbol(N1, Decl(complex.ts, 10, 1)) +>M : Symbol(M, Decl(complex.ts, 13, 12)) } interface N2 extends N1 { ->N2 : Symbol(N2, Decl(complex.d.ts, 14, 1)) ->T : Symbol(T, Decl(complex.d.ts, 15, 13)) ->N1 : Symbol(N1, Decl(complex.d.ts, 10, 1)) ->T : Symbol(T, Decl(complex.d.ts, 15, 13)) +>N2 : Symbol(N2, Decl(complex.ts, 14, 1)) +>T : Symbol(T, Decl(complex.ts, 15, 13)) +>N1 : Symbol(N1, Decl(complex.ts, 10, 1)) +>T : Symbol(T, Decl(complex.ts, 15, 13)) map(mapper: (value: T, key: void, iter: this) => M): N2; ->map : Symbol(N2.map, Decl(complex.d.ts, 15, 31)) ->M : Symbol(M, Decl(complex.d.ts, 16, 8)) ->mapper : Symbol(mapper, Decl(complex.d.ts, 16, 11)) ->value : Symbol(value, Decl(complex.d.ts, 16, 20)) ->T : Symbol(T, Decl(complex.d.ts, 15, 13)) ->key : Symbol(key, Decl(complex.d.ts, 16, 29)) ->iter : Symbol(iter, Decl(complex.d.ts, 16, 40)) ->M : Symbol(M, Decl(complex.d.ts, 16, 8)) ->N2 : Symbol(N2, Decl(complex.d.ts, 14, 1)) ->M : Symbol(M, Decl(complex.d.ts, 16, 8)) +>map : Symbol(N2.map, Decl(complex.ts, 15, 31)) +>M : Symbol(M, Decl(complex.ts, 16, 8)) +>mapper : Symbol(mapper, Decl(complex.ts, 16, 11)) +>value : Symbol(value, Decl(complex.ts, 16, 20)) +>T : Symbol(T, Decl(complex.ts, 15, 13)) +>key : Symbol(key, Decl(complex.ts, 16, 29)) +>iter : Symbol(iter, Decl(complex.ts, 16, 40)) +>M : Symbol(M, Decl(complex.ts, 16, 8)) +>N2 : Symbol(N2, Decl(complex.ts, 14, 1)) +>M : Symbol(M, Decl(complex.ts, 16, 8)) flatMap(mapper: (value: T, key: void, iter: this) => Ara, context?: any): N2; ->flatMap : Symbol(N2.flatMap, Decl(complex.d.ts, 16, 66)) ->M : Symbol(M, Decl(complex.d.ts, 17, 12)) ->mapper : Symbol(mapper, Decl(complex.d.ts, 17, 15)) ->value : Symbol(value, Decl(complex.d.ts, 17, 24)) ->T : Symbol(T, Decl(complex.d.ts, 15, 13)) ->key : Symbol(key, Decl(complex.d.ts, 17, 33)) ->iter : Symbol(iter, Decl(complex.d.ts, 17, 44)) ->Ara : Symbol(Ara, Decl(complex.d.ts, 0, 0)) ->M : Symbol(M, Decl(complex.d.ts, 17, 12)) ->context : Symbol(context, Decl(complex.d.ts, 17, 67)) ->N2 : Symbol(N2, Decl(complex.d.ts, 14, 1)) ->M : Symbol(M, Decl(complex.d.ts, 17, 12)) +>flatMap : Symbol(N2.flatMap, Decl(complex.ts, 16, 66)) +>M : Symbol(M, Decl(complex.ts, 17, 12)) +>mapper : Symbol(mapper, Decl(complex.ts, 17, 15)) +>value : Symbol(value, Decl(complex.ts, 17, 24)) +>T : Symbol(T, Decl(complex.ts, 15, 13)) +>key : Symbol(key, Decl(complex.ts, 17, 33)) +>iter : Symbol(iter, Decl(complex.ts, 17, 44)) +>Ara : Symbol(Ara, Decl(complex.ts, 0, 0)) +>M : Symbol(M, Decl(complex.ts, 17, 12)) +>context : Symbol(context, Decl(complex.ts, 17, 67)) +>N2 : Symbol(N2, Decl(complex.ts, 14, 1)) +>M : Symbol(M, Decl(complex.ts, 17, 12)) toSeq(): N2; ->toSeq : Symbol(N2.toSeq, Decl(complex.d.ts, 17, 90)) ->N2 : Symbol(N2, Decl(complex.d.ts, 14, 1)) ->T : Symbol(T, Decl(complex.d.ts, 15, 13)) +>toSeq : Symbol(N2.toSeq, Decl(complex.ts, 17, 90)) +>N2 : Symbol(N2, Decl(complex.ts, 14, 1)) +>T : Symbol(T, Decl(complex.ts, 15, 13)) } -=== tests/cases/compiler/immutable.d.ts === +=== tests/cases/compiler/immutable.ts === // Test that complex recursive collections can pass the `extends` assignability check without // running out of memory. This bug was exposed in Typescript 2.4 when more generic signatures // started being checked. declare module Immutable { ->Immutable : Symbol(Immutable, Decl(immutable.d.ts, 0, 0)) +>Immutable : Symbol(Immutable, Decl(immutable.ts, 0, 0)) export function fromJS(jsValue: any, reviver?: (key: string | number, sequence: Collection.Keyed | Collection.Indexed, path?: Array) => any): any; ->fromJS : Symbol(fromJS, Decl(immutable.d.ts, 3, 26)) ->jsValue : Symbol(jsValue, Decl(immutable.d.ts, 4, 25)) ->reviver : Symbol(reviver, Decl(immutable.d.ts, 4, 38)) ->key : Symbol(key, Decl(immutable.d.ts, 4, 50)) ->sequence : Symbol(sequence, Decl(immutable.d.ts, 4, 71)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Keyed : Symbol(Collection.Keyed, Decl(immutable.d.ts, 336, 51), Decl(immutable.d.ts, 337, 26), Decl(immutable.d.ts, 338, 86), Decl(immutable.d.ts, 339, 83)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Indexed : Symbol(Collection.Indexed, Decl(immutable.d.ts, 355, 5), Decl(immutable.d.ts, 356, 28), Decl(immutable.d.ts, 357, 79)) ->path : Symbol(path, Decl(immutable.d.ts, 4, 138)) +>fromJS : Symbol(fromJS, Decl(immutable.ts, 3, 26)) +>jsValue : Symbol(jsValue, Decl(immutable.ts, 4, 25)) +>reviver : Symbol(reviver, Decl(immutable.ts, 4, 38)) +>key : Symbol(key, Decl(immutable.ts, 4, 50)) +>sequence : Symbol(sequence, Decl(immutable.ts, 4, 71)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Keyed : Symbol(Collection.Keyed, Decl(immutable.ts, 336, 51), Decl(immutable.ts, 337, 26), Decl(immutable.ts, 338, 86), Decl(immutable.ts, 339, 83)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Indexed : Symbol(Collection.Indexed, Decl(immutable.ts, 355, 5), Decl(immutable.ts, 356, 28), Decl(immutable.ts, 357, 79)) +>path : Symbol(path, Decl(immutable.ts, 4, 138)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) export function is(first: any, second: any): boolean; ->is : Symbol(is, Decl(immutable.d.ts, 4, 183)) ->first : Symbol(first, Decl(immutable.d.ts, 5, 21)) ->second : Symbol(second, Decl(immutable.d.ts, 5, 32)) +>is : Symbol(is, Decl(immutable.ts, 4, 183)) +>first : Symbol(first, Decl(immutable.ts, 5, 21)) +>second : Symbol(second, Decl(immutable.ts, 5, 32)) export function hash(value: any): number; ->hash : Symbol(hash, Decl(immutable.d.ts, 5, 55)) ->value : Symbol(value, Decl(immutable.d.ts, 6, 23)) +>hash : Symbol(hash, Decl(immutable.ts, 5, 55)) +>value : Symbol(value, Decl(immutable.ts, 6, 23)) export function isImmutable(maybeImmutable: any): maybeImmutable is Collection; ->isImmutable : Symbol(isImmutable, Decl(immutable.d.ts, 6, 43)) ->maybeImmutable : Symbol(maybeImmutable, Decl(immutable.d.ts, 7, 30)) ->maybeImmutable : Symbol(maybeImmutable, Decl(immutable.d.ts, 7, 30)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) +>isImmutable : Symbol(isImmutable, Decl(immutable.ts, 6, 43)) +>maybeImmutable : Symbol(maybeImmutable, Decl(immutable.ts, 7, 30)) +>maybeImmutable : Symbol(maybeImmutable, Decl(immutable.ts, 7, 30)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) export function isCollection(maybeCollection: any): maybeCollection is Collection; ->isCollection : Symbol(isCollection, Decl(immutable.d.ts, 7, 91)) ->maybeCollection : Symbol(maybeCollection, Decl(immutable.d.ts, 8, 31)) ->maybeCollection : Symbol(maybeCollection, Decl(immutable.d.ts, 8, 31)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) +>isCollection : Symbol(isCollection, Decl(immutable.ts, 7, 91)) +>maybeCollection : Symbol(maybeCollection, Decl(immutable.ts, 8, 31)) +>maybeCollection : Symbol(maybeCollection, Decl(immutable.ts, 8, 31)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) export function isKeyed(maybeKeyed: any): maybeKeyed is Collection.Keyed; ->isKeyed : Symbol(isKeyed, Decl(immutable.d.ts, 8, 94)) ->maybeKeyed : Symbol(maybeKeyed, Decl(immutable.d.ts, 9, 26)) ->maybeKeyed : Symbol(maybeKeyed, Decl(immutable.d.ts, 9, 26)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Keyed : Symbol(Collection.Keyed, Decl(immutable.d.ts, 336, 51), Decl(immutable.d.ts, 337, 26), Decl(immutable.d.ts, 338, 86), Decl(immutable.d.ts, 339, 83)) +>isKeyed : Symbol(isKeyed, Decl(immutable.ts, 8, 94)) +>maybeKeyed : Symbol(maybeKeyed, Decl(immutable.ts, 9, 26)) +>maybeKeyed : Symbol(maybeKeyed, Decl(immutable.ts, 9, 26)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Keyed : Symbol(Collection.Keyed, Decl(immutable.ts, 336, 51), Decl(immutable.ts, 337, 26), Decl(immutable.ts, 338, 86), Decl(immutable.ts, 339, 83)) export function isIndexed(maybeIndexed: any): maybeIndexed is Collection.Indexed; ->isIndexed : Symbol(isIndexed, Decl(immutable.d.ts, 9, 85)) ->maybeIndexed : Symbol(maybeIndexed, Decl(immutable.d.ts, 10, 28)) ->maybeIndexed : Symbol(maybeIndexed, Decl(immutable.d.ts, 10, 28)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Indexed : Symbol(Collection.Indexed, Decl(immutable.d.ts, 355, 5), Decl(immutable.d.ts, 356, 28), Decl(immutable.d.ts, 357, 79)) +>isIndexed : Symbol(isIndexed, Decl(immutable.ts, 9, 85)) +>maybeIndexed : Symbol(maybeIndexed, Decl(immutable.ts, 10, 28)) +>maybeIndexed : Symbol(maybeIndexed, Decl(immutable.ts, 10, 28)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Indexed : Symbol(Collection.Indexed, Decl(immutable.ts, 355, 5), Decl(immutable.ts, 356, 28), Decl(immutable.ts, 357, 79)) export function isAssociative(maybeAssociative: any): maybeAssociative is Collection.Keyed | Collection.Indexed; ->isAssociative : Symbol(isAssociative, Decl(immutable.d.ts, 10, 88)) ->maybeAssociative : Symbol(maybeAssociative, Decl(immutable.d.ts, 11, 32)) ->maybeAssociative : Symbol(maybeAssociative, Decl(immutable.d.ts, 11, 32)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Keyed : Symbol(Collection.Keyed, Decl(immutable.d.ts, 336, 51), Decl(immutable.d.ts, 337, 26), Decl(immutable.d.ts, 338, 86), Decl(immutable.d.ts, 339, 83)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Indexed : Symbol(Collection.Indexed, Decl(immutable.d.ts, 355, 5), Decl(immutable.d.ts, 356, 28), Decl(immutable.d.ts, 357, 79)) +>isAssociative : Symbol(isAssociative, Decl(immutable.ts, 10, 88)) +>maybeAssociative : Symbol(maybeAssociative, Decl(immutable.ts, 11, 32)) +>maybeAssociative : Symbol(maybeAssociative, Decl(immutable.ts, 11, 32)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Keyed : Symbol(Collection.Keyed, Decl(immutable.ts, 336, 51), Decl(immutable.ts, 337, 26), Decl(immutable.ts, 338, 86), Decl(immutable.ts, 339, 83)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Indexed : Symbol(Collection.Indexed, Decl(immutable.ts, 355, 5), Decl(immutable.ts, 356, 28), Decl(immutable.ts, 357, 79)) export function isOrdered(maybeOrdered: any): boolean; ->isOrdered : Symbol(isOrdered, Decl(immutable.d.ts, 11, 129)) ->maybeOrdered : Symbol(maybeOrdered, Decl(immutable.d.ts, 12, 28)) +>isOrdered : Symbol(isOrdered, Decl(immutable.ts, 11, 129)) +>maybeOrdered : Symbol(maybeOrdered, Decl(immutable.ts, 12, 28)) export function isValueObject(maybeValue: any): maybeValue is ValueObject; ->isValueObject : Symbol(isValueObject, Decl(immutable.d.ts, 12, 56)) ->maybeValue : Symbol(maybeValue, Decl(immutable.d.ts, 13, 32)) ->maybeValue : Symbol(maybeValue, Decl(immutable.d.ts, 13, 32)) ->ValueObject : Symbol(ValueObject, Decl(immutable.d.ts, 13, 76)) +>isValueObject : Symbol(isValueObject, Decl(immutable.ts, 12, 56)) +>maybeValue : Symbol(maybeValue, Decl(immutable.ts, 13, 32)) +>maybeValue : Symbol(maybeValue, Decl(immutable.ts, 13, 32)) +>ValueObject : Symbol(ValueObject, Decl(immutable.ts, 13, 76)) export interface ValueObject { ->ValueObject : Symbol(ValueObject, Decl(immutable.d.ts, 13, 76)) +>ValueObject : Symbol(ValueObject, Decl(immutable.ts, 13, 76)) equals(other: any): boolean; ->equals : Symbol(ValueObject.equals, Decl(immutable.d.ts, 14, 32)) ->other : Symbol(other, Decl(immutable.d.ts, 15, 11)) +>equals : Symbol(ValueObject.equals, Decl(immutable.ts, 14, 32)) +>other : Symbol(other, Decl(immutable.ts, 15, 11)) hashCode(): number; ->hashCode : Symbol(ValueObject.hashCode, Decl(immutable.d.ts, 15, 32)) +>hashCode : Symbol(ValueObject.hashCode, Decl(immutable.ts, 15, 32)) } export module List { ->List : Symbol(List, Decl(immutable.d.ts, 17, 3), Decl(immutable.d.ts, 21, 3), Decl(immutable.d.ts, 22, 36), Decl(immutable.d.ts, 23, 37), Decl(immutable.d.ts, 24, 60)) +>List : Symbol(List, Decl(immutable.ts, 17, 3), Decl(immutable.ts, 21, 3), Decl(immutable.ts, 22, 36), Decl(immutable.ts, 23, 37), Decl(immutable.ts, 24, 60)) function isList(maybeList: any): maybeList is List; ->isList : Symbol(isList, Decl(immutable.d.ts, 18, 22)) ->maybeList : Symbol(maybeList, Decl(immutable.d.ts, 19, 20)) ->maybeList : Symbol(maybeList, Decl(immutable.d.ts, 19, 20)) ->List : Symbol(List, Decl(immutable.d.ts, 17, 3), Decl(immutable.d.ts, 21, 3), Decl(immutable.d.ts, 22, 36), Decl(immutable.d.ts, 23, 37), Decl(immutable.d.ts, 24, 60)) +>isList : Symbol(isList, Decl(immutable.ts, 18, 22)) +>maybeList : Symbol(maybeList, Decl(immutable.ts, 19, 20)) +>maybeList : Symbol(maybeList, Decl(immutable.ts, 19, 20)) +>List : Symbol(List, Decl(immutable.ts, 17, 3), Decl(immutable.ts, 21, 3), Decl(immutable.ts, 22, 36), Decl(immutable.ts, 23, 37), Decl(immutable.ts, 24, 60)) function of(...values: Array): List; ->of : Symbol(of, Decl(immutable.d.ts, 19, 60)) ->T : Symbol(T, Decl(immutable.d.ts, 20, 16)) ->values : Symbol(values, Decl(immutable.d.ts, 20, 19)) +>of : Symbol(of, Decl(immutable.ts, 19, 60)) +>T : Symbol(T, Decl(immutable.ts, 20, 16)) +>values : Symbol(values, Decl(immutable.ts, 20, 19)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 20, 16)) ->List : Symbol(List, Decl(immutable.d.ts, 17, 3), Decl(immutable.d.ts, 21, 3), Decl(immutable.d.ts, 22, 36), Decl(immutable.d.ts, 23, 37), Decl(immutable.d.ts, 24, 60)) ->T : Symbol(T, Decl(immutable.d.ts, 20, 16)) +>T : Symbol(T, Decl(immutable.ts, 20, 16)) +>List : Symbol(List, Decl(immutable.ts, 17, 3), Decl(immutable.ts, 21, 3), Decl(immutable.ts, 22, 36), Decl(immutable.ts, 23, 37), Decl(immutable.ts, 24, 60)) +>T : Symbol(T, Decl(immutable.ts, 20, 16)) } export function List(): List; ->List : Symbol(List, Decl(immutable.d.ts, 17, 3), Decl(immutable.d.ts, 21, 3), Decl(immutable.d.ts, 22, 36), Decl(immutable.d.ts, 23, 37), Decl(immutable.d.ts, 24, 60)) ->List : Symbol(List, Decl(immutable.d.ts, 17, 3), Decl(immutable.d.ts, 21, 3), Decl(immutable.d.ts, 22, 36), Decl(immutable.d.ts, 23, 37), Decl(immutable.d.ts, 24, 60)) +>List : Symbol(List, Decl(immutable.ts, 17, 3), Decl(immutable.ts, 21, 3), Decl(immutable.ts, 22, 36), Decl(immutable.ts, 23, 37), Decl(immutable.ts, 24, 60)) +>List : Symbol(List, Decl(immutable.ts, 17, 3), Decl(immutable.ts, 21, 3), Decl(immutable.ts, 22, 36), Decl(immutable.ts, 23, 37), Decl(immutable.ts, 24, 60)) export function List(): List; ->List : Symbol(List, Decl(immutable.d.ts, 17, 3), Decl(immutable.d.ts, 21, 3), Decl(immutable.d.ts, 22, 36), Decl(immutable.d.ts, 23, 37), Decl(immutable.d.ts, 24, 60)) ->T : Symbol(T, Decl(immutable.d.ts, 23, 23)) ->List : Symbol(List, Decl(immutable.d.ts, 17, 3), Decl(immutable.d.ts, 21, 3), Decl(immutable.d.ts, 22, 36), Decl(immutable.d.ts, 23, 37), Decl(immutable.d.ts, 24, 60)) ->T : Symbol(T, Decl(immutable.d.ts, 23, 23)) +>List : Symbol(List, Decl(immutable.ts, 17, 3), Decl(immutable.ts, 21, 3), Decl(immutable.ts, 22, 36), Decl(immutable.ts, 23, 37), Decl(immutable.ts, 24, 60)) +>T : Symbol(T, Decl(immutable.ts, 23, 23)) +>List : Symbol(List, Decl(immutable.ts, 17, 3), Decl(immutable.ts, 21, 3), Decl(immutable.ts, 22, 36), Decl(immutable.ts, 23, 37), Decl(immutable.ts, 24, 60)) +>T : Symbol(T, Decl(immutable.ts, 23, 23)) export function List(collection: Iterable): List; ->List : Symbol(List, Decl(immutable.d.ts, 17, 3), Decl(immutable.d.ts, 21, 3), Decl(immutable.d.ts, 22, 36), Decl(immutable.d.ts, 23, 37), Decl(immutable.d.ts, 24, 60)) ->T : Symbol(T, Decl(immutable.d.ts, 24, 23)) ->collection : Symbol(collection, Decl(immutable.d.ts, 24, 26)) +>List : Symbol(List, Decl(immutable.ts, 17, 3), Decl(immutable.ts, 21, 3), Decl(immutable.ts, 22, 36), Decl(immutable.ts, 23, 37), Decl(immutable.ts, 24, 60)) +>T : Symbol(T, Decl(immutable.ts, 24, 23)) +>collection : Symbol(collection, Decl(immutable.ts, 24, 26)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 24, 23)) ->List : Symbol(List, Decl(immutable.d.ts, 17, 3), Decl(immutable.d.ts, 21, 3), Decl(immutable.d.ts, 22, 36), Decl(immutable.d.ts, 23, 37), Decl(immutable.d.ts, 24, 60)) ->T : Symbol(T, Decl(immutable.d.ts, 24, 23)) +>T : Symbol(T, Decl(immutable.ts, 24, 23)) +>List : Symbol(List, Decl(immutable.ts, 17, 3), Decl(immutable.ts, 21, 3), Decl(immutable.ts, 22, 36), Decl(immutable.ts, 23, 37), Decl(immutable.ts, 24, 60)) +>T : Symbol(T, Decl(immutable.ts, 24, 23)) export interface List extends Collection.Indexed { ->List : Symbol(List, Decl(immutable.d.ts, 17, 3), Decl(immutable.d.ts, 21, 3), Decl(immutable.d.ts, 22, 36), Decl(immutable.d.ts, 23, 37), Decl(immutable.d.ts, 24, 60)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) ->Collection.Indexed : Symbol(Collection.Indexed, Decl(immutable.d.ts, 355, 5), Decl(immutable.d.ts, 356, 28), Decl(immutable.d.ts, 357, 79)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Indexed : Symbol(Collection.Indexed, Decl(immutable.d.ts, 355, 5), Decl(immutable.d.ts, 356, 28), Decl(immutable.d.ts, 357, 79)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) +>List : Symbol(List, Decl(immutable.ts, 17, 3), Decl(immutable.ts, 21, 3), Decl(immutable.ts, 22, 36), Decl(immutable.ts, 23, 37), Decl(immutable.ts, 24, 60)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) +>Collection.Indexed : Symbol(Collection.Indexed, Decl(immutable.ts, 355, 5), Decl(immutable.ts, 356, 28), Decl(immutable.ts, 357, 79)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Indexed : Symbol(Collection.Indexed, Decl(immutable.ts, 355, 5), Decl(immutable.ts, 356, 28), Decl(immutable.ts, 357, 79)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) // Persistent changes set(index: number, value: T): List; ->set : Symbol(List.set, Decl(immutable.d.ts, 25, 58)) ->index : Symbol(index, Decl(immutable.d.ts, 27, 8)) ->value : Symbol(value, Decl(immutable.d.ts, 27, 22)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) ->List : Symbol(List, Decl(immutable.d.ts, 17, 3), Decl(immutable.d.ts, 21, 3), Decl(immutable.d.ts, 22, 36), Decl(immutable.d.ts, 23, 37), Decl(immutable.d.ts, 24, 60)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) +>set : Symbol(List.set, Decl(immutable.ts, 25, 58)) +>index : Symbol(index, Decl(immutable.ts, 27, 8)) +>value : Symbol(value, Decl(immutable.ts, 27, 22)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) +>List : Symbol(List, Decl(immutable.ts, 17, 3), Decl(immutable.ts, 21, 3), Decl(immutable.ts, 22, 36), Decl(immutable.ts, 23, 37), Decl(immutable.ts, 24, 60)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) delete(index: number): List; ->delete : Symbol(List.delete, Decl(immutable.d.ts, 27, 42)) ->index : Symbol(index, Decl(immutable.d.ts, 28, 11)) ->List : Symbol(List, Decl(immutable.d.ts, 17, 3), Decl(immutable.d.ts, 21, 3), Decl(immutable.d.ts, 22, 36), Decl(immutable.d.ts, 23, 37), Decl(immutable.d.ts, 24, 60)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) +>delete : Symbol(List.delete, Decl(immutable.ts, 27, 42)) +>index : Symbol(index, Decl(immutable.ts, 28, 11)) +>List : Symbol(List, Decl(immutable.ts, 17, 3), Decl(immutable.ts, 21, 3), Decl(immutable.ts, 22, 36), Decl(immutable.ts, 23, 37), Decl(immutable.ts, 24, 60)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) remove(index: number): List; ->remove : Symbol(List.remove, Decl(immutable.d.ts, 28, 35)) ->index : Symbol(index, Decl(immutable.d.ts, 29, 11)) ->List : Symbol(List, Decl(immutable.d.ts, 17, 3), Decl(immutable.d.ts, 21, 3), Decl(immutable.d.ts, 22, 36), Decl(immutable.d.ts, 23, 37), Decl(immutable.d.ts, 24, 60)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) +>remove : Symbol(List.remove, Decl(immutable.ts, 28, 35)) +>index : Symbol(index, Decl(immutable.ts, 29, 11)) +>List : Symbol(List, Decl(immutable.ts, 17, 3), Decl(immutable.ts, 21, 3), Decl(immutable.ts, 22, 36), Decl(immutable.ts, 23, 37), Decl(immutable.ts, 24, 60)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) insert(index: number, value: T): List; ->insert : Symbol(List.insert, Decl(immutable.d.ts, 29, 35)) ->index : Symbol(index, Decl(immutable.d.ts, 30, 11)) ->value : Symbol(value, Decl(immutable.d.ts, 30, 25)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) ->List : Symbol(List, Decl(immutable.d.ts, 17, 3), Decl(immutable.d.ts, 21, 3), Decl(immutable.d.ts, 22, 36), Decl(immutable.d.ts, 23, 37), Decl(immutable.d.ts, 24, 60)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) +>insert : Symbol(List.insert, Decl(immutable.ts, 29, 35)) +>index : Symbol(index, Decl(immutable.ts, 30, 11)) +>value : Symbol(value, Decl(immutable.ts, 30, 25)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) +>List : Symbol(List, Decl(immutable.ts, 17, 3), Decl(immutable.ts, 21, 3), Decl(immutable.ts, 22, 36), Decl(immutable.ts, 23, 37), Decl(immutable.ts, 24, 60)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) clear(): List; ->clear : Symbol(List.clear, Decl(immutable.d.ts, 30, 45)) ->List : Symbol(List, Decl(immutable.d.ts, 17, 3), Decl(immutable.d.ts, 21, 3), Decl(immutable.d.ts, 22, 36), Decl(immutable.d.ts, 23, 37), Decl(immutable.d.ts, 24, 60)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) +>clear : Symbol(List.clear, Decl(immutable.ts, 30, 45)) +>List : Symbol(List, Decl(immutable.ts, 17, 3), Decl(immutable.ts, 21, 3), Decl(immutable.ts, 22, 36), Decl(immutable.ts, 23, 37), Decl(immutable.ts, 24, 60)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) push(...values: Array): List; ->push : Symbol(List.push, Decl(immutable.d.ts, 31, 21)) ->values : Symbol(values, Decl(immutable.d.ts, 32, 9)) +>push : Symbol(List.push, Decl(immutable.ts, 31, 21)) +>values : Symbol(values, Decl(immutable.ts, 32, 9)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) ->List : Symbol(List, Decl(immutable.d.ts, 17, 3), Decl(immutable.d.ts, 21, 3), Decl(immutable.d.ts, 22, 36), Decl(immutable.d.ts, 23, 37), Decl(immutable.d.ts, 24, 60)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) +>List : Symbol(List, Decl(immutable.ts, 17, 3), Decl(immutable.ts, 21, 3), Decl(immutable.ts, 22, 36), Decl(immutable.ts, 23, 37), Decl(immutable.ts, 24, 60)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) pop(): List; ->pop : Symbol(List.pop, Decl(immutable.d.ts, 32, 39)) ->List : Symbol(List, Decl(immutable.d.ts, 17, 3), Decl(immutable.d.ts, 21, 3), Decl(immutable.d.ts, 22, 36), Decl(immutable.d.ts, 23, 37), Decl(immutable.d.ts, 24, 60)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) +>pop : Symbol(List.pop, Decl(immutable.ts, 32, 39)) +>List : Symbol(List, Decl(immutable.ts, 17, 3), Decl(immutable.ts, 21, 3), Decl(immutable.ts, 22, 36), Decl(immutable.ts, 23, 37), Decl(immutable.ts, 24, 60)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) unshift(...values: Array): List; ->unshift : Symbol(List.unshift, Decl(immutable.d.ts, 33, 19)) ->values : Symbol(values, Decl(immutable.d.ts, 34, 12)) +>unshift : Symbol(List.unshift, Decl(immutable.ts, 33, 19)) +>values : Symbol(values, Decl(immutable.ts, 34, 12)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) ->List : Symbol(List, Decl(immutable.d.ts, 17, 3), Decl(immutable.d.ts, 21, 3), Decl(immutable.d.ts, 22, 36), Decl(immutable.d.ts, 23, 37), Decl(immutable.d.ts, 24, 60)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) +>List : Symbol(List, Decl(immutable.ts, 17, 3), Decl(immutable.ts, 21, 3), Decl(immutable.ts, 22, 36), Decl(immutable.ts, 23, 37), Decl(immutable.ts, 24, 60)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) shift(): List; ->shift : Symbol(List.shift, Decl(immutable.d.ts, 34, 42)) ->List : Symbol(List, Decl(immutable.d.ts, 17, 3), Decl(immutable.d.ts, 21, 3), Decl(immutable.d.ts, 22, 36), Decl(immutable.d.ts, 23, 37), Decl(immutable.d.ts, 24, 60)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) +>shift : Symbol(List.shift, Decl(immutable.ts, 34, 42)) +>List : Symbol(List, Decl(immutable.ts, 17, 3), Decl(immutable.ts, 21, 3), Decl(immutable.ts, 22, 36), Decl(immutable.ts, 23, 37), Decl(immutable.ts, 24, 60)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) update(index: number, notSetValue: T, updater: (value: T) => T): this; ->update : Symbol(List.update, Decl(immutable.d.ts, 35, 21), Decl(immutable.d.ts, 36, 74), Decl(immutable.d.ts, 37, 58)) ->index : Symbol(index, Decl(immutable.d.ts, 36, 11)) ->notSetValue : Symbol(notSetValue, Decl(immutable.d.ts, 36, 25)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) ->updater : Symbol(updater, Decl(immutable.d.ts, 36, 41)) ->value : Symbol(value, Decl(immutable.d.ts, 36, 52)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) +>update : Symbol(List.update, Decl(immutable.ts, 35, 21), Decl(immutable.ts, 36, 74), Decl(immutable.ts, 37, 58)) +>index : Symbol(index, Decl(immutable.ts, 36, 11)) +>notSetValue : Symbol(notSetValue, Decl(immutable.ts, 36, 25)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) +>updater : Symbol(updater, Decl(immutable.ts, 36, 41)) +>value : Symbol(value, Decl(immutable.ts, 36, 52)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) update(index: number, updater: (value: T) => T): this; ->update : Symbol(List.update, Decl(immutable.d.ts, 35, 21), Decl(immutable.d.ts, 36, 74), Decl(immutable.d.ts, 37, 58)) ->index : Symbol(index, Decl(immutable.d.ts, 37, 11)) ->updater : Symbol(updater, Decl(immutable.d.ts, 37, 25)) ->value : Symbol(value, Decl(immutable.d.ts, 37, 36)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) +>update : Symbol(List.update, Decl(immutable.ts, 35, 21), Decl(immutable.ts, 36, 74), Decl(immutable.ts, 37, 58)) +>index : Symbol(index, Decl(immutable.ts, 37, 11)) +>updater : Symbol(updater, Decl(immutable.ts, 37, 25)) +>value : Symbol(value, Decl(immutable.ts, 37, 36)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) update(updater: (value: this) => R): R; ->update : Symbol(List.update, Decl(immutable.d.ts, 35, 21), Decl(immutable.d.ts, 36, 74), Decl(immutable.d.ts, 37, 58)) ->R : Symbol(R, Decl(immutable.d.ts, 38, 11)) ->updater : Symbol(updater, Decl(immutable.d.ts, 38, 14)) ->value : Symbol(value, Decl(immutable.d.ts, 38, 24)) ->R : Symbol(R, Decl(immutable.d.ts, 38, 11)) ->R : Symbol(R, Decl(immutable.d.ts, 38, 11)) +>update : Symbol(List.update, Decl(immutable.ts, 35, 21), Decl(immutable.ts, 36, 74), Decl(immutable.ts, 37, 58)) +>R : Symbol(R, Decl(immutable.ts, 38, 11)) +>updater : Symbol(updater, Decl(immutable.ts, 38, 14)) +>value : Symbol(value, Decl(immutable.ts, 38, 24)) +>R : Symbol(R, Decl(immutable.ts, 38, 11)) +>R : Symbol(R, Decl(immutable.ts, 38, 11)) merge(...collections: Array | Array>): this; ->merge : Symbol(List.merge, Decl(immutable.d.ts, 38, 46)) ->collections : Symbol(collections, Decl(immutable.d.ts, 39, 10)) +>merge : Symbol(List.merge, Decl(immutable.ts, 38, 46)) +>collections : Symbol(collections, Decl(immutable.ts, 39, 10)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Indexed : Symbol(Collection.Indexed, Decl(immutable.d.ts, 355, 5), Decl(immutable.d.ts, 356, 28), Decl(immutable.d.ts, 357, 79)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Indexed : Symbol(Collection.Indexed, Decl(immutable.ts, 355, 5), Decl(immutable.ts, 356, 28), Decl(immutable.ts, 357, 79)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) mergeWith(merger: (oldVal: T, newVal: T, key: number) => T, ...collections: Array | Array>): this; ->mergeWith : Symbol(List.mergeWith, Decl(immutable.d.ts, 39, 73)) ->merger : Symbol(merger, Decl(immutable.d.ts, 40, 14)) ->oldVal : Symbol(oldVal, Decl(immutable.d.ts, 40, 23)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) ->newVal : Symbol(newVal, Decl(immutable.d.ts, 40, 33)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) ->key : Symbol(key, Decl(immutable.d.ts, 40, 44)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) ->collections : Symbol(collections, Decl(immutable.d.ts, 40, 63)) +>mergeWith : Symbol(List.mergeWith, Decl(immutable.ts, 39, 73)) +>merger : Symbol(merger, Decl(immutable.ts, 40, 14)) +>oldVal : Symbol(oldVal, Decl(immutable.ts, 40, 23)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) +>newVal : Symbol(newVal, Decl(immutable.ts, 40, 33)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) +>key : Symbol(key, Decl(immutable.ts, 40, 44)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) +>collections : Symbol(collections, Decl(immutable.ts, 40, 63)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Indexed : Symbol(Collection.Indexed, Decl(immutable.d.ts, 355, 5), Decl(immutable.d.ts, 356, 28), Decl(immutable.d.ts, 357, 79)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Indexed : Symbol(Collection.Indexed, Decl(immutable.ts, 355, 5), Decl(immutable.ts, 356, 28), Decl(immutable.ts, 357, 79)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) mergeDeep(...collections: Array | Array>): this; ->mergeDeep : Symbol(List.mergeDeep, Decl(immutable.d.ts, 40, 127)) ->collections : Symbol(collections, Decl(immutable.d.ts, 41, 14)) +>mergeDeep : Symbol(List.mergeDeep, Decl(immutable.ts, 40, 127)) +>collections : Symbol(collections, Decl(immutable.ts, 41, 14)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Indexed : Symbol(Collection.Indexed, Decl(immutable.d.ts, 355, 5), Decl(immutable.d.ts, 356, 28), Decl(immutable.d.ts, 357, 79)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Indexed : Symbol(Collection.Indexed, Decl(immutable.ts, 355, 5), Decl(immutable.ts, 356, 28), Decl(immutable.ts, 357, 79)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) mergeDeepWith(merger: (oldVal: T, newVal: T, key: number) => T, ...collections: Array | Array>): this; ->mergeDeepWith : Symbol(List.mergeDeepWith, Decl(immutable.d.ts, 41, 77)) ->merger : Symbol(merger, Decl(immutable.d.ts, 42, 18)) ->oldVal : Symbol(oldVal, Decl(immutable.d.ts, 42, 27)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) ->newVal : Symbol(newVal, Decl(immutable.d.ts, 42, 37)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) ->key : Symbol(key, Decl(immutable.d.ts, 42, 48)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) ->collections : Symbol(collections, Decl(immutable.d.ts, 42, 67)) +>mergeDeepWith : Symbol(List.mergeDeepWith, Decl(immutable.ts, 41, 77)) +>merger : Symbol(merger, Decl(immutable.ts, 42, 18)) +>oldVal : Symbol(oldVal, Decl(immutable.ts, 42, 27)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) +>newVal : Symbol(newVal, Decl(immutable.ts, 42, 37)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) +>key : Symbol(key, Decl(immutable.ts, 42, 48)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) +>collections : Symbol(collections, Decl(immutable.ts, 42, 67)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Indexed : Symbol(Collection.Indexed, Decl(immutable.d.ts, 355, 5), Decl(immutable.d.ts, 356, 28), Decl(immutable.d.ts, 357, 79)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Indexed : Symbol(Collection.Indexed, Decl(immutable.ts, 355, 5), Decl(immutable.ts, 356, 28), Decl(immutable.ts, 357, 79)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) setSize(size: number): List; ->setSize : Symbol(List.setSize, Decl(immutable.d.ts, 42, 131)) ->size : Symbol(size, Decl(immutable.d.ts, 43, 12)) ->List : Symbol(List, Decl(immutable.d.ts, 17, 3), Decl(immutable.d.ts, 21, 3), Decl(immutable.d.ts, 22, 36), Decl(immutable.d.ts, 23, 37), Decl(immutable.d.ts, 24, 60)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) +>setSize : Symbol(List.setSize, Decl(immutable.ts, 42, 131)) +>size : Symbol(size, Decl(immutable.ts, 43, 12)) +>List : Symbol(List, Decl(immutable.ts, 17, 3), Decl(immutable.ts, 21, 3), Decl(immutable.ts, 22, 36), Decl(immutable.ts, 23, 37), Decl(immutable.ts, 24, 60)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) // Deep persistent changes setIn(keyPath: Iterable, value: any): this; ->setIn : Symbol(List.setIn, Decl(immutable.d.ts, 43, 35)) ->keyPath : Symbol(keyPath, Decl(immutable.d.ts, 45, 10)) +>setIn : Symbol(List.setIn, Decl(immutable.ts, 43, 35)) +>keyPath : Symbol(keyPath, Decl(immutable.ts, 45, 10)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->value : Symbol(value, Decl(immutable.d.ts, 45, 33)) +>value : Symbol(value, Decl(immutable.ts, 45, 33)) deleteIn(keyPath: Iterable): this; ->deleteIn : Symbol(List.deleteIn, Decl(immutable.d.ts, 45, 52)) ->keyPath : Symbol(keyPath, Decl(immutable.d.ts, 46, 13)) +>deleteIn : Symbol(List.deleteIn, Decl(immutable.ts, 45, 52)) +>keyPath : Symbol(keyPath, Decl(immutable.ts, 46, 13)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) removeIn(keyPath: Iterable): this; ->removeIn : Symbol(List.removeIn, Decl(immutable.d.ts, 46, 43)) ->keyPath : Symbol(keyPath, Decl(immutable.d.ts, 47, 13)) +>removeIn : Symbol(List.removeIn, Decl(immutable.ts, 46, 43)) +>keyPath : Symbol(keyPath, Decl(immutable.ts, 47, 13)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) updateIn(keyPath: Iterable, notSetValue: any, updater: (value: any) => any): this; ->updateIn : Symbol(List.updateIn, Decl(immutable.d.ts, 47, 43), Decl(immutable.d.ts, 48, 91)) ->keyPath : Symbol(keyPath, Decl(immutable.d.ts, 48, 13)) +>updateIn : Symbol(List.updateIn, Decl(immutable.ts, 47, 43), Decl(immutable.ts, 48, 91)) +>keyPath : Symbol(keyPath, Decl(immutable.ts, 48, 13)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->notSetValue : Symbol(notSetValue, Decl(immutable.d.ts, 48, 36)) ->updater : Symbol(updater, Decl(immutable.d.ts, 48, 54)) ->value : Symbol(value, Decl(immutable.d.ts, 48, 65)) +>notSetValue : Symbol(notSetValue, Decl(immutable.ts, 48, 36)) +>updater : Symbol(updater, Decl(immutable.ts, 48, 54)) +>value : Symbol(value, Decl(immutable.ts, 48, 65)) updateIn(keyPath: Iterable, updater: (value: any) => any): this; ->updateIn : Symbol(List.updateIn, Decl(immutable.d.ts, 47, 43), Decl(immutable.d.ts, 48, 91)) ->keyPath : Symbol(keyPath, Decl(immutable.d.ts, 49, 13)) +>updateIn : Symbol(List.updateIn, Decl(immutable.ts, 47, 43), Decl(immutable.ts, 48, 91)) +>keyPath : Symbol(keyPath, Decl(immutable.ts, 49, 13)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->updater : Symbol(updater, Decl(immutable.d.ts, 49, 36)) ->value : Symbol(value, Decl(immutable.d.ts, 49, 47)) +>updater : Symbol(updater, Decl(immutable.ts, 49, 36)) +>value : Symbol(value, Decl(immutable.ts, 49, 47)) mergeIn(keyPath: Iterable, ...collections: Array): this; ->mergeIn : Symbol(List.mergeIn, Decl(immutable.d.ts, 49, 73)) ->keyPath : Symbol(keyPath, Decl(immutable.d.ts, 50, 12)) +>mergeIn : Symbol(List.mergeIn, Decl(immutable.ts, 49, 73)) +>keyPath : Symbol(keyPath, Decl(immutable.ts, 50, 12)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->collections : Symbol(collections, Decl(immutable.d.ts, 50, 35)) +>collections : Symbol(collections, Decl(immutable.ts, 50, 35)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) mergeDeepIn(keyPath: Iterable, ...collections: Array): this; ->mergeDeepIn : Symbol(List.mergeDeepIn, Decl(immutable.d.ts, 50, 70)) ->keyPath : Symbol(keyPath, Decl(immutable.d.ts, 51, 16)) +>mergeDeepIn : Symbol(List.mergeDeepIn, Decl(immutable.ts, 50, 70)) +>keyPath : Symbol(keyPath, Decl(immutable.ts, 51, 16)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->collections : Symbol(collections, Decl(immutable.d.ts, 51, 39)) +>collections : Symbol(collections, Decl(immutable.ts, 51, 39)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) // Transient changes withMutations(mutator: (mutable: this) => any): this; ->withMutations : Symbol(List.withMutations, Decl(immutable.d.ts, 51, 74)) ->mutator : Symbol(mutator, Decl(immutable.d.ts, 53, 18)) ->mutable : Symbol(mutable, Decl(immutable.d.ts, 53, 28)) +>withMutations : Symbol(List.withMutations, Decl(immutable.ts, 51, 74)) +>mutator : Symbol(mutator, Decl(immutable.ts, 53, 18)) +>mutable : Symbol(mutable, Decl(immutable.ts, 53, 28)) asMutable(): this; ->asMutable : Symbol(List.asMutable, Decl(immutable.d.ts, 53, 57)) +>asMutable : Symbol(List.asMutable, Decl(immutable.ts, 53, 57)) asImmutable(): this; ->asImmutable : Symbol(List.asImmutable, Decl(immutable.d.ts, 54, 22)) +>asImmutable : Symbol(List.asImmutable, Decl(immutable.ts, 54, 22)) // Sequence algorithms concat(...valuesOrCollections: Array | C>): List; ->concat : Symbol(List.concat, Decl(immutable.d.ts, 55, 24)) ->C : Symbol(C, Decl(immutable.d.ts, 57, 11)) ->valuesOrCollections : Symbol(valuesOrCollections, Decl(immutable.d.ts, 57, 14)) +>concat : Symbol(List.concat, Decl(immutable.ts, 55, 24)) +>C : Symbol(C, Decl(immutable.ts, 57, 11)) +>valuesOrCollections : Symbol(valuesOrCollections, Decl(immutable.ts, 57, 14)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->C : Symbol(C, Decl(immutable.d.ts, 57, 11)) ->C : Symbol(C, Decl(immutable.d.ts, 57, 11)) ->List : Symbol(List, Decl(immutable.d.ts, 17, 3), Decl(immutable.d.ts, 21, 3), Decl(immutable.d.ts, 22, 36), Decl(immutable.d.ts, 23, 37), Decl(immutable.d.ts, 24, 60)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) ->C : Symbol(C, Decl(immutable.d.ts, 57, 11)) +>C : Symbol(C, Decl(immutable.ts, 57, 11)) +>C : Symbol(C, Decl(immutable.ts, 57, 11)) +>List : Symbol(List, Decl(immutable.ts, 17, 3), Decl(immutable.ts, 21, 3), Decl(immutable.ts, 22, 36), Decl(immutable.ts, 23, 37), Decl(immutable.ts, 24, 60)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) +>C : Symbol(C, Decl(immutable.ts, 57, 11)) map(mapper: (value: T, key: number, iter: this) => M, context?: any): List; ->map : Symbol(List.map, Decl(immutable.d.ts, 57, 75)) ->M : Symbol(M, Decl(immutable.d.ts, 58, 8)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 58, 11)) ->value : Symbol(value, Decl(immutable.d.ts, 58, 20)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) ->key : Symbol(key, Decl(immutable.d.ts, 58, 29)) ->iter : Symbol(iter, Decl(immutable.d.ts, 58, 42)) ->M : Symbol(M, Decl(immutable.d.ts, 58, 8)) ->context : Symbol(context, Decl(immutable.d.ts, 58, 60)) ->List : Symbol(List, Decl(immutable.d.ts, 17, 3), Decl(immutable.d.ts, 21, 3), Decl(immutable.d.ts, 22, 36), Decl(immutable.d.ts, 23, 37), Decl(immutable.d.ts, 24, 60)) ->M : Symbol(M, Decl(immutable.d.ts, 58, 8)) +>map : Symbol(List.map, Decl(immutable.ts, 57, 75)) +>M : Symbol(M, Decl(immutable.ts, 58, 8)) +>mapper : Symbol(mapper, Decl(immutable.ts, 58, 11)) +>value : Symbol(value, Decl(immutable.ts, 58, 20)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) +>key : Symbol(key, Decl(immutable.ts, 58, 29)) +>iter : Symbol(iter, Decl(immutable.ts, 58, 42)) +>M : Symbol(M, Decl(immutable.ts, 58, 8)) +>context : Symbol(context, Decl(immutable.ts, 58, 60)) +>List : Symbol(List, Decl(immutable.ts, 17, 3), Decl(immutable.ts, 21, 3), Decl(immutable.ts, 22, 36), Decl(immutable.ts, 23, 37), Decl(immutable.ts, 24, 60)) +>M : Symbol(M, Decl(immutable.ts, 58, 8)) flatMap(mapper: (value: T, key: number, iter: this) => Iterable, context?: any): List; ->flatMap : Symbol(List.flatMap, Decl(immutable.d.ts, 58, 85)) ->M : Symbol(M, Decl(immutable.d.ts, 59, 12)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 59, 15)) ->value : Symbol(value, Decl(immutable.d.ts, 59, 24)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) ->key : Symbol(key, Decl(immutable.d.ts, 59, 33)) ->iter : Symbol(iter, Decl(immutable.d.ts, 59, 46)) +>flatMap : Symbol(List.flatMap, Decl(immutable.ts, 58, 85)) +>M : Symbol(M, Decl(immutable.ts, 59, 12)) +>mapper : Symbol(mapper, Decl(immutable.ts, 59, 15)) +>value : Symbol(value, Decl(immutable.ts, 59, 24)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) +>key : Symbol(key, Decl(immutable.ts, 59, 33)) +>iter : Symbol(iter, Decl(immutable.ts, 59, 46)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->M : Symbol(M, Decl(immutable.d.ts, 59, 12)) ->context : Symbol(context, Decl(immutable.d.ts, 59, 74)) ->List : Symbol(List, Decl(immutable.d.ts, 17, 3), Decl(immutable.d.ts, 21, 3), Decl(immutable.d.ts, 22, 36), Decl(immutable.d.ts, 23, 37), Decl(immutable.d.ts, 24, 60)) ->M : Symbol(M, Decl(immutable.d.ts, 59, 12)) +>M : Symbol(M, Decl(immutable.ts, 59, 12)) +>context : Symbol(context, Decl(immutable.ts, 59, 74)) +>List : Symbol(List, Decl(immutable.ts, 17, 3), Decl(immutable.ts, 21, 3), Decl(immutable.ts, 22, 36), Decl(immutable.ts, 23, 37), Decl(immutable.ts, 24, 60)) +>M : Symbol(M, Decl(immutable.ts, 59, 12)) filter(predicate: (value: T, index: number, iter: this) => value is F, context?: any): List; ->filter : Symbol(List.filter, Decl(immutable.d.ts, 59, 99), Decl(immutable.d.ts, 60, 112)) ->F : Symbol(F, Decl(immutable.d.ts, 60, 11)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 60, 24)) ->value : Symbol(value, Decl(immutable.d.ts, 60, 36)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) ->index : Symbol(index, Decl(immutable.d.ts, 60, 45)) ->iter : Symbol(iter, Decl(immutable.d.ts, 60, 60)) ->value : Symbol(value, Decl(immutable.d.ts, 60, 36)) ->F : Symbol(F, Decl(immutable.d.ts, 60, 11)) ->context : Symbol(context, Decl(immutable.d.ts, 60, 87)) ->List : Symbol(List, Decl(immutable.d.ts, 17, 3), Decl(immutable.d.ts, 21, 3), Decl(immutable.d.ts, 22, 36), Decl(immutable.d.ts, 23, 37), Decl(immutable.d.ts, 24, 60)) ->F : Symbol(F, Decl(immutable.d.ts, 60, 11)) +>filter : Symbol(List.filter, Decl(immutable.ts, 59, 99), Decl(immutable.ts, 60, 112)) +>F : Symbol(F, Decl(immutable.ts, 60, 11)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) +>predicate : Symbol(predicate, Decl(immutable.ts, 60, 24)) +>value : Symbol(value, Decl(immutable.ts, 60, 36)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) +>index : Symbol(index, Decl(immutable.ts, 60, 45)) +>iter : Symbol(iter, Decl(immutable.ts, 60, 60)) +>value : Symbol(value, Decl(immutable.ts, 60, 36)) +>F : Symbol(F, Decl(immutable.ts, 60, 11)) +>context : Symbol(context, Decl(immutable.ts, 60, 87)) +>List : Symbol(List, Decl(immutable.ts, 17, 3), Decl(immutable.ts, 21, 3), Decl(immutable.ts, 22, 36), Decl(immutable.ts, 23, 37), Decl(immutable.ts, 24, 60)) +>F : Symbol(F, Decl(immutable.ts, 60, 11)) filter(predicate: (value: T, index: number, iter: this) => any, context?: any): this; ->filter : Symbol(List.filter, Decl(immutable.d.ts, 59, 99), Decl(immutable.d.ts, 60, 112)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 61, 11)) ->value : Symbol(value, Decl(immutable.d.ts, 61, 23)) ->T : Symbol(T, Decl(immutable.d.ts, 25, 24)) ->index : Symbol(index, Decl(immutable.d.ts, 61, 32)) ->iter : Symbol(iter, Decl(immutable.d.ts, 61, 47)) ->context : Symbol(context, Decl(immutable.d.ts, 61, 67)) +>filter : Symbol(List.filter, Decl(immutable.ts, 59, 99), Decl(immutable.ts, 60, 112)) +>predicate : Symbol(predicate, Decl(immutable.ts, 61, 11)) +>value : Symbol(value, Decl(immutable.ts, 61, 23)) +>T : Symbol(T, Decl(immutable.ts, 25, 24)) +>index : Symbol(index, Decl(immutable.ts, 61, 32)) +>iter : Symbol(iter, Decl(immutable.ts, 61, 47)) +>context : Symbol(context, Decl(immutable.ts, 61, 67)) } export module Map { ->Map : Symbol(Map, Decl(immutable.d.ts, 62, 3), Decl(immutable.d.ts, 66, 3), Decl(immutable.d.ts, 67, 69), Decl(immutable.d.ts, 68, 71), Decl(immutable.d.ts, 69, 66) ... and 2 more) +>Map : Symbol(Map, Decl(immutable.ts, 62, 3), Decl(immutable.ts, 66, 3), Decl(immutable.ts, 67, 69), Decl(immutable.ts, 68, 71), Decl(immutable.ts, 69, 66) ... and 2 more) function isMap(maybeMap: any): maybeMap is Map; ->isMap : Symbol(isMap, Decl(immutable.d.ts, 63, 21)) ->maybeMap : Symbol(maybeMap, Decl(immutable.d.ts, 64, 19)) ->maybeMap : Symbol(maybeMap, Decl(immutable.d.ts, 64, 19)) ->Map : Symbol(Map, Decl(immutable.d.ts, 62, 3), Decl(immutable.d.ts, 66, 3), Decl(immutable.d.ts, 67, 69), Decl(immutable.d.ts, 68, 71), Decl(immutable.d.ts, 69, 66) ... and 2 more) +>isMap : Symbol(isMap, Decl(immutable.ts, 63, 21)) +>maybeMap : Symbol(maybeMap, Decl(immutable.ts, 64, 19)) +>maybeMap : Symbol(maybeMap, Decl(immutable.ts, 64, 19)) +>Map : Symbol(Map, Decl(immutable.ts, 62, 3), Decl(immutable.ts, 66, 3), Decl(immutable.ts, 67, 69), Decl(immutable.ts, 68, 71), Decl(immutable.ts, 69, 66) ... and 2 more) function of(...keyValues: Array): Map; ->of : Symbol(of, Decl(immutable.d.ts, 64, 61)) ->keyValues : Symbol(keyValues, Decl(immutable.d.ts, 65, 16)) +>of : Symbol(of, Decl(immutable.ts, 64, 61)) +>keyValues : Symbol(keyValues, Decl(immutable.ts, 65, 16)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->Map : Symbol(Map, Decl(immutable.d.ts, 62, 3), Decl(immutable.d.ts, 66, 3), Decl(immutable.d.ts, 67, 69), Decl(immutable.d.ts, 68, 71), Decl(immutable.d.ts, 69, 66) ... and 2 more) +>Map : Symbol(Map, Decl(immutable.ts, 62, 3), Decl(immutable.ts, 66, 3), Decl(immutable.ts, 67, 69), Decl(immutable.ts, 68, 71), Decl(immutable.ts, 69, 66) ... and 2 more) } export function Map(collection: Iterable<[K, V]>): Map; ->Map : Symbol(Map, Decl(immutable.d.ts, 62, 3), Decl(immutable.d.ts, 66, 3), Decl(immutable.d.ts, 67, 69), Decl(immutable.d.ts, 68, 71), Decl(immutable.d.ts, 69, 66) ... and 2 more) ->K : Symbol(K, Decl(immutable.d.ts, 67, 22)) ->V : Symbol(V, Decl(immutable.d.ts, 67, 24)) ->collection : Symbol(collection, Decl(immutable.d.ts, 67, 28)) +>Map : Symbol(Map, Decl(immutable.ts, 62, 3), Decl(immutable.ts, 66, 3), Decl(immutable.ts, 67, 69), Decl(immutable.ts, 68, 71), Decl(immutable.ts, 69, 66) ... and 2 more) +>K : Symbol(K, Decl(immutable.ts, 67, 22)) +>V : Symbol(V, Decl(immutable.ts, 67, 24)) +>collection : Symbol(collection, Decl(immutable.ts, 67, 28)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->K : Symbol(K, Decl(immutable.d.ts, 67, 22)) ->V : Symbol(V, Decl(immutable.d.ts, 67, 24)) ->Map : Symbol(Map, Decl(immutable.d.ts, 62, 3), Decl(immutable.d.ts, 66, 3), Decl(immutable.d.ts, 67, 69), Decl(immutable.d.ts, 68, 71), Decl(immutable.d.ts, 69, 66) ... and 2 more) ->K : Symbol(K, Decl(immutable.d.ts, 67, 22)) ->V : Symbol(V, Decl(immutable.d.ts, 67, 24)) +>K : Symbol(K, Decl(immutable.ts, 67, 22)) +>V : Symbol(V, Decl(immutable.ts, 67, 24)) +>Map : Symbol(Map, Decl(immutable.ts, 62, 3), Decl(immutable.ts, 66, 3), Decl(immutable.ts, 67, 69), Decl(immutable.ts, 68, 71), Decl(immutable.ts, 69, 66) ... and 2 more) +>K : Symbol(K, Decl(immutable.ts, 67, 22)) +>V : Symbol(V, Decl(immutable.ts, 67, 24)) export function Map(collection: Iterable>): Map; ->Map : Symbol(Map, Decl(immutable.d.ts, 62, 3), Decl(immutable.d.ts, 66, 3), Decl(immutable.d.ts, 67, 69), Decl(immutable.d.ts, 68, 71), Decl(immutable.d.ts, 69, 66) ... and 2 more) ->T : Symbol(T, Decl(immutable.d.ts, 68, 22)) ->collection : Symbol(collection, Decl(immutable.d.ts, 68, 25)) +>Map : Symbol(Map, Decl(immutable.ts, 62, 3), Decl(immutable.ts, 66, 3), Decl(immutable.ts, 67, 69), Decl(immutable.ts, 68, 71), Decl(immutable.ts, 69, 66) ... and 2 more) +>T : Symbol(T, Decl(immutable.ts, 68, 22)) +>collection : Symbol(collection, Decl(immutable.ts, 68, 25)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 68, 22)) ->Map : Symbol(Map, Decl(immutable.d.ts, 62, 3), Decl(immutable.d.ts, 66, 3), Decl(immutable.d.ts, 67, 69), Decl(immutable.d.ts, 68, 71), Decl(immutable.d.ts, 69, 66) ... and 2 more) ->T : Symbol(T, Decl(immutable.d.ts, 68, 22)) ->T : Symbol(T, Decl(immutable.d.ts, 68, 22)) +>T : Symbol(T, Decl(immutable.ts, 68, 22)) +>Map : Symbol(Map, Decl(immutable.ts, 62, 3), Decl(immutable.ts, 66, 3), Decl(immutable.ts, 67, 69), Decl(immutable.ts, 68, 71), Decl(immutable.ts, 69, 66) ... and 2 more) +>T : Symbol(T, Decl(immutable.ts, 68, 22)) +>T : Symbol(T, Decl(immutable.ts, 68, 22)) export function Map(obj: {[key: string]: V}): Map; ->Map : Symbol(Map, Decl(immutable.d.ts, 62, 3), Decl(immutable.d.ts, 66, 3), Decl(immutable.d.ts, 67, 69), Decl(immutable.d.ts, 68, 71), Decl(immutable.d.ts, 69, 66) ... and 2 more) ->V : Symbol(V, Decl(immutable.d.ts, 69, 22)) ->obj : Symbol(obj, Decl(immutable.d.ts, 69, 25)) ->key : Symbol(key, Decl(immutable.d.ts, 69, 32)) ->V : Symbol(V, Decl(immutable.d.ts, 69, 22)) ->Map : Symbol(Map, Decl(immutable.d.ts, 62, 3), Decl(immutable.d.ts, 66, 3), Decl(immutable.d.ts, 67, 69), Decl(immutable.d.ts, 68, 71), Decl(immutable.d.ts, 69, 66) ... and 2 more) ->V : Symbol(V, Decl(immutable.d.ts, 69, 22)) +>Map : Symbol(Map, Decl(immutable.ts, 62, 3), Decl(immutable.ts, 66, 3), Decl(immutable.ts, 67, 69), Decl(immutable.ts, 68, 71), Decl(immutable.ts, 69, 66) ... and 2 more) +>V : Symbol(V, Decl(immutable.ts, 69, 22)) +>obj : Symbol(obj, Decl(immutable.ts, 69, 25)) +>key : Symbol(key, Decl(immutable.ts, 69, 32)) +>V : Symbol(V, Decl(immutable.ts, 69, 22)) +>Map : Symbol(Map, Decl(immutable.ts, 62, 3), Decl(immutable.ts, 66, 3), Decl(immutable.ts, 67, 69), Decl(immutable.ts, 68, 71), Decl(immutable.ts, 69, 66) ... and 2 more) +>V : Symbol(V, Decl(immutable.ts, 69, 22)) export function Map(): Map; ->Map : Symbol(Map, Decl(immutable.d.ts, 62, 3), Decl(immutable.d.ts, 66, 3), Decl(immutable.d.ts, 67, 69), Decl(immutable.d.ts, 68, 71), Decl(immutable.d.ts, 69, 66) ... and 2 more) ->K : Symbol(K, Decl(immutable.d.ts, 70, 22)) ->V : Symbol(V, Decl(immutable.d.ts, 70, 24)) ->Map : Symbol(Map, Decl(immutable.d.ts, 62, 3), Decl(immutable.d.ts, 66, 3), Decl(immutable.d.ts, 67, 69), Decl(immutable.d.ts, 68, 71), Decl(immutable.d.ts, 69, 66) ... and 2 more) ->K : Symbol(K, Decl(immutable.d.ts, 70, 22)) ->V : Symbol(V, Decl(immutable.d.ts, 70, 24)) +>Map : Symbol(Map, Decl(immutable.ts, 62, 3), Decl(immutable.ts, 66, 3), Decl(immutable.ts, 67, 69), Decl(immutable.ts, 68, 71), Decl(immutable.ts, 69, 66) ... and 2 more) +>K : Symbol(K, Decl(immutable.ts, 70, 22)) +>V : Symbol(V, Decl(immutable.ts, 70, 24)) +>Map : Symbol(Map, Decl(immutable.ts, 62, 3), Decl(immutable.ts, 66, 3), Decl(immutable.ts, 67, 69), Decl(immutable.ts, 68, 71), Decl(immutable.ts, 69, 66) ... and 2 more) +>K : Symbol(K, Decl(immutable.ts, 70, 22)) +>V : Symbol(V, Decl(immutable.ts, 70, 24)) export function Map(): Map; ->Map : Symbol(Map, Decl(immutable.d.ts, 62, 3), Decl(immutable.d.ts, 66, 3), Decl(immutable.d.ts, 67, 69), Decl(immutable.d.ts, 68, 71), Decl(immutable.d.ts, 69, 66) ... and 2 more) ->Map : Symbol(Map, Decl(immutable.d.ts, 62, 3), Decl(immutable.d.ts, 66, 3), Decl(immutable.d.ts, 67, 69), Decl(immutable.d.ts, 68, 71), Decl(immutable.d.ts, 69, 66) ... and 2 more) +>Map : Symbol(Map, Decl(immutable.ts, 62, 3), Decl(immutable.ts, 66, 3), Decl(immutable.ts, 67, 69), Decl(immutable.ts, 68, 71), Decl(immutable.ts, 69, 66) ... and 2 more) +>Map : Symbol(Map, Decl(immutable.ts, 62, 3), Decl(immutable.ts, 66, 3), Decl(immutable.ts, 67, 69), Decl(immutable.ts, 68, 71), Decl(immutable.ts, 69, 66) ... and 2 more) export interface Map extends Collection.Keyed { ->Map : Symbol(Map, Decl(immutable.d.ts, 62, 3), Decl(immutable.d.ts, 66, 3), Decl(immutable.d.ts, 67, 69), Decl(immutable.d.ts, 68, 71), Decl(immutable.d.ts, 69, 66) ... and 2 more) ->K : Symbol(K, Decl(immutable.d.ts, 72, 23)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) ->Collection.Keyed : Symbol(Collection.Keyed, Decl(immutable.d.ts, 336, 51), Decl(immutable.d.ts, 337, 26), Decl(immutable.d.ts, 338, 86), Decl(immutable.d.ts, 339, 83)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Keyed : Symbol(Collection.Keyed, Decl(immutable.d.ts, 336, 51), Decl(immutable.d.ts, 337, 26), Decl(immutable.d.ts, 338, 86), Decl(immutable.d.ts, 339, 83)) ->K : Symbol(K, Decl(immutable.d.ts, 72, 23)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) +>Map : Symbol(Map, Decl(immutable.ts, 62, 3), Decl(immutable.ts, 66, 3), Decl(immutable.ts, 67, 69), Decl(immutable.ts, 68, 71), Decl(immutable.ts, 69, 66) ... and 2 more) +>K : Symbol(K, Decl(immutable.ts, 72, 23)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) +>Collection.Keyed : Symbol(Collection.Keyed, Decl(immutable.ts, 336, 51), Decl(immutable.ts, 337, 26), Decl(immutable.ts, 338, 86), Decl(immutable.ts, 339, 83)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Keyed : Symbol(Collection.Keyed, Decl(immutable.ts, 336, 51), Decl(immutable.ts, 337, 26), Decl(immutable.ts, 338, 86), Decl(immutable.ts, 339, 83)) +>K : Symbol(K, Decl(immutable.ts, 72, 23)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) // Persistent changes set(key: K, value: V): this; ->set : Symbol(Map.set, Decl(immutable.d.ts, 72, 61)) ->key : Symbol(key, Decl(immutable.d.ts, 74, 8)) ->K : Symbol(K, Decl(immutable.d.ts, 72, 23)) ->value : Symbol(value, Decl(immutable.d.ts, 74, 15)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) +>set : Symbol(Map.set, Decl(immutable.ts, 72, 61)) +>key : Symbol(key, Decl(immutable.ts, 74, 8)) +>K : Symbol(K, Decl(immutable.ts, 72, 23)) +>value : Symbol(value, Decl(immutable.ts, 74, 15)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) delete(key: K): this; ->delete : Symbol(Map.delete, Decl(immutable.d.ts, 74, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 75, 11)) ->K : Symbol(K, Decl(immutable.d.ts, 72, 23)) +>delete : Symbol(Map.delete, Decl(immutable.ts, 74, 32)) +>key : Symbol(key, Decl(immutable.ts, 75, 11)) +>K : Symbol(K, Decl(immutable.ts, 72, 23)) remove(key: K): this; ->remove : Symbol(Map.remove, Decl(immutable.d.ts, 75, 25)) ->key : Symbol(key, Decl(immutable.d.ts, 76, 11)) ->K : Symbol(K, Decl(immutable.d.ts, 72, 23)) +>remove : Symbol(Map.remove, Decl(immutable.ts, 75, 25)) +>key : Symbol(key, Decl(immutable.ts, 76, 11)) +>K : Symbol(K, Decl(immutable.ts, 72, 23)) deleteAll(keys: Iterable): this; ->deleteAll : Symbol(Map.deleteAll, Decl(immutable.d.ts, 76, 25)) ->keys : Symbol(keys, Decl(immutable.d.ts, 77, 14)) +>deleteAll : Symbol(Map.deleteAll, Decl(immutable.ts, 76, 25)) +>keys : Symbol(keys, Decl(immutable.ts, 77, 14)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->K : Symbol(K, Decl(immutable.d.ts, 72, 23)) +>K : Symbol(K, Decl(immutable.ts, 72, 23)) removeAll(keys: Iterable): this; ->removeAll : Symbol(Map.removeAll, Decl(immutable.d.ts, 77, 39)) ->keys : Symbol(keys, Decl(immutable.d.ts, 78, 14)) +>removeAll : Symbol(Map.removeAll, Decl(immutable.ts, 77, 39)) +>keys : Symbol(keys, Decl(immutable.ts, 78, 14)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->K : Symbol(K, Decl(immutable.d.ts, 72, 23)) +>K : Symbol(K, Decl(immutable.ts, 72, 23)) clear(): this; ->clear : Symbol(Map.clear, Decl(immutable.d.ts, 78, 39)) +>clear : Symbol(Map.clear, Decl(immutable.ts, 78, 39)) update(key: K, notSetValue: V, updater: (value: V) => V): this; ->update : Symbol(Map.update, Decl(immutable.d.ts, 79, 18), Decl(immutable.d.ts, 80, 67), Decl(immutable.d.ts, 81, 51)) ->key : Symbol(key, Decl(immutable.d.ts, 80, 11)) ->K : Symbol(K, Decl(immutable.d.ts, 72, 23)) ->notSetValue : Symbol(notSetValue, Decl(immutable.d.ts, 80, 18)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) ->updater : Symbol(updater, Decl(immutable.d.ts, 80, 34)) ->value : Symbol(value, Decl(immutable.d.ts, 80, 45)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) +>update : Symbol(Map.update, Decl(immutable.ts, 79, 18), Decl(immutable.ts, 80, 67), Decl(immutable.ts, 81, 51)) +>key : Symbol(key, Decl(immutable.ts, 80, 11)) +>K : Symbol(K, Decl(immutable.ts, 72, 23)) +>notSetValue : Symbol(notSetValue, Decl(immutable.ts, 80, 18)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) +>updater : Symbol(updater, Decl(immutable.ts, 80, 34)) +>value : Symbol(value, Decl(immutable.ts, 80, 45)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) update(key: K, updater: (value: V) => V): this; ->update : Symbol(Map.update, Decl(immutable.d.ts, 79, 18), Decl(immutable.d.ts, 80, 67), Decl(immutable.d.ts, 81, 51)) ->key : Symbol(key, Decl(immutable.d.ts, 81, 11)) ->K : Symbol(K, Decl(immutable.d.ts, 72, 23)) ->updater : Symbol(updater, Decl(immutable.d.ts, 81, 18)) ->value : Symbol(value, Decl(immutable.d.ts, 81, 29)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) +>update : Symbol(Map.update, Decl(immutable.ts, 79, 18), Decl(immutable.ts, 80, 67), Decl(immutable.ts, 81, 51)) +>key : Symbol(key, Decl(immutable.ts, 81, 11)) +>K : Symbol(K, Decl(immutable.ts, 72, 23)) +>updater : Symbol(updater, Decl(immutable.ts, 81, 18)) +>value : Symbol(value, Decl(immutable.ts, 81, 29)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) update(updater: (value: this) => R): R; ->update : Symbol(Map.update, Decl(immutable.d.ts, 79, 18), Decl(immutable.d.ts, 80, 67), Decl(immutable.d.ts, 81, 51)) ->R : Symbol(R, Decl(immutable.d.ts, 82, 11)) ->updater : Symbol(updater, Decl(immutable.d.ts, 82, 14)) ->value : Symbol(value, Decl(immutable.d.ts, 82, 24)) ->R : Symbol(R, Decl(immutable.d.ts, 82, 11)) ->R : Symbol(R, Decl(immutable.d.ts, 82, 11)) +>update : Symbol(Map.update, Decl(immutable.ts, 79, 18), Decl(immutable.ts, 80, 67), Decl(immutable.ts, 81, 51)) +>R : Symbol(R, Decl(immutable.ts, 82, 11)) +>updater : Symbol(updater, Decl(immutable.ts, 82, 14)) +>value : Symbol(value, Decl(immutable.ts, 82, 24)) +>R : Symbol(R, Decl(immutable.ts, 82, 11)) +>R : Symbol(R, Decl(immutable.ts, 82, 11)) merge(...collections: Array | {[key: string]: V}>): this; ->merge : Symbol(Map.merge, Decl(immutable.d.ts, 82, 46)) ->collections : Symbol(collections, Decl(immutable.d.ts, 83, 10)) +>merge : Symbol(Map.merge, Decl(immutable.ts, 82, 46)) +>collections : Symbol(collections, Decl(immutable.ts, 83, 10)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->K : Symbol(K, Decl(immutable.d.ts, 72, 23)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) ->key : Symbol(key, Decl(immutable.d.ts, 83, 53)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>K : Symbol(K, Decl(immutable.ts, 72, 23)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) +>key : Symbol(key, Decl(immutable.ts, 83, 53)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) mergeWith(merger: (oldVal: V, newVal: V, key: K) => V, ...collections: Array | {[key: string]: V}>): this; ->mergeWith : Symbol(Map.mergeWith, Decl(immutable.d.ts, 83, 78)) ->merger : Symbol(merger, Decl(immutable.d.ts, 84, 14)) ->oldVal : Symbol(oldVal, Decl(immutable.d.ts, 84, 23)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) ->newVal : Symbol(newVal, Decl(immutable.d.ts, 84, 33)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) ->key : Symbol(key, Decl(immutable.d.ts, 84, 44)) ->K : Symbol(K, Decl(immutable.d.ts, 72, 23)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) ->collections : Symbol(collections, Decl(immutable.d.ts, 84, 58)) +>mergeWith : Symbol(Map.mergeWith, Decl(immutable.ts, 83, 78)) +>merger : Symbol(merger, Decl(immutable.ts, 84, 14)) +>oldVal : Symbol(oldVal, Decl(immutable.ts, 84, 23)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) +>newVal : Symbol(newVal, Decl(immutable.ts, 84, 33)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) +>key : Symbol(key, Decl(immutable.ts, 84, 44)) +>K : Symbol(K, Decl(immutable.ts, 72, 23)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) +>collections : Symbol(collections, Decl(immutable.ts, 84, 58)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->K : Symbol(K, Decl(immutable.d.ts, 72, 23)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) ->key : Symbol(key, Decl(immutable.d.ts, 84, 102)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>K : Symbol(K, Decl(immutable.ts, 72, 23)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) +>key : Symbol(key, Decl(immutable.ts, 84, 102)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) mergeDeep(...collections: Array | {[key: string]: V}>): this; ->mergeDeep : Symbol(Map.mergeDeep, Decl(immutable.d.ts, 84, 127)) ->collections : Symbol(collections, Decl(immutable.d.ts, 85, 14)) +>mergeDeep : Symbol(Map.mergeDeep, Decl(immutable.ts, 84, 127)) +>collections : Symbol(collections, Decl(immutable.ts, 85, 14)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->K : Symbol(K, Decl(immutable.d.ts, 72, 23)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) ->key : Symbol(key, Decl(immutable.d.ts, 85, 57)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>K : Symbol(K, Decl(immutable.ts, 72, 23)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) +>key : Symbol(key, Decl(immutable.ts, 85, 57)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) mergeDeepWith(merger: (oldVal: V, newVal: V, key: K) => V, ...collections: Array | {[key: string]: V}>): this; ->mergeDeepWith : Symbol(Map.mergeDeepWith, Decl(immutable.d.ts, 85, 82)) ->merger : Symbol(merger, Decl(immutable.d.ts, 86, 18)) ->oldVal : Symbol(oldVal, Decl(immutable.d.ts, 86, 27)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) ->newVal : Symbol(newVal, Decl(immutable.d.ts, 86, 37)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) ->key : Symbol(key, Decl(immutable.d.ts, 86, 48)) ->K : Symbol(K, Decl(immutable.d.ts, 72, 23)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) ->collections : Symbol(collections, Decl(immutable.d.ts, 86, 62)) +>mergeDeepWith : Symbol(Map.mergeDeepWith, Decl(immutable.ts, 85, 82)) +>merger : Symbol(merger, Decl(immutable.ts, 86, 18)) +>oldVal : Symbol(oldVal, Decl(immutable.ts, 86, 27)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) +>newVal : Symbol(newVal, Decl(immutable.ts, 86, 37)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) +>key : Symbol(key, Decl(immutable.ts, 86, 48)) +>K : Symbol(K, Decl(immutable.ts, 72, 23)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) +>collections : Symbol(collections, Decl(immutable.ts, 86, 62)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->K : Symbol(K, Decl(immutable.d.ts, 72, 23)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) ->key : Symbol(key, Decl(immutable.d.ts, 86, 106)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>K : Symbol(K, Decl(immutable.ts, 72, 23)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) +>key : Symbol(key, Decl(immutable.ts, 86, 106)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) // Deep persistent changes setIn(keyPath: Iterable, value: any): this; ->setIn : Symbol(Map.setIn, Decl(immutable.d.ts, 86, 131)) ->keyPath : Symbol(keyPath, Decl(immutable.d.ts, 88, 10)) +>setIn : Symbol(Map.setIn, Decl(immutable.ts, 86, 131)) +>keyPath : Symbol(keyPath, Decl(immutable.ts, 88, 10)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->value : Symbol(value, Decl(immutable.d.ts, 88, 33)) +>value : Symbol(value, Decl(immutable.ts, 88, 33)) deleteIn(keyPath: Iterable): this; ->deleteIn : Symbol(Map.deleteIn, Decl(immutable.d.ts, 88, 52)) ->keyPath : Symbol(keyPath, Decl(immutable.d.ts, 89, 13)) +>deleteIn : Symbol(Map.deleteIn, Decl(immutable.ts, 88, 52)) +>keyPath : Symbol(keyPath, Decl(immutable.ts, 89, 13)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) removeIn(keyPath: Iterable): this; ->removeIn : Symbol(Map.removeIn, Decl(immutable.d.ts, 89, 43)) ->keyPath : Symbol(keyPath, Decl(immutable.d.ts, 90, 13)) +>removeIn : Symbol(Map.removeIn, Decl(immutable.ts, 89, 43)) +>keyPath : Symbol(keyPath, Decl(immutable.ts, 90, 13)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) updateIn(keyPath: Iterable, notSetValue: any, updater: (value: any) => any): this; ->updateIn : Symbol(Map.updateIn, Decl(immutable.d.ts, 90, 43), Decl(immutable.d.ts, 91, 91)) ->keyPath : Symbol(keyPath, Decl(immutable.d.ts, 91, 13)) +>updateIn : Symbol(Map.updateIn, Decl(immutable.ts, 90, 43), Decl(immutable.ts, 91, 91)) +>keyPath : Symbol(keyPath, Decl(immutable.ts, 91, 13)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->notSetValue : Symbol(notSetValue, Decl(immutable.d.ts, 91, 36)) ->updater : Symbol(updater, Decl(immutable.d.ts, 91, 54)) ->value : Symbol(value, Decl(immutable.d.ts, 91, 65)) +>notSetValue : Symbol(notSetValue, Decl(immutable.ts, 91, 36)) +>updater : Symbol(updater, Decl(immutable.ts, 91, 54)) +>value : Symbol(value, Decl(immutable.ts, 91, 65)) updateIn(keyPath: Iterable, updater: (value: any) => any): this; ->updateIn : Symbol(Map.updateIn, Decl(immutable.d.ts, 90, 43), Decl(immutable.d.ts, 91, 91)) ->keyPath : Symbol(keyPath, Decl(immutable.d.ts, 92, 13)) +>updateIn : Symbol(Map.updateIn, Decl(immutable.ts, 90, 43), Decl(immutable.ts, 91, 91)) +>keyPath : Symbol(keyPath, Decl(immutable.ts, 92, 13)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->updater : Symbol(updater, Decl(immutable.d.ts, 92, 36)) ->value : Symbol(value, Decl(immutable.d.ts, 92, 47)) +>updater : Symbol(updater, Decl(immutable.ts, 92, 36)) +>value : Symbol(value, Decl(immutable.ts, 92, 47)) mergeIn(keyPath: Iterable, ...collections: Array): this; ->mergeIn : Symbol(Map.mergeIn, Decl(immutable.d.ts, 92, 73)) ->keyPath : Symbol(keyPath, Decl(immutable.d.ts, 93, 12)) +>mergeIn : Symbol(Map.mergeIn, Decl(immutable.ts, 92, 73)) +>keyPath : Symbol(keyPath, Decl(immutable.ts, 93, 12)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->collections : Symbol(collections, Decl(immutable.d.ts, 93, 35)) +>collections : Symbol(collections, Decl(immutable.ts, 93, 35)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) mergeDeepIn(keyPath: Iterable, ...collections: Array): this; ->mergeDeepIn : Symbol(Map.mergeDeepIn, Decl(immutable.d.ts, 93, 70)) ->keyPath : Symbol(keyPath, Decl(immutable.d.ts, 94, 16)) +>mergeDeepIn : Symbol(Map.mergeDeepIn, Decl(immutable.ts, 93, 70)) +>keyPath : Symbol(keyPath, Decl(immutable.ts, 94, 16)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->collections : Symbol(collections, Decl(immutable.d.ts, 94, 39)) +>collections : Symbol(collections, Decl(immutable.ts, 94, 39)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) // Transient changes withMutations(mutator: (mutable: this) => any): this; ->withMutations : Symbol(Map.withMutations, Decl(immutable.d.ts, 94, 74)) ->mutator : Symbol(mutator, Decl(immutable.d.ts, 96, 18)) ->mutable : Symbol(mutable, Decl(immutable.d.ts, 96, 28)) +>withMutations : Symbol(Map.withMutations, Decl(immutable.ts, 94, 74)) +>mutator : Symbol(mutator, Decl(immutable.ts, 96, 18)) +>mutable : Symbol(mutable, Decl(immutable.ts, 96, 28)) asMutable(): this; ->asMutable : Symbol(Map.asMutable, Decl(immutable.d.ts, 96, 57)) +>asMutable : Symbol(Map.asMutable, Decl(immutable.ts, 96, 57)) asImmutable(): this; ->asImmutable : Symbol(Map.asImmutable, Decl(immutable.d.ts, 97, 22)) +>asImmutable : Symbol(Map.asImmutable, Decl(immutable.ts, 97, 22)) // Sequence algorithms concat(...collections: Array>): Map; ->concat : Symbol(Map.concat, Decl(immutable.d.ts, 98, 24), Decl(immutable.d.ts, 100, 83)) ->KC : Symbol(KC, Decl(immutable.d.ts, 100, 11)) ->VC : Symbol(VC, Decl(immutable.d.ts, 100, 14)) ->collections : Symbol(collections, Decl(immutable.d.ts, 100, 19)) +>concat : Symbol(Map.concat, Decl(immutable.ts, 98, 24), Decl(immutable.ts, 100, 83)) +>KC : Symbol(KC, Decl(immutable.ts, 100, 11)) +>VC : Symbol(VC, Decl(immutable.ts, 100, 14)) +>collections : Symbol(collections, Decl(immutable.ts, 100, 19)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->KC : Symbol(KC, Decl(immutable.d.ts, 100, 11)) ->VC : Symbol(VC, Decl(immutable.d.ts, 100, 14)) ->Map : Symbol(Map, Decl(immutable.d.ts, 62, 3), Decl(immutable.d.ts, 66, 3), Decl(immutable.d.ts, 67, 69), Decl(immutable.d.ts, 68, 71), Decl(immutable.d.ts, 69, 66) ... and 2 more) ->K : Symbol(K, Decl(immutable.d.ts, 72, 23)) ->KC : Symbol(KC, Decl(immutable.d.ts, 100, 11)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) ->VC : Symbol(VC, Decl(immutable.d.ts, 100, 14)) +>KC : Symbol(KC, Decl(immutable.ts, 100, 11)) +>VC : Symbol(VC, Decl(immutable.ts, 100, 14)) +>Map : Symbol(Map, Decl(immutable.ts, 62, 3), Decl(immutable.ts, 66, 3), Decl(immutable.ts, 67, 69), Decl(immutable.ts, 68, 71), Decl(immutable.ts, 69, 66) ... and 2 more) +>K : Symbol(K, Decl(immutable.ts, 72, 23)) +>KC : Symbol(KC, Decl(immutable.ts, 100, 11)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) +>VC : Symbol(VC, Decl(immutable.ts, 100, 14)) concat(...collections: Array<{[key: string]: C}>): Map; ->concat : Symbol(Map.concat, Decl(immutable.d.ts, 98, 24), Decl(immutable.d.ts, 100, 83)) ->C : Symbol(C, Decl(immutable.d.ts, 101, 11)) ->collections : Symbol(collections, Decl(immutable.d.ts, 101, 14)) +>concat : Symbol(Map.concat, Decl(immutable.ts, 98, 24), Decl(immutable.ts, 100, 83)) +>C : Symbol(C, Decl(immutable.ts, 101, 11)) +>collections : Symbol(collections, Decl(immutable.ts, 101, 14)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->key : Symbol(key, Decl(immutable.d.ts, 101, 38)) ->C : Symbol(C, Decl(immutable.d.ts, 101, 11)) ->Map : Symbol(Map, Decl(immutable.d.ts, 62, 3), Decl(immutable.d.ts, 66, 3), Decl(immutable.d.ts, 67, 69), Decl(immutable.d.ts, 68, 71), Decl(immutable.d.ts, 69, 66) ... and 2 more) ->K : Symbol(K, Decl(immutable.d.ts, 72, 23)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) ->C : Symbol(C, Decl(immutable.d.ts, 101, 11)) +>key : Symbol(key, Decl(immutable.ts, 101, 38)) +>C : Symbol(C, Decl(immutable.ts, 101, 11)) +>Map : Symbol(Map, Decl(immutable.ts, 62, 3), Decl(immutable.ts, 66, 3), Decl(immutable.ts, 67, 69), Decl(immutable.ts, 68, 71), Decl(immutable.ts, 69, 66) ... and 2 more) +>K : Symbol(K, Decl(immutable.ts, 72, 23)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) +>C : Symbol(C, Decl(immutable.ts, 101, 11)) map(mapper: (value: V, key: K, iter: this) => M, context?: any): Map; ->map : Symbol(Map.map, Decl(immutable.d.ts, 101, 81)) ->M : Symbol(M, Decl(immutable.d.ts, 102, 8)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 102, 11)) ->value : Symbol(value, Decl(immutable.d.ts, 102, 20)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) ->key : Symbol(key, Decl(immutable.d.ts, 102, 29)) ->K : Symbol(K, Decl(immutable.d.ts, 72, 23)) ->iter : Symbol(iter, Decl(immutable.d.ts, 102, 37)) ->M : Symbol(M, Decl(immutable.d.ts, 102, 8)) ->context : Symbol(context, Decl(immutable.d.ts, 102, 55)) ->Map : Symbol(Map, Decl(immutable.d.ts, 62, 3), Decl(immutable.d.ts, 66, 3), Decl(immutable.d.ts, 67, 69), Decl(immutable.d.ts, 68, 71), Decl(immutable.d.ts, 69, 66) ... and 2 more) ->K : Symbol(K, Decl(immutable.d.ts, 72, 23)) ->M : Symbol(M, Decl(immutable.d.ts, 102, 8)) +>map : Symbol(Map.map, Decl(immutable.ts, 101, 81)) +>M : Symbol(M, Decl(immutable.ts, 102, 8)) +>mapper : Symbol(mapper, Decl(immutable.ts, 102, 11)) +>value : Symbol(value, Decl(immutable.ts, 102, 20)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) +>key : Symbol(key, Decl(immutable.ts, 102, 29)) +>K : Symbol(K, Decl(immutable.ts, 72, 23)) +>iter : Symbol(iter, Decl(immutable.ts, 102, 37)) +>M : Symbol(M, Decl(immutable.ts, 102, 8)) +>context : Symbol(context, Decl(immutable.ts, 102, 55)) +>Map : Symbol(Map, Decl(immutable.ts, 62, 3), Decl(immutable.ts, 66, 3), Decl(immutable.ts, 67, 69), Decl(immutable.ts, 68, 71), Decl(immutable.ts, 69, 66) ... and 2 more) +>K : Symbol(K, Decl(immutable.ts, 72, 23)) +>M : Symbol(M, Decl(immutable.ts, 102, 8)) mapKeys(mapper: (key: K, value: V, iter: this) => M, context?: any): Map; ->mapKeys : Symbol(Map.mapKeys, Decl(immutable.d.ts, 102, 82)) ->M : Symbol(M, Decl(immutable.d.ts, 103, 12)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 103, 15)) ->key : Symbol(key, Decl(immutable.d.ts, 103, 24)) ->K : Symbol(K, Decl(immutable.d.ts, 72, 23)) ->value : Symbol(value, Decl(immutable.d.ts, 103, 31)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) ->iter : Symbol(iter, Decl(immutable.d.ts, 103, 41)) ->M : Symbol(M, Decl(immutable.d.ts, 103, 12)) ->context : Symbol(context, Decl(immutable.d.ts, 103, 59)) ->Map : Symbol(Map, Decl(immutable.d.ts, 62, 3), Decl(immutable.d.ts, 66, 3), Decl(immutable.d.ts, 67, 69), Decl(immutable.d.ts, 68, 71), Decl(immutable.d.ts, 69, 66) ... and 2 more) ->M : Symbol(M, Decl(immutable.d.ts, 103, 12)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) +>mapKeys : Symbol(Map.mapKeys, Decl(immutable.ts, 102, 82)) +>M : Symbol(M, Decl(immutable.ts, 103, 12)) +>mapper : Symbol(mapper, Decl(immutable.ts, 103, 15)) +>key : Symbol(key, Decl(immutable.ts, 103, 24)) +>K : Symbol(K, Decl(immutable.ts, 72, 23)) +>value : Symbol(value, Decl(immutable.ts, 103, 31)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) +>iter : Symbol(iter, Decl(immutable.ts, 103, 41)) +>M : Symbol(M, Decl(immutable.ts, 103, 12)) +>context : Symbol(context, Decl(immutable.ts, 103, 59)) +>Map : Symbol(Map, Decl(immutable.ts, 62, 3), Decl(immutable.ts, 66, 3), Decl(immutable.ts, 67, 69), Decl(immutable.ts, 68, 71), Decl(immutable.ts, 69, 66) ... and 2 more) +>M : Symbol(M, Decl(immutable.ts, 103, 12)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) mapEntries(mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: any): Map; ->mapEntries : Symbol(Map.mapEntries, Decl(immutable.d.ts, 103, 86)) ->KM : Symbol(KM, Decl(immutable.d.ts, 104, 15)) ->VM : Symbol(VM, Decl(immutable.d.ts, 104, 18)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 104, 23)) ->entry : Symbol(entry, Decl(immutable.d.ts, 104, 32)) ->K : Symbol(K, Decl(immutable.d.ts, 72, 23)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) ->index : Symbol(index, Decl(immutable.d.ts, 104, 46)) ->iter : Symbol(iter, Decl(immutable.d.ts, 104, 61)) ->KM : Symbol(KM, Decl(immutable.d.ts, 104, 15)) ->VM : Symbol(VM, Decl(immutable.d.ts, 104, 18)) ->context : Symbol(context, Decl(immutable.d.ts, 104, 86)) ->Map : Symbol(Map, Decl(immutable.d.ts, 62, 3), Decl(immutable.d.ts, 66, 3), Decl(immutable.d.ts, 67, 69), Decl(immutable.d.ts, 68, 71), Decl(immutable.d.ts, 69, 66) ... and 2 more) ->KM : Symbol(KM, Decl(immutable.d.ts, 104, 15)) ->VM : Symbol(VM, Decl(immutable.d.ts, 104, 18)) +>mapEntries : Symbol(Map.mapEntries, Decl(immutable.ts, 103, 86)) +>KM : Symbol(KM, Decl(immutable.ts, 104, 15)) +>VM : Symbol(VM, Decl(immutable.ts, 104, 18)) +>mapper : Symbol(mapper, Decl(immutable.ts, 104, 23)) +>entry : Symbol(entry, Decl(immutable.ts, 104, 32)) +>K : Symbol(K, Decl(immutable.ts, 72, 23)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) +>index : Symbol(index, Decl(immutable.ts, 104, 46)) +>iter : Symbol(iter, Decl(immutable.ts, 104, 61)) +>KM : Symbol(KM, Decl(immutable.ts, 104, 15)) +>VM : Symbol(VM, Decl(immutable.ts, 104, 18)) +>context : Symbol(context, Decl(immutable.ts, 104, 86)) +>Map : Symbol(Map, Decl(immutable.ts, 62, 3), Decl(immutable.ts, 66, 3), Decl(immutable.ts, 67, 69), Decl(immutable.ts, 68, 71), Decl(immutable.ts, 69, 66) ... and 2 more) +>KM : Symbol(KM, Decl(immutable.ts, 104, 15)) +>VM : Symbol(VM, Decl(immutable.ts, 104, 18)) flatMap(mapper: (value: V, key: K, iter: this) => Iterable, context?: any): Map; ->flatMap : Symbol(Map.flatMap, Decl(immutable.d.ts, 104, 115)) ->M : Symbol(M, Decl(immutable.d.ts, 105, 12)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 105, 15)) ->value : Symbol(value, Decl(immutable.d.ts, 105, 24)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) ->key : Symbol(key, Decl(immutable.d.ts, 105, 33)) ->K : Symbol(K, Decl(immutable.d.ts, 72, 23)) ->iter : Symbol(iter, Decl(immutable.d.ts, 105, 41)) +>flatMap : Symbol(Map.flatMap, Decl(immutable.ts, 104, 115)) +>M : Symbol(M, Decl(immutable.ts, 105, 12)) +>mapper : Symbol(mapper, Decl(immutable.ts, 105, 15)) +>value : Symbol(value, Decl(immutable.ts, 105, 24)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) +>key : Symbol(key, Decl(immutable.ts, 105, 33)) +>K : Symbol(K, Decl(immutable.ts, 72, 23)) +>iter : Symbol(iter, Decl(immutable.ts, 105, 41)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->M : Symbol(M, Decl(immutable.d.ts, 105, 12)) ->context : Symbol(context, Decl(immutable.d.ts, 105, 69)) ->Map : Symbol(Map, Decl(immutable.d.ts, 62, 3), Decl(immutable.d.ts, 66, 3), Decl(immutable.d.ts, 67, 69), Decl(immutable.d.ts, 68, 71), Decl(immutable.d.ts, 69, 66) ... and 2 more) +>M : Symbol(M, Decl(immutable.ts, 105, 12)) +>context : Symbol(context, Decl(immutable.ts, 105, 69)) +>Map : Symbol(Map, Decl(immutable.ts, 62, 3), Decl(immutable.ts, 66, 3), Decl(immutable.ts, 67, 69), Decl(immutable.ts, 68, 71), Decl(immutable.ts, 69, 66) ... and 2 more) filter(predicate: (value: V, key: K, iter: this) => value is F, context?: any): Map; ->filter : Symbol(Map.filter, Decl(immutable.d.ts, 105, 100), Decl(immutable.d.ts, 106, 107)) ->F : Symbol(F, Decl(immutable.d.ts, 106, 11)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 106, 24)) ->value : Symbol(value, Decl(immutable.d.ts, 106, 36)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) ->key : Symbol(key, Decl(immutable.d.ts, 106, 45)) ->K : Symbol(K, Decl(immutable.d.ts, 72, 23)) ->iter : Symbol(iter, Decl(immutable.d.ts, 106, 53)) ->value : Symbol(value, Decl(immutable.d.ts, 106, 36)) ->F : Symbol(F, Decl(immutable.d.ts, 106, 11)) ->context : Symbol(context, Decl(immutable.d.ts, 106, 80)) ->Map : Symbol(Map, Decl(immutable.d.ts, 62, 3), Decl(immutable.d.ts, 66, 3), Decl(immutable.d.ts, 67, 69), Decl(immutable.d.ts, 68, 71), Decl(immutable.d.ts, 69, 66) ... and 2 more) ->K : Symbol(K, Decl(immutable.d.ts, 72, 23)) ->F : Symbol(F, Decl(immutable.d.ts, 106, 11)) +>filter : Symbol(Map.filter, Decl(immutable.ts, 105, 100), Decl(immutable.ts, 106, 107)) +>F : Symbol(F, Decl(immutable.ts, 106, 11)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) +>predicate : Symbol(predicate, Decl(immutable.ts, 106, 24)) +>value : Symbol(value, Decl(immutable.ts, 106, 36)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) +>key : Symbol(key, Decl(immutable.ts, 106, 45)) +>K : Symbol(K, Decl(immutable.ts, 72, 23)) +>iter : Symbol(iter, Decl(immutable.ts, 106, 53)) +>value : Symbol(value, Decl(immutable.ts, 106, 36)) +>F : Symbol(F, Decl(immutable.ts, 106, 11)) +>context : Symbol(context, Decl(immutable.ts, 106, 80)) +>Map : Symbol(Map, Decl(immutable.ts, 62, 3), Decl(immutable.ts, 66, 3), Decl(immutable.ts, 67, 69), Decl(immutable.ts, 68, 71), Decl(immutable.ts, 69, 66) ... and 2 more) +>K : Symbol(K, Decl(immutable.ts, 72, 23)) +>F : Symbol(F, Decl(immutable.ts, 106, 11)) filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this; ->filter : Symbol(Map.filter, Decl(immutable.d.ts, 105, 100), Decl(immutable.d.ts, 106, 107)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 107, 11)) ->value : Symbol(value, Decl(immutable.d.ts, 107, 23)) ->V : Symbol(V, Decl(immutable.d.ts, 72, 25)) ->key : Symbol(key, Decl(immutable.d.ts, 107, 32)) ->K : Symbol(K, Decl(immutable.d.ts, 72, 23)) ->iter : Symbol(iter, Decl(immutable.d.ts, 107, 40)) ->context : Symbol(context, Decl(immutable.d.ts, 107, 60)) +>filter : Symbol(Map.filter, Decl(immutable.ts, 105, 100), Decl(immutable.ts, 106, 107)) +>predicate : Symbol(predicate, Decl(immutable.ts, 107, 11)) +>value : Symbol(value, Decl(immutable.ts, 107, 23)) +>V : Symbol(V, Decl(immutable.ts, 72, 25)) +>key : Symbol(key, Decl(immutable.ts, 107, 32)) +>K : Symbol(K, Decl(immutable.ts, 72, 23)) +>iter : Symbol(iter, Decl(immutable.ts, 107, 40)) +>context : Symbol(context, Decl(immutable.ts, 107, 60)) } export module OrderedMap { ->OrderedMap : Symbol(OrderedMap, Decl(immutable.d.ts, 108, 3), Decl(immutable.d.ts, 111, 3), Decl(immutable.d.ts, 112, 83), Decl(immutable.d.ts, 113, 85), Decl(immutable.d.ts, 114, 80) ... and 2 more) +>OrderedMap : Symbol(OrderedMap, Decl(immutable.ts, 108, 3), Decl(immutable.ts, 111, 3), Decl(immutable.ts, 112, 83), Decl(immutable.ts, 113, 85), Decl(immutable.ts, 114, 80) ... and 2 more) function isOrderedMap(maybeOrderedMap: any): maybeOrderedMap is OrderedMap; ->isOrderedMap : Symbol(isOrderedMap, Decl(immutable.d.ts, 109, 28)) ->maybeOrderedMap : Symbol(maybeOrderedMap, Decl(immutable.d.ts, 110, 26)) ->maybeOrderedMap : Symbol(maybeOrderedMap, Decl(immutable.d.ts, 110, 26)) ->OrderedMap : Symbol(OrderedMap, Decl(immutable.d.ts, 108, 3), Decl(immutable.d.ts, 111, 3), Decl(immutable.d.ts, 112, 83), Decl(immutable.d.ts, 113, 85), Decl(immutable.d.ts, 114, 80) ... and 2 more) +>isOrderedMap : Symbol(isOrderedMap, Decl(immutable.ts, 109, 28)) +>maybeOrderedMap : Symbol(maybeOrderedMap, Decl(immutable.ts, 110, 26)) +>maybeOrderedMap : Symbol(maybeOrderedMap, Decl(immutable.ts, 110, 26)) +>OrderedMap : Symbol(OrderedMap, Decl(immutable.ts, 108, 3), Decl(immutable.ts, 111, 3), Decl(immutable.ts, 112, 83), Decl(immutable.ts, 113, 85), Decl(immutable.ts, 114, 80) ... and 2 more) } export function OrderedMap(collection: Iterable<[K, V]>): OrderedMap; ->OrderedMap : Symbol(OrderedMap, Decl(immutable.d.ts, 108, 3), Decl(immutable.d.ts, 111, 3), Decl(immutable.d.ts, 112, 83), Decl(immutable.d.ts, 113, 85), Decl(immutable.d.ts, 114, 80) ... and 2 more) ->K : Symbol(K, Decl(immutable.d.ts, 112, 29)) ->V : Symbol(V, Decl(immutable.d.ts, 112, 31)) ->collection : Symbol(collection, Decl(immutable.d.ts, 112, 35)) +>OrderedMap : Symbol(OrderedMap, Decl(immutable.ts, 108, 3), Decl(immutable.ts, 111, 3), Decl(immutable.ts, 112, 83), Decl(immutable.ts, 113, 85), Decl(immutable.ts, 114, 80) ... and 2 more) +>K : Symbol(K, Decl(immutable.ts, 112, 29)) +>V : Symbol(V, Decl(immutable.ts, 112, 31)) +>collection : Symbol(collection, Decl(immutable.ts, 112, 35)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->K : Symbol(K, Decl(immutable.d.ts, 112, 29)) ->V : Symbol(V, Decl(immutable.d.ts, 112, 31)) ->OrderedMap : Symbol(OrderedMap, Decl(immutable.d.ts, 108, 3), Decl(immutable.d.ts, 111, 3), Decl(immutable.d.ts, 112, 83), Decl(immutable.d.ts, 113, 85), Decl(immutable.d.ts, 114, 80) ... and 2 more) ->K : Symbol(K, Decl(immutable.d.ts, 112, 29)) ->V : Symbol(V, Decl(immutable.d.ts, 112, 31)) +>K : Symbol(K, Decl(immutable.ts, 112, 29)) +>V : Symbol(V, Decl(immutable.ts, 112, 31)) +>OrderedMap : Symbol(OrderedMap, Decl(immutable.ts, 108, 3), Decl(immutable.ts, 111, 3), Decl(immutable.ts, 112, 83), Decl(immutable.ts, 113, 85), Decl(immutable.ts, 114, 80) ... and 2 more) +>K : Symbol(K, Decl(immutable.ts, 112, 29)) +>V : Symbol(V, Decl(immutable.ts, 112, 31)) export function OrderedMap(collection: Iterable>): OrderedMap; ->OrderedMap : Symbol(OrderedMap, Decl(immutable.d.ts, 108, 3), Decl(immutable.d.ts, 111, 3), Decl(immutable.d.ts, 112, 83), Decl(immutable.d.ts, 113, 85), Decl(immutable.d.ts, 114, 80) ... and 2 more) ->T : Symbol(T, Decl(immutable.d.ts, 113, 29)) ->collection : Symbol(collection, Decl(immutable.d.ts, 113, 32)) +>OrderedMap : Symbol(OrderedMap, Decl(immutable.ts, 108, 3), Decl(immutable.ts, 111, 3), Decl(immutable.ts, 112, 83), Decl(immutable.ts, 113, 85), Decl(immutable.ts, 114, 80) ... and 2 more) +>T : Symbol(T, Decl(immutable.ts, 113, 29)) +>collection : Symbol(collection, Decl(immutable.ts, 113, 32)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 113, 29)) ->OrderedMap : Symbol(OrderedMap, Decl(immutable.d.ts, 108, 3), Decl(immutable.d.ts, 111, 3), Decl(immutable.d.ts, 112, 83), Decl(immutable.d.ts, 113, 85), Decl(immutable.d.ts, 114, 80) ... and 2 more) ->T : Symbol(T, Decl(immutable.d.ts, 113, 29)) ->T : Symbol(T, Decl(immutable.d.ts, 113, 29)) +>T : Symbol(T, Decl(immutable.ts, 113, 29)) +>OrderedMap : Symbol(OrderedMap, Decl(immutable.ts, 108, 3), Decl(immutable.ts, 111, 3), Decl(immutable.ts, 112, 83), Decl(immutable.ts, 113, 85), Decl(immutable.ts, 114, 80) ... and 2 more) +>T : Symbol(T, Decl(immutable.ts, 113, 29)) +>T : Symbol(T, Decl(immutable.ts, 113, 29)) export function OrderedMap(obj: {[key: string]: V}): OrderedMap; ->OrderedMap : Symbol(OrderedMap, Decl(immutable.d.ts, 108, 3), Decl(immutable.d.ts, 111, 3), Decl(immutable.d.ts, 112, 83), Decl(immutable.d.ts, 113, 85), Decl(immutable.d.ts, 114, 80) ... and 2 more) ->V : Symbol(V, Decl(immutable.d.ts, 114, 29)) ->obj : Symbol(obj, Decl(immutable.d.ts, 114, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 114, 39)) ->V : Symbol(V, Decl(immutable.d.ts, 114, 29)) ->OrderedMap : Symbol(OrderedMap, Decl(immutable.d.ts, 108, 3), Decl(immutable.d.ts, 111, 3), Decl(immutable.d.ts, 112, 83), Decl(immutable.d.ts, 113, 85), Decl(immutable.d.ts, 114, 80) ... and 2 more) ->V : Symbol(V, Decl(immutable.d.ts, 114, 29)) +>OrderedMap : Symbol(OrderedMap, Decl(immutable.ts, 108, 3), Decl(immutable.ts, 111, 3), Decl(immutable.ts, 112, 83), Decl(immutable.ts, 113, 85), Decl(immutable.ts, 114, 80) ... and 2 more) +>V : Symbol(V, Decl(immutable.ts, 114, 29)) +>obj : Symbol(obj, Decl(immutable.ts, 114, 32)) +>key : Symbol(key, Decl(immutable.ts, 114, 39)) +>V : Symbol(V, Decl(immutable.ts, 114, 29)) +>OrderedMap : Symbol(OrderedMap, Decl(immutable.ts, 108, 3), Decl(immutable.ts, 111, 3), Decl(immutable.ts, 112, 83), Decl(immutable.ts, 113, 85), Decl(immutable.ts, 114, 80) ... and 2 more) +>V : Symbol(V, Decl(immutable.ts, 114, 29)) export function OrderedMap(): OrderedMap; ->OrderedMap : Symbol(OrderedMap, Decl(immutable.d.ts, 108, 3), Decl(immutable.d.ts, 111, 3), Decl(immutable.d.ts, 112, 83), Decl(immutable.d.ts, 113, 85), Decl(immutable.d.ts, 114, 80) ... and 2 more) ->K : Symbol(K, Decl(immutable.d.ts, 115, 29)) ->V : Symbol(V, Decl(immutable.d.ts, 115, 31)) ->OrderedMap : Symbol(OrderedMap, Decl(immutable.d.ts, 108, 3), Decl(immutable.d.ts, 111, 3), Decl(immutable.d.ts, 112, 83), Decl(immutable.d.ts, 113, 85), Decl(immutable.d.ts, 114, 80) ... and 2 more) ->K : Symbol(K, Decl(immutable.d.ts, 115, 29)) ->V : Symbol(V, Decl(immutable.d.ts, 115, 31)) +>OrderedMap : Symbol(OrderedMap, Decl(immutable.ts, 108, 3), Decl(immutable.ts, 111, 3), Decl(immutable.ts, 112, 83), Decl(immutable.ts, 113, 85), Decl(immutable.ts, 114, 80) ... and 2 more) +>K : Symbol(K, Decl(immutable.ts, 115, 29)) +>V : Symbol(V, Decl(immutable.ts, 115, 31)) +>OrderedMap : Symbol(OrderedMap, Decl(immutable.ts, 108, 3), Decl(immutable.ts, 111, 3), Decl(immutable.ts, 112, 83), Decl(immutable.ts, 113, 85), Decl(immutable.ts, 114, 80) ... and 2 more) +>K : Symbol(K, Decl(immutable.ts, 115, 29)) +>V : Symbol(V, Decl(immutable.ts, 115, 31)) export function OrderedMap(): OrderedMap; ->OrderedMap : Symbol(OrderedMap, Decl(immutable.d.ts, 108, 3), Decl(immutable.d.ts, 111, 3), Decl(immutable.d.ts, 112, 83), Decl(immutable.d.ts, 113, 85), Decl(immutable.d.ts, 114, 80) ... and 2 more) ->OrderedMap : Symbol(OrderedMap, Decl(immutable.d.ts, 108, 3), Decl(immutable.d.ts, 111, 3), Decl(immutable.d.ts, 112, 83), Decl(immutable.d.ts, 113, 85), Decl(immutable.d.ts, 114, 80) ... and 2 more) +>OrderedMap : Symbol(OrderedMap, Decl(immutable.ts, 108, 3), Decl(immutable.ts, 111, 3), Decl(immutable.ts, 112, 83), Decl(immutable.ts, 113, 85), Decl(immutable.ts, 114, 80) ... and 2 more) +>OrderedMap : Symbol(OrderedMap, Decl(immutable.ts, 108, 3), Decl(immutable.ts, 111, 3), Decl(immutable.ts, 112, 83), Decl(immutable.ts, 113, 85), Decl(immutable.ts, 114, 80) ... and 2 more) export interface OrderedMap extends Map { ->OrderedMap : Symbol(OrderedMap, Decl(immutable.d.ts, 108, 3), Decl(immutable.d.ts, 111, 3), Decl(immutable.d.ts, 112, 83), Decl(immutable.d.ts, 113, 85), Decl(immutable.d.ts, 114, 80) ... and 2 more) ->K : Symbol(K, Decl(immutable.d.ts, 117, 30)) ->V : Symbol(V, Decl(immutable.d.ts, 117, 32)) ->Map : Symbol(Map, Decl(immutable.d.ts, 62, 3), Decl(immutable.d.ts, 66, 3), Decl(immutable.d.ts, 67, 69), Decl(immutable.d.ts, 68, 71), Decl(immutable.d.ts, 69, 66) ... and 2 more) ->K : Symbol(K, Decl(immutable.d.ts, 117, 30)) ->V : Symbol(V, Decl(immutable.d.ts, 117, 32)) +>OrderedMap : Symbol(OrderedMap, Decl(immutable.ts, 108, 3), Decl(immutable.ts, 111, 3), Decl(immutable.ts, 112, 83), Decl(immutable.ts, 113, 85), Decl(immutable.ts, 114, 80) ... and 2 more) +>K : Symbol(K, Decl(immutable.ts, 117, 30)) +>V : Symbol(V, Decl(immutable.ts, 117, 32)) +>Map : Symbol(Map, Decl(immutable.ts, 62, 3), Decl(immutable.ts, 66, 3), Decl(immutable.ts, 67, 69), Decl(immutable.ts, 68, 71), Decl(immutable.ts, 69, 66) ... and 2 more) +>K : Symbol(K, Decl(immutable.ts, 117, 30)) +>V : Symbol(V, Decl(immutable.ts, 117, 32)) // Sequence algorithms concat(...collections: Array>): OrderedMap; ->concat : Symbol(OrderedMap.concat, Decl(immutable.d.ts, 117, 55), Decl(immutable.d.ts, 119, 90)) ->KC : Symbol(KC, Decl(immutable.d.ts, 119, 11)) ->VC : Symbol(VC, Decl(immutable.d.ts, 119, 14)) ->collections : Symbol(collections, Decl(immutable.d.ts, 119, 19)) +>concat : Symbol(OrderedMap.concat, Decl(immutable.ts, 117, 55), Decl(immutable.ts, 119, 90)) +>KC : Symbol(KC, Decl(immutable.ts, 119, 11)) +>VC : Symbol(VC, Decl(immutable.ts, 119, 14)) +>collections : Symbol(collections, Decl(immutable.ts, 119, 19)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->KC : Symbol(KC, Decl(immutable.d.ts, 119, 11)) ->VC : Symbol(VC, Decl(immutable.d.ts, 119, 14)) ->OrderedMap : Symbol(OrderedMap, Decl(immutable.d.ts, 108, 3), Decl(immutable.d.ts, 111, 3), Decl(immutable.d.ts, 112, 83), Decl(immutable.d.ts, 113, 85), Decl(immutable.d.ts, 114, 80) ... and 2 more) ->K : Symbol(K, Decl(immutable.d.ts, 117, 30)) ->KC : Symbol(KC, Decl(immutable.d.ts, 119, 11)) ->V : Symbol(V, Decl(immutable.d.ts, 117, 32)) ->VC : Symbol(VC, Decl(immutable.d.ts, 119, 14)) +>KC : Symbol(KC, Decl(immutable.ts, 119, 11)) +>VC : Symbol(VC, Decl(immutable.ts, 119, 14)) +>OrderedMap : Symbol(OrderedMap, Decl(immutable.ts, 108, 3), Decl(immutable.ts, 111, 3), Decl(immutable.ts, 112, 83), Decl(immutable.ts, 113, 85), Decl(immutable.ts, 114, 80) ... and 2 more) +>K : Symbol(K, Decl(immutable.ts, 117, 30)) +>KC : Symbol(KC, Decl(immutable.ts, 119, 11)) +>V : Symbol(V, Decl(immutable.ts, 117, 32)) +>VC : Symbol(VC, Decl(immutable.ts, 119, 14)) concat(...collections: Array<{[key: string]: C}>): OrderedMap; ->concat : Symbol(OrderedMap.concat, Decl(immutable.d.ts, 117, 55), Decl(immutable.d.ts, 119, 90)) ->C : Symbol(C, Decl(immutable.d.ts, 120, 11)) ->collections : Symbol(collections, Decl(immutable.d.ts, 120, 14)) +>concat : Symbol(OrderedMap.concat, Decl(immutable.ts, 117, 55), Decl(immutable.ts, 119, 90)) +>C : Symbol(C, Decl(immutable.ts, 120, 11)) +>collections : Symbol(collections, Decl(immutable.ts, 120, 14)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->key : Symbol(key, Decl(immutable.d.ts, 120, 38)) ->C : Symbol(C, Decl(immutable.d.ts, 120, 11)) ->OrderedMap : Symbol(OrderedMap, Decl(immutable.d.ts, 108, 3), Decl(immutable.d.ts, 111, 3), Decl(immutable.d.ts, 112, 83), Decl(immutable.d.ts, 113, 85), Decl(immutable.d.ts, 114, 80) ... and 2 more) ->K : Symbol(K, Decl(immutable.d.ts, 117, 30)) ->V : Symbol(V, Decl(immutable.d.ts, 117, 32)) ->C : Symbol(C, Decl(immutable.d.ts, 120, 11)) +>key : Symbol(key, Decl(immutable.ts, 120, 38)) +>C : Symbol(C, Decl(immutable.ts, 120, 11)) +>OrderedMap : Symbol(OrderedMap, Decl(immutable.ts, 108, 3), Decl(immutable.ts, 111, 3), Decl(immutable.ts, 112, 83), Decl(immutable.ts, 113, 85), Decl(immutable.ts, 114, 80) ... and 2 more) +>K : Symbol(K, Decl(immutable.ts, 117, 30)) +>V : Symbol(V, Decl(immutable.ts, 117, 32)) +>C : Symbol(C, Decl(immutable.ts, 120, 11)) map(mapper: (value: V, key: K, iter: this) => M, context?: any): OrderedMap; ->map : Symbol(OrderedMap.map, Decl(immutable.d.ts, 120, 88)) ->M : Symbol(M, Decl(immutable.d.ts, 121, 8)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 121, 11)) ->value : Symbol(value, Decl(immutable.d.ts, 121, 20)) ->V : Symbol(V, Decl(immutable.d.ts, 117, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 121, 29)) ->K : Symbol(K, Decl(immutable.d.ts, 117, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 121, 37)) ->M : Symbol(M, Decl(immutable.d.ts, 121, 8)) ->context : Symbol(context, Decl(immutable.d.ts, 121, 55)) ->OrderedMap : Symbol(OrderedMap, Decl(immutable.d.ts, 108, 3), Decl(immutable.d.ts, 111, 3), Decl(immutable.d.ts, 112, 83), Decl(immutable.d.ts, 113, 85), Decl(immutable.d.ts, 114, 80) ... and 2 more) ->K : Symbol(K, Decl(immutable.d.ts, 117, 30)) ->M : Symbol(M, Decl(immutable.d.ts, 121, 8)) +>map : Symbol(OrderedMap.map, Decl(immutable.ts, 120, 88)) +>M : Symbol(M, Decl(immutable.ts, 121, 8)) +>mapper : Symbol(mapper, Decl(immutable.ts, 121, 11)) +>value : Symbol(value, Decl(immutable.ts, 121, 20)) +>V : Symbol(V, Decl(immutable.ts, 117, 32)) +>key : Symbol(key, Decl(immutable.ts, 121, 29)) +>K : Symbol(K, Decl(immutable.ts, 117, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 121, 37)) +>M : Symbol(M, Decl(immutable.ts, 121, 8)) +>context : Symbol(context, Decl(immutable.ts, 121, 55)) +>OrderedMap : Symbol(OrderedMap, Decl(immutable.ts, 108, 3), Decl(immutable.ts, 111, 3), Decl(immutable.ts, 112, 83), Decl(immutable.ts, 113, 85), Decl(immutable.ts, 114, 80) ... and 2 more) +>K : Symbol(K, Decl(immutable.ts, 117, 30)) +>M : Symbol(M, Decl(immutable.ts, 121, 8)) mapKeys(mapper: (key: K, value: V, iter: this) => M, context?: any): OrderedMap; ->mapKeys : Symbol(OrderedMap.mapKeys, Decl(immutable.d.ts, 121, 89)) ->M : Symbol(M, Decl(immutable.d.ts, 122, 12)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 122, 15)) ->key : Symbol(key, Decl(immutable.d.ts, 122, 24)) ->K : Symbol(K, Decl(immutable.d.ts, 117, 30)) ->value : Symbol(value, Decl(immutable.d.ts, 122, 31)) ->V : Symbol(V, Decl(immutable.d.ts, 117, 32)) ->iter : Symbol(iter, Decl(immutable.d.ts, 122, 41)) ->M : Symbol(M, Decl(immutable.d.ts, 122, 12)) ->context : Symbol(context, Decl(immutable.d.ts, 122, 59)) ->OrderedMap : Symbol(OrderedMap, Decl(immutable.d.ts, 108, 3), Decl(immutable.d.ts, 111, 3), Decl(immutable.d.ts, 112, 83), Decl(immutable.d.ts, 113, 85), Decl(immutable.d.ts, 114, 80) ... and 2 more) ->M : Symbol(M, Decl(immutable.d.ts, 122, 12)) ->V : Symbol(V, Decl(immutable.d.ts, 117, 32)) +>mapKeys : Symbol(OrderedMap.mapKeys, Decl(immutable.ts, 121, 89)) +>M : Symbol(M, Decl(immutable.ts, 122, 12)) +>mapper : Symbol(mapper, Decl(immutable.ts, 122, 15)) +>key : Symbol(key, Decl(immutable.ts, 122, 24)) +>K : Symbol(K, Decl(immutable.ts, 117, 30)) +>value : Symbol(value, Decl(immutable.ts, 122, 31)) +>V : Symbol(V, Decl(immutable.ts, 117, 32)) +>iter : Symbol(iter, Decl(immutable.ts, 122, 41)) +>M : Symbol(M, Decl(immutable.ts, 122, 12)) +>context : Symbol(context, Decl(immutable.ts, 122, 59)) +>OrderedMap : Symbol(OrderedMap, Decl(immutable.ts, 108, 3), Decl(immutable.ts, 111, 3), Decl(immutable.ts, 112, 83), Decl(immutable.ts, 113, 85), Decl(immutable.ts, 114, 80) ... and 2 more) +>M : Symbol(M, Decl(immutable.ts, 122, 12)) +>V : Symbol(V, Decl(immutable.ts, 117, 32)) mapEntries(mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: any): OrderedMap; ->mapEntries : Symbol(OrderedMap.mapEntries, Decl(immutable.d.ts, 122, 93)) ->KM : Symbol(KM, Decl(immutable.d.ts, 123, 15)) ->VM : Symbol(VM, Decl(immutable.d.ts, 123, 18)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 123, 23)) ->entry : Symbol(entry, Decl(immutable.d.ts, 123, 32)) ->K : Symbol(K, Decl(immutable.d.ts, 117, 30)) ->V : Symbol(V, Decl(immutable.d.ts, 117, 32)) ->index : Symbol(index, Decl(immutable.d.ts, 123, 46)) ->iter : Symbol(iter, Decl(immutable.d.ts, 123, 61)) ->KM : Symbol(KM, Decl(immutable.d.ts, 123, 15)) ->VM : Symbol(VM, Decl(immutable.d.ts, 123, 18)) ->context : Symbol(context, Decl(immutable.d.ts, 123, 86)) ->OrderedMap : Symbol(OrderedMap, Decl(immutable.d.ts, 108, 3), Decl(immutable.d.ts, 111, 3), Decl(immutable.d.ts, 112, 83), Decl(immutable.d.ts, 113, 85), Decl(immutable.d.ts, 114, 80) ... and 2 more) ->KM : Symbol(KM, Decl(immutable.d.ts, 123, 15)) ->VM : Symbol(VM, Decl(immutable.d.ts, 123, 18)) +>mapEntries : Symbol(OrderedMap.mapEntries, Decl(immutable.ts, 122, 93)) +>KM : Symbol(KM, Decl(immutable.ts, 123, 15)) +>VM : Symbol(VM, Decl(immutable.ts, 123, 18)) +>mapper : Symbol(mapper, Decl(immutable.ts, 123, 23)) +>entry : Symbol(entry, Decl(immutable.ts, 123, 32)) +>K : Symbol(K, Decl(immutable.ts, 117, 30)) +>V : Symbol(V, Decl(immutable.ts, 117, 32)) +>index : Symbol(index, Decl(immutable.ts, 123, 46)) +>iter : Symbol(iter, Decl(immutable.ts, 123, 61)) +>KM : Symbol(KM, Decl(immutable.ts, 123, 15)) +>VM : Symbol(VM, Decl(immutable.ts, 123, 18)) +>context : Symbol(context, Decl(immutable.ts, 123, 86)) +>OrderedMap : Symbol(OrderedMap, Decl(immutable.ts, 108, 3), Decl(immutable.ts, 111, 3), Decl(immutable.ts, 112, 83), Decl(immutable.ts, 113, 85), Decl(immutable.ts, 114, 80) ... and 2 more) +>KM : Symbol(KM, Decl(immutable.ts, 123, 15)) +>VM : Symbol(VM, Decl(immutable.ts, 123, 18)) flatMap(mapper: (value: V, key: K, iter: this) => Iterable, context?: any): OrderedMap; ->flatMap : Symbol(OrderedMap.flatMap, Decl(immutable.d.ts, 123, 122)) ->M : Symbol(M, Decl(immutable.d.ts, 124, 12)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 124, 15)) ->value : Symbol(value, Decl(immutable.d.ts, 124, 24)) ->V : Symbol(V, Decl(immutable.d.ts, 117, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 124, 33)) ->K : Symbol(K, Decl(immutable.d.ts, 117, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 124, 41)) +>flatMap : Symbol(OrderedMap.flatMap, Decl(immutable.ts, 123, 122)) +>M : Symbol(M, Decl(immutable.ts, 124, 12)) +>mapper : Symbol(mapper, Decl(immutable.ts, 124, 15)) +>value : Symbol(value, Decl(immutable.ts, 124, 24)) +>V : Symbol(V, Decl(immutable.ts, 117, 32)) +>key : Symbol(key, Decl(immutable.ts, 124, 33)) +>K : Symbol(K, Decl(immutable.ts, 117, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 124, 41)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->M : Symbol(M, Decl(immutable.d.ts, 124, 12)) ->context : Symbol(context, Decl(immutable.d.ts, 124, 69)) ->OrderedMap : Symbol(OrderedMap, Decl(immutable.d.ts, 108, 3), Decl(immutable.d.ts, 111, 3), Decl(immutable.d.ts, 112, 83), Decl(immutable.d.ts, 113, 85), Decl(immutable.d.ts, 114, 80) ... and 2 more) +>M : Symbol(M, Decl(immutable.ts, 124, 12)) +>context : Symbol(context, Decl(immutable.ts, 124, 69)) +>OrderedMap : Symbol(OrderedMap, Decl(immutable.ts, 108, 3), Decl(immutable.ts, 111, 3), Decl(immutable.ts, 112, 83), Decl(immutable.ts, 113, 85), Decl(immutable.ts, 114, 80) ... and 2 more) filter(predicate: (value: V, key: K, iter: this) => value is F, context?: any): OrderedMap; ->filter : Symbol(OrderedMap.filter, Decl(immutable.d.ts, 124, 107), Decl(immutable.d.ts, 125, 114)) ->F : Symbol(F, Decl(immutable.d.ts, 125, 11)) ->V : Symbol(V, Decl(immutable.d.ts, 117, 32)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 125, 24)) ->value : Symbol(value, Decl(immutable.d.ts, 125, 36)) ->V : Symbol(V, Decl(immutable.d.ts, 117, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 125, 45)) ->K : Symbol(K, Decl(immutable.d.ts, 117, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 125, 53)) ->value : Symbol(value, Decl(immutable.d.ts, 125, 36)) ->F : Symbol(F, Decl(immutable.d.ts, 125, 11)) ->context : Symbol(context, Decl(immutable.d.ts, 125, 80)) ->OrderedMap : Symbol(OrderedMap, Decl(immutable.d.ts, 108, 3), Decl(immutable.d.ts, 111, 3), Decl(immutable.d.ts, 112, 83), Decl(immutable.d.ts, 113, 85), Decl(immutable.d.ts, 114, 80) ... and 2 more) ->K : Symbol(K, Decl(immutable.d.ts, 117, 30)) ->F : Symbol(F, Decl(immutable.d.ts, 125, 11)) +>filter : Symbol(OrderedMap.filter, Decl(immutable.ts, 124, 107), Decl(immutable.ts, 125, 114)) +>F : Symbol(F, Decl(immutable.ts, 125, 11)) +>V : Symbol(V, Decl(immutable.ts, 117, 32)) +>predicate : Symbol(predicate, Decl(immutable.ts, 125, 24)) +>value : Symbol(value, Decl(immutable.ts, 125, 36)) +>V : Symbol(V, Decl(immutable.ts, 117, 32)) +>key : Symbol(key, Decl(immutable.ts, 125, 45)) +>K : Symbol(K, Decl(immutable.ts, 117, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 125, 53)) +>value : Symbol(value, Decl(immutable.ts, 125, 36)) +>F : Symbol(F, Decl(immutable.ts, 125, 11)) +>context : Symbol(context, Decl(immutable.ts, 125, 80)) +>OrderedMap : Symbol(OrderedMap, Decl(immutable.ts, 108, 3), Decl(immutable.ts, 111, 3), Decl(immutable.ts, 112, 83), Decl(immutable.ts, 113, 85), Decl(immutable.ts, 114, 80) ... and 2 more) +>K : Symbol(K, Decl(immutable.ts, 117, 30)) +>F : Symbol(F, Decl(immutable.ts, 125, 11)) filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this; ->filter : Symbol(OrderedMap.filter, Decl(immutable.d.ts, 124, 107), Decl(immutable.d.ts, 125, 114)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 126, 11)) ->value : Symbol(value, Decl(immutable.d.ts, 126, 23)) ->V : Symbol(V, Decl(immutable.d.ts, 117, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 126, 32)) ->K : Symbol(K, Decl(immutable.d.ts, 117, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 126, 40)) ->context : Symbol(context, Decl(immutable.d.ts, 126, 60)) +>filter : Symbol(OrderedMap.filter, Decl(immutable.ts, 124, 107), Decl(immutable.ts, 125, 114)) +>predicate : Symbol(predicate, Decl(immutable.ts, 126, 11)) +>value : Symbol(value, Decl(immutable.ts, 126, 23)) +>V : Symbol(V, Decl(immutable.ts, 117, 32)) +>key : Symbol(key, Decl(immutable.ts, 126, 32)) +>K : Symbol(K, Decl(immutable.ts, 117, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 126, 40)) +>context : Symbol(context, Decl(immutable.ts, 126, 60)) } export module Set { ->Set : Symbol(Set, Decl(immutable.d.ts, 127, 3), Decl(immutable.d.ts, 135, 3), Decl(immutable.d.ts, 136, 34), Decl(immutable.d.ts, 137, 35), Decl(immutable.d.ts, 138, 58)) +>Set : Symbol(Set, Decl(immutable.ts, 127, 3), Decl(immutable.ts, 135, 3), Decl(immutable.ts, 136, 34), Decl(immutable.ts, 137, 35), Decl(immutable.ts, 138, 58)) function isSet(maybeSet: any): maybeSet is Set; ->isSet : Symbol(isSet, Decl(immutable.d.ts, 128, 21)) ->maybeSet : Symbol(maybeSet, Decl(immutable.d.ts, 129, 19)) ->maybeSet : Symbol(maybeSet, Decl(immutable.d.ts, 129, 19)) ->Set : Symbol(Set, Decl(immutable.d.ts, 127, 3), Decl(immutable.d.ts, 135, 3), Decl(immutable.d.ts, 136, 34), Decl(immutable.d.ts, 137, 35), Decl(immutable.d.ts, 138, 58)) +>isSet : Symbol(isSet, Decl(immutable.ts, 128, 21)) +>maybeSet : Symbol(maybeSet, Decl(immutable.ts, 129, 19)) +>maybeSet : Symbol(maybeSet, Decl(immutable.ts, 129, 19)) +>Set : Symbol(Set, Decl(immutable.ts, 127, 3), Decl(immutable.ts, 135, 3), Decl(immutable.ts, 136, 34), Decl(immutable.ts, 137, 35), Decl(immutable.ts, 138, 58)) function of(...values: Array): Set; ->of : Symbol(of, Decl(immutable.d.ts, 129, 56)) ->T : Symbol(T, Decl(immutable.d.ts, 130, 16)) ->values : Symbol(values, Decl(immutable.d.ts, 130, 19)) +>of : Symbol(of, Decl(immutable.ts, 129, 56)) +>T : Symbol(T, Decl(immutable.ts, 130, 16)) +>values : Symbol(values, Decl(immutable.ts, 130, 19)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 130, 16)) ->Set : Symbol(Set, Decl(immutable.d.ts, 127, 3), Decl(immutable.d.ts, 135, 3), Decl(immutable.d.ts, 136, 34), Decl(immutable.d.ts, 137, 35), Decl(immutable.d.ts, 138, 58)) ->T : Symbol(T, Decl(immutable.d.ts, 130, 16)) +>T : Symbol(T, Decl(immutable.ts, 130, 16)) +>Set : Symbol(Set, Decl(immutable.ts, 127, 3), Decl(immutable.ts, 135, 3), Decl(immutable.ts, 136, 34), Decl(immutable.ts, 137, 35), Decl(immutable.ts, 138, 58)) +>T : Symbol(T, Decl(immutable.ts, 130, 16)) function fromKeys(iter: Collection): Set; ->fromKeys : Symbol(fromKeys, Decl(immutable.d.ts, 130, 48), Decl(immutable.d.ts, 131, 59)) ->T : Symbol(T, Decl(immutable.d.ts, 131, 22)) ->iter : Symbol(iter, Decl(immutable.d.ts, 131, 25)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->T : Symbol(T, Decl(immutable.d.ts, 131, 22)) ->Set : Symbol(Set, Decl(immutable.d.ts, 127, 3), Decl(immutable.d.ts, 135, 3), Decl(immutable.d.ts, 136, 34), Decl(immutable.d.ts, 137, 35), Decl(immutable.d.ts, 138, 58)) ->T : Symbol(T, Decl(immutable.d.ts, 131, 22)) +>fromKeys : Symbol(fromKeys, Decl(immutable.ts, 130, 48), Decl(immutable.ts, 131, 59)) +>T : Symbol(T, Decl(immutable.ts, 131, 22)) +>iter : Symbol(iter, Decl(immutable.ts, 131, 25)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>T : Symbol(T, Decl(immutable.ts, 131, 22)) +>Set : Symbol(Set, Decl(immutable.ts, 127, 3), Decl(immutable.ts, 135, 3), Decl(immutable.ts, 136, 34), Decl(immutable.ts, 137, 35), Decl(immutable.ts, 138, 58)) +>T : Symbol(T, Decl(immutable.ts, 131, 22)) function fromKeys(obj: {[key: string]: any}): Set; ->fromKeys : Symbol(fromKeys, Decl(immutable.d.ts, 130, 48), Decl(immutable.d.ts, 131, 59)) ->obj : Symbol(obj, Decl(immutable.d.ts, 132, 22)) ->key : Symbol(key, Decl(immutable.d.ts, 132, 29)) ->Set : Symbol(Set, Decl(immutable.d.ts, 127, 3), Decl(immutable.d.ts, 135, 3), Decl(immutable.d.ts, 136, 34), Decl(immutable.d.ts, 137, 35), Decl(immutable.d.ts, 138, 58)) +>fromKeys : Symbol(fromKeys, Decl(immutable.ts, 130, 48), Decl(immutable.ts, 131, 59)) +>obj : Symbol(obj, Decl(immutable.ts, 132, 22)) +>key : Symbol(key, Decl(immutable.ts, 132, 29)) +>Set : Symbol(Set, Decl(immutable.ts, 127, 3), Decl(immutable.ts, 135, 3), Decl(immutable.ts, 136, 34), Decl(immutable.ts, 137, 35), Decl(immutable.ts, 138, 58)) function intersect(sets: Iterable>): Set; ->intersect : Symbol(intersect, Decl(immutable.d.ts, 132, 62)) ->T : Symbol(T, Decl(immutable.d.ts, 133, 23)) ->sets : Symbol(sets, Decl(immutable.d.ts, 133, 26)) +>intersect : Symbol(intersect, Decl(immutable.ts, 132, 62)) +>T : Symbol(T, Decl(immutable.ts, 133, 23)) +>sets : Symbol(sets, Decl(immutable.ts, 133, 26)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 133, 23)) ->Set : Symbol(Set, Decl(immutable.d.ts, 127, 3), Decl(immutable.d.ts, 135, 3), Decl(immutable.d.ts, 136, 34), Decl(immutable.d.ts, 137, 35), Decl(immutable.d.ts, 138, 58)) ->T : Symbol(T, Decl(immutable.d.ts, 133, 23)) +>T : Symbol(T, Decl(immutable.ts, 133, 23)) +>Set : Symbol(Set, Decl(immutable.ts, 127, 3), Decl(immutable.ts, 135, 3), Decl(immutable.ts, 136, 34), Decl(immutable.ts, 137, 35), Decl(immutable.ts, 138, 58)) +>T : Symbol(T, Decl(immutable.ts, 133, 23)) function union(sets: Iterable>): Set; ->union : Symbol(union, Decl(immutable.d.ts, 133, 63)) ->T : Symbol(T, Decl(immutable.d.ts, 134, 19)) ->sets : Symbol(sets, Decl(immutable.d.ts, 134, 22)) +>union : Symbol(union, Decl(immutable.ts, 133, 63)) +>T : Symbol(T, Decl(immutable.ts, 134, 19)) +>sets : Symbol(sets, Decl(immutable.ts, 134, 22)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 134, 19)) ->Set : Symbol(Set, Decl(immutable.d.ts, 127, 3), Decl(immutable.d.ts, 135, 3), Decl(immutable.d.ts, 136, 34), Decl(immutable.d.ts, 137, 35), Decl(immutable.d.ts, 138, 58)) ->T : Symbol(T, Decl(immutable.d.ts, 134, 19)) +>T : Symbol(T, Decl(immutable.ts, 134, 19)) +>Set : Symbol(Set, Decl(immutable.ts, 127, 3), Decl(immutable.ts, 135, 3), Decl(immutable.ts, 136, 34), Decl(immutable.ts, 137, 35), Decl(immutable.ts, 138, 58)) +>T : Symbol(T, Decl(immutable.ts, 134, 19)) } export function Set(): Set; ->Set : Symbol(Set, Decl(immutable.d.ts, 127, 3), Decl(immutable.d.ts, 135, 3), Decl(immutable.d.ts, 136, 34), Decl(immutable.d.ts, 137, 35), Decl(immutable.d.ts, 138, 58)) ->Set : Symbol(Set, Decl(immutable.d.ts, 127, 3), Decl(immutable.d.ts, 135, 3), Decl(immutable.d.ts, 136, 34), Decl(immutable.d.ts, 137, 35), Decl(immutable.d.ts, 138, 58)) +>Set : Symbol(Set, Decl(immutable.ts, 127, 3), Decl(immutable.ts, 135, 3), Decl(immutable.ts, 136, 34), Decl(immutable.ts, 137, 35), Decl(immutable.ts, 138, 58)) +>Set : Symbol(Set, Decl(immutable.ts, 127, 3), Decl(immutable.ts, 135, 3), Decl(immutable.ts, 136, 34), Decl(immutable.ts, 137, 35), Decl(immutable.ts, 138, 58)) export function Set(): Set; ->Set : Symbol(Set, Decl(immutable.d.ts, 127, 3), Decl(immutable.d.ts, 135, 3), Decl(immutable.d.ts, 136, 34), Decl(immutable.d.ts, 137, 35), Decl(immutable.d.ts, 138, 58)) ->T : Symbol(T, Decl(immutable.d.ts, 137, 22)) ->Set : Symbol(Set, Decl(immutable.d.ts, 127, 3), Decl(immutable.d.ts, 135, 3), Decl(immutable.d.ts, 136, 34), Decl(immutable.d.ts, 137, 35), Decl(immutable.d.ts, 138, 58)) ->T : Symbol(T, Decl(immutable.d.ts, 137, 22)) +>Set : Symbol(Set, Decl(immutable.ts, 127, 3), Decl(immutable.ts, 135, 3), Decl(immutable.ts, 136, 34), Decl(immutable.ts, 137, 35), Decl(immutable.ts, 138, 58)) +>T : Symbol(T, Decl(immutable.ts, 137, 22)) +>Set : Symbol(Set, Decl(immutable.ts, 127, 3), Decl(immutable.ts, 135, 3), Decl(immutable.ts, 136, 34), Decl(immutable.ts, 137, 35), Decl(immutable.ts, 138, 58)) +>T : Symbol(T, Decl(immutable.ts, 137, 22)) export function Set(collection: Iterable): Set; ->Set : Symbol(Set, Decl(immutable.d.ts, 127, 3), Decl(immutable.d.ts, 135, 3), Decl(immutable.d.ts, 136, 34), Decl(immutable.d.ts, 137, 35), Decl(immutable.d.ts, 138, 58)) ->T : Symbol(T, Decl(immutable.d.ts, 138, 22)) ->collection : Symbol(collection, Decl(immutable.d.ts, 138, 25)) +>Set : Symbol(Set, Decl(immutable.ts, 127, 3), Decl(immutable.ts, 135, 3), Decl(immutable.ts, 136, 34), Decl(immutable.ts, 137, 35), Decl(immutable.ts, 138, 58)) +>T : Symbol(T, Decl(immutable.ts, 138, 22)) +>collection : Symbol(collection, Decl(immutable.ts, 138, 25)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 138, 22)) ->Set : Symbol(Set, Decl(immutable.d.ts, 127, 3), Decl(immutable.d.ts, 135, 3), Decl(immutable.d.ts, 136, 34), Decl(immutable.d.ts, 137, 35), Decl(immutable.d.ts, 138, 58)) ->T : Symbol(T, Decl(immutable.d.ts, 138, 22)) +>T : Symbol(T, Decl(immutable.ts, 138, 22)) +>Set : Symbol(Set, Decl(immutable.ts, 127, 3), Decl(immutable.ts, 135, 3), Decl(immutable.ts, 136, 34), Decl(immutable.ts, 137, 35), Decl(immutable.ts, 138, 58)) +>T : Symbol(T, Decl(immutable.ts, 138, 22)) export interface Set extends Collection.Set { ->Set : Symbol(Set, Decl(immutable.d.ts, 127, 3), Decl(immutable.d.ts, 135, 3), Decl(immutable.d.ts, 136, 34), Decl(immutable.d.ts, 137, 35), Decl(immutable.d.ts, 138, 58)) ->T : Symbol(T, Decl(immutable.d.ts, 139, 23)) ->Collection.Set : Symbol(Collection.Set, Decl(immutable.d.ts, 387, 5), Decl(immutable.d.ts, 388, 24), Decl(immutable.d.ts, 389, 71)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Set : Symbol(Collection.Set, Decl(immutable.d.ts, 387, 5), Decl(immutable.d.ts, 388, 24), Decl(immutable.d.ts, 389, 71)) ->T : Symbol(T, Decl(immutable.d.ts, 139, 23)) +>Set : Symbol(Set, Decl(immutable.ts, 127, 3), Decl(immutable.ts, 135, 3), Decl(immutable.ts, 136, 34), Decl(immutable.ts, 137, 35), Decl(immutable.ts, 138, 58)) +>T : Symbol(T, Decl(immutable.ts, 139, 23)) +>Collection.Set : Symbol(Collection.Set, Decl(immutable.ts, 387, 5), Decl(immutable.ts, 388, 24), Decl(immutable.ts, 389, 71)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Set : Symbol(Collection.Set, Decl(immutable.ts, 387, 5), Decl(immutable.ts, 388, 24), Decl(immutable.ts, 389, 71)) +>T : Symbol(T, Decl(immutable.ts, 139, 23)) // Persistent changes add(value: T): this; ->add : Symbol(Set.add, Decl(immutable.d.ts, 139, 53)) ->value : Symbol(value, Decl(immutable.d.ts, 141, 8)) ->T : Symbol(T, Decl(immutable.d.ts, 139, 23)) +>add : Symbol(Set.add, Decl(immutable.ts, 139, 53)) +>value : Symbol(value, Decl(immutable.ts, 141, 8)) +>T : Symbol(T, Decl(immutable.ts, 139, 23)) delete(value: T): this; ->delete : Symbol(Set.delete, Decl(immutable.d.ts, 141, 24)) ->value : Symbol(value, Decl(immutable.d.ts, 142, 11)) ->T : Symbol(T, Decl(immutable.d.ts, 139, 23)) +>delete : Symbol(Set.delete, Decl(immutable.ts, 141, 24)) +>value : Symbol(value, Decl(immutable.ts, 142, 11)) +>T : Symbol(T, Decl(immutable.ts, 139, 23)) remove(value: T): this; ->remove : Symbol(Set.remove, Decl(immutable.d.ts, 142, 27)) ->value : Symbol(value, Decl(immutable.d.ts, 143, 11)) ->T : Symbol(T, Decl(immutable.d.ts, 139, 23)) +>remove : Symbol(Set.remove, Decl(immutable.ts, 142, 27)) +>value : Symbol(value, Decl(immutable.ts, 143, 11)) +>T : Symbol(T, Decl(immutable.ts, 139, 23)) clear(): this; ->clear : Symbol(Set.clear, Decl(immutable.d.ts, 143, 27)) +>clear : Symbol(Set.clear, Decl(immutable.ts, 143, 27)) union(...collections: Array | Array>): this; ->union : Symbol(Set.union, Decl(immutable.d.ts, 144, 18)) ->collections : Symbol(collections, Decl(immutable.d.ts, 145, 10)) +>union : Symbol(Set.union, Decl(immutable.ts, 144, 18)) +>collections : Symbol(collections, Decl(immutable.ts, 145, 10)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->T : Symbol(T, Decl(immutable.d.ts, 139, 23)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>T : Symbol(T, Decl(immutable.ts, 139, 23)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 139, 23)) +>T : Symbol(T, Decl(immutable.ts, 139, 23)) merge(...collections: Array | Array>): this; ->merge : Symbol(Set.merge, Decl(immutable.d.ts, 145, 70)) ->collections : Symbol(collections, Decl(immutable.d.ts, 146, 10)) +>merge : Symbol(Set.merge, Decl(immutable.ts, 145, 70)) +>collections : Symbol(collections, Decl(immutable.ts, 146, 10)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->T : Symbol(T, Decl(immutable.d.ts, 139, 23)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>T : Symbol(T, Decl(immutable.ts, 139, 23)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 139, 23)) +>T : Symbol(T, Decl(immutable.ts, 139, 23)) intersect(...collections: Array | Array>): this; ->intersect : Symbol(Set.intersect, Decl(immutable.d.ts, 146, 70)) ->collections : Symbol(collections, Decl(immutable.d.ts, 147, 14)) +>intersect : Symbol(Set.intersect, Decl(immutable.ts, 146, 70)) +>collections : Symbol(collections, Decl(immutable.ts, 147, 14)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->T : Symbol(T, Decl(immutable.d.ts, 139, 23)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>T : Symbol(T, Decl(immutable.ts, 139, 23)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 139, 23)) +>T : Symbol(T, Decl(immutable.ts, 139, 23)) subtract(...collections: Array | Array>): this; ->subtract : Symbol(Set.subtract, Decl(immutable.d.ts, 147, 74)) ->collections : Symbol(collections, Decl(immutable.d.ts, 148, 13)) +>subtract : Symbol(Set.subtract, Decl(immutable.ts, 147, 74)) +>collections : Symbol(collections, Decl(immutable.ts, 148, 13)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->T : Symbol(T, Decl(immutable.d.ts, 139, 23)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>T : Symbol(T, Decl(immutable.ts, 139, 23)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 139, 23)) +>T : Symbol(T, Decl(immutable.ts, 139, 23)) // Transient changes withMutations(mutator: (mutable: this) => any): this; ->withMutations : Symbol(Set.withMutations, Decl(immutable.d.ts, 148, 73)) ->mutator : Symbol(mutator, Decl(immutable.d.ts, 150, 18)) ->mutable : Symbol(mutable, Decl(immutable.d.ts, 150, 28)) +>withMutations : Symbol(Set.withMutations, Decl(immutable.ts, 148, 73)) +>mutator : Symbol(mutator, Decl(immutable.ts, 150, 18)) +>mutable : Symbol(mutable, Decl(immutable.ts, 150, 28)) asMutable(): this; ->asMutable : Symbol(Set.asMutable, Decl(immutable.d.ts, 150, 57)) +>asMutable : Symbol(Set.asMutable, Decl(immutable.ts, 150, 57)) asImmutable(): this; ->asImmutable : Symbol(Set.asImmutable, Decl(immutable.d.ts, 151, 22)) +>asImmutable : Symbol(Set.asImmutable, Decl(immutable.ts, 151, 22)) // Sequence algorithms concat(...valuesOrCollections: Array | C>): Set; ->concat : Symbol(Set.concat, Decl(immutable.d.ts, 152, 24)) ->C : Symbol(C, Decl(immutable.d.ts, 154, 11)) ->valuesOrCollections : Symbol(valuesOrCollections, Decl(immutable.d.ts, 154, 14)) +>concat : Symbol(Set.concat, Decl(immutable.ts, 152, 24)) +>C : Symbol(C, Decl(immutable.ts, 154, 11)) +>valuesOrCollections : Symbol(valuesOrCollections, Decl(immutable.ts, 154, 14)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->C : Symbol(C, Decl(immutable.d.ts, 154, 11)) ->C : Symbol(C, Decl(immutable.d.ts, 154, 11)) ->Set : Symbol(Set, Decl(immutable.d.ts, 127, 3), Decl(immutable.d.ts, 135, 3), Decl(immutable.d.ts, 136, 34), Decl(immutable.d.ts, 137, 35), Decl(immutable.d.ts, 138, 58)) ->T : Symbol(T, Decl(immutable.d.ts, 139, 23)) ->C : Symbol(C, Decl(immutable.d.ts, 154, 11)) +>C : Symbol(C, Decl(immutable.ts, 154, 11)) +>C : Symbol(C, Decl(immutable.ts, 154, 11)) +>Set : Symbol(Set, Decl(immutable.ts, 127, 3), Decl(immutable.ts, 135, 3), Decl(immutable.ts, 136, 34), Decl(immutable.ts, 137, 35), Decl(immutable.ts, 138, 58)) +>T : Symbol(T, Decl(immutable.ts, 139, 23)) +>C : Symbol(C, Decl(immutable.ts, 154, 11)) map(mapper: (value: T, key: never, iter: this) => M, context?: any): Set; ->map : Symbol(Set.map, Decl(immutable.d.ts, 154, 74)) ->M : Symbol(M, Decl(immutable.d.ts, 155, 8)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 155, 11)) ->value : Symbol(value, Decl(immutable.d.ts, 155, 20)) ->T : Symbol(T, Decl(immutable.d.ts, 139, 23)) ->key : Symbol(key, Decl(immutable.d.ts, 155, 29)) ->iter : Symbol(iter, Decl(immutable.d.ts, 155, 41)) ->M : Symbol(M, Decl(immutable.d.ts, 155, 8)) ->context : Symbol(context, Decl(immutable.d.ts, 155, 59)) ->Set : Symbol(Set, Decl(immutable.d.ts, 127, 3), Decl(immutable.d.ts, 135, 3), Decl(immutable.d.ts, 136, 34), Decl(immutable.d.ts, 137, 35), Decl(immutable.d.ts, 138, 58)) ->M : Symbol(M, Decl(immutable.d.ts, 155, 8)) +>map : Symbol(Set.map, Decl(immutable.ts, 154, 74)) +>M : Symbol(M, Decl(immutable.ts, 155, 8)) +>mapper : Symbol(mapper, Decl(immutable.ts, 155, 11)) +>value : Symbol(value, Decl(immutable.ts, 155, 20)) +>T : Symbol(T, Decl(immutable.ts, 139, 23)) +>key : Symbol(key, Decl(immutable.ts, 155, 29)) +>iter : Symbol(iter, Decl(immutable.ts, 155, 41)) +>M : Symbol(M, Decl(immutable.ts, 155, 8)) +>context : Symbol(context, Decl(immutable.ts, 155, 59)) +>Set : Symbol(Set, Decl(immutable.ts, 127, 3), Decl(immutable.ts, 135, 3), Decl(immutable.ts, 136, 34), Decl(immutable.ts, 137, 35), Decl(immutable.ts, 138, 58)) +>M : Symbol(M, Decl(immutable.ts, 155, 8)) flatMap(mapper: (value: T, key: never, iter: this) => Iterable, context?: any): Set; ->flatMap : Symbol(Set.flatMap, Decl(immutable.d.ts, 155, 83)) ->M : Symbol(M, Decl(immutable.d.ts, 156, 12)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 156, 15)) ->value : Symbol(value, Decl(immutable.d.ts, 156, 24)) ->T : Symbol(T, Decl(immutable.d.ts, 139, 23)) ->key : Symbol(key, Decl(immutable.d.ts, 156, 33)) ->iter : Symbol(iter, Decl(immutable.d.ts, 156, 45)) +>flatMap : Symbol(Set.flatMap, Decl(immutable.ts, 155, 83)) +>M : Symbol(M, Decl(immutable.ts, 156, 12)) +>mapper : Symbol(mapper, Decl(immutable.ts, 156, 15)) +>value : Symbol(value, Decl(immutable.ts, 156, 24)) +>T : Symbol(T, Decl(immutable.ts, 139, 23)) +>key : Symbol(key, Decl(immutable.ts, 156, 33)) +>iter : Symbol(iter, Decl(immutable.ts, 156, 45)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->M : Symbol(M, Decl(immutable.d.ts, 156, 12)) ->context : Symbol(context, Decl(immutable.d.ts, 156, 73)) ->Set : Symbol(Set, Decl(immutable.d.ts, 127, 3), Decl(immutable.d.ts, 135, 3), Decl(immutable.d.ts, 136, 34), Decl(immutable.d.ts, 137, 35), Decl(immutable.d.ts, 138, 58)) ->M : Symbol(M, Decl(immutable.d.ts, 156, 12)) +>M : Symbol(M, Decl(immutable.ts, 156, 12)) +>context : Symbol(context, Decl(immutable.ts, 156, 73)) +>Set : Symbol(Set, Decl(immutable.ts, 127, 3), Decl(immutable.ts, 135, 3), Decl(immutable.ts, 136, 34), Decl(immutable.ts, 137, 35), Decl(immutable.ts, 138, 58)) +>M : Symbol(M, Decl(immutable.ts, 156, 12)) filter(predicate: (value: T, key: never, iter: this) => value is F, context?: any): Set; ->filter : Symbol(Set.filter, Decl(immutable.d.ts, 156, 97), Decl(immutable.d.ts, 157, 108)) ->F : Symbol(F, Decl(immutable.d.ts, 157, 11)) ->T : Symbol(T, Decl(immutable.d.ts, 139, 23)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 157, 24)) ->value : Symbol(value, Decl(immutable.d.ts, 157, 36)) ->T : Symbol(T, Decl(immutable.d.ts, 139, 23)) ->key : Symbol(key, Decl(immutable.d.ts, 157, 45)) ->iter : Symbol(iter, Decl(immutable.d.ts, 157, 57)) ->value : Symbol(value, Decl(immutable.d.ts, 157, 36)) ->F : Symbol(F, Decl(immutable.d.ts, 157, 11)) ->context : Symbol(context, Decl(immutable.d.ts, 157, 84)) ->Set : Symbol(Set, Decl(immutable.d.ts, 127, 3), Decl(immutable.d.ts, 135, 3), Decl(immutable.d.ts, 136, 34), Decl(immutable.d.ts, 137, 35), Decl(immutable.d.ts, 138, 58)) ->F : Symbol(F, Decl(immutable.d.ts, 157, 11)) +>filter : Symbol(Set.filter, Decl(immutable.ts, 156, 97), Decl(immutable.ts, 157, 108)) +>F : Symbol(F, Decl(immutable.ts, 157, 11)) +>T : Symbol(T, Decl(immutable.ts, 139, 23)) +>predicate : Symbol(predicate, Decl(immutable.ts, 157, 24)) +>value : Symbol(value, Decl(immutable.ts, 157, 36)) +>T : Symbol(T, Decl(immutable.ts, 139, 23)) +>key : Symbol(key, Decl(immutable.ts, 157, 45)) +>iter : Symbol(iter, Decl(immutable.ts, 157, 57)) +>value : Symbol(value, Decl(immutable.ts, 157, 36)) +>F : Symbol(F, Decl(immutable.ts, 157, 11)) +>context : Symbol(context, Decl(immutable.ts, 157, 84)) +>Set : Symbol(Set, Decl(immutable.ts, 127, 3), Decl(immutable.ts, 135, 3), Decl(immutable.ts, 136, 34), Decl(immutable.ts, 137, 35), Decl(immutable.ts, 138, 58)) +>F : Symbol(F, Decl(immutable.ts, 157, 11)) filter(predicate: (value: T, key: never, iter: this) => any, context?: any): this; ->filter : Symbol(Set.filter, Decl(immutable.d.ts, 156, 97), Decl(immutable.d.ts, 157, 108)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 158, 11)) ->value : Symbol(value, Decl(immutable.d.ts, 158, 23)) ->T : Symbol(T, Decl(immutable.d.ts, 139, 23)) ->key : Symbol(key, Decl(immutable.d.ts, 158, 32)) ->iter : Symbol(iter, Decl(immutable.d.ts, 158, 44)) ->context : Symbol(context, Decl(immutable.d.ts, 158, 64)) +>filter : Symbol(Set.filter, Decl(immutable.ts, 156, 97), Decl(immutable.ts, 157, 108)) +>predicate : Symbol(predicate, Decl(immutable.ts, 158, 11)) +>value : Symbol(value, Decl(immutable.ts, 158, 23)) +>T : Symbol(T, Decl(immutable.ts, 139, 23)) +>key : Symbol(key, Decl(immutable.ts, 158, 32)) +>iter : Symbol(iter, Decl(immutable.ts, 158, 44)) +>context : Symbol(context, Decl(immutable.ts, 158, 64)) } export module OrderedSet { ->OrderedSet : Symbol(OrderedSet, Decl(immutable.d.ts, 159, 3), Decl(immutable.d.ts, 165, 3), Decl(immutable.d.ts, 166, 48), Decl(immutable.d.ts, 167, 49), Decl(immutable.d.ts, 168, 72)) +>OrderedSet : Symbol(OrderedSet, Decl(immutable.ts, 159, 3), Decl(immutable.ts, 165, 3), Decl(immutable.ts, 166, 48), Decl(immutable.ts, 167, 49), Decl(immutable.ts, 168, 72)) function isOrderedSet(maybeOrderedSet: any): boolean; ->isOrderedSet : Symbol(isOrderedSet, Decl(immutable.d.ts, 160, 28)) ->maybeOrderedSet : Symbol(maybeOrderedSet, Decl(immutable.d.ts, 161, 26)) +>isOrderedSet : Symbol(isOrderedSet, Decl(immutable.ts, 160, 28)) +>maybeOrderedSet : Symbol(maybeOrderedSet, Decl(immutable.ts, 161, 26)) function of(...values: Array): OrderedSet; ->of : Symbol(of, Decl(immutable.d.ts, 161, 57)) ->T : Symbol(T, Decl(immutable.d.ts, 162, 16)) ->values : Symbol(values, Decl(immutable.d.ts, 162, 19)) +>of : Symbol(of, Decl(immutable.ts, 161, 57)) +>T : Symbol(T, Decl(immutable.ts, 162, 16)) +>values : Symbol(values, Decl(immutable.ts, 162, 19)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 162, 16)) ->OrderedSet : Symbol(OrderedSet, Decl(immutable.d.ts, 159, 3), Decl(immutable.d.ts, 165, 3), Decl(immutable.d.ts, 166, 48), Decl(immutable.d.ts, 167, 49), Decl(immutable.d.ts, 168, 72)) ->T : Symbol(T, Decl(immutable.d.ts, 162, 16)) +>T : Symbol(T, Decl(immutable.ts, 162, 16)) +>OrderedSet : Symbol(OrderedSet, Decl(immutable.ts, 159, 3), Decl(immutable.ts, 165, 3), Decl(immutable.ts, 166, 48), Decl(immutable.ts, 167, 49), Decl(immutable.ts, 168, 72)) +>T : Symbol(T, Decl(immutable.ts, 162, 16)) function fromKeys(iter: Collection): OrderedSet; ->fromKeys : Symbol(fromKeys, Decl(immutable.d.ts, 162, 55), Decl(immutable.d.ts, 163, 66)) ->T : Symbol(T, Decl(immutable.d.ts, 163, 22)) ->iter : Symbol(iter, Decl(immutable.d.ts, 163, 25)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->T : Symbol(T, Decl(immutable.d.ts, 163, 22)) ->OrderedSet : Symbol(OrderedSet, Decl(immutable.d.ts, 159, 3), Decl(immutable.d.ts, 165, 3), Decl(immutable.d.ts, 166, 48), Decl(immutable.d.ts, 167, 49), Decl(immutable.d.ts, 168, 72)) ->T : Symbol(T, Decl(immutable.d.ts, 163, 22)) +>fromKeys : Symbol(fromKeys, Decl(immutable.ts, 162, 55), Decl(immutable.ts, 163, 66)) +>T : Symbol(T, Decl(immutable.ts, 163, 22)) +>iter : Symbol(iter, Decl(immutable.ts, 163, 25)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>T : Symbol(T, Decl(immutable.ts, 163, 22)) +>OrderedSet : Symbol(OrderedSet, Decl(immutable.ts, 159, 3), Decl(immutable.ts, 165, 3), Decl(immutable.ts, 166, 48), Decl(immutable.ts, 167, 49), Decl(immutable.ts, 168, 72)) +>T : Symbol(T, Decl(immutable.ts, 163, 22)) function fromKeys(obj: {[key: string]: any}): OrderedSet; ->fromKeys : Symbol(fromKeys, Decl(immutable.d.ts, 162, 55), Decl(immutable.d.ts, 163, 66)) ->obj : Symbol(obj, Decl(immutable.d.ts, 164, 22)) ->key : Symbol(key, Decl(immutable.d.ts, 164, 29)) ->OrderedSet : Symbol(OrderedSet, Decl(immutable.d.ts, 159, 3), Decl(immutable.d.ts, 165, 3), Decl(immutable.d.ts, 166, 48), Decl(immutable.d.ts, 167, 49), Decl(immutable.d.ts, 168, 72)) +>fromKeys : Symbol(fromKeys, Decl(immutable.ts, 162, 55), Decl(immutable.ts, 163, 66)) +>obj : Symbol(obj, Decl(immutable.ts, 164, 22)) +>key : Symbol(key, Decl(immutable.ts, 164, 29)) +>OrderedSet : Symbol(OrderedSet, Decl(immutable.ts, 159, 3), Decl(immutable.ts, 165, 3), Decl(immutable.ts, 166, 48), Decl(immutable.ts, 167, 49), Decl(immutable.ts, 168, 72)) } export function OrderedSet(): OrderedSet; ->OrderedSet : Symbol(OrderedSet, Decl(immutable.d.ts, 159, 3), Decl(immutable.d.ts, 165, 3), Decl(immutable.d.ts, 166, 48), Decl(immutable.d.ts, 167, 49), Decl(immutable.d.ts, 168, 72)) ->OrderedSet : Symbol(OrderedSet, Decl(immutable.d.ts, 159, 3), Decl(immutable.d.ts, 165, 3), Decl(immutable.d.ts, 166, 48), Decl(immutable.d.ts, 167, 49), Decl(immutable.d.ts, 168, 72)) +>OrderedSet : Symbol(OrderedSet, Decl(immutable.ts, 159, 3), Decl(immutable.ts, 165, 3), Decl(immutable.ts, 166, 48), Decl(immutable.ts, 167, 49), Decl(immutable.ts, 168, 72)) +>OrderedSet : Symbol(OrderedSet, Decl(immutable.ts, 159, 3), Decl(immutable.ts, 165, 3), Decl(immutable.ts, 166, 48), Decl(immutable.ts, 167, 49), Decl(immutable.ts, 168, 72)) export function OrderedSet(): OrderedSet; ->OrderedSet : Symbol(OrderedSet, Decl(immutable.d.ts, 159, 3), Decl(immutable.d.ts, 165, 3), Decl(immutable.d.ts, 166, 48), Decl(immutable.d.ts, 167, 49), Decl(immutable.d.ts, 168, 72)) ->T : Symbol(T, Decl(immutable.d.ts, 167, 29)) ->OrderedSet : Symbol(OrderedSet, Decl(immutable.d.ts, 159, 3), Decl(immutable.d.ts, 165, 3), Decl(immutable.d.ts, 166, 48), Decl(immutable.d.ts, 167, 49), Decl(immutable.d.ts, 168, 72)) ->T : Symbol(T, Decl(immutable.d.ts, 167, 29)) +>OrderedSet : Symbol(OrderedSet, Decl(immutable.ts, 159, 3), Decl(immutable.ts, 165, 3), Decl(immutable.ts, 166, 48), Decl(immutable.ts, 167, 49), Decl(immutable.ts, 168, 72)) +>T : Symbol(T, Decl(immutable.ts, 167, 29)) +>OrderedSet : Symbol(OrderedSet, Decl(immutable.ts, 159, 3), Decl(immutable.ts, 165, 3), Decl(immutable.ts, 166, 48), Decl(immutable.ts, 167, 49), Decl(immutable.ts, 168, 72)) +>T : Symbol(T, Decl(immutable.ts, 167, 29)) export function OrderedSet(collection: Iterable): OrderedSet; ->OrderedSet : Symbol(OrderedSet, Decl(immutable.d.ts, 159, 3), Decl(immutable.d.ts, 165, 3), Decl(immutable.d.ts, 166, 48), Decl(immutable.d.ts, 167, 49), Decl(immutable.d.ts, 168, 72)) ->T : Symbol(T, Decl(immutable.d.ts, 168, 29)) ->collection : Symbol(collection, Decl(immutable.d.ts, 168, 32)) +>OrderedSet : Symbol(OrderedSet, Decl(immutable.ts, 159, 3), Decl(immutable.ts, 165, 3), Decl(immutable.ts, 166, 48), Decl(immutable.ts, 167, 49), Decl(immutable.ts, 168, 72)) +>T : Symbol(T, Decl(immutable.ts, 168, 29)) +>collection : Symbol(collection, Decl(immutable.ts, 168, 32)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 168, 29)) ->OrderedSet : Symbol(OrderedSet, Decl(immutable.d.ts, 159, 3), Decl(immutable.d.ts, 165, 3), Decl(immutable.d.ts, 166, 48), Decl(immutable.d.ts, 167, 49), Decl(immutable.d.ts, 168, 72)) ->T : Symbol(T, Decl(immutable.d.ts, 168, 29)) +>T : Symbol(T, Decl(immutable.ts, 168, 29)) +>OrderedSet : Symbol(OrderedSet, Decl(immutable.ts, 159, 3), Decl(immutable.ts, 165, 3), Decl(immutable.ts, 166, 48), Decl(immutable.ts, 167, 49), Decl(immutable.ts, 168, 72)) +>T : Symbol(T, Decl(immutable.ts, 168, 29)) export interface OrderedSet extends Set { ->OrderedSet : Symbol(OrderedSet, Decl(immutable.d.ts, 159, 3), Decl(immutable.d.ts, 165, 3), Decl(immutable.d.ts, 166, 48), Decl(immutable.d.ts, 167, 49), Decl(immutable.d.ts, 168, 72)) ->T : Symbol(T, Decl(immutable.d.ts, 169, 30)) ->Set : Symbol(Set, Decl(immutable.d.ts, 127, 3), Decl(immutable.d.ts, 135, 3), Decl(immutable.d.ts, 136, 34), Decl(immutable.d.ts, 137, 35), Decl(immutable.d.ts, 138, 58)) ->T : Symbol(T, Decl(immutable.d.ts, 169, 30)) +>OrderedSet : Symbol(OrderedSet, Decl(immutable.ts, 159, 3), Decl(immutable.ts, 165, 3), Decl(immutable.ts, 166, 48), Decl(immutable.ts, 167, 49), Decl(immutable.ts, 168, 72)) +>T : Symbol(T, Decl(immutable.ts, 169, 30)) +>Set : Symbol(Set, Decl(immutable.ts, 127, 3), Decl(immutable.ts, 135, 3), Decl(immutable.ts, 136, 34), Decl(immutable.ts, 137, 35), Decl(immutable.ts, 138, 58)) +>T : Symbol(T, Decl(immutable.ts, 169, 30)) // Sequence algorithms concat(...valuesOrCollections: Array | C>): OrderedSet; ->concat : Symbol(OrderedSet.concat, Decl(immutable.d.ts, 169, 49)) ->C : Symbol(C, Decl(immutable.d.ts, 171, 11)) ->valuesOrCollections : Symbol(valuesOrCollections, Decl(immutable.d.ts, 171, 14)) +>concat : Symbol(OrderedSet.concat, Decl(immutable.ts, 169, 49)) +>C : Symbol(C, Decl(immutable.ts, 171, 11)) +>valuesOrCollections : Symbol(valuesOrCollections, Decl(immutable.ts, 171, 14)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->C : Symbol(C, Decl(immutable.d.ts, 171, 11)) ->C : Symbol(C, Decl(immutable.d.ts, 171, 11)) ->OrderedSet : Symbol(OrderedSet, Decl(immutable.d.ts, 159, 3), Decl(immutable.d.ts, 165, 3), Decl(immutable.d.ts, 166, 48), Decl(immutable.d.ts, 167, 49), Decl(immutable.d.ts, 168, 72)) ->T : Symbol(T, Decl(immutable.d.ts, 169, 30)) ->C : Symbol(C, Decl(immutable.d.ts, 171, 11)) +>C : Symbol(C, Decl(immutable.ts, 171, 11)) +>C : Symbol(C, Decl(immutable.ts, 171, 11)) +>OrderedSet : Symbol(OrderedSet, Decl(immutable.ts, 159, 3), Decl(immutable.ts, 165, 3), Decl(immutable.ts, 166, 48), Decl(immutable.ts, 167, 49), Decl(immutable.ts, 168, 72)) +>T : Symbol(T, Decl(immutable.ts, 169, 30)) +>C : Symbol(C, Decl(immutable.ts, 171, 11)) map(mapper: (value: T, key: never, iter: this) => M, context?: any): OrderedSet; ->map : Symbol(OrderedSet.map, Decl(immutable.d.ts, 171, 81)) ->M : Symbol(M, Decl(immutable.d.ts, 172, 8)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 172, 11)) ->value : Symbol(value, Decl(immutable.d.ts, 172, 20)) ->T : Symbol(T, Decl(immutable.d.ts, 169, 30)) ->key : Symbol(key, Decl(immutable.d.ts, 172, 29)) ->iter : Symbol(iter, Decl(immutable.d.ts, 172, 41)) ->M : Symbol(M, Decl(immutable.d.ts, 172, 8)) ->context : Symbol(context, Decl(immutable.d.ts, 172, 59)) ->OrderedSet : Symbol(OrderedSet, Decl(immutable.d.ts, 159, 3), Decl(immutable.d.ts, 165, 3), Decl(immutable.d.ts, 166, 48), Decl(immutable.d.ts, 167, 49), Decl(immutable.d.ts, 168, 72)) ->M : Symbol(M, Decl(immutable.d.ts, 172, 8)) +>map : Symbol(OrderedSet.map, Decl(immutable.ts, 171, 81)) +>M : Symbol(M, Decl(immutable.ts, 172, 8)) +>mapper : Symbol(mapper, Decl(immutable.ts, 172, 11)) +>value : Symbol(value, Decl(immutable.ts, 172, 20)) +>T : Symbol(T, Decl(immutable.ts, 169, 30)) +>key : Symbol(key, Decl(immutable.ts, 172, 29)) +>iter : Symbol(iter, Decl(immutable.ts, 172, 41)) +>M : Symbol(M, Decl(immutable.ts, 172, 8)) +>context : Symbol(context, Decl(immutable.ts, 172, 59)) +>OrderedSet : Symbol(OrderedSet, Decl(immutable.ts, 159, 3), Decl(immutable.ts, 165, 3), Decl(immutable.ts, 166, 48), Decl(immutable.ts, 167, 49), Decl(immutable.ts, 168, 72)) +>M : Symbol(M, Decl(immutable.ts, 172, 8)) flatMap(mapper: (value: T, key: never, iter: this) => Iterable, context?: any): OrderedSet; ->flatMap : Symbol(OrderedSet.flatMap, Decl(immutable.d.ts, 172, 90)) ->M : Symbol(M, Decl(immutable.d.ts, 173, 12)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 173, 15)) ->value : Symbol(value, Decl(immutable.d.ts, 173, 24)) ->T : Symbol(T, Decl(immutable.d.ts, 169, 30)) ->key : Symbol(key, Decl(immutable.d.ts, 173, 33)) ->iter : Symbol(iter, Decl(immutable.d.ts, 173, 45)) +>flatMap : Symbol(OrderedSet.flatMap, Decl(immutable.ts, 172, 90)) +>M : Symbol(M, Decl(immutable.ts, 173, 12)) +>mapper : Symbol(mapper, Decl(immutable.ts, 173, 15)) +>value : Symbol(value, Decl(immutable.ts, 173, 24)) +>T : Symbol(T, Decl(immutable.ts, 169, 30)) +>key : Symbol(key, Decl(immutable.ts, 173, 33)) +>iter : Symbol(iter, Decl(immutable.ts, 173, 45)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->M : Symbol(M, Decl(immutable.d.ts, 173, 12)) ->context : Symbol(context, Decl(immutable.d.ts, 173, 73)) ->OrderedSet : Symbol(OrderedSet, Decl(immutable.d.ts, 159, 3), Decl(immutable.d.ts, 165, 3), Decl(immutable.d.ts, 166, 48), Decl(immutable.d.ts, 167, 49), Decl(immutable.d.ts, 168, 72)) ->M : Symbol(M, Decl(immutable.d.ts, 173, 12)) +>M : Symbol(M, Decl(immutable.ts, 173, 12)) +>context : Symbol(context, Decl(immutable.ts, 173, 73)) +>OrderedSet : Symbol(OrderedSet, Decl(immutable.ts, 159, 3), Decl(immutable.ts, 165, 3), Decl(immutable.ts, 166, 48), Decl(immutable.ts, 167, 49), Decl(immutable.ts, 168, 72)) +>M : Symbol(M, Decl(immutable.ts, 173, 12)) filter(predicate: (value: T, key: never, iter: this) => value is F, context?: any): OrderedSet; ->filter : Symbol(OrderedSet.filter, Decl(immutable.d.ts, 173, 104), Decl(immutable.d.ts, 174, 115)) ->F : Symbol(F, Decl(immutable.d.ts, 174, 11)) ->T : Symbol(T, Decl(immutable.d.ts, 169, 30)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 174, 24)) ->value : Symbol(value, Decl(immutable.d.ts, 174, 36)) ->T : Symbol(T, Decl(immutable.d.ts, 169, 30)) ->key : Symbol(key, Decl(immutable.d.ts, 174, 45)) ->iter : Symbol(iter, Decl(immutable.d.ts, 174, 57)) ->value : Symbol(value, Decl(immutable.d.ts, 174, 36)) ->F : Symbol(F, Decl(immutable.d.ts, 174, 11)) ->context : Symbol(context, Decl(immutable.d.ts, 174, 84)) ->OrderedSet : Symbol(OrderedSet, Decl(immutable.d.ts, 159, 3), Decl(immutable.d.ts, 165, 3), Decl(immutable.d.ts, 166, 48), Decl(immutable.d.ts, 167, 49), Decl(immutable.d.ts, 168, 72)) ->F : Symbol(F, Decl(immutable.d.ts, 174, 11)) +>filter : Symbol(OrderedSet.filter, Decl(immutable.ts, 173, 104), Decl(immutable.ts, 174, 115)) +>F : Symbol(F, Decl(immutable.ts, 174, 11)) +>T : Symbol(T, Decl(immutable.ts, 169, 30)) +>predicate : Symbol(predicate, Decl(immutable.ts, 174, 24)) +>value : Symbol(value, Decl(immutable.ts, 174, 36)) +>T : Symbol(T, Decl(immutable.ts, 169, 30)) +>key : Symbol(key, Decl(immutable.ts, 174, 45)) +>iter : Symbol(iter, Decl(immutable.ts, 174, 57)) +>value : Symbol(value, Decl(immutable.ts, 174, 36)) +>F : Symbol(F, Decl(immutable.ts, 174, 11)) +>context : Symbol(context, Decl(immutable.ts, 174, 84)) +>OrderedSet : Symbol(OrderedSet, Decl(immutable.ts, 159, 3), Decl(immutable.ts, 165, 3), Decl(immutable.ts, 166, 48), Decl(immutable.ts, 167, 49), Decl(immutable.ts, 168, 72)) +>F : Symbol(F, Decl(immutable.ts, 174, 11)) filter(predicate: (value: T, key: never, iter: this) => any, context?: any): this; ->filter : Symbol(OrderedSet.filter, Decl(immutable.d.ts, 173, 104), Decl(immutable.d.ts, 174, 115)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 175, 11)) ->value : Symbol(value, Decl(immutable.d.ts, 175, 23)) ->T : Symbol(T, Decl(immutable.d.ts, 169, 30)) ->key : Symbol(key, Decl(immutable.d.ts, 175, 32)) ->iter : Symbol(iter, Decl(immutable.d.ts, 175, 44)) ->context : Symbol(context, Decl(immutable.d.ts, 175, 64)) +>filter : Symbol(OrderedSet.filter, Decl(immutable.ts, 173, 104), Decl(immutable.ts, 174, 115)) +>predicate : Symbol(predicate, Decl(immutable.ts, 175, 11)) +>value : Symbol(value, Decl(immutable.ts, 175, 23)) +>T : Symbol(T, Decl(immutable.ts, 169, 30)) +>key : Symbol(key, Decl(immutable.ts, 175, 32)) +>iter : Symbol(iter, Decl(immutable.ts, 175, 44)) +>context : Symbol(context, Decl(immutable.ts, 175, 64)) zip(...collections: Array>): OrderedSet; ->zip : Symbol(OrderedSet.zip, Decl(immutable.d.ts, 175, 86)) ->collections : Symbol(collections, Decl(immutable.d.ts, 176, 8)) +>zip : Symbol(OrderedSet.zip, Decl(immutable.ts, 175, 86)) +>collections : Symbol(collections, Decl(immutable.ts, 176, 8)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->OrderedSet : Symbol(OrderedSet, Decl(immutable.d.ts, 159, 3), Decl(immutable.d.ts, 165, 3), Decl(immutable.d.ts, 166, 48), Decl(immutable.d.ts, 167, 49), Decl(immutable.d.ts, 168, 72)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>OrderedSet : Symbol(OrderedSet, Decl(immutable.ts, 159, 3), Decl(immutable.ts, 165, 3), Decl(immutable.ts, 166, 48), Decl(immutable.ts, 167, 49), Decl(immutable.ts, 168, 72)) zipWith(zipper: (value: T, otherValue: U) => Z, otherCollection: Collection): OrderedSet; ->zipWith : Symbol(OrderedSet.zipWith, Decl(immutable.d.ts, 176, 70), Decl(immutable.d.ts, 177, 110), Decl(immutable.d.ts, 178, 165)) ->U : Symbol(U, Decl(immutable.d.ts, 177, 12)) ->Z : Symbol(Z, Decl(immutable.d.ts, 177, 14)) ->zipper : Symbol(zipper, Decl(immutable.d.ts, 177, 18)) ->value : Symbol(value, Decl(immutable.d.ts, 177, 27)) ->T : Symbol(T, Decl(immutable.d.ts, 169, 30)) ->otherValue : Symbol(otherValue, Decl(immutable.d.ts, 177, 36)) ->U : Symbol(U, Decl(immutable.d.ts, 177, 12)) ->Z : Symbol(Z, Decl(immutable.d.ts, 177, 14)) ->otherCollection : Symbol(otherCollection, Decl(immutable.d.ts, 177, 57)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->U : Symbol(U, Decl(immutable.d.ts, 177, 12)) ->OrderedSet : Symbol(OrderedSet, Decl(immutable.d.ts, 159, 3), Decl(immutable.d.ts, 165, 3), Decl(immutable.d.ts, 166, 48), Decl(immutable.d.ts, 167, 49), Decl(immutable.d.ts, 168, 72)) ->Z : Symbol(Z, Decl(immutable.d.ts, 177, 14)) +>zipWith : Symbol(OrderedSet.zipWith, Decl(immutable.ts, 176, 70), Decl(immutable.ts, 177, 110), Decl(immutable.ts, 178, 165)) +>U : Symbol(U, Decl(immutable.ts, 177, 12)) +>Z : Symbol(Z, Decl(immutable.ts, 177, 14)) +>zipper : Symbol(zipper, Decl(immutable.ts, 177, 18)) +>value : Symbol(value, Decl(immutable.ts, 177, 27)) +>T : Symbol(T, Decl(immutable.ts, 169, 30)) +>otherValue : Symbol(otherValue, Decl(immutable.ts, 177, 36)) +>U : Symbol(U, Decl(immutable.ts, 177, 12)) +>Z : Symbol(Z, Decl(immutable.ts, 177, 14)) +>otherCollection : Symbol(otherCollection, Decl(immutable.ts, 177, 57)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>U : Symbol(U, Decl(immutable.ts, 177, 12)) +>OrderedSet : Symbol(OrderedSet, Decl(immutable.ts, 159, 3), Decl(immutable.ts, 165, 3), Decl(immutable.ts, 166, 48), Decl(immutable.ts, 167, 49), Decl(immutable.ts, 168, 72)) +>Z : Symbol(Z, Decl(immutable.ts, 177, 14)) zipWith(zipper: (value: T, otherValue: U, thirdValue: V) => Z, otherCollection: Collection, thirdCollection: Collection): OrderedSet; ->zipWith : Symbol(OrderedSet.zipWith, Decl(immutable.d.ts, 176, 70), Decl(immutable.d.ts, 177, 110), Decl(immutable.d.ts, 178, 165)) ->U : Symbol(U, Decl(immutable.d.ts, 178, 12)) ->V : Symbol(V, Decl(immutable.d.ts, 178, 14)) ->Z : Symbol(Z, Decl(immutable.d.ts, 178, 17)) ->zipper : Symbol(zipper, Decl(immutable.d.ts, 178, 21)) ->value : Symbol(value, Decl(immutable.d.ts, 178, 30)) ->T : Symbol(T, Decl(immutable.d.ts, 169, 30)) ->otherValue : Symbol(otherValue, Decl(immutable.d.ts, 178, 39)) ->U : Symbol(U, Decl(immutable.d.ts, 178, 12)) ->thirdValue : Symbol(thirdValue, Decl(immutable.d.ts, 178, 54)) ->V : Symbol(V, Decl(immutable.d.ts, 178, 14)) ->Z : Symbol(Z, Decl(immutable.d.ts, 178, 17)) ->otherCollection : Symbol(otherCollection, Decl(immutable.d.ts, 178, 75)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->U : Symbol(U, Decl(immutable.d.ts, 178, 12)) ->thirdCollection : Symbol(thirdCollection, Decl(immutable.d.ts, 178, 112)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->V : Symbol(V, Decl(immutable.d.ts, 178, 14)) ->OrderedSet : Symbol(OrderedSet, Decl(immutable.d.ts, 159, 3), Decl(immutable.d.ts, 165, 3), Decl(immutable.d.ts, 166, 48), Decl(immutable.d.ts, 167, 49), Decl(immutable.d.ts, 168, 72)) ->Z : Symbol(Z, Decl(immutable.d.ts, 178, 17)) +>zipWith : Symbol(OrderedSet.zipWith, Decl(immutable.ts, 176, 70), Decl(immutable.ts, 177, 110), Decl(immutable.ts, 178, 165)) +>U : Symbol(U, Decl(immutable.ts, 178, 12)) +>V : Symbol(V, Decl(immutable.ts, 178, 14)) +>Z : Symbol(Z, Decl(immutable.ts, 178, 17)) +>zipper : Symbol(zipper, Decl(immutable.ts, 178, 21)) +>value : Symbol(value, Decl(immutable.ts, 178, 30)) +>T : Symbol(T, Decl(immutable.ts, 169, 30)) +>otherValue : Symbol(otherValue, Decl(immutable.ts, 178, 39)) +>U : Symbol(U, Decl(immutable.ts, 178, 12)) +>thirdValue : Symbol(thirdValue, Decl(immutable.ts, 178, 54)) +>V : Symbol(V, Decl(immutable.ts, 178, 14)) +>Z : Symbol(Z, Decl(immutable.ts, 178, 17)) +>otherCollection : Symbol(otherCollection, Decl(immutable.ts, 178, 75)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>U : Symbol(U, Decl(immutable.ts, 178, 12)) +>thirdCollection : Symbol(thirdCollection, Decl(immutable.ts, 178, 112)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>V : Symbol(V, Decl(immutable.ts, 178, 14)) +>OrderedSet : Symbol(OrderedSet, Decl(immutable.ts, 159, 3), Decl(immutable.ts, 165, 3), Decl(immutable.ts, 166, 48), Decl(immutable.ts, 167, 49), Decl(immutable.ts, 168, 72)) +>Z : Symbol(Z, Decl(immutable.ts, 178, 17)) zipWith(zipper: (...any: Array) => Z, ...collections: Array>): OrderedSet; ->zipWith : Symbol(OrderedSet.zipWith, Decl(immutable.d.ts, 176, 70), Decl(immutable.d.ts, 177, 110), Decl(immutable.d.ts, 178, 165)) ->Z : Symbol(Z, Decl(immutable.d.ts, 179, 12)) ->zipper : Symbol(zipper, Decl(immutable.d.ts, 179, 15)) ->any : Symbol(any, Decl(immutable.d.ts, 179, 24)) +>zipWith : Symbol(OrderedSet.zipWith, Decl(immutable.ts, 176, 70), Decl(immutable.ts, 177, 110), Decl(immutable.ts, 178, 165)) +>Z : Symbol(Z, Decl(immutable.ts, 179, 12)) +>zipper : Symbol(zipper, Decl(immutable.ts, 179, 15)) +>any : Symbol(any, Decl(immutable.ts, 179, 24)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->Z : Symbol(Z, Decl(immutable.d.ts, 179, 12)) ->collections : Symbol(collections, Decl(immutable.d.ts, 179, 49)) +>Z : Symbol(Z, Decl(immutable.ts, 179, 12)) +>collections : Symbol(collections, Decl(immutable.ts, 179, 49)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->OrderedSet : Symbol(OrderedSet, Decl(immutable.d.ts, 159, 3), Decl(immutable.d.ts, 165, 3), Decl(immutable.d.ts, 166, 48), Decl(immutable.d.ts, 167, 49), Decl(immutable.d.ts, 168, 72)) ->Z : Symbol(Z, Decl(immutable.d.ts, 179, 12)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>OrderedSet : Symbol(OrderedSet, Decl(immutable.ts, 159, 3), Decl(immutable.ts, 165, 3), Decl(immutable.ts, 166, 48), Decl(immutable.ts, 167, 49), Decl(immutable.ts, 168, 72)) +>Z : Symbol(Z, Decl(immutable.ts, 179, 12)) } export module Stack { ->Stack : Symbol(Stack, Decl(immutable.d.ts, 180, 3), Decl(immutable.d.ts, 184, 3), Decl(immutable.d.ts, 185, 38), Decl(immutable.d.ts, 186, 39), Decl(immutable.d.ts, 187, 62)) +>Stack : Symbol(Stack, Decl(immutable.ts, 180, 3), Decl(immutable.ts, 184, 3), Decl(immutable.ts, 185, 38), Decl(immutable.ts, 186, 39), Decl(immutable.ts, 187, 62)) function isStack(maybeStack: any): maybeStack is Stack; ->isStack : Symbol(isStack, Decl(immutable.d.ts, 181, 23)) ->maybeStack : Symbol(maybeStack, Decl(immutable.d.ts, 182, 21)) ->maybeStack : Symbol(maybeStack, Decl(immutable.d.ts, 182, 21)) ->Stack : Symbol(Stack, Decl(immutable.d.ts, 180, 3), Decl(immutable.d.ts, 184, 3), Decl(immutable.d.ts, 185, 38), Decl(immutable.d.ts, 186, 39), Decl(immutable.d.ts, 187, 62)) +>isStack : Symbol(isStack, Decl(immutable.ts, 181, 23)) +>maybeStack : Symbol(maybeStack, Decl(immutable.ts, 182, 21)) +>maybeStack : Symbol(maybeStack, Decl(immutable.ts, 182, 21)) +>Stack : Symbol(Stack, Decl(immutable.ts, 180, 3), Decl(immutable.ts, 184, 3), Decl(immutable.ts, 185, 38), Decl(immutable.ts, 186, 39), Decl(immutable.ts, 187, 62)) function of(...values: Array): Stack; ->of : Symbol(of, Decl(immutable.d.ts, 182, 64)) ->T : Symbol(T, Decl(immutable.d.ts, 183, 16)) ->values : Symbol(values, Decl(immutable.d.ts, 183, 19)) +>of : Symbol(of, Decl(immutable.ts, 182, 64)) +>T : Symbol(T, Decl(immutable.ts, 183, 16)) +>values : Symbol(values, Decl(immutable.ts, 183, 19)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 183, 16)) ->Stack : Symbol(Stack, Decl(immutable.d.ts, 180, 3), Decl(immutable.d.ts, 184, 3), Decl(immutable.d.ts, 185, 38), Decl(immutable.d.ts, 186, 39), Decl(immutable.d.ts, 187, 62)) ->T : Symbol(T, Decl(immutable.d.ts, 183, 16)) +>T : Symbol(T, Decl(immutable.ts, 183, 16)) +>Stack : Symbol(Stack, Decl(immutable.ts, 180, 3), Decl(immutable.ts, 184, 3), Decl(immutable.ts, 185, 38), Decl(immutable.ts, 186, 39), Decl(immutable.ts, 187, 62)) +>T : Symbol(T, Decl(immutable.ts, 183, 16)) } export function Stack(): Stack; ->Stack : Symbol(Stack, Decl(immutable.d.ts, 180, 3), Decl(immutable.d.ts, 184, 3), Decl(immutable.d.ts, 185, 38), Decl(immutable.d.ts, 186, 39), Decl(immutable.d.ts, 187, 62)) ->Stack : Symbol(Stack, Decl(immutable.d.ts, 180, 3), Decl(immutable.d.ts, 184, 3), Decl(immutable.d.ts, 185, 38), Decl(immutable.d.ts, 186, 39), Decl(immutable.d.ts, 187, 62)) +>Stack : Symbol(Stack, Decl(immutable.ts, 180, 3), Decl(immutable.ts, 184, 3), Decl(immutable.ts, 185, 38), Decl(immutable.ts, 186, 39), Decl(immutable.ts, 187, 62)) +>Stack : Symbol(Stack, Decl(immutable.ts, 180, 3), Decl(immutable.ts, 184, 3), Decl(immutable.ts, 185, 38), Decl(immutable.ts, 186, 39), Decl(immutable.ts, 187, 62)) export function Stack(): Stack; ->Stack : Symbol(Stack, Decl(immutable.d.ts, 180, 3), Decl(immutable.d.ts, 184, 3), Decl(immutable.d.ts, 185, 38), Decl(immutable.d.ts, 186, 39), Decl(immutable.d.ts, 187, 62)) ->T : Symbol(T, Decl(immutable.d.ts, 186, 24)) ->Stack : Symbol(Stack, Decl(immutable.d.ts, 180, 3), Decl(immutable.d.ts, 184, 3), Decl(immutable.d.ts, 185, 38), Decl(immutable.d.ts, 186, 39), Decl(immutable.d.ts, 187, 62)) ->T : Symbol(T, Decl(immutable.d.ts, 186, 24)) +>Stack : Symbol(Stack, Decl(immutable.ts, 180, 3), Decl(immutable.ts, 184, 3), Decl(immutable.ts, 185, 38), Decl(immutable.ts, 186, 39), Decl(immutable.ts, 187, 62)) +>T : Symbol(T, Decl(immutable.ts, 186, 24)) +>Stack : Symbol(Stack, Decl(immutable.ts, 180, 3), Decl(immutable.ts, 184, 3), Decl(immutable.ts, 185, 38), Decl(immutable.ts, 186, 39), Decl(immutable.ts, 187, 62)) +>T : Symbol(T, Decl(immutable.ts, 186, 24)) export function Stack(collection: Iterable): Stack; ->Stack : Symbol(Stack, Decl(immutable.d.ts, 180, 3), Decl(immutable.d.ts, 184, 3), Decl(immutable.d.ts, 185, 38), Decl(immutable.d.ts, 186, 39), Decl(immutable.d.ts, 187, 62)) ->T : Symbol(T, Decl(immutable.d.ts, 187, 24)) ->collection : Symbol(collection, Decl(immutable.d.ts, 187, 27)) +>Stack : Symbol(Stack, Decl(immutable.ts, 180, 3), Decl(immutable.ts, 184, 3), Decl(immutable.ts, 185, 38), Decl(immutable.ts, 186, 39), Decl(immutable.ts, 187, 62)) +>T : Symbol(T, Decl(immutable.ts, 187, 24)) +>collection : Symbol(collection, Decl(immutable.ts, 187, 27)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 187, 24)) ->Stack : Symbol(Stack, Decl(immutable.d.ts, 180, 3), Decl(immutable.d.ts, 184, 3), Decl(immutable.d.ts, 185, 38), Decl(immutable.d.ts, 186, 39), Decl(immutable.d.ts, 187, 62)) ->T : Symbol(T, Decl(immutable.d.ts, 187, 24)) +>T : Symbol(T, Decl(immutable.ts, 187, 24)) +>Stack : Symbol(Stack, Decl(immutable.ts, 180, 3), Decl(immutable.ts, 184, 3), Decl(immutable.ts, 185, 38), Decl(immutable.ts, 186, 39), Decl(immutable.ts, 187, 62)) +>T : Symbol(T, Decl(immutable.ts, 187, 24)) export interface Stack extends Collection.Indexed { ->Stack : Symbol(Stack, Decl(immutable.d.ts, 180, 3), Decl(immutable.d.ts, 184, 3), Decl(immutable.d.ts, 185, 38), Decl(immutable.d.ts, 186, 39), Decl(immutable.d.ts, 187, 62)) ->T : Symbol(T, Decl(immutable.d.ts, 188, 25)) ->Collection.Indexed : Symbol(Collection.Indexed, Decl(immutable.d.ts, 355, 5), Decl(immutable.d.ts, 356, 28), Decl(immutable.d.ts, 357, 79)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Indexed : Symbol(Collection.Indexed, Decl(immutable.d.ts, 355, 5), Decl(immutable.d.ts, 356, 28), Decl(immutable.d.ts, 357, 79)) ->T : Symbol(T, Decl(immutable.d.ts, 188, 25)) +>Stack : Symbol(Stack, Decl(immutable.ts, 180, 3), Decl(immutable.ts, 184, 3), Decl(immutable.ts, 185, 38), Decl(immutable.ts, 186, 39), Decl(immutable.ts, 187, 62)) +>T : Symbol(T, Decl(immutable.ts, 188, 25)) +>Collection.Indexed : Symbol(Collection.Indexed, Decl(immutable.ts, 355, 5), Decl(immutable.ts, 356, 28), Decl(immutable.ts, 357, 79)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Indexed : Symbol(Collection.Indexed, Decl(immutable.ts, 355, 5), Decl(immutable.ts, 356, 28), Decl(immutable.ts, 357, 79)) +>T : Symbol(T, Decl(immutable.ts, 188, 25)) // Reading values peek(): T | undefined; ->peek : Symbol(Stack.peek, Decl(immutable.d.ts, 188, 59)) ->T : Symbol(T, Decl(immutable.d.ts, 188, 25)) +>peek : Symbol(Stack.peek, Decl(immutable.ts, 188, 59)) +>T : Symbol(T, Decl(immutable.ts, 188, 25)) // Persistent changes clear(): Stack; ->clear : Symbol(Stack.clear, Decl(immutable.d.ts, 190, 26)) ->Stack : Symbol(Stack, Decl(immutable.d.ts, 180, 3), Decl(immutable.d.ts, 184, 3), Decl(immutable.d.ts, 185, 38), Decl(immutable.d.ts, 186, 39), Decl(immutable.d.ts, 187, 62)) ->T : Symbol(T, Decl(immutable.d.ts, 188, 25)) +>clear : Symbol(Stack.clear, Decl(immutable.ts, 190, 26)) +>Stack : Symbol(Stack, Decl(immutable.ts, 180, 3), Decl(immutable.ts, 184, 3), Decl(immutable.ts, 185, 38), Decl(immutable.ts, 186, 39), Decl(immutable.ts, 187, 62)) +>T : Symbol(T, Decl(immutable.ts, 188, 25)) unshift(...values: Array): Stack; ->unshift : Symbol(Stack.unshift, Decl(immutable.d.ts, 192, 22)) ->values : Symbol(values, Decl(immutable.d.ts, 193, 12)) +>unshift : Symbol(Stack.unshift, Decl(immutable.ts, 192, 22)) +>values : Symbol(values, Decl(immutable.ts, 193, 12)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 188, 25)) ->Stack : Symbol(Stack, Decl(immutable.d.ts, 180, 3), Decl(immutable.d.ts, 184, 3), Decl(immutable.d.ts, 185, 38), Decl(immutable.d.ts, 186, 39), Decl(immutable.d.ts, 187, 62)) ->T : Symbol(T, Decl(immutable.d.ts, 188, 25)) +>T : Symbol(T, Decl(immutable.ts, 188, 25)) +>Stack : Symbol(Stack, Decl(immutable.ts, 180, 3), Decl(immutable.ts, 184, 3), Decl(immutable.ts, 185, 38), Decl(immutable.ts, 186, 39), Decl(immutable.ts, 187, 62)) +>T : Symbol(T, Decl(immutable.ts, 188, 25)) unshiftAll(iter: Iterable): Stack; ->unshiftAll : Symbol(Stack.unshiftAll, Decl(immutable.d.ts, 193, 43)) ->iter : Symbol(iter, Decl(immutable.d.ts, 194, 15)) +>unshiftAll : Symbol(Stack.unshiftAll, Decl(immutable.ts, 193, 43)) +>iter : Symbol(iter, Decl(immutable.ts, 194, 15)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 188, 25)) ->Stack : Symbol(Stack, Decl(immutable.d.ts, 180, 3), Decl(immutable.d.ts, 184, 3), Decl(immutable.d.ts, 185, 38), Decl(immutable.d.ts, 186, 39), Decl(immutable.d.ts, 187, 62)) ->T : Symbol(T, Decl(immutable.d.ts, 188, 25)) +>T : Symbol(T, Decl(immutable.ts, 188, 25)) +>Stack : Symbol(Stack, Decl(immutable.ts, 180, 3), Decl(immutable.ts, 184, 3), Decl(immutable.ts, 185, 38), Decl(immutable.ts, 186, 39), Decl(immutable.ts, 187, 62)) +>T : Symbol(T, Decl(immutable.ts, 188, 25)) shift(): Stack; ->shift : Symbol(Stack.shift, Decl(immutable.d.ts, 194, 44)) ->Stack : Symbol(Stack, Decl(immutable.d.ts, 180, 3), Decl(immutable.d.ts, 184, 3), Decl(immutable.d.ts, 185, 38), Decl(immutable.d.ts, 186, 39), Decl(immutable.d.ts, 187, 62)) ->T : Symbol(T, Decl(immutable.d.ts, 188, 25)) +>shift : Symbol(Stack.shift, Decl(immutable.ts, 194, 44)) +>Stack : Symbol(Stack, Decl(immutable.ts, 180, 3), Decl(immutable.ts, 184, 3), Decl(immutable.ts, 185, 38), Decl(immutable.ts, 186, 39), Decl(immutable.ts, 187, 62)) +>T : Symbol(T, Decl(immutable.ts, 188, 25)) push(...values: Array): Stack; ->push : Symbol(Stack.push, Decl(immutable.d.ts, 195, 22)) ->values : Symbol(values, Decl(immutable.d.ts, 196, 9)) +>push : Symbol(Stack.push, Decl(immutable.ts, 195, 22)) +>values : Symbol(values, Decl(immutable.ts, 196, 9)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 188, 25)) ->Stack : Symbol(Stack, Decl(immutable.d.ts, 180, 3), Decl(immutable.d.ts, 184, 3), Decl(immutable.d.ts, 185, 38), Decl(immutable.d.ts, 186, 39), Decl(immutable.d.ts, 187, 62)) ->T : Symbol(T, Decl(immutable.d.ts, 188, 25)) +>T : Symbol(T, Decl(immutable.ts, 188, 25)) +>Stack : Symbol(Stack, Decl(immutable.ts, 180, 3), Decl(immutable.ts, 184, 3), Decl(immutable.ts, 185, 38), Decl(immutable.ts, 186, 39), Decl(immutable.ts, 187, 62)) +>T : Symbol(T, Decl(immutable.ts, 188, 25)) pushAll(iter: Iterable): Stack; ->pushAll : Symbol(Stack.pushAll, Decl(immutable.d.ts, 196, 40)) ->iter : Symbol(iter, Decl(immutable.d.ts, 197, 12)) +>pushAll : Symbol(Stack.pushAll, Decl(immutable.ts, 196, 40)) +>iter : Symbol(iter, Decl(immutable.ts, 197, 12)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 188, 25)) ->Stack : Symbol(Stack, Decl(immutable.d.ts, 180, 3), Decl(immutable.d.ts, 184, 3), Decl(immutable.d.ts, 185, 38), Decl(immutable.d.ts, 186, 39), Decl(immutable.d.ts, 187, 62)) ->T : Symbol(T, Decl(immutable.d.ts, 188, 25)) +>T : Symbol(T, Decl(immutable.ts, 188, 25)) +>Stack : Symbol(Stack, Decl(immutable.ts, 180, 3), Decl(immutable.ts, 184, 3), Decl(immutable.ts, 185, 38), Decl(immutable.ts, 186, 39), Decl(immutable.ts, 187, 62)) +>T : Symbol(T, Decl(immutable.ts, 188, 25)) pop(): Stack; ->pop : Symbol(Stack.pop, Decl(immutable.d.ts, 197, 41)) ->Stack : Symbol(Stack, Decl(immutable.d.ts, 180, 3), Decl(immutable.d.ts, 184, 3), Decl(immutable.d.ts, 185, 38), Decl(immutable.d.ts, 186, 39), Decl(immutable.d.ts, 187, 62)) ->T : Symbol(T, Decl(immutable.d.ts, 188, 25)) +>pop : Symbol(Stack.pop, Decl(immutable.ts, 197, 41)) +>Stack : Symbol(Stack, Decl(immutable.ts, 180, 3), Decl(immutable.ts, 184, 3), Decl(immutable.ts, 185, 38), Decl(immutable.ts, 186, 39), Decl(immutable.ts, 187, 62)) +>T : Symbol(T, Decl(immutable.ts, 188, 25)) // Transient changes withMutations(mutator: (mutable: this) => any): this; ->withMutations : Symbol(Stack.withMutations, Decl(immutable.d.ts, 198, 20)) ->mutator : Symbol(mutator, Decl(immutable.d.ts, 200, 18)) ->mutable : Symbol(mutable, Decl(immutable.d.ts, 200, 28)) +>withMutations : Symbol(Stack.withMutations, Decl(immutable.ts, 198, 20)) +>mutator : Symbol(mutator, Decl(immutable.ts, 200, 18)) +>mutable : Symbol(mutable, Decl(immutable.ts, 200, 28)) asMutable(): this; ->asMutable : Symbol(Stack.asMutable, Decl(immutable.d.ts, 200, 57)) +>asMutable : Symbol(Stack.asMutable, Decl(immutable.ts, 200, 57)) asImmutable(): this; ->asImmutable : Symbol(Stack.asImmutable, Decl(immutable.d.ts, 201, 22)) +>asImmutable : Symbol(Stack.asImmutable, Decl(immutable.ts, 201, 22)) // Sequence algorithms concat(...valuesOrCollections: Array | C>): Stack; ->concat : Symbol(Stack.concat, Decl(immutable.d.ts, 202, 24)) ->C : Symbol(C, Decl(immutable.d.ts, 204, 11)) ->valuesOrCollections : Symbol(valuesOrCollections, Decl(immutable.d.ts, 204, 14)) +>concat : Symbol(Stack.concat, Decl(immutable.ts, 202, 24)) +>C : Symbol(C, Decl(immutable.ts, 204, 11)) +>valuesOrCollections : Symbol(valuesOrCollections, Decl(immutable.ts, 204, 14)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->C : Symbol(C, Decl(immutable.d.ts, 204, 11)) ->C : Symbol(C, Decl(immutable.d.ts, 204, 11)) ->Stack : Symbol(Stack, Decl(immutable.d.ts, 180, 3), Decl(immutable.d.ts, 184, 3), Decl(immutable.d.ts, 185, 38), Decl(immutable.d.ts, 186, 39), Decl(immutable.d.ts, 187, 62)) ->T : Symbol(T, Decl(immutable.d.ts, 188, 25)) ->C : Symbol(C, Decl(immutable.d.ts, 204, 11)) +>C : Symbol(C, Decl(immutable.ts, 204, 11)) +>C : Symbol(C, Decl(immutable.ts, 204, 11)) +>Stack : Symbol(Stack, Decl(immutable.ts, 180, 3), Decl(immutable.ts, 184, 3), Decl(immutable.ts, 185, 38), Decl(immutable.ts, 186, 39), Decl(immutable.ts, 187, 62)) +>T : Symbol(T, Decl(immutable.ts, 188, 25)) +>C : Symbol(C, Decl(immutable.ts, 204, 11)) map(mapper: (value: T, key: number, iter: this) => M, context?: any): Stack; ->map : Symbol(Stack.map, Decl(immutable.d.ts, 204, 76)) ->M : Symbol(M, Decl(immutable.d.ts, 205, 8)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 205, 11)) ->value : Symbol(value, Decl(immutable.d.ts, 205, 20)) ->T : Symbol(T, Decl(immutable.d.ts, 188, 25)) ->key : Symbol(key, Decl(immutable.d.ts, 205, 29)) ->iter : Symbol(iter, Decl(immutable.d.ts, 205, 42)) ->M : Symbol(M, Decl(immutable.d.ts, 205, 8)) ->context : Symbol(context, Decl(immutable.d.ts, 205, 60)) ->Stack : Symbol(Stack, Decl(immutable.d.ts, 180, 3), Decl(immutable.d.ts, 184, 3), Decl(immutable.d.ts, 185, 38), Decl(immutable.d.ts, 186, 39), Decl(immutable.d.ts, 187, 62)) ->M : Symbol(M, Decl(immutable.d.ts, 205, 8)) +>map : Symbol(Stack.map, Decl(immutable.ts, 204, 76)) +>M : Symbol(M, Decl(immutable.ts, 205, 8)) +>mapper : Symbol(mapper, Decl(immutable.ts, 205, 11)) +>value : Symbol(value, Decl(immutable.ts, 205, 20)) +>T : Symbol(T, Decl(immutable.ts, 188, 25)) +>key : Symbol(key, Decl(immutable.ts, 205, 29)) +>iter : Symbol(iter, Decl(immutable.ts, 205, 42)) +>M : Symbol(M, Decl(immutable.ts, 205, 8)) +>context : Symbol(context, Decl(immutable.ts, 205, 60)) +>Stack : Symbol(Stack, Decl(immutable.ts, 180, 3), Decl(immutable.ts, 184, 3), Decl(immutable.ts, 185, 38), Decl(immutable.ts, 186, 39), Decl(immutable.ts, 187, 62)) +>M : Symbol(M, Decl(immutable.ts, 205, 8)) flatMap(mapper: (value: T, key: number, iter: this) => Iterable, context?: any): Stack; ->flatMap : Symbol(Stack.flatMap, Decl(immutable.d.ts, 205, 86)) ->M : Symbol(M, Decl(immutable.d.ts, 206, 12)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 206, 15)) ->value : Symbol(value, Decl(immutable.d.ts, 206, 24)) ->T : Symbol(T, Decl(immutable.d.ts, 188, 25)) ->key : Symbol(key, Decl(immutable.d.ts, 206, 33)) ->iter : Symbol(iter, Decl(immutable.d.ts, 206, 46)) +>flatMap : Symbol(Stack.flatMap, Decl(immutable.ts, 205, 86)) +>M : Symbol(M, Decl(immutable.ts, 206, 12)) +>mapper : Symbol(mapper, Decl(immutable.ts, 206, 15)) +>value : Symbol(value, Decl(immutable.ts, 206, 24)) +>T : Symbol(T, Decl(immutable.ts, 188, 25)) +>key : Symbol(key, Decl(immutable.ts, 206, 33)) +>iter : Symbol(iter, Decl(immutable.ts, 206, 46)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->M : Symbol(M, Decl(immutable.d.ts, 206, 12)) ->context : Symbol(context, Decl(immutable.d.ts, 206, 74)) ->Stack : Symbol(Stack, Decl(immutable.d.ts, 180, 3), Decl(immutable.d.ts, 184, 3), Decl(immutable.d.ts, 185, 38), Decl(immutable.d.ts, 186, 39), Decl(immutable.d.ts, 187, 62)) ->M : Symbol(M, Decl(immutable.d.ts, 206, 12)) +>M : Symbol(M, Decl(immutable.ts, 206, 12)) +>context : Symbol(context, Decl(immutable.ts, 206, 74)) +>Stack : Symbol(Stack, Decl(immutable.ts, 180, 3), Decl(immutable.ts, 184, 3), Decl(immutable.ts, 185, 38), Decl(immutable.ts, 186, 39), Decl(immutable.ts, 187, 62)) +>M : Symbol(M, Decl(immutable.ts, 206, 12)) filter(predicate: (value: T, index: number, iter: this) => value is F, context?: any): Set; ->filter : Symbol(Stack.filter, Decl(immutable.d.ts, 206, 100), Decl(immutable.d.ts, 207, 111)) ->F : Symbol(F, Decl(immutable.d.ts, 207, 11)) ->T : Symbol(T, Decl(immutable.d.ts, 188, 25)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 207, 24)) ->value : Symbol(value, Decl(immutable.d.ts, 207, 36)) ->T : Symbol(T, Decl(immutable.d.ts, 188, 25)) ->index : Symbol(index, Decl(immutable.d.ts, 207, 45)) ->iter : Symbol(iter, Decl(immutable.d.ts, 207, 60)) ->value : Symbol(value, Decl(immutable.d.ts, 207, 36)) ->F : Symbol(F, Decl(immutable.d.ts, 207, 11)) ->context : Symbol(context, Decl(immutable.d.ts, 207, 87)) ->Set : Symbol(Set, Decl(immutable.d.ts, 127, 3), Decl(immutable.d.ts, 135, 3), Decl(immutable.d.ts, 136, 34), Decl(immutable.d.ts, 137, 35), Decl(immutable.d.ts, 138, 58)) ->F : Symbol(F, Decl(immutable.d.ts, 207, 11)) +>filter : Symbol(Stack.filter, Decl(immutable.ts, 206, 100), Decl(immutable.ts, 207, 111)) +>F : Symbol(F, Decl(immutable.ts, 207, 11)) +>T : Symbol(T, Decl(immutable.ts, 188, 25)) +>predicate : Symbol(predicate, Decl(immutable.ts, 207, 24)) +>value : Symbol(value, Decl(immutable.ts, 207, 36)) +>T : Symbol(T, Decl(immutable.ts, 188, 25)) +>index : Symbol(index, Decl(immutable.ts, 207, 45)) +>iter : Symbol(iter, Decl(immutable.ts, 207, 60)) +>value : Symbol(value, Decl(immutable.ts, 207, 36)) +>F : Symbol(F, Decl(immutable.ts, 207, 11)) +>context : Symbol(context, Decl(immutable.ts, 207, 87)) +>Set : Symbol(Set, Decl(immutable.ts, 127, 3), Decl(immutable.ts, 135, 3), Decl(immutable.ts, 136, 34), Decl(immutable.ts, 137, 35), Decl(immutable.ts, 138, 58)) +>F : Symbol(F, Decl(immutable.ts, 207, 11)) filter(predicate: (value: T, index: number, iter: this) => any, context?: any): this; ->filter : Symbol(Stack.filter, Decl(immutable.d.ts, 206, 100), Decl(immutable.d.ts, 207, 111)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 208, 11)) ->value : Symbol(value, Decl(immutable.d.ts, 208, 23)) ->T : Symbol(T, Decl(immutable.d.ts, 188, 25)) ->index : Symbol(index, Decl(immutable.d.ts, 208, 32)) ->iter : Symbol(iter, Decl(immutable.d.ts, 208, 47)) ->context : Symbol(context, Decl(immutable.d.ts, 208, 67)) +>filter : Symbol(Stack.filter, Decl(immutable.ts, 206, 100), Decl(immutable.ts, 207, 111)) +>predicate : Symbol(predicate, Decl(immutable.ts, 208, 11)) +>value : Symbol(value, Decl(immutable.ts, 208, 23)) +>T : Symbol(T, Decl(immutable.ts, 188, 25)) +>index : Symbol(index, Decl(immutable.ts, 208, 32)) +>iter : Symbol(iter, Decl(immutable.ts, 208, 47)) +>context : Symbol(context, Decl(immutable.ts, 208, 67)) } export function Range(start?: number, end?: number, step?: number): Seq.Indexed; ->Range : Symbol(Range, Decl(immutable.d.ts, 209, 3)) ->start : Symbol(start, Decl(immutable.d.ts, 210, 24)) ->end : Symbol(end, Decl(immutable.d.ts, 210, 39)) ->step : Symbol(step, Decl(immutable.d.ts, 210, 53)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Indexed : Symbol(Seq.Indexed, Decl(immutable.d.ts, 281, 5), Decl(immutable.d.ts, 284, 5), Decl(immutable.d.ts, 285, 48), Decl(immutable.d.ts, 286, 49), Decl(immutable.d.ts, 287, 72)) +>Range : Symbol(Range, Decl(immutable.ts, 209, 3)) +>start : Symbol(start, Decl(immutable.ts, 210, 24)) +>end : Symbol(end, Decl(immutable.ts, 210, 39)) +>step : Symbol(step, Decl(immutable.ts, 210, 53)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Indexed : Symbol(Seq.Indexed, Decl(immutable.ts, 281, 5), Decl(immutable.ts, 284, 5), Decl(immutable.ts, 285, 48), Decl(immutable.ts, 286, 49), Decl(immutable.ts, 287, 72)) export function Repeat(value: T, times?: number): Seq.Indexed; ->Repeat : Symbol(Repeat, Decl(immutable.d.ts, 210, 90)) ->T : Symbol(T, Decl(immutable.d.ts, 211, 25)) ->value : Symbol(value, Decl(immutable.d.ts, 211, 28)) ->T : Symbol(T, Decl(immutable.d.ts, 211, 25)) ->times : Symbol(times, Decl(immutable.d.ts, 211, 37)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Indexed : Symbol(Seq.Indexed, Decl(immutable.d.ts, 281, 5), Decl(immutable.d.ts, 284, 5), Decl(immutable.d.ts, 285, 48), Decl(immutable.d.ts, 286, 49), Decl(immutable.d.ts, 287, 72)) ->T : Symbol(T, Decl(immutable.d.ts, 211, 25)) +>Repeat : Symbol(Repeat, Decl(immutable.ts, 210, 90)) +>T : Symbol(T, Decl(immutable.ts, 211, 25)) +>value : Symbol(value, Decl(immutable.ts, 211, 28)) +>T : Symbol(T, Decl(immutable.ts, 211, 25)) +>times : Symbol(times, Decl(immutable.ts, 211, 37)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Indexed : Symbol(Seq.Indexed, Decl(immutable.ts, 281, 5), Decl(immutable.ts, 284, 5), Decl(immutable.ts, 285, 48), Decl(immutable.ts, 286, 49), Decl(immutable.ts, 287, 72)) +>T : Symbol(T, Decl(immutable.ts, 211, 25)) export module Record { ->Record : Symbol(Record, Decl(immutable.d.ts, 211, 70), Decl(immutable.d.ts, 259, 3)) +>Record : Symbol(Record, Decl(immutable.ts, 211, 70), Decl(immutable.ts, 259, 3)) export function isRecord(maybeRecord: any): maybeRecord is Record.Instance; ->isRecord : Symbol(isRecord, Decl(immutable.d.ts, 212, 24)) ->maybeRecord : Symbol(maybeRecord, Decl(immutable.d.ts, 213, 29)) ->maybeRecord : Symbol(maybeRecord, Decl(immutable.d.ts, 213, 29)) ->Record : Symbol(Record, Decl(immutable.d.ts, 211, 70), Decl(immutable.d.ts, 259, 3)) ->Instance : Symbol(Instance, Decl(immutable.d.ts, 218, 5)) +>isRecord : Symbol(isRecord, Decl(immutable.ts, 212, 24)) +>maybeRecord : Symbol(maybeRecord, Decl(immutable.ts, 213, 29)) +>maybeRecord : Symbol(maybeRecord, Decl(immutable.ts, 213, 29)) +>Record : Symbol(Record, Decl(immutable.ts, 211, 70), Decl(immutable.ts, 259, 3)) +>Instance : Symbol(Instance, Decl(immutable.ts, 218, 5)) export function getDescriptiveName(record: Instance): string; ->getDescriptiveName : Symbol(getDescriptiveName, Decl(immutable.d.ts, 213, 84)) ->record : Symbol(record, Decl(immutable.d.ts, 214, 39)) ->Instance : Symbol(Instance, Decl(immutable.d.ts, 218, 5)) +>getDescriptiveName : Symbol(getDescriptiveName, Decl(immutable.ts, 213, 84)) +>record : Symbol(record, Decl(immutable.ts, 214, 39)) +>Instance : Symbol(Instance, Decl(immutable.ts, 218, 5)) export interface Class { ->Class : Symbol(Class, Decl(immutable.d.ts, 214, 70)) ->T : Symbol(T, Decl(immutable.d.ts, 215, 27)) +>Class : Symbol(Class, Decl(immutable.ts, 214, 70)) +>T : Symbol(T, Decl(immutable.ts, 215, 27)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) (values?: Partial | Iterable<[string, any]>): Instance & Readonly; ->values : Symbol(values, Decl(immutable.d.ts, 216, 7)) +>values : Symbol(values, Decl(immutable.ts, 216, 7)) >Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 215, 27)) +>T : Symbol(T, Decl(immutable.ts, 215, 27)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->Instance : Symbol(Instance, Decl(immutable.d.ts, 218, 5)) ->T : Symbol(T, Decl(immutable.d.ts, 215, 27)) +>Instance : Symbol(Instance, Decl(immutable.ts, 218, 5)) +>T : Symbol(T, Decl(immutable.ts, 215, 27)) >Readonly : Symbol(Readonly, Decl(lib.es5.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 215, 27)) +>T : Symbol(T, Decl(immutable.ts, 215, 27)) new (values?: Partial | Iterable<[string, any]>): Instance & Readonly; ->values : Symbol(values, Decl(immutable.d.ts, 217, 11)) +>values : Symbol(values, Decl(immutable.ts, 217, 11)) >Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 215, 27)) +>T : Symbol(T, Decl(immutable.ts, 215, 27)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->Instance : Symbol(Instance, Decl(immutable.d.ts, 218, 5)) ->T : Symbol(T, Decl(immutable.d.ts, 215, 27)) +>Instance : Symbol(Instance, Decl(immutable.ts, 218, 5)) +>T : Symbol(T, Decl(immutable.ts, 215, 27)) >Readonly : Symbol(Readonly, Decl(lib.es5.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 215, 27)) +>T : Symbol(T, Decl(immutable.ts, 215, 27)) } export interface Instance { ->Instance : Symbol(Instance, Decl(immutable.d.ts, 218, 5)) ->T : Symbol(T, Decl(immutable.d.ts, 219, 30)) +>Instance : Symbol(Instance, Decl(immutable.ts, 218, 5)) +>T : Symbol(T, Decl(immutable.ts, 219, 30)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) readonly size: number; ->size : Symbol(Instance.size, Decl(immutable.d.ts, 219, 49)) +>size : Symbol(Instance.size, Decl(immutable.ts, 219, 49)) // Reading values has(key: string): boolean; ->has : Symbol(Instance.has, Decl(immutable.d.ts, 220, 28)) ->key : Symbol(key, Decl(immutable.d.ts, 222, 10)) +>has : Symbol(Instance.has, Decl(immutable.ts, 220, 28)) +>key : Symbol(key, Decl(immutable.ts, 222, 10)) get(key: K): T[K]; ->get : Symbol(Instance.get, Decl(immutable.d.ts, 222, 32)) ->K : Symbol(K, Decl(immutable.d.ts, 223, 10)) ->T : Symbol(T, Decl(immutable.d.ts, 219, 30)) ->key : Symbol(key, Decl(immutable.d.ts, 223, 29)) ->K : Symbol(K, Decl(immutable.d.ts, 223, 10)) ->T : Symbol(T, Decl(immutable.d.ts, 219, 30)) ->K : Symbol(K, Decl(immutable.d.ts, 223, 10)) +>get : Symbol(Instance.get, Decl(immutable.ts, 222, 32)) +>K : Symbol(K, Decl(immutable.ts, 223, 10)) +>T : Symbol(T, Decl(immutable.ts, 219, 30)) +>key : Symbol(key, Decl(immutable.ts, 223, 29)) +>K : Symbol(K, Decl(immutable.ts, 223, 10)) +>T : Symbol(T, Decl(immutable.ts, 219, 30)) +>K : Symbol(K, Decl(immutable.ts, 223, 10)) // Reading deep values hasIn(keyPath: Iterable): boolean; ->hasIn : Symbol(Instance.hasIn, Decl(immutable.d.ts, 223, 43)) ->keyPath : Symbol(keyPath, Decl(immutable.d.ts, 225, 12)) +>hasIn : Symbol(Instance.hasIn, Decl(immutable.ts, 223, 43)) +>keyPath : Symbol(keyPath, Decl(immutable.ts, 225, 12)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) getIn(keyPath: Iterable): any; ->getIn : Symbol(Instance.getIn, Decl(immutable.d.ts, 225, 45)) ->keyPath : Symbol(keyPath, Decl(immutable.d.ts, 226, 12)) +>getIn : Symbol(Instance.getIn, Decl(immutable.ts, 225, 45)) +>keyPath : Symbol(keyPath, Decl(immutable.ts, 226, 12)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) // Value equality equals(other: any): boolean; ->equals : Symbol(Instance.equals, Decl(immutable.d.ts, 226, 41)) ->other : Symbol(other, Decl(immutable.d.ts, 228, 13)) +>equals : Symbol(Instance.equals, Decl(immutable.ts, 226, 41)) +>other : Symbol(other, Decl(immutable.ts, 228, 13)) hashCode(): number; ->hashCode : Symbol(Instance.hashCode, Decl(immutable.d.ts, 228, 34)) +>hashCode : Symbol(Instance.hashCode, Decl(immutable.ts, 228, 34)) // Persistent changes set(key: K, value: T[K]): this; ->set : Symbol(Instance.set, Decl(immutable.d.ts, 229, 25)) ->K : Symbol(K, Decl(immutable.d.ts, 231, 10)) ->T : Symbol(T, Decl(immutable.d.ts, 219, 30)) ->key : Symbol(key, Decl(immutable.d.ts, 231, 29)) ->K : Symbol(K, Decl(immutable.d.ts, 231, 10)) ->value : Symbol(value, Decl(immutable.d.ts, 231, 36)) ->T : Symbol(T, Decl(immutable.d.ts, 219, 30)) ->K : Symbol(K, Decl(immutable.d.ts, 231, 10)) +>set : Symbol(Instance.set, Decl(immutable.ts, 229, 25)) +>K : Symbol(K, Decl(immutable.ts, 231, 10)) +>T : Symbol(T, Decl(immutable.ts, 219, 30)) +>key : Symbol(key, Decl(immutable.ts, 231, 29)) +>K : Symbol(K, Decl(immutable.ts, 231, 10)) +>value : Symbol(value, Decl(immutable.ts, 231, 36)) +>T : Symbol(T, Decl(immutable.ts, 219, 30)) +>K : Symbol(K, Decl(immutable.ts, 231, 10)) update(key: K, updater: (value: T[K]) => T[K]): this; ->update : Symbol(Instance.update, Decl(immutable.d.ts, 231, 56)) ->K : Symbol(K, Decl(immutable.d.ts, 232, 13)) ->T : Symbol(T, Decl(immutable.d.ts, 219, 30)) ->key : Symbol(key, Decl(immutable.d.ts, 232, 32)) ->K : Symbol(K, Decl(immutable.d.ts, 232, 13)) ->updater : Symbol(updater, Decl(immutable.d.ts, 232, 39)) ->value : Symbol(value, Decl(immutable.d.ts, 232, 50)) ->T : Symbol(T, Decl(immutable.d.ts, 219, 30)) ->K : Symbol(K, Decl(immutable.d.ts, 232, 13)) ->T : Symbol(T, Decl(immutable.d.ts, 219, 30)) ->K : Symbol(K, Decl(immutable.d.ts, 232, 13)) +>update : Symbol(Instance.update, Decl(immutable.ts, 231, 56)) +>K : Symbol(K, Decl(immutable.ts, 232, 13)) +>T : Symbol(T, Decl(immutable.ts, 219, 30)) +>key : Symbol(key, Decl(immutable.ts, 232, 32)) +>K : Symbol(K, Decl(immutable.ts, 232, 13)) +>updater : Symbol(updater, Decl(immutable.ts, 232, 39)) +>value : Symbol(value, Decl(immutable.ts, 232, 50)) +>T : Symbol(T, Decl(immutable.ts, 219, 30)) +>K : Symbol(K, Decl(immutable.ts, 232, 13)) +>T : Symbol(T, Decl(immutable.ts, 219, 30)) +>K : Symbol(K, Decl(immutable.ts, 232, 13)) merge(...collections: Array | Iterable<[string, any]>>): this; ->merge : Symbol(Instance.merge, Decl(immutable.d.ts, 232, 78)) ->collections : Symbol(collections, Decl(immutable.d.ts, 233, 12)) +>merge : Symbol(Instance.merge, Decl(immutable.ts, 232, 78)) +>collections : Symbol(collections, Decl(immutable.ts, 233, 12)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 219, 30)) +>T : Symbol(T, Decl(immutable.ts, 219, 30)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) mergeDeep(...collections: Array | Iterable<[string, any]>>): this; ->mergeDeep : Symbol(Instance.mergeDeep, Decl(immutable.d.ts, 233, 79)) ->collections : Symbol(collections, Decl(immutable.d.ts, 234, 16)) +>mergeDeep : Symbol(Instance.mergeDeep, Decl(immutable.ts, 233, 79)) +>collections : Symbol(collections, Decl(immutable.ts, 234, 16)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 219, 30)) +>T : Symbol(T, Decl(immutable.ts, 219, 30)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) mergeWith(merger: (oldVal: any, newVal: any, key: keyof T) => any, ...collections: Array | Iterable<[string, any]>>): this; ->mergeWith : Symbol(Instance.mergeWith, Decl(immutable.d.ts, 234, 83)) ->merger : Symbol(merger, Decl(immutable.d.ts, 235, 16)) ->oldVal : Symbol(oldVal, Decl(immutable.d.ts, 235, 25)) ->newVal : Symbol(newVal, Decl(immutable.d.ts, 235, 37)) ->key : Symbol(key, Decl(immutable.d.ts, 235, 50)) ->T : Symbol(T, Decl(immutable.d.ts, 219, 30)) ->collections : Symbol(collections, Decl(immutable.d.ts, 235, 72)) +>mergeWith : Symbol(Instance.mergeWith, Decl(immutable.ts, 234, 83)) +>merger : Symbol(merger, Decl(immutable.ts, 235, 16)) +>oldVal : Symbol(oldVal, Decl(immutable.ts, 235, 25)) +>newVal : Symbol(newVal, Decl(immutable.ts, 235, 37)) +>key : Symbol(key, Decl(immutable.ts, 235, 50)) +>T : Symbol(T, Decl(immutable.ts, 219, 30)) +>collections : Symbol(collections, Decl(immutable.ts, 235, 72)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 219, 30)) +>T : Symbol(T, Decl(immutable.ts, 219, 30)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) mergeDeepWith(merger: (oldVal: any, newVal: any, key: any) => any, ...collections: Array | Iterable<[string, any]>>): this; ->mergeDeepWith : Symbol(Instance.mergeDeepWith, Decl(immutable.d.ts, 235, 140)) ->merger : Symbol(merger, Decl(immutable.d.ts, 236, 20)) ->oldVal : Symbol(oldVal, Decl(immutable.d.ts, 236, 29)) ->newVal : Symbol(newVal, Decl(immutable.d.ts, 236, 41)) ->key : Symbol(key, Decl(immutable.d.ts, 236, 54)) ->collections : Symbol(collections, Decl(immutable.d.ts, 236, 72)) +>mergeDeepWith : Symbol(Instance.mergeDeepWith, Decl(immutable.ts, 235, 140)) +>merger : Symbol(merger, Decl(immutable.ts, 236, 20)) +>oldVal : Symbol(oldVal, Decl(immutable.ts, 236, 29)) +>newVal : Symbol(newVal, Decl(immutable.ts, 236, 41)) +>key : Symbol(key, Decl(immutable.ts, 236, 54)) +>collections : Symbol(collections, Decl(immutable.ts, 236, 72)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 219, 30)) +>T : Symbol(T, Decl(immutable.ts, 219, 30)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) delete(key: K): this; ->delete : Symbol(Instance.delete, Decl(immutable.d.ts, 236, 140)) ->K : Symbol(K, Decl(immutable.d.ts, 237, 13)) ->T : Symbol(T, Decl(immutable.d.ts, 219, 30)) ->key : Symbol(key, Decl(immutable.d.ts, 237, 32)) ->K : Symbol(K, Decl(immutable.d.ts, 237, 13)) +>delete : Symbol(Instance.delete, Decl(immutable.ts, 236, 140)) +>K : Symbol(K, Decl(immutable.ts, 237, 13)) +>T : Symbol(T, Decl(immutable.ts, 219, 30)) +>key : Symbol(key, Decl(immutable.ts, 237, 32)) +>K : Symbol(K, Decl(immutable.ts, 237, 13)) remove(key: K): this; ->remove : Symbol(Instance.remove, Decl(immutable.d.ts, 237, 46)) ->K : Symbol(K, Decl(immutable.d.ts, 238, 13)) ->T : Symbol(T, Decl(immutable.d.ts, 219, 30)) ->key : Symbol(key, Decl(immutable.d.ts, 238, 32)) ->K : Symbol(K, Decl(immutable.d.ts, 238, 13)) +>remove : Symbol(Instance.remove, Decl(immutable.ts, 237, 46)) +>K : Symbol(K, Decl(immutable.ts, 238, 13)) +>T : Symbol(T, Decl(immutable.ts, 219, 30)) +>key : Symbol(key, Decl(immutable.ts, 238, 32)) +>K : Symbol(K, Decl(immutable.ts, 238, 13)) clear(): this; ->clear : Symbol(Instance.clear, Decl(immutable.d.ts, 238, 46)) +>clear : Symbol(Instance.clear, Decl(immutable.ts, 238, 46)) // Deep persistent changes setIn(keyPath: Iterable, value: any): this; ->setIn : Symbol(Instance.setIn, Decl(immutable.d.ts, 239, 20)) ->keyPath : Symbol(keyPath, Decl(immutable.d.ts, 241, 12)) +>setIn : Symbol(Instance.setIn, Decl(immutable.ts, 239, 20)) +>keyPath : Symbol(keyPath, Decl(immutable.ts, 241, 12)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->value : Symbol(value, Decl(immutable.d.ts, 241, 35)) +>value : Symbol(value, Decl(immutable.ts, 241, 35)) updateIn(keyPath: Iterable, updater: (value: any) => any): this; ->updateIn : Symbol(Instance.updateIn, Decl(immutable.d.ts, 241, 54)) ->keyPath : Symbol(keyPath, Decl(immutable.d.ts, 242, 15)) +>updateIn : Symbol(Instance.updateIn, Decl(immutable.ts, 241, 54)) +>keyPath : Symbol(keyPath, Decl(immutable.ts, 242, 15)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->updater : Symbol(updater, Decl(immutable.d.ts, 242, 38)) ->value : Symbol(value, Decl(immutable.d.ts, 242, 49)) +>updater : Symbol(updater, Decl(immutable.ts, 242, 38)) +>value : Symbol(value, Decl(immutable.ts, 242, 49)) mergeIn(keyPath: Iterable, ...collections: Array): this; ->mergeIn : Symbol(Instance.mergeIn, Decl(immutable.d.ts, 242, 75)) ->keyPath : Symbol(keyPath, Decl(immutable.d.ts, 243, 14)) +>mergeIn : Symbol(Instance.mergeIn, Decl(immutable.ts, 242, 75)) +>keyPath : Symbol(keyPath, Decl(immutable.ts, 243, 14)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->collections : Symbol(collections, Decl(immutable.d.ts, 243, 37)) +>collections : Symbol(collections, Decl(immutable.ts, 243, 37)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) mergeDeepIn(keyPath: Iterable, ...collections: Array): this; ->mergeDeepIn : Symbol(Instance.mergeDeepIn, Decl(immutable.d.ts, 243, 72)) ->keyPath : Symbol(keyPath, Decl(immutable.d.ts, 244, 18)) +>mergeDeepIn : Symbol(Instance.mergeDeepIn, Decl(immutable.ts, 243, 72)) +>keyPath : Symbol(keyPath, Decl(immutable.ts, 244, 18)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->collections : Symbol(collections, Decl(immutable.d.ts, 244, 41)) +>collections : Symbol(collections, Decl(immutable.ts, 244, 41)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) deleteIn(keyPath: Iterable): this; ->deleteIn : Symbol(Instance.deleteIn, Decl(immutable.d.ts, 244, 76)) ->keyPath : Symbol(keyPath, Decl(immutable.d.ts, 245, 15)) +>deleteIn : Symbol(Instance.deleteIn, Decl(immutable.ts, 244, 76)) +>keyPath : Symbol(keyPath, Decl(immutable.ts, 245, 15)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) removeIn(keyPath: Iterable): this; ->removeIn : Symbol(Instance.removeIn, Decl(immutable.d.ts, 245, 45)) ->keyPath : Symbol(keyPath, Decl(immutable.d.ts, 246, 15)) +>removeIn : Symbol(Instance.removeIn, Decl(immutable.ts, 245, 45)) +>keyPath : Symbol(keyPath, Decl(immutable.ts, 246, 15)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) // Conversion to JavaScript types toJS(): { [K in keyof T]: any }; ->toJS : Symbol(Instance.toJS, Decl(immutable.d.ts, 246, 45)) ->K : Symbol(K, Decl(immutable.d.ts, 248, 17)) ->T : Symbol(T, Decl(immutable.d.ts, 219, 30)) +>toJS : Symbol(Instance.toJS, Decl(immutable.ts, 246, 45)) +>K : Symbol(K, Decl(immutable.ts, 248, 17)) +>T : Symbol(T, Decl(immutable.ts, 219, 30)) toJSON(): T; ->toJSON : Symbol(Instance.toJSON, Decl(immutable.d.ts, 248, 38)) ->T : Symbol(T, Decl(immutable.d.ts, 219, 30)) +>toJSON : Symbol(Instance.toJSON, Decl(immutable.ts, 248, 38)) +>T : Symbol(T, Decl(immutable.ts, 219, 30)) toObject(): T; ->toObject : Symbol(Instance.toObject, Decl(immutable.d.ts, 249, 18)) ->T : Symbol(T, Decl(immutable.d.ts, 219, 30)) +>toObject : Symbol(Instance.toObject, Decl(immutable.ts, 249, 18)) +>T : Symbol(T, Decl(immutable.ts, 219, 30)) // Transient changes withMutations(mutator: (mutable: this) => any): this; ->withMutations : Symbol(Instance.withMutations, Decl(immutable.d.ts, 250, 20)) ->mutator : Symbol(mutator, Decl(immutable.d.ts, 252, 20)) ->mutable : Symbol(mutable, Decl(immutable.d.ts, 252, 30)) +>withMutations : Symbol(Instance.withMutations, Decl(immutable.ts, 250, 20)) +>mutator : Symbol(mutator, Decl(immutable.ts, 252, 20)) +>mutable : Symbol(mutable, Decl(immutable.ts, 252, 30)) asMutable(): this; ->asMutable : Symbol(Instance.asMutable, Decl(immutable.d.ts, 252, 59)) +>asMutable : Symbol(Instance.asMutable, Decl(immutable.ts, 252, 59)) asImmutable(): this; ->asImmutable : Symbol(Instance.asImmutable, Decl(immutable.d.ts, 253, 24)) +>asImmutable : Symbol(Instance.asImmutable, Decl(immutable.ts, 253, 24)) // Sequence algorithms toSeq(): Seq.Keyed; ->toSeq : Symbol(Instance.toSeq, Decl(immutable.d.ts, 254, 26)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Keyed : Symbol(Seq.Keyed, Decl(immutable.d.ts, 263, 56), Decl(immutable.d.ts, 264, 26), Decl(immutable.d.ts, 265, 79), Decl(immutable.d.ts, 266, 76), Decl(immutable.d.ts, 267, 51) ... and 1 more) ->T : Symbol(T, Decl(immutable.d.ts, 219, 30)) ->T : Symbol(T, Decl(immutable.d.ts, 219, 30)) ->T : Symbol(T, Decl(immutable.d.ts, 219, 30)) +>toSeq : Symbol(Instance.toSeq, Decl(immutable.ts, 254, 26)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Keyed : Symbol(Seq.Keyed, Decl(immutable.ts, 263, 56), Decl(immutable.ts, 264, 26), Decl(immutable.ts, 265, 79), Decl(immutable.ts, 266, 76), Decl(immutable.ts, 267, 51) ... and 1 more) +>T : Symbol(T, Decl(immutable.ts, 219, 30)) +>T : Symbol(T, Decl(immutable.ts, 219, 30)) +>T : Symbol(T, Decl(immutable.ts, 219, 30)) [Symbol.iterator](): IterableIterator<[keyof T, T[keyof T]]>; >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 219, 30)) ->T : Symbol(T, Decl(immutable.d.ts, 219, 30)) ->T : Symbol(T, Decl(immutable.d.ts, 219, 30)) +>T : Symbol(T, Decl(immutable.ts, 219, 30)) +>T : Symbol(T, Decl(immutable.ts, 219, 30)) +>T : Symbol(T, Decl(immutable.ts, 219, 30)) } } export function Record(defaultValues: T, name?: string): Record.Class; ->Record : Symbol(Record, Decl(immutable.d.ts, 211, 70), Decl(immutable.d.ts, 259, 3)) ->T : Symbol(T, Decl(immutable.d.ts, 260, 25)) ->defaultValues : Symbol(defaultValues, Decl(immutable.d.ts, 260, 28)) ->T : Symbol(T, Decl(immutable.d.ts, 260, 25)) ->name : Symbol(name, Decl(immutable.d.ts, 260, 45)) ->Record : Symbol(Record, Decl(immutable.d.ts, 211, 70), Decl(immutable.d.ts, 259, 3)) ->Class : Symbol(Record.Class, Decl(immutable.d.ts, 214, 70)) ->T : Symbol(T, Decl(immutable.d.ts, 260, 25)) +>Record : Symbol(Record, Decl(immutable.ts, 211, 70), Decl(immutable.ts, 259, 3)) +>T : Symbol(T, Decl(immutable.ts, 260, 25)) +>defaultValues : Symbol(defaultValues, Decl(immutable.ts, 260, 28)) +>T : Symbol(T, Decl(immutable.ts, 260, 25)) +>name : Symbol(name, Decl(immutable.ts, 260, 45)) +>Record : Symbol(Record, Decl(immutable.ts, 211, 70), Decl(immutable.ts, 259, 3)) +>Class : Symbol(Record.Class, Decl(immutable.ts, 214, 70)) +>T : Symbol(T, Decl(immutable.ts, 260, 25)) export module Seq { ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) function isSeq(maybeSeq: any): maybeSeq is Seq.Indexed | Seq.Keyed; ->isSeq : Symbol(isSeq, Decl(immutable.d.ts, 261, 21)) ->maybeSeq : Symbol(maybeSeq, Decl(immutable.d.ts, 262, 19)) ->maybeSeq : Symbol(maybeSeq, Decl(immutable.d.ts, 262, 19)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Indexed : Symbol(Indexed, Decl(immutable.d.ts, 281, 5), Decl(immutable.d.ts, 284, 5), Decl(immutable.d.ts, 285, 48), Decl(immutable.d.ts, 286, 49), Decl(immutable.d.ts, 287, 72)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 263, 56), Decl(immutable.d.ts, 264, 26), Decl(immutable.d.ts, 265, 79), Decl(immutable.d.ts, 266, 76), Decl(immutable.d.ts, 267, 51) ... and 1 more) +>isSeq : Symbol(isSeq, Decl(immutable.ts, 261, 21)) +>maybeSeq : Symbol(maybeSeq, Decl(immutable.ts, 262, 19)) +>maybeSeq : Symbol(maybeSeq, Decl(immutable.ts, 262, 19)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Indexed : Symbol(Indexed, Decl(immutable.ts, 281, 5), Decl(immutable.ts, 284, 5), Decl(immutable.ts, 285, 48), Decl(immutable.ts, 286, 49), Decl(immutable.ts, 287, 72)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 263, 56), Decl(immutable.ts, 264, 26), Decl(immutable.ts, 265, 79), Decl(immutable.ts, 266, 76), Decl(immutable.ts, 267, 51) ... and 1 more) function of(...values: Array): Seq.Indexed; ->of : Symbol(of, Decl(immutable.d.ts, 262, 86)) ->T : Symbol(T, Decl(immutable.d.ts, 263, 16)) ->values : Symbol(values, Decl(immutable.d.ts, 263, 19)) +>of : Symbol(of, Decl(immutable.ts, 262, 86)) +>T : Symbol(T, Decl(immutable.ts, 263, 16)) +>values : Symbol(values, Decl(immutable.ts, 263, 19)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 263, 16)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Indexed : Symbol(Indexed, Decl(immutable.d.ts, 281, 5), Decl(immutable.d.ts, 284, 5), Decl(immutable.d.ts, 285, 48), Decl(immutable.d.ts, 286, 49), Decl(immutable.d.ts, 287, 72)) ->T : Symbol(T, Decl(immutable.d.ts, 263, 16)) +>T : Symbol(T, Decl(immutable.ts, 263, 16)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Indexed : Symbol(Indexed, Decl(immutable.ts, 281, 5), Decl(immutable.ts, 284, 5), Decl(immutable.ts, 285, 48), Decl(immutable.ts, 286, 49), Decl(immutable.ts, 287, 72)) +>T : Symbol(T, Decl(immutable.ts, 263, 16)) export module Keyed {} ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 263, 56), Decl(immutable.d.ts, 264, 26), Decl(immutable.d.ts, 265, 79), Decl(immutable.d.ts, 266, 76), Decl(immutable.d.ts, 267, 51) ... and 1 more) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 263, 56), Decl(immutable.ts, 264, 26), Decl(immutable.ts, 265, 79), Decl(immutable.ts, 266, 76), Decl(immutable.ts, 267, 51) ... and 1 more) export function Keyed(collection: Iterable<[K, V]>): Seq.Keyed; ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 263, 56), Decl(immutable.d.ts, 264, 26), Decl(immutable.d.ts, 265, 79), Decl(immutable.d.ts, 266, 76), Decl(immutable.d.ts, 267, 51) ... and 1 more) ->K : Symbol(K, Decl(immutable.d.ts, 265, 26)) ->V : Symbol(V, Decl(immutable.d.ts, 265, 28)) ->collection : Symbol(collection, Decl(immutable.d.ts, 265, 32)) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 263, 56), Decl(immutable.ts, 264, 26), Decl(immutable.ts, 265, 79), Decl(immutable.ts, 266, 76), Decl(immutable.ts, 267, 51) ... and 1 more) +>K : Symbol(K, Decl(immutable.ts, 265, 26)) +>V : Symbol(V, Decl(immutable.ts, 265, 28)) +>collection : Symbol(collection, Decl(immutable.ts, 265, 32)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->K : Symbol(K, Decl(immutable.d.ts, 265, 26)) ->V : Symbol(V, Decl(immutable.d.ts, 265, 28)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 263, 56), Decl(immutable.d.ts, 264, 26), Decl(immutable.d.ts, 265, 79), Decl(immutable.d.ts, 266, 76), Decl(immutable.d.ts, 267, 51) ... and 1 more) ->K : Symbol(K, Decl(immutable.d.ts, 265, 26)) ->V : Symbol(V, Decl(immutable.d.ts, 265, 28)) +>K : Symbol(K, Decl(immutable.ts, 265, 26)) +>V : Symbol(V, Decl(immutable.ts, 265, 28)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 263, 56), Decl(immutable.ts, 264, 26), Decl(immutable.ts, 265, 79), Decl(immutable.ts, 266, 76), Decl(immutable.ts, 267, 51) ... and 1 more) +>K : Symbol(K, Decl(immutable.ts, 265, 26)) +>V : Symbol(V, Decl(immutable.ts, 265, 28)) export function Keyed(obj: {[key: string]: V}): Seq.Keyed; ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 263, 56), Decl(immutable.d.ts, 264, 26), Decl(immutable.d.ts, 265, 79), Decl(immutable.d.ts, 266, 76), Decl(immutable.d.ts, 267, 51) ... and 1 more) ->V : Symbol(V, Decl(immutable.d.ts, 266, 26)) ->obj : Symbol(obj, Decl(immutable.d.ts, 266, 29)) ->key : Symbol(key, Decl(immutable.d.ts, 266, 36)) ->V : Symbol(V, Decl(immutable.d.ts, 266, 26)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 263, 56), Decl(immutable.d.ts, 264, 26), Decl(immutable.d.ts, 265, 79), Decl(immutable.d.ts, 266, 76), Decl(immutable.d.ts, 267, 51) ... and 1 more) ->V : Symbol(V, Decl(immutable.d.ts, 266, 26)) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 263, 56), Decl(immutable.ts, 264, 26), Decl(immutable.ts, 265, 79), Decl(immutable.ts, 266, 76), Decl(immutable.ts, 267, 51) ... and 1 more) +>V : Symbol(V, Decl(immutable.ts, 266, 26)) +>obj : Symbol(obj, Decl(immutable.ts, 266, 29)) +>key : Symbol(key, Decl(immutable.ts, 266, 36)) +>V : Symbol(V, Decl(immutable.ts, 266, 26)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 263, 56), Decl(immutable.ts, 264, 26), Decl(immutable.ts, 265, 79), Decl(immutable.ts, 266, 76), Decl(immutable.ts, 267, 51) ... and 1 more) +>V : Symbol(V, Decl(immutable.ts, 266, 26)) export function Keyed(): Seq.Keyed; ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 263, 56), Decl(immutable.d.ts, 264, 26), Decl(immutable.d.ts, 265, 79), Decl(immutable.d.ts, 266, 76), Decl(immutable.d.ts, 267, 51) ... and 1 more) ->K : Symbol(K, Decl(immutable.d.ts, 267, 26)) ->V : Symbol(V, Decl(immutable.d.ts, 267, 28)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 263, 56), Decl(immutable.d.ts, 264, 26), Decl(immutable.d.ts, 265, 79), Decl(immutable.d.ts, 266, 76), Decl(immutable.d.ts, 267, 51) ... and 1 more) ->K : Symbol(K, Decl(immutable.d.ts, 267, 26)) ->V : Symbol(V, Decl(immutable.d.ts, 267, 28)) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 263, 56), Decl(immutable.ts, 264, 26), Decl(immutable.ts, 265, 79), Decl(immutable.ts, 266, 76), Decl(immutable.ts, 267, 51) ... and 1 more) +>K : Symbol(K, Decl(immutable.ts, 267, 26)) +>V : Symbol(V, Decl(immutable.ts, 267, 28)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 263, 56), Decl(immutable.ts, 264, 26), Decl(immutable.ts, 265, 79), Decl(immutable.ts, 266, 76), Decl(immutable.ts, 267, 51) ... and 1 more) +>K : Symbol(K, Decl(immutable.ts, 267, 26)) +>V : Symbol(V, Decl(immutable.ts, 267, 28)) export function Keyed(): Seq.Keyed; ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 263, 56), Decl(immutable.d.ts, 264, 26), Decl(immutable.d.ts, 265, 79), Decl(immutable.d.ts, 266, 76), Decl(immutable.d.ts, 267, 51) ... and 1 more) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 263, 56), Decl(immutable.d.ts, 264, 26), Decl(immutable.d.ts, 265, 79), Decl(immutable.d.ts, 266, 76), Decl(immutable.d.ts, 267, 51) ... and 1 more) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 263, 56), Decl(immutable.ts, 264, 26), Decl(immutable.ts, 265, 79), Decl(immutable.ts, 266, 76), Decl(immutable.ts, 267, 51) ... and 1 more) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 263, 56), Decl(immutable.ts, 264, 26), Decl(immutable.ts, 265, 79), Decl(immutable.ts, 266, 76), Decl(immutable.ts, 267, 51) ... and 1 more) export interface Keyed extends Seq, Collection.Keyed { ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 263, 56), Decl(immutable.d.ts, 264, 26), Decl(immutable.d.ts, 265, 79), Decl(immutable.d.ts, 266, 76), Decl(immutable.d.ts, 267, 51) ... and 1 more) ->K : Symbol(K, Decl(immutable.d.ts, 269, 27)) ->V : Symbol(V, Decl(immutable.d.ts, 269, 29)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->K : Symbol(K, Decl(immutable.d.ts, 269, 27)) ->V : Symbol(V, Decl(immutable.d.ts, 269, 29)) ->Collection.Keyed : Symbol(Collection.Keyed, Decl(immutable.d.ts, 336, 51), Decl(immutable.d.ts, 337, 26), Decl(immutable.d.ts, 338, 86), Decl(immutable.d.ts, 339, 83)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Keyed : Symbol(Collection.Keyed, Decl(immutable.d.ts, 336, 51), Decl(immutable.d.ts, 337, 26), Decl(immutable.d.ts, 338, 86), Decl(immutable.d.ts, 339, 83)) ->K : Symbol(K, Decl(immutable.d.ts, 269, 27)) ->V : Symbol(V, Decl(immutable.d.ts, 269, 29)) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 263, 56), Decl(immutable.ts, 264, 26), Decl(immutable.ts, 265, 79), Decl(immutable.ts, 266, 76), Decl(immutable.ts, 267, 51) ... and 1 more) +>K : Symbol(K, Decl(immutable.ts, 269, 27)) +>V : Symbol(V, Decl(immutable.ts, 269, 29)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>K : Symbol(K, Decl(immutable.ts, 269, 27)) +>V : Symbol(V, Decl(immutable.ts, 269, 29)) +>Collection.Keyed : Symbol(Collection.Keyed, Decl(immutable.ts, 336, 51), Decl(immutable.ts, 337, 26), Decl(immutable.ts, 338, 86), Decl(immutable.ts, 339, 83)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Keyed : Symbol(Collection.Keyed, Decl(immutable.ts, 336, 51), Decl(immutable.ts, 337, 26), Decl(immutable.ts, 338, 86), Decl(immutable.ts, 339, 83)) +>K : Symbol(K, Decl(immutable.ts, 269, 27)) +>V : Symbol(V, Decl(immutable.ts, 269, 29)) toJS(): Object; ->toJS : Symbol(Keyed.toJS, Decl(immutable.d.ts, 269, 76)) +>toJS : Symbol(Keyed.toJS, Decl(immutable.ts, 269, 76)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) toJSON(): { [key: string]: V }; ->toJSON : Symbol(Keyed.toJSON, Decl(immutable.d.ts, 270, 21)) ->key : Symbol(key, Decl(immutable.d.ts, 271, 19)) ->V : Symbol(V, Decl(immutable.d.ts, 269, 29)) +>toJSON : Symbol(Keyed.toJSON, Decl(immutable.ts, 270, 21)) +>key : Symbol(key, Decl(immutable.ts, 271, 19)) +>V : Symbol(V, Decl(immutable.ts, 269, 29)) toSeq(): this; ->toSeq : Symbol(Keyed.toSeq, Decl(immutable.d.ts, 271, 37)) +>toSeq : Symbol(Keyed.toSeq, Decl(immutable.ts, 271, 37)) concat(...collections: Array>): Seq.Keyed; ->concat : Symbol(Keyed.concat, Decl(immutable.d.ts, 272, 20), Decl(immutable.d.ts, 273, 91)) ->KC : Symbol(KC, Decl(immutable.d.ts, 273, 13)) ->VC : Symbol(VC, Decl(immutable.d.ts, 273, 16)) ->collections : Symbol(collections, Decl(immutable.d.ts, 273, 21)) +>concat : Symbol(Keyed.concat, Decl(immutable.ts, 272, 20), Decl(immutable.ts, 273, 91)) +>KC : Symbol(KC, Decl(immutable.ts, 273, 13)) +>VC : Symbol(VC, Decl(immutable.ts, 273, 16)) +>collections : Symbol(collections, Decl(immutable.ts, 273, 21)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->KC : Symbol(KC, Decl(immutable.d.ts, 273, 13)) ->VC : Symbol(VC, Decl(immutable.d.ts, 273, 16)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 263, 56), Decl(immutable.d.ts, 264, 26), Decl(immutable.d.ts, 265, 79), Decl(immutable.d.ts, 266, 76), Decl(immutable.d.ts, 267, 51) ... and 1 more) ->K : Symbol(K, Decl(immutable.d.ts, 269, 27)) ->KC : Symbol(KC, Decl(immutable.d.ts, 273, 13)) ->V : Symbol(V, Decl(immutable.d.ts, 269, 29)) ->VC : Symbol(VC, Decl(immutable.d.ts, 273, 16)) +>KC : Symbol(KC, Decl(immutable.ts, 273, 13)) +>VC : Symbol(VC, Decl(immutable.ts, 273, 16)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 263, 56), Decl(immutable.ts, 264, 26), Decl(immutable.ts, 265, 79), Decl(immutable.ts, 266, 76), Decl(immutable.ts, 267, 51) ... and 1 more) +>K : Symbol(K, Decl(immutable.ts, 269, 27)) +>KC : Symbol(KC, Decl(immutable.ts, 273, 13)) +>V : Symbol(V, Decl(immutable.ts, 269, 29)) +>VC : Symbol(VC, Decl(immutable.ts, 273, 16)) concat(...collections: Array<{[key: string]: C}>): Seq.Keyed; ->concat : Symbol(Keyed.concat, Decl(immutable.d.ts, 272, 20), Decl(immutable.d.ts, 273, 91)) ->C : Symbol(C, Decl(immutable.d.ts, 274, 13)) ->collections : Symbol(collections, Decl(immutable.d.ts, 274, 16)) +>concat : Symbol(Keyed.concat, Decl(immutable.ts, 272, 20), Decl(immutable.ts, 273, 91)) +>C : Symbol(C, Decl(immutable.ts, 274, 13)) +>collections : Symbol(collections, Decl(immutable.ts, 274, 16)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->key : Symbol(key, Decl(immutable.d.ts, 274, 40)) ->C : Symbol(C, Decl(immutable.d.ts, 274, 13)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 263, 56), Decl(immutable.d.ts, 264, 26), Decl(immutable.d.ts, 265, 79), Decl(immutable.d.ts, 266, 76), Decl(immutable.d.ts, 267, 51) ... and 1 more) ->K : Symbol(K, Decl(immutable.d.ts, 269, 27)) ->V : Symbol(V, Decl(immutable.d.ts, 269, 29)) ->C : Symbol(C, Decl(immutable.d.ts, 274, 13)) +>key : Symbol(key, Decl(immutable.ts, 274, 40)) +>C : Symbol(C, Decl(immutable.ts, 274, 13)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 263, 56), Decl(immutable.ts, 264, 26), Decl(immutable.ts, 265, 79), Decl(immutable.ts, 266, 76), Decl(immutable.ts, 267, 51) ... and 1 more) +>K : Symbol(K, Decl(immutable.ts, 269, 27)) +>V : Symbol(V, Decl(immutable.ts, 269, 29)) +>C : Symbol(C, Decl(immutable.ts, 274, 13)) map(mapper: (value: V, key: K, iter: this) => M, context?: any): Seq.Keyed; ->map : Symbol(Keyed.map, Decl(immutable.d.ts, 274, 89)) ->M : Symbol(M, Decl(immutable.d.ts, 275, 10)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 275, 13)) ->value : Symbol(value, Decl(immutable.d.ts, 275, 22)) ->V : Symbol(V, Decl(immutable.d.ts, 269, 29)) ->key : Symbol(key, Decl(immutable.d.ts, 275, 31)) ->K : Symbol(K, Decl(immutable.d.ts, 269, 27)) ->iter : Symbol(iter, Decl(immutable.d.ts, 275, 39)) ->M : Symbol(M, Decl(immutable.d.ts, 275, 10)) ->context : Symbol(context, Decl(immutable.d.ts, 275, 57)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 263, 56), Decl(immutable.d.ts, 264, 26), Decl(immutable.d.ts, 265, 79), Decl(immutable.d.ts, 266, 76), Decl(immutable.d.ts, 267, 51) ... and 1 more) ->K : Symbol(K, Decl(immutable.d.ts, 269, 27)) ->M : Symbol(M, Decl(immutable.d.ts, 275, 10)) +>map : Symbol(Keyed.map, Decl(immutable.ts, 274, 89)) +>M : Symbol(M, Decl(immutable.ts, 275, 10)) +>mapper : Symbol(mapper, Decl(immutable.ts, 275, 13)) +>value : Symbol(value, Decl(immutable.ts, 275, 22)) +>V : Symbol(V, Decl(immutable.ts, 269, 29)) +>key : Symbol(key, Decl(immutable.ts, 275, 31)) +>K : Symbol(K, Decl(immutable.ts, 269, 27)) +>iter : Symbol(iter, Decl(immutable.ts, 275, 39)) +>M : Symbol(M, Decl(immutable.ts, 275, 10)) +>context : Symbol(context, Decl(immutable.ts, 275, 57)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 263, 56), Decl(immutable.ts, 264, 26), Decl(immutable.ts, 265, 79), Decl(immutable.ts, 266, 76), Decl(immutable.ts, 267, 51) ... and 1 more) +>K : Symbol(K, Decl(immutable.ts, 269, 27)) +>M : Symbol(M, Decl(immutable.ts, 275, 10)) mapKeys(mapper: (key: K, value: V, iter: this) => M, context?: any): Seq.Keyed; ->mapKeys : Symbol(Keyed.mapKeys, Decl(immutable.d.ts, 275, 90)) ->M : Symbol(M, Decl(immutable.d.ts, 276, 14)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 276, 17)) ->key : Symbol(key, Decl(immutable.d.ts, 276, 26)) ->K : Symbol(K, Decl(immutable.d.ts, 269, 27)) ->value : Symbol(value, Decl(immutable.d.ts, 276, 33)) ->V : Symbol(V, Decl(immutable.d.ts, 269, 29)) ->iter : Symbol(iter, Decl(immutable.d.ts, 276, 43)) ->M : Symbol(M, Decl(immutable.d.ts, 276, 14)) ->context : Symbol(context, Decl(immutable.d.ts, 276, 61)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 263, 56), Decl(immutable.d.ts, 264, 26), Decl(immutable.d.ts, 265, 79), Decl(immutable.d.ts, 266, 76), Decl(immutable.d.ts, 267, 51) ... and 1 more) ->M : Symbol(M, Decl(immutable.d.ts, 276, 14)) ->V : Symbol(V, Decl(immutable.d.ts, 269, 29)) +>mapKeys : Symbol(Keyed.mapKeys, Decl(immutable.ts, 275, 90)) +>M : Symbol(M, Decl(immutable.ts, 276, 14)) +>mapper : Symbol(mapper, Decl(immutable.ts, 276, 17)) +>key : Symbol(key, Decl(immutable.ts, 276, 26)) +>K : Symbol(K, Decl(immutable.ts, 269, 27)) +>value : Symbol(value, Decl(immutable.ts, 276, 33)) +>V : Symbol(V, Decl(immutable.ts, 269, 29)) +>iter : Symbol(iter, Decl(immutable.ts, 276, 43)) +>M : Symbol(M, Decl(immutable.ts, 276, 14)) +>context : Symbol(context, Decl(immutable.ts, 276, 61)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 263, 56), Decl(immutable.ts, 264, 26), Decl(immutable.ts, 265, 79), Decl(immutable.ts, 266, 76), Decl(immutable.ts, 267, 51) ... and 1 more) +>M : Symbol(M, Decl(immutable.ts, 276, 14)) +>V : Symbol(V, Decl(immutable.ts, 269, 29)) mapEntries(mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: any): Seq.Keyed; ->mapEntries : Symbol(Keyed.mapEntries, Decl(immutable.d.ts, 276, 94)) ->KM : Symbol(KM, Decl(immutable.d.ts, 277, 17)) ->VM : Symbol(VM, Decl(immutable.d.ts, 277, 20)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 277, 25)) ->entry : Symbol(entry, Decl(immutable.d.ts, 277, 34)) ->K : Symbol(K, Decl(immutable.d.ts, 269, 27)) ->V : Symbol(V, Decl(immutable.d.ts, 269, 29)) ->index : Symbol(index, Decl(immutable.d.ts, 277, 48)) ->iter : Symbol(iter, Decl(immutable.d.ts, 277, 63)) ->KM : Symbol(KM, Decl(immutable.d.ts, 277, 17)) ->VM : Symbol(VM, Decl(immutable.d.ts, 277, 20)) ->context : Symbol(context, Decl(immutable.d.ts, 277, 88)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 263, 56), Decl(immutable.d.ts, 264, 26), Decl(immutable.d.ts, 265, 79), Decl(immutable.d.ts, 266, 76), Decl(immutable.d.ts, 267, 51) ... and 1 more) ->KM : Symbol(KM, Decl(immutable.d.ts, 277, 17)) ->VM : Symbol(VM, Decl(immutable.d.ts, 277, 20)) +>mapEntries : Symbol(Keyed.mapEntries, Decl(immutable.ts, 276, 94)) +>KM : Symbol(KM, Decl(immutable.ts, 277, 17)) +>VM : Symbol(VM, Decl(immutable.ts, 277, 20)) +>mapper : Symbol(mapper, Decl(immutable.ts, 277, 25)) +>entry : Symbol(entry, Decl(immutable.ts, 277, 34)) +>K : Symbol(K, Decl(immutable.ts, 269, 27)) +>V : Symbol(V, Decl(immutable.ts, 269, 29)) +>index : Symbol(index, Decl(immutable.ts, 277, 48)) +>iter : Symbol(iter, Decl(immutable.ts, 277, 63)) +>KM : Symbol(KM, Decl(immutable.ts, 277, 17)) +>VM : Symbol(VM, Decl(immutable.ts, 277, 20)) +>context : Symbol(context, Decl(immutable.ts, 277, 88)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 263, 56), Decl(immutable.ts, 264, 26), Decl(immutable.ts, 265, 79), Decl(immutable.ts, 266, 76), Decl(immutable.ts, 267, 51) ... and 1 more) +>KM : Symbol(KM, Decl(immutable.ts, 277, 17)) +>VM : Symbol(VM, Decl(immutable.ts, 277, 20)) flatMap(mapper: (value: V, key: K, iter: this) => Iterable, context?: any): Seq.Keyed; ->flatMap : Symbol(Keyed.flatMap, Decl(immutable.d.ts, 277, 123)) ->M : Symbol(M, Decl(immutable.d.ts, 278, 14)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 278, 17)) ->value : Symbol(value, Decl(immutable.d.ts, 278, 26)) ->V : Symbol(V, Decl(immutable.d.ts, 269, 29)) ->key : Symbol(key, Decl(immutable.d.ts, 278, 35)) ->K : Symbol(K, Decl(immutable.d.ts, 269, 27)) ->iter : Symbol(iter, Decl(immutable.d.ts, 278, 43)) +>flatMap : Symbol(Keyed.flatMap, Decl(immutable.ts, 277, 123)) +>M : Symbol(M, Decl(immutable.ts, 278, 14)) +>mapper : Symbol(mapper, Decl(immutable.ts, 278, 17)) +>value : Symbol(value, Decl(immutable.ts, 278, 26)) +>V : Symbol(V, Decl(immutable.ts, 269, 29)) +>key : Symbol(key, Decl(immutable.ts, 278, 35)) +>K : Symbol(K, Decl(immutable.ts, 269, 27)) +>iter : Symbol(iter, Decl(immutable.ts, 278, 43)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->M : Symbol(M, Decl(immutable.d.ts, 278, 14)) ->context : Symbol(context, Decl(immutable.d.ts, 278, 71)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 263, 56), Decl(immutable.d.ts, 264, 26), Decl(immutable.d.ts, 265, 79), Decl(immutable.d.ts, 266, 76), Decl(immutable.d.ts, 267, 51) ... and 1 more) +>M : Symbol(M, Decl(immutable.ts, 278, 14)) +>context : Symbol(context, Decl(immutable.ts, 278, 71)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 263, 56), Decl(immutable.ts, 264, 26), Decl(immutable.ts, 265, 79), Decl(immutable.ts, 266, 76), Decl(immutable.ts, 267, 51) ... and 1 more) filter(predicate: (value: V, key: K, iter: this) => value is F, context?: any): Seq.Keyed; ->filter : Symbol(Keyed.filter, Decl(immutable.d.ts, 278, 108), Decl(immutable.d.ts, 279, 115)) ->F : Symbol(F, Decl(immutable.d.ts, 279, 13)) ->V : Symbol(V, Decl(immutable.d.ts, 269, 29)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 279, 26)) ->value : Symbol(value, Decl(immutable.d.ts, 279, 38)) ->V : Symbol(V, Decl(immutable.d.ts, 269, 29)) ->key : Symbol(key, Decl(immutable.d.ts, 279, 47)) ->K : Symbol(K, Decl(immutable.d.ts, 269, 27)) ->iter : Symbol(iter, Decl(immutable.d.ts, 279, 55)) ->value : Symbol(value, Decl(immutable.d.ts, 279, 38)) ->F : Symbol(F, Decl(immutable.d.ts, 279, 13)) ->context : Symbol(context, Decl(immutable.d.ts, 279, 82)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 263, 56), Decl(immutable.d.ts, 264, 26), Decl(immutable.d.ts, 265, 79), Decl(immutable.d.ts, 266, 76), Decl(immutable.d.ts, 267, 51) ... and 1 more) ->K : Symbol(K, Decl(immutable.d.ts, 269, 27)) ->F : Symbol(F, Decl(immutable.d.ts, 279, 13)) +>filter : Symbol(Keyed.filter, Decl(immutable.ts, 278, 108), Decl(immutable.ts, 279, 115)) +>F : Symbol(F, Decl(immutable.ts, 279, 13)) +>V : Symbol(V, Decl(immutable.ts, 269, 29)) +>predicate : Symbol(predicate, Decl(immutable.ts, 279, 26)) +>value : Symbol(value, Decl(immutable.ts, 279, 38)) +>V : Symbol(V, Decl(immutable.ts, 269, 29)) +>key : Symbol(key, Decl(immutable.ts, 279, 47)) +>K : Symbol(K, Decl(immutable.ts, 269, 27)) +>iter : Symbol(iter, Decl(immutable.ts, 279, 55)) +>value : Symbol(value, Decl(immutable.ts, 279, 38)) +>F : Symbol(F, Decl(immutable.ts, 279, 13)) +>context : Symbol(context, Decl(immutable.ts, 279, 82)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 263, 56), Decl(immutable.ts, 264, 26), Decl(immutable.ts, 265, 79), Decl(immutable.ts, 266, 76), Decl(immutable.ts, 267, 51) ... and 1 more) +>K : Symbol(K, Decl(immutable.ts, 269, 27)) +>F : Symbol(F, Decl(immutable.ts, 279, 13)) filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this; ->filter : Symbol(Keyed.filter, Decl(immutable.d.ts, 278, 108), Decl(immutable.d.ts, 279, 115)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 280, 13)) ->value : Symbol(value, Decl(immutable.d.ts, 280, 25)) ->V : Symbol(V, Decl(immutable.d.ts, 269, 29)) ->key : Symbol(key, Decl(immutable.d.ts, 280, 34)) ->K : Symbol(K, Decl(immutable.d.ts, 269, 27)) ->iter : Symbol(iter, Decl(immutable.d.ts, 280, 42)) ->context : Symbol(context, Decl(immutable.d.ts, 280, 62)) +>filter : Symbol(Keyed.filter, Decl(immutable.ts, 278, 108), Decl(immutable.ts, 279, 115)) +>predicate : Symbol(predicate, Decl(immutable.ts, 280, 13)) +>value : Symbol(value, Decl(immutable.ts, 280, 25)) +>V : Symbol(V, Decl(immutable.ts, 269, 29)) +>key : Symbol(key, Decl(immutable.ts, 280, 34)) +>K : Symbol(K, Decl(immutable.ts, 269, 27)) +>iter : Symbol(iter, Decl(immutable.ts, 280, 42)) +>context : Symbol(context, Decl(immutable.ts, 280, 62)) } module Indexed { ->Indexed : Symbol(Indexed, Decl(immutable.d.ts, 281, 5), Decl(immutable.d.ts, 284, 5), Decl(immutable.d.ts, 285, 48), Decl(immutable.d.ts, 286, 49), Decl(immutable.d.ts, 287, 72)) +>Indexed : Symbol(Indexed, Decl(immutable.ts, 281, 5), Decl(immutable.ts, 284, 5), Decl(immutable.ts, 285, 48), Decl(immutable.ts, 286, 49), Decl(immutable.ts, 287, 72)) function of(...values: Array): Seq.Indexed; ->of : Symbol(of, Decl(immutable.d.ts, 282, 20)) ->T : Symbol(T, Decl(immutable.d.ts, 283, 18)) ->values : Symbol(values, Decl(immutable.d.ts, 283, 21)) +>of : Symbol(of, Decl(immutable.ts, 282, 20)) +>T : Symbol(T, Decl(immutable.ts, 283, 18)) +>values : Symbol(values, Decl(immutable.ts, 283, 21)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 283, 18)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Indexed : Symbol(Indexed, Decl(immutable.d.ts, 281, 5), Decl(immutable.d.ts, 284, 5), Decl(immutable.d.ts, 285, 48), Decl(immutable.d.ts, 286, 49), Decl(immutable.d.ts, 287, 72)) ->T : Symbol(T, Decl(immutable.d.ts, 283, 18)) +>T : Symbol(T, Decl(immutable.ts, 283, 18)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Indexed : Symbol(Indexed, Decl(immutable.ts, 281, 5), Decl(immutable.ts, 284, 5), Decl(immutable.ts, 285, 48), Decl(immutable.ts, 286, 49), Decl(immutable.ts, 287, 72)) +>T : Symbol(T, Decl(immutable.ts, 283, 18)) } export function Indexed(): Seq.Indexed; ->Indexed : Symbol(Indexed, Decl(immutable.d.ts, 281, 5), Decl(immutable.d.ts, 284, 5), Decl(immutable.d.ts, 285, 48), Decl(immutable.d.ts, 286, 49), Decl(immutable.d.ts, 287, 72)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Indexed : Symbol(Indexed, Decl(immutable.d.ts, 281, 5), Decl(immutable.d.ts, 284, 5), Decl(immutable.d.ts, 285, 48), Decl(immutable.d.ts, 286, 49), Decl(immutable.d.ts, 287, 72)) +>Indexed : Symbol(Indexed, Decl(immutable.ts, 281, 5), Decl(immutable.ts, 284, 5), Decl(immutable.ts, 285, 48), Decl(immutable.ts, 286, 49), Decl(immutable.ts, 287, 72)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Indexed : Symbol(Indexed, Decl(immutable.ts, 281, 5), Decl(immutable.ts, 284, 5), Decl(immutable.ts, 285, 48), Decl(immutable.ts, 286, 49), Decl(immutable.ts, 287, 72)) export function Indexed(): Seq.Indexed; ->Indexed : Symbol(Indexed, Decl(immutable.d.ts, 281, 5), Decl(immutable.d.ts, 284, 5), Decl(immutable.d.ts, 285, 48), Decl(immutable.d.ts, 286, 49), Decl(immutable.d.ts, 287, 72)) ->T : Symbol(T, Decl(immutable.d.ts, 286, 28)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Indexed : Symbol(Indexed, Decl(immutable.d.ts, 281, 5), Decl(immutable.d.ts, 284, 5), Decl(immutable.d.ts, 285, 48), Decl(immutable.d.ts, 286, 49), Decl(immutable.d.ts, 287, 72)) ->T : Symbol(T, Decl(immutable.d.ts, 286, 28)) +>Indexed : Symbol(Indexed, Decl(immutable.ts, 281, 5), Decl(immutable.ts, 284, 5), Decl(immutable.ts, 285, 48), Decl(immutable.ts, 286, 49), Decl(immutable.ts, 287, 72)) +>T : Symbol(T, Decl(immutable.ts, 286, 28)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Indexed : Symbol(Indexed, Decl(immutable.ts, 281, 5), Decl(immutable.ts, 284, 5), Decl(immutable.ts, 285, 48), Decl(immutable.ts, 286, 49), Decl(immutable.ts, 287, 72)) +>T : Symbol(T, Decl(immutable.ts, 286, 28)) export function Indexed(collection: Iterable): Seq.Indexed; ->Indexed : Symbol(Indexed, Decl(immutable.d.ts, 281, 5), Decl(immutable.d.ts, 284, 5), Decl(immutable.d.ts, 285, 48), Decl(immutable.d.ts, 286, 49), Decl(immutable.d.ts, 287, 72)) ->T : Symbol(T, Decl(immutable.d.ts, 287, 28)) ->collection : Symbol(collection, Decl(immutable.d.ts, 287, 31)) +>Indexed : Symbol(Indexed, Decl(immutable.ts, 281, 5), Decl(immutable.ts, 284, 5), Decl(immutable.ts, 285, 48), Decl(immutable.ts, 286, 49), Decl(immutable.ts, 287, 72)) +>T : Symbol(T, Decl(immutable.ts, 287, 28)) +>collection : Symbol(collection, Decl(immutable.ts, 287, 31)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 287, 28)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Indexed : Symbol(Indexed, Decl(immutable.d.ts, 281, 5), Decl(immutable.d.ts, 284, 5), Decl(immutable.d.ts, 285, 48), Decl(immutable.d.ts, 286, 49), Decl(immutable.d.ts, 287, 72)) ->T : Symbol(T, Decl(immutable.d.ts, 287, 28)) +>T : Symbol(T, Decl(immutable.ts, 287, 28)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Indexed : Symbol(Indexed, Decl(immutable.ts, 281, 5), Decl(immutable.ts, 284, 5), Decl(immutable.ts, 285, 48), Decl(immutable.ts, 286, 49), Decl(immutable.ts, 287, 72)) +>T : Symbol(T, Decl(immutable.ts, 287, 28)) export interface Indexed extends Seq, Collection.Indexed { ->Indexed : Symbol(Indexed, Decl(immutable.d.ts, 281, 5), Decl(immutable.d.ts, 284, 5), Decl(immutable.d.ts, 285, 48), Decl(immutable.d.ts, 286, 49), Decl(immutable.d.ts, 287, 72)) ->T : Symbol(T, Decl(immutable.d.ts, 288, 29)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->T : Symbol(T, Decl(immutable.d.ts, 288, 29)) ->Collection.Indexed : Symbol(Collection.Indexed, Decl(immutable.d.ts, 355, 5), Decl(immutable.d.ts, 356, 28), Decl(immutable.d.ts, 357, 79)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Indexed : Symbol(Collection.Indexed, Decl(immutable.d.ts, 355, 5), Decl(immutable.d.ts, 356, 28), Decl(immutable.d.ts, 357, 79)) ->T : Symbol(T, Decl(immutable.d.ts, 288, 29)) +>Indexed : Symbol(Indexed, Decl(immutable.ts, 281, 5), Decl(immutable.ts, 284, 5), Decl(immutable.ts, 285, 48), Decl(immutable.ts, 286, 49), Decl(immutable.ts, 287, 72)) +>T : Symbol(T, Decl(immutable.ts, 288, 29)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>T : Symbol(T, Decl(immutable.ts, 288, 29)) +>Collection.Indexed : Symbol(Collection.Indexed, Decl(immutable.ts, 355, 5), Decl(immutable.ts, 356, 28), Decl(immutable.ts, 357, 79)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Indexed : Symbol(Collection.Indexed, Decl(immutable.ts, 355, 5), Decl(immutable.ts, 356, 28), Decl(immutable.ts, 357, 79)) +>T : Symbol(T, Decl(immutable.ts, 288, 29)) toJS(): Array; ->toJS : Symbol(Indexed.toJS, Decl(immutable.d.ts, 288, 79)) +>toJS : Symbol(Indexed.toJS, Decl(immutable.ts, 288, 79)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) toJSON(): Array; ->toJSON : Symbol(Indexed.toJSON, Decl(immutable.d.ts, 289, 25)) +>toJSON : Symbol(Indexed.toJSON, Decl(immutable.ts, 289, 25)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 288, 29)) +>T : Symbol(T, Decl(immutable.ts, 288, 29)) toSeq(): this; ->toSeq : Symbol(Indexed.toSeq, Decl(immutable.d.ts, 290, 25)) +>toSeq : Symbol(Indexed.toSeq, Decl(immutable.ts, 290, 25)) concat(...valuesOrCollections: Array | C>): Seq.Indexed; ->concat : Symbol(Indexed.concat, Decl(immutable.d.ts, 291, 20)) ->C : Symbol(C, Decl(immutable.d.ts, 292, 13)) ->valuesOrCollections : Symbol(valuesOrCollections, Decl(immutable.d.ts, 292, 16)) +>concat : Symbol(Indexed.concat, Decl(immutable.ts, 291, 20)) +>C : Symbol(C, Decl(immutable.ts, 292, 13)) +>valuesOrCollections : Symbol(valuesOrCollections, Decl(immutable.ts, 292, 16)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->C : Symbol(C, Decl(immutable.d.ts, 292, 13)) ->C : Symbol(C, Decl(immutable.d.ts, 292, 13)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Indexed : Symbol(Indexed, Decl(immutable.d.ts, 281, 5), Decl(immutable.d.ts, 284, 5), Decl(immutable.d.ts, 285, 48), Decl(immutable.d.ts, 286, 49), Decl(immutable.d.ts, 287, 72)) ->T : Symbol(T, Decl(immutable.d.ts, 288, 29)) ->C : Symbol(C, Decl(immutable.d.ts, 292, 13)) +>C : Symbol(C, Decl(immutable.ts, 292, 13)) +>C : Symbol(C, Decl(immutable.ts, 292, 13)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Indexed : Symbol(Indexed, Decl(immutable.ts, 281, 5), Decl(immutable.ts, 284, 5), Decl(immutable.ts, 285, 48), Decl(immutable.ts, 286, 49), Decl(immutable.ts, 287, 72)) +>T : Symbol(T, Decl(immutable.ts, 288, 29)) +>C : Symbol(C, Decl(immutable.ts, 292, 13)) map(mapper: (value: T, key: number, iter: this) => M, context?: any): Seq.Indexed; ->map : Symbol(Indexed.map, Decl(immutable.d.ts, 292, 84)) ->M : Symbol(M, Decl(immutable.d.ts, 293, 10)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 293, 13)) ->value : Symbol(value, Decl(immutable.d.ts, 293, 22)) ->T : Symbol(T, Decl(immutable.d.ts, 288, 29)) ->key : Symbol(key, Decl(immutable.d.ts, 293, 31)) ->iter : Symbol(iter, Decl(immutable.d.ts, 293, 44)) ->M : Symbol(M, Decl(immutable.d.ts, 293, 10)) ->context : Symbol(context, Decl(immutable.d.ts, 293, 62)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Indexed : Symbol(Indexed, Decl(immutable.d.ts, 281, 5), Decl(immutable.d.ts, 284, 5), Decl(immutable.d.ts, 285, 48), Decl(immutable.d.ts, 286, 49), Decl(immutable.d.ts, 287, 72)) ->M : Symbol(M, Decl(immutable.d.ts, 293, 10)) +>map : Symbol(Indexed.map, Decl(immutable.ts, 292, 84)) +>M : Symbol(M, Decl(immutable.ts, 293, 10)) +>mapper : Symbol(mapper, Decl(immutable.ts, 293, 13)) +>value : Symbol(value, Decl(immutable.ts, 293, 22)) +>T : Symbol(T, Decl(immutable.ts, 288, 29)) +>key : Symbol(key, Decl(immutable.ts, 293, 31)) +>iter : Symbol(iter, Decl(immutable.ts, 293, 44)) +>M : Symbol(M, Decl(immutable.ts, 293, 10)) +>context : Symbol(context, Decl(immutable.ts, 293, 62)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Indexed : Symbol(Indexed, Decl(immutable.ts, 281, 5), Decl(immutable.ts, 284, 5), Decl(immutable.ts, 285, 48), Decl(immutable.ts, 286, 49), Decl(immutable.ts, 287, 72)) +>M : Symbol(M, Decl(immutable.ts, 293, 10)) flatMap(mapper: (value: T, key: number, iter: this) => Iterable, context?: any): Seq.Indexed; ->flatMap : Symbol(Indexed.flatMap, Decl(immutable.d.ts, 293, 94)) ->M : Symbol(M, Decl(immutable.d.ts, 294, 14)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 294, 17)) ->value : Symbol(value, Decl(immutable.d.ts, 294, 26)) ->T : Symbol(T, Decl(immutable.d.ts, 288, 29)) ->key : Symbol(key, Decl(immutable.d.ts, 294, 35)) ->iter : Symbol(iter, Decl(immutable.d.ts, 294, 48)) +>flatMap : Symbol(Indexed.flatMap, Decl(immutable.ts, 293, 94)) +>M : Symbol(M, Decl(immutable.ts, 294, 14)) +>mapper : Symbol(mapper, Decl(immutable.ts, 294, 17)) +>value : Symbol(value, Decl(immutable.ts, 294, 26)) +>T : Symbol(T, Decl(immutable.ts, 288, 29)) +>key : Symbol(key, Decl(immutable.ts, 294, 35)) +>iter : Symbol(iter, Decl(immutable.ts, 294, 48)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->M : Symbol(M, Decl(immutable.d.ts, 294, 14)) ->context : Symbol(context, Decl(immutable.d.ts, 294, 76)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Indexed : Symbol(Indexed, Decl(immutable.d.ts, 281, 5), Decl(immutable.d.ts, 284, 5), Decl(immutable.d.ts, 285, 48), Decl(immutable.d.ts, 286, 49), Decl(immutable.d.ts, 287, 72)) ->M : Symbol(M, Decl(immutable.d.ts, 294, 14)) +>M : Symbol(M, Decl(immutable.ts, 294, 14)) +>context : Symbol(context, Decl(immutable.ts, 294, 76)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Indexed : Symbol(Indexed, Decl(immutable.ts, 281, 5), Decl(immutable.ts, 284, 5), Decl(immutable.ts, 285, 48), Decl(immutable.ts, 286, 49), Decl(immutable.ts, 287, 72)) +>M : Symbol(M, Decl(immutable.ts, 294, 14)) filter(predicate: (value: T, index: number, iter: this) => value is F, context?: any): Seq.Indexed; ->filter : Symbol(Indexed.filter, Decl(immutable.d.ts, 294, 108), Decl(immutable.d.ts, 295, 121)) ->F : Symbol(F, Decl(immutable.d.ts, 295, 13)) ->T : Symbol(T, Decl(immutable.d.ts, 288, 29)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 295, 26)) ->value : Symbol(value, Decl(immutable.d.ts, 295, 38)) ->T : Symbol(T, Decl(immutable.d.ts, 288, 29)) ->index : Symbol(index, Decl(immutable.d.ts, 295, 47)) ->iter : Symbol(iter, Decl(immutable.d.ts, 295, 62)) ->value : Symbol(value, Decl(immutable.d.ts, 295, 38)) ->F : Symbol(F, Decl(immutable.d.ts, 295, 13)) ->context : Symbol(context, Decl(immutable.d.ts, 295, 89)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Indexed : Symbol(Indexed, Decl(immutable.d.ts, 281, 5), Decl(immutable.d.ts, 284, 5), Decl(immutable.d.ts, 285, 48), Decl(immutable.d.ts, 286, 49), Decl(immutable.d.ts, 287, 72)) ->F : Symbol(F, Decl(immutable.d.ts, 295, 13)) +>filter : Symbol(Indexed.filter, Decl(immutable.ts, 294, 108), Decl(immutable.ts, 295, 121)) +>F : Symbol(F, Decl(immutable.ts, 295, 13)) +>T : Symbol(T, Decl(immutable.ts, 288, 29)) +>predicate : Symbol(predicate, Decl(immutable.ts, 295, 26)) +>value : Symbol(value, Decl(immutable.ts, 295, 38)) +>T : Symbol(T, Decl(immutable.ts, 288, 29)) +>index : Symbol(index, Decl(immutable.ts, 295, 47)) +>iter : Symbol(iter, Decl(immutable.ts, 295, 62)) +>value : Symbol(value, Decl(immutable.ts, 295, 38)) +>F : Symbol(F, Decl(immutable.ts, 295, 13)) +>context : Symbol(context, Decl(immutable.ts, 295, 89)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Indexed : Symbol(Indexed, Decl(immutable.ts, 281, 5), Decl(immutable.ts, 284, 5), Decl(immutable.ts, 285, 48), Decl(immutable.ts, 286, 49), Decl(immutable.ts, 287, 72)) +>F : Symbol(F, Decl(immutable.ts, 295, 13)) filter(predicate: (value: T, index: number, iter: this) => any, context?: any): this; ->filter : Symbol(Indexed.filter, Decl(immutable.d.ts, 294, 108), Decl(immutable.d.ts, 295, 121)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 296, 13)) ->value : Symbol(value, Decl(immutable.d.ts, 296, 25)) ->T : Symbol(T, Decl(immutable.d.ts, 288, 29)) ->index : Symbol(index, Decl(immutable.d.ts, 296, 34)) ->iter : Symbol(iter, Decl(immutable.d.ts, 296, 49)) ->context : Symbol(context, Decl(immutable.d.ts, 296, 69)) +>filter : Symbol(Indexed.filter, Decl(immutable.ts, 294, 108), Decl(immutable.ts, 295, 121)) +>predicate : Symbol(predicate, Decl(immutable.ts, 296, 13)) +>value : Symbol(value, Decl(immutable.ts, 296, 25)) +>T : Symbol(T, Decl(immutable.ts, 288, 29)) +>index : Symbol(index, Decl(immutable.ts, 296, 34)) +>iter : Symbol(iter, Decl(immutable.ts, 296, 49)) +>context : Symbol(context, Decl(immutable.ts, 296, 69)) } export module Set { ->Set : Symbol(Set, Decl(immutable.d.ts, 297, 5), Decl(immutable.d.ts, 300, 5), Decl(immutable.d.ts, 301, 40), Decl(immutable.d.ts, 302, 41), Decl(immutable.d.ts, 303, 64)) +>Set : Symbol(Set, Decl(immutable.ts, 297, 5), Decl(immutable.ts, 300, 5), Decl(immutable.ts, 301, 40), Decl(immutable.ts, 302, 41), Decl(immutable.ts, 303, 64)) function of(...values: Array): Seq.Set; ->of : Symbol(of, Decl(immutable.d.ts, 298, 23)) ->T : Symbol(T, Decl(immutable.d.ts, 299, 18)) ->values : Symbol(values, Decl(immutable.d.ts, 299, 21)) +>of : Symbol(of, Decl(immutable.ts, 298, 23)) +>T : Symbol(T, Decl(immutable.ts, 299, 18)) +>values : Symbol(values, Decl(immutable.ts, 299, 21)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 299, 18)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Set : Symbol(Set, Decl(immutable.d.ts, 297, 5), Decl(immutable.d.ts, 300, 5), Decl(immutable.d.ts, 301, 40), Decl(immutable.d.ts, 302, 41), Decl(immutable.d.ts, 303, 64)) ->T : Symbol(T, Decl(immutable.d.ts, 299, 18)) +>T : Symbol(T, Decl(immutable.ts, 299, 18)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Set : Symbol(Set, Decl(immutable.ts, 297, 5), Decl(immutable.ts, 300, 5), Decl(immutable.ts, 301, 40), Decl(immutable.ts, 302, 41), Decl(immutable.ts, 303, 64)) +>T : Symbol(T, Decl(immutable.ts, 299, 18)) } export function Set(): Seq.Set; ->Set : Symbol(Set, Decl(immutable.d.ts, 297, 5), Decl(immutable.d.ts, 300, 5), Decl(immutable.d.ts, 301, 40), Decl(immutable.d.ts, 302, 41), Decl(immutable.d.ts, 303, 64)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Set : Symbol(Set, Decl(immutable.d.ts, 297, 5), Decl(immutable.d.ts, 300, 5), Decl(immutable.d.ts, 301, 40), Decl(immutable.d.ts, 302, 41), Decl(immutable.d.ts, 303, 64)) +>Set : Symbol(Set, Decl(immutable.ts, 297, 5), Decl(immutable.ts, 300, 5), Decl(immutable.ts, 301, 40), Decl(immutable.ts, 302, 41), Decl(immutable.ts, 303, 64)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Set : Symbol(Set, Decl(immutable.ts, 297, 5), Decl(immutable.ts, 300, 5), Decl(immutable.ts, 301, 40), Decl(immutable.ts, 302, 41), Decl(immutable.ts, 303, 64)) export function Set(): Seq.Set; ->Set : Symbol(Set, Decl(immutable.d.ts, 297, 5), Decl(immutable.d.ts, 300, 5), Decl(immutable.d.ts, 301, 40), Decl(immutable.d.ts, 302, 41), Decl(immutable.d.ts, 303, 64)) ->T : Symbol(T, Decl(immutable.d.ts, 302, 24)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Set : Symbol(Set, Decl(immutable.d.ts, 297, 5), Decl(immutable.d.ts, 300, 5), Decl(immutable.d.ts, 301, 40), Decl(immutable.d.ts, 302, 41), Decl(immutable.d.ts, 303, 64)) ->T : Symbol(T, Decl(immutable.d.ts, 302, 24)) +>Set : Symbol(Set, Decl(immutable.ts, 297, 5), Decl(immutable.ts, 300, 5), Decl(immutable.ts, 301, 40), Decl(immutable.ts, 302, 41), Decl(immutable.ts, 303, 64)) +>T : Symbol(T, Decl(immutable.ts, 302, 24)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Set : Symbol(Set, Decl(immutable.ts, 297, 5), Decl(immutable.ts, 300, 5), Decl(immutable.ts, 301, 40), Decl(immutable.ts, 302, 41), Decl(immutable.ts, 303, 64)) +>T : Symbol(T, Decl(immutable.ts, 302, 24)) export function Set(collection: Iterable): Seq.Set; ->Set : Symbol(Set, Decl(immutable.d.ts, 297, 5), Decl(immutable.d.ts, 300, 5), Decl(immutable.d.ts, 301, 40), Decl(immutable.d.ts, 302, 41), Decl(immutable.d.ts, 303, 64)) ->T : Symbol(T, Decl(immutable.d.ts, 303, 24)) ->collection : Symbol(collection, Decl(immutable.d.ts, 303, 27)) +>Set : Symbol(Set, Decl(immutable.ts, 297, 5), Decl(immutable.ts, 300, 5), Decl(immutable.ts, 301, 40), Decl(immutable.ts, 302, 41), Decl(immutable.ts, 303, 64)) +>T : Symbol(T, Decl(immutable.ts, 303, 24)) +>collection : Symbol(collection, Decl(immutable.ts, 303, 27)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 303, 24)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Set : Symbol(Set, Decl(immutable.d.ts, 297, 5), Decl(immutable.d.ts, 300, 5), Decl(immutable.d.ts, 301, 40), Decl(immutable.d.ts, 302, 41), Decl(immutable.d.ts, 303, 64)) ->T : Symbol(T, Decl(immutable.d.ts, 303, 24)) +>T : Symbol(T, Decl(immutable.ts, 303, 24)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Set : Symbol(Set, Decl(immutable.ts, 297, 5), Decl(immutable.ts, 300, 5), Decl(immutable.ts, 301, 40), Decl(immutable.ts, 302, 41), Decl(immutable.ts, 303, 64)) +>T : Symbol(T, Decl(immutable.ts, 303, 24)) export interface Set extends Seq, Collection.Set { ->Set : Symbol(Set, Decl(immutable.d.ts, 297, 5), Decl(immutable.d.ts, 300, 5), Decl(immutable.d.ts, 301, 40), Decl(immutable.d.ts, 302, 41), Decl(immutable.d.ts, 303, 64)) ->T : Symbol(T, Decl(immutable.d.ts, 304, 25)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->T : Symbol(T, Decl(immutable.d.ts, 304, 25)) ->Collection.Set : Symbol(Collection.Set, Decl(immutable.d.ts, 387, 5), Decl(immutable.d.ts, 388, 24), Decl(immutable.d.ts, 389, 71)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Set : Symbol(Collection.Set, Decl(immutable.d.ts, 387, 5), Decl(immutable.d.ts, 388, 24), Decl(immutable.d.ts, 389, 71)) ->T : Symbol(T, Decl(immutable.d.ts, 304, 25)) +>Set : Symbol(Set, Decl(immutable.ts, 297, 5), Decl(immutable.ts, 300, 5), Decl(immutable.ts, 301, 40), Decl(immutable.ts, 302, 41), Decl(immutable.ts, 303, 64)) +>T : Symbol(T, Decl(immutable.ts, 304, 25)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>T : Symbol(T, Decl(immutable.ts, 304, 25)) +>Collection.Set : Symbol(Collection.Set, Decl(immutable.ts, 387, 5), Decl(immutable.ts, 388, 24), Decl(immutable.ts, 389, 71)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Set : Symbol(Collection.Set, Decl(immutable.ts, 387, 5), Decl(immutable.ts, 388, 24), Decl(immutable.ts, 389, 71)) +>T : Symbol(T, Decl(immutable.ts, 304, 25)) toJS(): Array; ->toJS : Symbol(Set.toJS, Decl(immutable.d.ts, 304, 70)) +>toJS : Symbol(Set.toJS, Decl(immutable.ts, 304, 70)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) toJSON(): Array; ->toJSON : Symbol(Set.toJSON, Decl(immutable.d.ts, 305, 25)) +>toJSON : Symbol(Set.toJSON, Decl(immutable.ts, 305, 25)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 304, 25)) +>T : Symbol(T, Decl(immutable.ts, 304, 25)) toSeq(): this; ->toSeq : Symbol(Set.toSeq, Decl(immutable.d.ts, 306, 25)) +>toSeq : Symbol(Set.toSeq, Decl(immutable.ts, 306, 25)) concat(...valuesOrCollections: Array | C>): Seq.Set; ->concat : Symbol(Set.concat, Decl(immutable.d.ts, 307, 20)) ->C : Symbol(C, Decl(immutable.d.ts, 308, 13)) ->valuesOrCollections : Symbol(valuesOrCollections, Decl(immutable.d.ts, 308, 16)) +>concat : Symbol(Set.concat, Decl(immutable.ts, 307, 20)) +>C : Symbol(C, Decl(immutable.ts, 308, 13)) +>valuesOrCollections : Symbol(valuesOrCollections, Decl(immutable.ts, 308, 16)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->C : Symbol(C, Decl(immutable.d.ts, 308, 13)) ->C : Symbol(C, Decl(immutable.d.ts, 308, 13)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Set : Symbol(Set, Decl(immutable.d.ts, 297, 5), Decl(immutable.d.ts, 300, 5), Decl(immutable.d.ts, 301, 40), Decl(immutable.d.ts, 302, 41), Decl(immutable.d.ts, 303, 64)) ->T : Symbol(T, Decl(immutable.d.ts, 304, 25)) ->C : Symbol(C, Decl(immutable.d.ts, 308, 13)) +>C : Symbol(C, Decl(immutable.ts, 308, 13)) +>C : Symbol(C, Decl(immutable.ts, 308, 13)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Set : Symbol(Set, Decl(immutable.ts, 297, 5), Decl(immutable.ts, 300, 5), Decl(immutable.ts, 301, 40), Decl(immutable.ts, 302, 41), Decl(immutable.ts, 303, 64)) +>T : Symbol(T, Decl(immutable.ts, 304, 25)) +>C : Symbol(C, Decl(immutable.ts, 308, 13)) map(mapper: (value: T, key: never, iter: this) => M, context?: any): Seq.Set; ->map : Symbol(Set.map, Decl(immutable.d.ts, 308, 80)) ->M : Symbol(M, Decl(immutable.d.ts, 309, 10)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 309, 13)) ->value : Symbol(value, Decl(immutable.d.ts, 309, 22)) ->T : Symbol(T, Decl(immutable.d.ts, 304, 25)) ->key : Symbol(key, Decl(immutable.d.ts, 309, 31)) ->iter : Symbol(iter, Decl(immutable.d.ts, 309, 43)) ->M : Symbol(M, Decl(immutable.d.ts, 309, 10)) ->context : Symbol(context, Decl(immutable.d.ts, 309, 61)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Set : Symbol(Set, Decl(immutable.d.ts, 297, 5), Decl(immutable.d.ts, 300, 5), Decl(immutable.d.ts, 301, 40), Decl(immutable.d.ts, 302, 41), Decl(immutable.d.ts, 303, 64)) ->M : Symbol(M, Decl(immutable.d.ts, 309, 10)) +>map : Symbol(Set.map, Decl(immutable.ts, 308, 80)) +>M : Symbol(M, Decl(immutable.ts, 309, 10)) +>mapper : Symbol(mapper, Decl(immutable.ts, 309, 13)) +>value : Symbol(value, Decl(immutable.ts, 309, 22)) +>T : Symbol(T, Decl(immutable.ts, 304, 25)) +>key : Symbol(key, Decl(immutable.ts, 309, 31)) +>iter : Symbol(iter, Decl(immutable.ts, 309, 43)) +>M : Symbol(M, Decl(immutable.ts, 309, 10)) +>context : Symbol(context, Decl(immutable.ts, 309, 61)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Set : Symbol(Set, Decl(immutable.ts, 297, 5), Decl(immutable.ts, 300, 5), Decl(immutable.ts, 301, 40), Decl(immutable.ts, 302, 41), Decl(immutable.ts, 303, 64)) +>M : Symbol(M, Decl(immutable.ts, 309, 10)) flatMap(mapper: (value: T, key: never, iter: this) => Iterable, context?: any): Seq.Set; ->flatMap : Symbol(Set.flatMap, Decl(immutable.d.ts, 309, 89)) ->M : Symbol(M, Decl(immutable.d.ts, 310, 14)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 310, 17)) ->value : Symbol(value, Decl(immutable.d.ts, 310, 26)) ->T : Symbol(T, Decl(immutable.d.ts, 304, 25)) ->key : Symbol(key, Decl(immutable.d.ts, 310, 35)) ->iter : Symbol(iter, Decl(immutable.d.ts, 310, 47)) +>flatMap : Symbol(Set.flatMap, Decl(immutable.ts, 309, 89)) +>M : Symbol(M, Decl(immutable.ts, 310, 14)) +>mapper : Symbol(mapper, Decl(immutable.ts, 310, 17)) +>value : Symbol(value, Decl(immutable.ts, 310, 26)) +>T : Symbol(T, Decl(immutable.ts, 304, 25)) +>key : Symbol(key, Decl(immutable.ts, 310, 35)) +>iter : Symbol(iter, Decl(immutable.ts, 310, 47)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->M : Symbol(M, Decl(immutable.d.ts, 310, 14)) ->context : Symbol(context, Decl(immutable.d.ts, 310, 75)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Set : Symbol(Set, Decl(immutable.d.ts, 297, 5), Decl(immutable.d.ts, 300, 5), Decl(immutable.d.ts, 301, 40), Decl(immutable.d.ts, 302, 41), Decl(immutable.d.ts, 303, 64)) ->M : Symbol(M, Decl(immutable.d.ts, 310, 14)) +>M : Symbol(M, Decl(immutable.ts, 310, 14)) +>context : Symbol(context, Decl(immutable.ts, 310, 75)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Set : Symbol(Set, Decl(immutable.ts, 297, 5), Decl(immutable.ts, 300, 5), Decl(immutable.ts, 301, 40), Decl(immutable.ts, 302, 41), Decl(immutable.ts, 303, 64)) +>M : Symbol(M, Decl(immutable.ts, 310, 14)) filter(predicate: (value: T, key: never, iter: this) => value is F, context?: any): Seq.Set; ->filter : Symbol(Set.filter, Decl(immutable.d.ts, 310, 103), Decl(immutable.d.ts, 311, 114)) ->F : Symbol(F, Decl(immutable.d.ts, 311, 13)) ->T : Symbol(T, Decl(immutable.d.ts, 304, 25)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 311, 26)) ->value : Symbol(value, Decl(immutable.d.ts, 311, 38)) ->T : Symbol(T, Decl(immutable.d.ts, 304, 25)) ->key : Symbol(key, Decl(immutable.d.ts, 311, 47)) ->iter : Symbol(iter, Decl(immutable.d.ts, 311, 59)) ->value : Symbol(value, Decl(immutable.d.ts, 311, 38)) ->F : Symbol(F, Decl(immutable.d.ts, 311, 13)) ->context : Symbol(context, Decl(immutable.d.ts, 311, 86)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Set : Symbol(Set, Decl(immutable.d.ts, 297, 5), Decl(immutable.d.ts, 300, 5), Decl(immutable.d.ts, 301, 40), Decl(immutable.d.ts, 302, 41), Decl(immutable.d.ts, 303, 64)) ->F : Symbol(F, Decl(immutable.d.ts, 311, 13)) +>filter : Symbol(Set.filter, Decl(immutable.ts, 310, 103), Decl(immutable.ts, 311, 114)) +>F : Symbol(F, Decl(immutable.ts, 311, 13)) +>T : Symbol(T, Decl(immutable.ts, 304, 25)) +>predicate : Symbol(predicate, Decl(immutable.ts, 311, 26)) +>value : Symbol(value, Decl(immutable.ts, 311, 38)) +>T : Symbol(T, Decl(immutable.ts, 304, 25)) +>key : Symbol(key, Decl(immutable.ts, 311, 47)) +>iter : Symbol(iter, Decl(immutable.ts, 311, 59)) +>value : Symbol(value, Decl(immutable.ts, 311, 38)) +>F : Symbol(F, Decl(immutable.ts, 311, 13)) +>context : Symbol(context, Decl(immutable.ts, 311, 86)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Set : Symbol(Set, Decl(immutable.ts, 297, 5), Decl(immutable.ts, 300, 5), Decl(immutable.ts, 301, 40), Decl(immutable.ts, 302, 41), Decl(immutable.ts, 303, 64)) +>F : Symbol(F, Decl(immutable.ts, 311, 13)) filter(predicate: (value: T, key: never, iter: this) => any, context?: any): this; ->filter : Symbol(Set.filter, Decl(immutable.d.ts, 310, 103), Decl(immutable.d.ts, 311, 114)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 312, 13)) ->value : Symbol(value, Decl(immutable.d.ts, 312, 25)) ->T : Symbol(T, Decl(immutable.d.ts, 304, 25)) ->key : Symbol(key, Decl(immutable.d.ts, 312, 34)) ->iter : Symbol(iter, Decl(immutable.d.ts, 312, 46)) ->context : Symbol(context, Decl(immutable.d.ts, 312, 66)) +>filter : Symbol(Set.filter, Decl(immutable.ts, 310, 103), Decl(immutable.ts, 311, 114)) +>predicate : Symbol(predicate, Decl(immutable.ts, 312, 13)) +>value : Symbol(value, Decl(immutable.ts, 312, 25)) +>T : Symbol(T, Decl(immutable.ts, 304, 25)) +>key : Symbol(key, Decl(immutable.ts, 312, 34)) +>iter : Symbol(iter, Decl(immutable.ts, 312, 46)) +>context : Symbol(context, Decl(immutable.ts, 312, 66)) } } export function Seq>(seq: S): S; ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->S : Symbol(S, Decl(immutable.d.ts, 315, 22)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->seq : Symbol(seq, Decl(immutable.d.ts, 315, 47)) ->S : Symbol(S, Decl(immutable.d.ts, 315, 22)) ->S : Symbol(S, Decl(immutable.d.ts, 315, 22)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>S : Symbol(S, Decl(immutable.ts, 315, 22)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>seq : Symbol(seq, Decl(immutable.ts, 315, 47)) +>S : Symbol(S, Decl(immutable.ts, 315, 22)) +>S : Symbol(S, Decl(immutable.ts, 315, 22)) export function Seq(collection: Collection.Keyed): Seq.Keyed; ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->K : Symbol(K, Decl(immutable.d.ts, 316, 22)) ->V : Symbol(V, Decl(immutable.d.ts, 316, 24)) ->collection : Symbol(collection, Decl(immutable.d.ts, 316, 28)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Keyed : Symbol(Collection.Keyed, Decl(immutable.d.ts, 336, 51), Decl(immutable.d.ts, 337, 26), Decl(immutable.d.ts, 338, 86), Decl(immutable.d.ts, 339, 83)) ->K : Symbol(K, Decl(immutable.d.ts, 316, 22)) ->V : Symbol(V, Decl(immutable.d.ts, 316, 24)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Keyed : Symbol(Seq.Keyed, Decl(immutable.d.ts, 263, 56), Decl(immutable.d.ts, 264, 26), Decl(immutable.d.ts, 265, 79), Decl(immutable.d.ts, 266, 76), Decl(immutable.d.ts, 267, 51) ... and 1 more) ->K : Symbol(K, Decl(immutable.d.ts, 316, 22)) ->V : Symbol(V, Decl(immutable.d.ts, 316, 24)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>K : Symbol(K, Decl(immutable.ts, 316, 22)) +>V : Symbol(V, Decl(immutable.ts, 316, 24)) +>collection : Symbol(collection, Decl(immutable.ts, 316, 28)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Keyed : Symbol(Collection.Keyed, Decl(immutable.ts, 336, 51), Decl(immutable.ts, 337, 26), Decl(immutable.ts, 338, 86), Decl(immutable.ts, 339, 83)) +>K : Symbol(K, Decl(immutable.ts, 316, 22)) +>V : Symbol(V, Decl(immutable.ts, 316, 24)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Keyed : Symbol(Seq.Keyed, Decl(immutable.ts, 263, 56), Decl(immutable.ts, 264, 26), Decl(immutable.ts, 265, 79), Decl(immutable.ts, 266, 76), Decl(immutable.ts, 267, 51) ... and 1 more) +>K : Symbol(K, Decl(immutable.ts, 316, 22)) +>V : Symbol(V, Decl(immutable.ts, 316, 24)) export function Seq(collection: Collection.Indexed): Seq.Indexed; ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->T : Symbol(T, Decl(immutable.d.ts, 317, 22)) ->collection : Symbol(collection, Decl(immutable.d.ts, 317, 25)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Indexed : Symbol(Collection.Indexed, Decl(immutable.d.ts, 355, 5), Decl(immutable.d.ts, 356, 28), Decl(immutable.d.ts, 357, 79)) ->T : Symbol(T, Decl(immutable.d.ts, 317, 22)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Indexed : Symbol(Seq.Indexed, Decl(immutable.d.ts, 281, 5), Decl(immutable.d.ts, 284, 5), Decl(immutable.d.ts, 285, 48), Decl(immutable.d.ts, 286, 49), Decl(immutable.d.ts, 287, 72)) ->T : Symbol(T, Decl(immutable.d.ts, 317, 22)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>T : Symbol(T, Decl(immutable.ts, 317, 22)) +>collection : Symbol(collection, Decl(immutable.ts, 317, 25)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Indexed : Symbol(Collection.Indexed, Decl(immutable.ts, 355, 5), Decl(immutable.ts, 356, 28), Decl(immutable.ts, 357, 79)) +>T : Symbol(T, Decl(immutable.ts, 317, 22)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Indexed : Symbol(Seq.Indexed, Decl(immutable.ts, 281, 5), Decl(immutable.ts, 284, 5), Decl(immutable.ts, 285, 48), Decl(immutable.ts, 286, 49), Decl(immutable.ts, 287, 72)) +>T : Symbol(T, Decl(immutable.ts, 317, 22)) export function Seq(collection: Collection.Set): Seq.Set; ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->T : Symbol(T, Decl(immutable.d.ts, 318, 22)) ->collection : Symbol(collection, Decl(immutable.d.ts, 318, 25)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Set : Symbol(Collection.Set, Decl(immutable.d.ts, 387, 5), Decl(immutable.d.ts, 388, 24), Decl(immutable.d.ts, 389, 71)) ->T : Symbol(T, Decl(immutable.d.ts, 318, 22)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Set : Symbol(Seq.Set, Decl(immutable.d.ts, 297, 5), Decl(immutable.d.ts, 300, 5), Decl(immutable.d.ts, 301, 40), Decl(immutable.d.ts, 302, 41), Decl(immutable.d.ts, 303, 64)) ->T : Symbol(T, Decl(immutable.d.ts, 318, 22)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>T : Symbol(T, Decl(immutable.ts, 318, 22)) +>collection : Symbol(collection, Decl(immutable.ts, 318, 25)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Set : Symbol(Collection.Set, Decl(immutable.ts, 387, 5), Decl(immutable.ts, 388, 24), Decl(immutable.ts, 389, 71)) +>T : Symbol(T, Decl(immutable.ts, 318, 22)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Set : Symbol(Seq.Set, Decl(immutable.ts, 297, 5), Decl(immutable.ts, 300, 5), Decl(immutable.ts, 301, 40), Decl(immutable.ts, 302, 41), Decl(immutable.ts, 303, 64)) +>T : Symbol(T, Decl(immutable.ts, 318, 22)) export function Seq(collection: Iterable): Seq.Indexed; ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->T : Symbol(T, Decl(immutable.d.ts, 319, 22)) ->collection : Symbol(collection, Decl(immutable.d.ts, 319, 25)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>T : Symbol(T, Decl(immutable.ts, 319, 22)) +>collection : Symbol(collection, Decl(immutable.ts, 319, 25)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 319, 22)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Indexed : Symbol(Seq.Indexed, Decl(immutable.d.ts, 281, 5), Decl(immutable.d.ts, 284, 5), Decl(immutable.d.ts, 285, 48), Decl(immutable.d.ts, 286, 49), Decl(immutable.d.ts, 287, 72)) ->T : Symbol(T, Decl(immutable.d.ts, 319, 22)) +>T : Symbol(T, Decl(immutable.ts, 319, 22)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Indexed : Symbol(Seq.Indexed, Decl(immutable.ts, 281, 5), Decl(immutable.ts, 284, 5), Decl(immutable.ts, 285, 48), Decl(immutable.ts, 286, 49), Decl(immutable.ts, 287, 72)) +>T : Symbol(T, Decl(immutable.ts, 319, 22)) export function Seq(obj: {[key: string]: V}): Seq.Keyed; ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->V : Symbol(V, Decl(immutable.d.ts, 320, 22)) ->obj : Symbol(obj, Decl(immutable.d.ts, 320, 25)) ->key : Symbol(key, Decl(immutable.d.ts, 320, 32)) ->V : Symbol(V, Decl(immutable.d.ts, 320, 22)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Keyed : Symbol(Seq.Keyed, Decl(immutable.d.ts, 263, 56), Decl(immutable.d.ts, 264, 26), Decl(immutable.d.ts, 265, 79), Decl(immutable.d.ts, 266, 76), Decl(immutable.d.ts, 267, 51) ... and 1 more) ->V : Symbol(V, Decl(immutable.d.ts, 320, 22)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>V : Symbol(V, Decl(immutable.ts, 320, 22)) +>obj : Symbol(obj, Decl(immutable.ts, 320, 25)) +>key : Symbol(key, Decl(immutable.ts, 320, 32)) +>V : Symbol(V, Decl(immutable.ts, 320, 22)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Keyed : Symbol(Seq.Keyed, Decl(immutable.ts, 263, 56), Decl(immutable.ts, 264, 26), Decl(immutable.ts, 265, 79), Decl(immutable.ts, 266, 76), Decl(immutable.ts, 267, 51) ... and 1 more) +>V : Symbol(V, Decl(immutable.ts, 320, 22)) export function Seq(): Seq; ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) export interface Seq extends Collection { ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->K : Symbol(K, Decl(immutable.d.ts, 322, 23)) ->V : Symbol(V, Decl(immutable.d.ts, 322, 25)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->K : Symbol(K, Decl(immutable.d.ts, 322, 23)) ->V : Symbol(V, Decl(immutable.d.ts, 322, 25)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>K : Symbol(K, Decl(immutable.ts, 322, 23)) +>V : Symbol(V, Decl(immutable.ts, 322, 25)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>K : Symbol(K, Decl(immutable.ts, 322, 23)) +>V : Symbol(V, Decl(immutable.ts, 322, 25)) readonly size: number | undefined; ->size : Symbol(Seq.size, Decl(immutable.d.ts, 322, 55)) +>size : Symbol(Seq.size, Decl(immutable.ts, 322, 55)) // Force evaluation cacheResult(): this; ->cacheResult : Symbol(Seq.cacheResult, Decl(immutable.d.ts, 323, 38)) +>cacheResult : Symbol(Seq.cacheResult, Decl(immutable.ts, 323, 38)) // Sequence algorithms map(mapper: (value: V, key: K, iter: this) => M, context?: any): Seq; ->map : Symbol(Seq.map, Decl(immutable.d.ts, 325, 24)) ->M : Symbol(M, Decl(immutable.d.ts, 327, 8)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 327, 11)) ->value : Symbol(value, Decl(immutable.d.ts, 327, 20)) ->V : Symbol(V, Decl(immutable.d.ts, 322, 25)) ->key : Symbol(key, Decl(immutable.d.ts, 327, 29)) ->K : Symbol(K, Decl(immutable.d.ts, 322, 23)) ->iter : Symbol(iter, Decl(immutable.d.ts, 327, 37)) ->M : Symbol(M, Decl(immutable.d.ts, 327, 8)) ->context : Symbol(context, Decl(immutable.d.ts, 327, 55)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->K : Symbol(K, Decl(immutable.d.ts, 322, 23)) ->M : Symbol(M, Decl(immutable.d.ts, 327, 8)) +>map : Symbol(Seq.map, Decl(immutable.ts, 325, 24)) +>M : Symbol(M, Decl(immutable.ts, 327, 8)) +>mapper : Symbol(mapper, Decl(immutable.ts, 327, 11)) +>value : Symbol(value, Decl(immutable.ts, 327, 20)) +>V : Symbol(V, Decl(immutable.ts, 322, 25)) +>key : Symbol(key, Decl(immutable.ts, 327, 29)) +>K : Symbol(K, Decl(immutable.ts, 322, 23)) +>iter : Symbol(iter, Decl(immutable.ts, 327, 37)) +>M : Symbol(M, Decl(immutable.ts, 327, 8)) +>context : Symbol(context, Decl(immutable.ts, 327, 55)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>K : Symbol(K, Decl(immutable.ts, 322, 23)) +>M : Symbol(M, Decl(immutable.ts, 327, 8)) flatMap(mapper: (value: V, key: K, iter: this) => Iterable, context?: any): Seq; ->flatMap : Symbol(Seq.flatMap, Decl(immutable.d.ts, 327, 82)) ->M : Symbol(M, Decl(immutable.d.ts, 328, 12)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 328, 15)) ->value : Symbol(value, Decl(immutable.d.ts, 328, 24)) ->V : Symbol(V, Decl(immutable.d.ts, 322, 25)) ->key : Symbol(key, Decl(immutable.d.ts, 328, 33)) ->K : Symbol(K, Decl(immutable.d.ts, 322, 23)) ->iter : Symbol(iter, Decl(immutable.d.ts, 328, 41)) +>flatMap : Symbol(Seq.flatMap, Decl(immutable.ts, 327, 82)) +>M : Symbol(M, Decl(immutable.ts, 328, 12)) +>mapper : Symbol(mapper, Decl(immutable.ts, 328, 15)) +>value : Symbol(value, Decl(immutable.ts, 328, 24)) +>V : Symbol(V, Decl(immutable.ts, 322, 25)) +>key : Symbol(key, Decl(immutable.ts, 328, 33)) +>K : Symbol(K, Decl(immutable.ts, 322, 23)) +>iter : Symbol(iter, Decl(immutable.ts, 328, 41)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->M : Symbol(M, Decl(immutable.d.ts, 328, 12)) ->context : Symbol(context, Decl(immutable.d.ts, 328, 69)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->K : Symbol(K, Decl(immutable.d.ts, 322, 23)) ->M : Symbol(M, Decl(immutable.d.ts, 328, 12)) +>M : Symbol(M, Decl(immutable.ts, 328, 12)) +>context : Symbol(context, Decl(immutable.ts, 328, 69)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>K : Symbol(K, Decl(immutable.ts, 322, 23)) +>M : Symbol(M, Decl(immutable.ts, 328, 12)) filter(predicate: (value: V, key: K, iter: this) => value is F, context?: any): Seq; ->filter : Symbol(Seq.filter, Decl(immutable.d.ts, 328, 96), Decl(immutable.d.ts, 329, 107)) ->F : Symbol(F, Decl(immutable.d.ts, 329, 11)) ->V : Symbol(V, Decl(immutable.d.ts, 322, 25)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 329, 24)) ->value : Symbol(value, Decl(immutable.d.ts, 329, 36)) ->V : Symbol(V, Decl(immutable.d.ts, 322, 25)) ->key : Symbol(key, Decl(immutable.d.ts, 329, 45)) ->K : Symbol(K, Decl(immutable.d.ts, 322, 23)) ->iter : Symbol(iter, Decl(immutable.d.ts, 329, 53)) ->value : Symbol(value, Decl(immutable.d.ts, 329, 36)) ->F : Symbol(F, Decl(immutable.d.ts, 329, 11)) ->context : Symbol(context, Decl(immutable.d.ts, 329, 80)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->K : Symbol(K, Decl(immutable.d.ts, 322, 23)) ->F : Symbol(F, Decl(immutable.d.ts, 329, 11)) +>filter : Symbol(Seq.filter, Decl(immutable.ts, 328, 96), Decl(immutable.ts, 329, 107)) +>F : Symbol(F, Decl(immutable.ts, 329, 11)) +>V : Symbol(V, Decl(immutable.ts, 322, 25)) +>predicate : Symbol(predicate, Decl(immutable.ts, 329, 24)) +>value : Symbol(value, Decl(immutable.ts, 329, 36)) +>V : Symbol(V, Decl(immutable.ts, 322, 25)) +>key : Symbol(key, Decl(immutable.ts, 329, 45)) +>K : Symbol(K, Decl(immutable.ts, 322, 23)) +>iter : Symbol(iter, Decl(immutable.ts, 329, 53)) +>value : Symbol(value, Decl(immutable.ts, 329, 36)) +>F : Symbol(F, Decl(immutable.ts, 329, 11)) +>context : Symbol(context, Decl(immutable.ts, 329, 80)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>K : Symbol(K, Decl(immutable.ts, 322, 23)) +>F : Symbol(F, Decl(immutable.ts, 329, 11)) filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this; ->filter : Symbol(Seq.filter, Decl(immutable.d.ts, 328, 96), Decl(immutable.d.ts, 329, 107)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 330, 11)) ->value : Symbol(value, Decl(immutable.d.ts, 330, 23)) ->V : Symbol(V, Decl(immutable.d.ts, 322, 25)) ->key : Symbol(key, Decl(immutable.d.ts, 330, 32)) ->K : Symbol(K, Decl(immutable.d.ts, 322, 23)) ->iter : Symbol(iter, Decl(immutable.d.ts, 330, 40)) ->context : Symbol(context, Decl(immutable.d.ts, 330, 60)) +>filter : Symbol(Seq.filter, Decl(immutable.ts, 328, 96), Decl(immutable.ts, 329, 107)) +>predicate : Symbol(predicate, Decl(immutable.ts, 330, 11)) +>value : Symbol(value, Decl(immutable.ts, 330, 23)) +>V : Symbol(V, Decl(immutable.ts, 322, 25)) +>key : Symbol(key, Decl(immutable.ts, 330, 32)) +>K : Symbol(K, Decl(immutable.ts, 322, 23)) +>iter : Symbol(iter, Decl(immutable.ts, 330, 40)) +>context : Symbol(context, Decl(immutable.ts, 330, 60)) } export module Collection { ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) function isKeyed(maybeKeyed: any): maybeKeyed is Collection.Keyed; ->isKeyed : Symbol(isKeyed, Decl(immutable.d.ts, 332, 28)) ->maybeKeyed : Symbol(maybeKeyed, Decl(immutable.d.ts, 333, 21)) ->maybeKeyed : Symbol(maybeKeyed, Decl(immutable.d.ts, 333, 21)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 336, 51), Decl(immutable.d.ts, 337, 26), Decl(immutable.d.ts, 338, 86), Decl(immutable.d.ts, 339, 83)) +>isKeyed : Symbol(isKeyed, Decl(immutable.ts, 332, 28)) +>maybeKeyed : Symbol(maybeKeyed, Decl(immutable.ts, 333, 21)) +>maybeKeyed : Symbol(maybeKeyed, Decl(immutable.ts, 333, 21)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 336, 51), Decl(immutable.ts, 337, 26), Decl(immutable.ts, 338, 86), Decl(immutable.ts, 339, 83)) function isIndexed(maybeIndexed: any): maybeIndexed is Collection.Indexed; ->isIndexed : Symbol(isIndexed, Decl(immutable.d.ts, 333, 80)) ->maybeIndexed : Symbol(maybeIndexed, Decl(immutable.d.ts, 334, 23)) ->maybeIndexed : Symbol(maybeIndexed, Decl(immutable.d.ts, 334, 23)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Indexed : Symbol(Indexed, Decl(immutable.d.ts, 355, 5), Decl(immutable.d.ts, 356, 28), Decl(immutable.d.ts, 357, 79)) +>isIndexed : Symbol(isIndexed, Decl(immutable.ts, 333, 80)) +>maybeIndexed : Symbol(maybeIndexed, Decl(immutable.ts, 334, 23)) +>maybeIndexed : Symbol(maybeIndexed, Decl(immutable.ts, 334, 23)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Indexed : Symbol(Indexed, Decl(immutable.ts, 355, 5), Decl(immutable.ts, 356, 28), Decl(immutable.ts, 357, 79)) function isAssociative(maybeAssociative: any): maybeAssociative is Collection.Keyed | Collection.Indexed; ->isAssociative : Symbol(isAssociative, Decl(immutable.d.ts, 334, 83)) ->maybeAssociative : Symbol(maybeAssociative, Decl(immutable.d.ts, 335, 27)) ->maybeAssociative : Symbol(maybeAssociative, Decl(immutable.d.ts, 335, 27)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 336, 51), Decl(immutable.d.ts, 337, 26), Decl(immutable.d.ts, 338, 86), Decl(immutable.d.ts, 339, 83)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Indexed : Symbol(Indexed, Decl(immutable.d.ts, 355, 5), Decl(immutable.d.ts, 356, 28), Decl(immutable.d.ts, 357, 79)) +>isAssociative : Symbol(isAssociative, Decl(immutable.ts, 334, 83)) +>maybeAssociative : Symbol(maybeAssociative, Decl(immutable.ts, 335, 27)) +>maybeAssociative : Symbol(maybeAssociative, Decl(immutable.ts, 335, 27)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 336, 51), Decl(immutable.ts, 337, 26), Decl(immutable.ts, 338, 86), Decl(immutable.ts, 339, 83)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Indexed : Symbol(Indexed, Decl(immutable.ts, 355, 5), Decl(immutable.ts, 356, 28), Decl(immutable.ts, 357, 79)) function isOrdered(maybeOrdered: any): boolean; ->isOrdered : Symbol(isOrdered, Decl(immutable.d.ts, 335, 124)) ->maybeOrdered : Symbol(maybeOrdered, Decl(immutable.d.ts, 336, 23)) +>isOrdered : Symbol(isOrdered, Decl(immutable.ts, 335, 124)) +>maybeOrdered : Symbol(maybeOrdered, Decl(immutable.ts, 336, 23)) export module Keyed {} ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 336, 51), Decl(immutable.d.ts, 337, 26), Decl(immutable.d.ts, 338, 86), Decl(immutable.d.ts, 339, 83)) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 336, 51), Decl(immutable.ts, 337, 26), Decl(immutable.ts, 338, 86), Decl(immutable.ts, 339, 83)) export function Keyed(collection: Iterable<[K, V]>): Collection.Keyed; ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 336, 51), Decl(immutable.d.ts, 337, 26), Decl(immutable.d.ts, 338, 86), Decl(immutable.d.ts, 339, 83)) ->K : Symbol(K, Decl(immutable.d.ts, 338, 26)) ->V : Symbol(V, Decl(immutable.d.ts, 338, 28)) ->collection : Symbol(collection, Decl(immutable.d.ts, 338, 32)) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 336, 51), Decl(immutable.ts, 337, 26), Decl(immutable.ts, 338, 86), Decl(immutable.ts, 339, 83)) +>K : Symbol(K, Decl(immutable.ts, 338, 26)) +>V : Symbol(V, Decl(immutable.ts, 338, 28)) +>collection : Symbol(collection, Decl(immutable.ts, 338, 32)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->K : Symbol(K, Decl(immutable.d.ts, 338, 26)) ->V : Symbol(V, Decl(immutable.d.ts, 338, 28)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 336, 51), Decl(immutable.d.ts, 337, 26), Decl(immutable.d.ts, 338, 86), Decl(immutable.d.ts, 339, 83)) ->K : Symbol(K, Decl(immutable.d.ts, 338, 26)) ->V : Symbol(V, Decl(immutable.d.ts, 338, 28)) +>K : Symbol(K, Decl(immutable.ts, 338, 26)) +>V : Symbol(V, Decl(immutable.ts, 338, 28)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 336, 51), Decl(immutable.ts, 337, 26), Decl(immutable.ts, 338, 86), Decl(immutable.ts, 339, 83)) +>K : Symbol(K, Decl(immutable.ts, 338, 26)) +>V : Symbol(V, Decl(immutable.ts, 338, 28)) export function Keyed(obj: {[key: string]: V}): Collection.Keyed; ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 336, 51), Decl(immutable.d.ts, 337, 26), Decl(immutable.d.ts, 338, 86), Decl(immutable.d.ts, 339, 83)) ->V : Symbol(V, Decl(immutable.d.ts, 339, 26)) ->obj : Symbol(obj, Decl(immutable.d.ts, 339, 29)) ->key : Symbol(key, Decl(immutable.d.ts, 339, 36)) ->V : Symbol(V, Decl(immutable.d.ts, 339, 26)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 336, 51), Decl(immutable.d.ts, 337, 26), Decl(immutable.d.ts, 338, 86), Decl(immutable.d.ts, 339, 83)) ->V : Symbol(V, Decl(immutable.d.ts, 339, 26)) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 336, 51), Decl(immutable.ts, 337, 26), Decl(immutable.ts, 338, 86), Decl(immutable.ts, 339, 83)) +>V : Symbol(V, Decl(immutable.ts, 339, 26)) +>obj : Symbol(obj, Decl(immutable.ts, 339, 29)) +>key : Symbol(key, Decl(immutable.ts, 339, 36)) +>V : Symbol(V, Decl(immutable.ts, 339, 26)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 336, 51), Decl(immutable.ts, 337, 26), Decl(immutable.ts, 338, 86), Decl(immutable.ts, 339, 83)) +>V : Symbol(V, Decl(immutable.ts, 339, 26)) export interface Keyed extends Collection { ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 336, 51), Decl(immutable.d.ts, 337, 26), Decl(immutable.d.ts, 338, 86), Decl(immutable.d.ts, 339, 83)) ->K : Symbol(K, Decl(immutable.d.ts, 340, 27)) ->V : Symbol(V, Decl(immutable.d.ts, 340, 29)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->K : Symbol(K, Decl(immutable.d.ts, 340, 27)) ->V : Symbol(V, Decl(immutable.d.ts, 340, 29)) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 336, 51), Decl(immutable.ts, 337, 26), Decl(immutable.ts, 338, 86), Decl(immutable.ts, 339, 83)) +>K : Symbol(K, Decl(immutable.ts, 340, 27)) +>V : Symbol(V, Decl(immutable.ts, 340, 29)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>K : Symbol(K, Decl(immutable.ts, 340, 27)) +>V : Symbol(V, Decl(immutable.ts, 340, 29)) toJS(): Object; ->toJS : Symbol(Keyed.toJS, Decl(immutable.d.ts, 340, 59)) +>toJS : Symbol(Keyed.toJS, Decl(immutable.ts, 340, 59)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) toJSON(): { [key: string]: V }; ->toJSON : Symbol(Keyed.toJSON, Decl(immutable.d.ts, 341, 21)) ->key : Symbol(key, Decl(immutable.d.ts, 342, 19)) ->V : Symbol(V, Decl(immutable.d.ts, 340, 29)) +>toJSON : Symbol(Keyed.toJSON, Decl(immutable.ts, 341, 21)) +>key : Symbol(key, Decl(immutable.ts, 342, 19)) +>V : Symbol(V, Decl(immutable.ts, 340, 29)) toSeq(): Seq.Keyed; ->toSeq : Symbol(Keyed.toSeq, Decl(immutable.d.ts, 342, 37)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Keyed : Symbol(Seq.Keyed, Decl(immutable.d.ts, 263, 56), Decl(immutable.d.ts, 264, 26), Decl(immutable.d.ts, 265, 79), Decl(immutable.d.ts, 266, 76), Decl(immutable.d.ts, 267, 51) ... and 1 more) ->K : Symbol(K, Decl(immutable.d.ts, 340, 27)) ->V : Symbol(V, Decl(immutable.d.ts, 340, 29)) +>toSeq : Symbol(Keyed.toSeq, Decl(immutable.ts, 342, 37)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Keyed : Symbol(Seq.Keyed, Decl(immutable.ts, 263, 56), Decl(immutable.ts, 264, 26), Decl(immutable.ts, 265, 79), Decl(immutable.ts, 266, 76), Decl(immutable.ts, 267, 51) ... and 1 more) +>K : Symbol(K, Decl(immutable.ts, 340, 27)) +>V : Symbol(V, Decl(immutable.ts, 340, 29)) // Sequence functions flip(): this; ->flip : Symbol(Keyed.flip, Decl(immutable.d.ts, 343, 31)) +>flip : Symbol(Keyed.flip, Decl(immutable.ts, 343, 31)) concat(...collections: Array>): Collection.Keyed; ->concat : Symbol(Keyed.concat, Decl(immutable.d.ts, 345, 19), Decl(immutable.d.ts, 346, 98)) ->KC : Symbol(KC, Decl(immutable.d.ts, 346, 13)) ->VC : Symbol(VC, Decl(immutable.d.ts, 346, 16)) ->collections : Symbol(collections, Decl(immutable.d.ts, 346, 21)) +>concat : Symbol(Keyed.concat, Decl(immutable.ts, 345, 19), Decl(immutable.ts, 346, 98)) +>KC : Symbol(KC, Decl(immutable.ts, 346, 13)) +>VC : Symbol(VC, Decl(immutable.ts, 346, 16)) +>collections : Symbol(collections, Decl(immutable.ts, 346, 21)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->KC : Symbol(KC, Decl(immutable.d.ts, 346, 13)) ->VC : Symbol(VC, Decl(immutable.d.ts, 346, 16)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 336, 51), Decl(immutable.d.ts, 337, 26), Decl(immutable.d.ts, 338, 86), Decl(immutable.d.ts, 339, 83)) ->K : Symbol(K, Decl(immutable.d.ts, 340, 27)) ->KC : Symbol(KC, Decl(immutable.d.ts, 346, 13)) ->V : Symbol(V, Decl(immutable.d.ts, 340, 29)) ->VC : Symbol(VC, Decl(immutable.d.ts, 346, 16)) +>KC : Symbol(KC, Decl(immutable.ts, 346, 13)) +>VC : Symbol(VC, Decl(immutable.ts, 346, 16)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 336, 51), Decl(immutable.ts, 337, 26), Decl(immutable.ts, 338, 86), Decl(immutable.ts, 339, 83)) +>K : Symbol(K, Decl(immutable.ts, 340, 27)) +>KC : Symbol(KC, Decl(immutable.ts, 346, 13)) +>V : Symbol(V, Decl(immutable.ts, 340, 29)) +>VC : Symbol(VC, Decl(immutable.ts, 346, 16)) concat(...collections: Array<{[key: string]: C}>): Collection.Keyed; ->concat : Symbol(Keyed.concat, Decl(immutable.d.ts, 345, 19), Decl(immutable.d.ts, 346, 98)) ->C : Symbol(C, Decl(immutable.d.ts, 347, 13)) ->collections : Symbol(collections, Decl(immutable.d.ts, 347, 16)) +>concat : Symbol(Keyed.concat, Decl(immutable.ts, 345, 19), Decl(immutable.ts, 346, 98)) +>C : Symbol(C, Decl(immutable.ts, 347, 13)) +>collections : Symbol(collections, Decl(immutable.ts, 347, 16)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->key : Symbol(key, Decl(immutable.d.ts, 347, 40)) ->C : Symbol(C, Decl(immutable.d.ts, 347, 13)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 336, 51), Decl(immutable.d.ts, 337, 26), Decl(immutable.d.ts, 338, 86), Decl(immutable.d.ts, 339, 83)) ->K : Symbol(K, Decl(immutable.d.ts, 340, 27)) ->V : Symbol(V, Decl(immutable.d.ts, 340, 29)) ->C : Symbol(C, Decl(immutable.d.ts, 347, 13)) +>key : Symbol(key, Decl(immutable.ts, 347, 40)) +>C : Symbol(C, Decl(immutable.ts, 347, 13)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 336, 51), Decl(immutable.ts, 337, 26), Decl(immutable.ts, 338, 86), Decl(immutable.ts, 339, 83)) +>K : Symbol(K, Decl(immutable.ts, 340, 27)) +>V : Symbol(V, Decl(immutable.ts, 340, 29)) +>C : Symbol(C, Decl(immutable.ts, 347, 13)) map(mapper: (value: V, key: K, iter: this) => M, context?: any): Collection.Keyed; ->map : Symbol(Keyed.map, Decl(immutable.d.ts, 347, 96)) ->M : Symbol(M, Decl(immutable.d.ts, 348, 10)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 348, 13)) ->value : Symbol(value, Decl(immutable.d.ts, 348, 22)) ->V : Symbol(V, Decl(immutable.d.ts, 340, 29)) ->key : Symbol(key, Decl(immutable.d.ts, 348, 31)) ->K : Symbol(K, Decl(immutable.d.ts, 340, 27)) ->iter : Symbol(iter, Decl(immutable.d.ts, 348, 39)) ->M : Symbol(M, Decl(immutable.d.ts, 348, 10)) ->context : Symbol(context, Decl(immutable.d.ts, 348, 57)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 336, 51), Decl(immutable.d.ts, 337, 26), Decl(immutable.d.ts, 338, 86), Decl(immutable.d.ts, 339, 83)) ->K : Symbol(K, Decl(immutable.d.ts, 340, 27)) ->M : Symbol(M, Decl(immutable.d.ts, 348, 10)) +>map : Symbol(Keyed.map, Decl(immutable.ts, 347, 96)) +>M : Symbol(M, Decl(immutable.ts, 348, 10)) +>mapper : Symbol(mapper, Decl(immutable.ts, 348, 13)) +>value : Symbol(value, Decl(immutable.ts, 348, 22)) +>V : Symbol(V, Decl(immutable.ts, 340, 29)) +>key : Symbol(key, Decl(immutable.ts, 348, 31)) +>K : Symbol(K, Decl(immutable.ts, 340, 27)) +>iter : Symbol(iter, Decl(immutable.ts, 348, 39)) +>M : Symbol(M, Decl(immutable.ts, 348, 10)) +>context : Symbol(context, Decl(immutable.ts, 348, 57)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 336, 51), Decl(immutable.ts, 337, 26), Decl(immutable.ts, 338, 86), Decl(immutable.ts, 339, 83)) +>K : Symbol(K, Decl(immutable.ts, 340, 27)) +>M : Symbol(M, Decl(immutable.ts, 348, 10)) mapKeys(mapper: (key: K, value: V, iter: this) => M, context?: any): Collection.Keyed; ->mapKeys : Symbol(Keyed.mapKeys, Decl(immutable.d.ts, 348, 97)) ->M : Symbol(M, Decl(immutable.d.ts, 349, 14)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 349, 17)) ->key : Symbol(key, Decl(immutable.d.ts, 349, 26)) ->K : Symbol(K, Decl(immutable.d.ts, 340, 27)) ->value : Symbol(value, Decl(immutable.d.ts, 349, 33)) ->V : Symbol(V, Decl(immutable.d.ts, 340, 29)) ->iter : Symbol(iter, Decl(immutable.d.ts, 349, 43)) ->M : Symbol(M, Decl(immutable.d.ts, 349, 14)) ->context : Symbol(context, Decl(immutable.d.ts, 349, 61)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 336, 51), Decl(immutable.d.ts, 337, 26), Decl(immutable.d.ts, 338, 86), Decl(immutable.d.ts, 339, 83)) ->M : Symbol(M, Decl(immutable.d.ts, 349, 14)) ->V : Symbol(V, Decl(immutable.d.ts, 340, 29)) +>mapKeys : Symbol(Keyed.mapKeys, Decl(immutable.ts, 348, 97)) +>M : Symbol(M, Decl(immutable.ts, 349, 14)) +>mapper : Symbol(mapper, Decl(immutable.ts, 349, 17)) +>key : Symbol(key, Decl(immutable.ts, 349, 26)) +>K : Symbol(K, Decl(immutable.ts, 340, 27)) +>value : Symbol(value, Decl(immutable.ts, 349, 33)) +>V : Symbol(V, Decl(immutable.ts, 340, 29)) +>iter : Symbol(iter, Decl(immutable.ts, 349, 43)) +>M : Symbol(M, Decl(immutable.ts, 349, 14)) +>context : Symbol(context, Decl(immutable.ts, 349, 61)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 336, 51), Decl(immutable.ts, 337, 26), Decl(immutable.ts, 338, 86), Decl(immutable.ts, 339, 83)) +>M : Symbol(M, Decl(immutable.ts, 349, 14)) +>V : Symbol(V, Decl(immutable.ts, 340, 29)) mapEntries(mapper: (entry: [K, V], index: number, iter: this) => [KM, VM], context?: any): Collection.Keyed; ->mapEntries : Symbol(Keyed.mapEntries, Decl(immutable.d.ts, 349, 101)) ->KM : Symbol(KM, Decl(immutable.d.ts, 350, 17)) ->VM : Symbol(VM, Decl(immutable.d.ts, 350, 20)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 350, 25)) ->entry : Symbol(entry, Decl(immutable.d.ts, 350, 34)) ->K : Symbol(K, Decl(immutable.d.ts, 340, 27)) ->V : Symbol(V, Decl(immutable.d.ts, 340, 29)) ->index : Symbol(index, Decl(immutable.d.ts, 350, 48)) ->iter : Symbol(iter, Decl(immutable.d.ts, 350, 63)) ->KM : Symbol(KM, Decl(immutable.d.ts, 350, 17)) ->VM : Symbol(VM, Decl(immutable.d.ts, 350, 20)) ->context : Symbol(context, Decl(immutable.d.ts, 350, 88)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 336, 51), Decl(immutable.d.ts, 337, 26), Decl(immutable.d.ts, 338, 86), Decl(immutable.d.ts, 339, 83)) ->KM : Symbol(KM, Decl(immutable.d.ts, 350, 17)) ->VM : Symbol(VM, Decl(immutable.d.ts, 350, 20)) +>mapEntries : Symbol(Keyed.mapEntries, Decl(immutable.ts, 349, 101)) +>KM : Symbol(KM, Decl(immutable.ts, 350, 17)) +>VM : Symbol(VM, Decl(immutable.ts, 350, 20)) +>mapper : Symbol(mapper, Decl(immutable.ts, 350, 25)) +>entry : Symbol(entry, Decl(immutable.ts, 350, 34)) +>K : Symbol(K, Decl(immutable.ts, 340, 27)) +>V : Symbol(V, Decl(immutable.ts, 340, 29)) +>index : Symbol(index, Decl(immutable.ts, 350, 48)) +>iter : Symbol(iter, Decl(immutable.ts, 350, 63)) +>KM : Symbol(KM, Decl(immutable.ts, 350, 17)) +>VM : Symbol(VM, Decl(immutable.ts, 350, 20)) +>context : Symbol(context, Decl(immutable.ts, 350, 88)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 336, 51), Decl(immutable.ts, 337, 26), Decl(immutable.ts, 338, 86), Decl(immutable.ts, 339, 83)) +>KM : Symbol(KM, Decl(immutable.ts, 350, 17)) +>VM : Symbol(VM, Decl(immutable.ts, 350, 20)) flatMap(mapper: (value: V, key: K, iter: this) => Iterable, context?: any): Collection.Keyed; ->flatMap : Symbol(Keyed.flatMap, Decl(immutable.d.ts, 350, 130)) ->M : Symbol(M, Decl(immutable.d.ts, 351, 14)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 351, 17)) ->value : Symbol(value, Decl(immutable.d.ts, 351, 26)) ->V : Symbol(V, Decl(immutable.d.ts, 340, 29)) ->key : Symbol(key, Decl(immutable.d.ts, 351, 35)) ->K : Symbol(K, Decl(immutable.d.ts, 340, 27)) ->iter : Symbol(iter, Decl(immutable.d.ts, 351, 43)) +>flatMap : Symbol(Keyed.flatMap, Decl(immutable.ts, 350, 130)) +>M : Symbol(M, Decl(immutable.ts, 351, 14)) +>mapper : Symbol(mapper, Decl(immutable.ts, 351, 17)) +>value : Symbol(value, Decl(immutable.ts, 351, 26)) +>V : Symbol(V, Decl(immutable.ts, 340, 29)) +>key : Symbol(key, Decl(immutable.ts, 351, 35)) +>K : Symbol(K, Decl(immutable.ts, 340, 27)) +>iter : Symbol(iter, Decl(immutable.ts, 351, 43)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->M : Symbol(M, Decl(immutable.d.ts, 351, 14)) ->context : Symbol(context, Decl(immutable.d.ts, 351, 71)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 336, 51), Decl(immutable.d.ts, 337, 26), Decl(immutable.d.ts, 338, 86), Decl(immutable.d.ts, 339, 83)) +>M : Symbol(M, Decl(immutable.ts, 351, 14)) +>context : Symbol(context, Decl(immutable.ts, 351, 71)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 336, 51), Decl(immutable.ts, 337, 26), Decl(immutable.ts, 338, 86), Decl(immutable.ts, 339, 83)) filter(predicate: (value: V, key: K, iter: this) => value is F, context?: any): Collection.Keyed; ->filter : Symbol(Keyed.filter, Decl(immutable.d.ts, 351, 115), Decl(immutable.d.ts, 352, 122)) ->F : Symbol(F, Decl(immutable.d.ts, 352, 13)) ->V : Symbol(V, Decl(immutable.d.ts, 340, 29)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 352, 26)) ->value : Symbol(value, Decl(immutable.d.ts, 352, 38)) ->V : Symbol(V, Decl(immutable.d.ts, 340, 29)) ->key : Symbol(key, Decl(immutable.d.ts, 352, 47)) ->K : Symbol(K, Decl(immutable.d.ts, 340, 27)) ->iter : Symbol(iter, Decl(immutable.d.ts, 352, 55)) ->value : Symbol(value, Decl(immutable.d.ts, 352, 38)) ->F : Symbol(F, Decl(immutable.d.ts, 352, 13)) ->context : Symbol(context, Decl(immutable.d.ts, 352, 82)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Keyed : Symbol(Keyed, Decl(immutable.d.ts, 336, 51), Decl(immutable.d.ts, 337, 26), Decl(immutable.d.ts, 338, 86), Decl(immutable.d.ts, 339, 83)) ->K : Symbol(K, Decl(immutable.d.ts, 340, 27)) ->F : Symbol(F, Decl(immutable.d.ts, 352, 13)) +>filter : Symbol(Keyed.filter, Decl(immutable.ts, 351, 115), Decl(immutable.ts, 352, 122)) +>F : Symbol(F, Decl(immutable.ts, 352, 13)) +>V : Symbol(V, Decl(immutable.ts, 340, 29)) +>predicate : Symbol(predicate, Decl(immutable.ts, 352, 26)) +>value : Symbol(value, Decl(immutable.ts, 352, 38)) +>V : Symbol(V, Decl(immutable.ts, 340, 29)) +>key : Symbol(key, Decl(immutable.ts, 352, 47)) +>K : Symbol(K, Decl(immutable.ts, 340, 27)) +>iter : Symbol(iter, Decl(immutable.ts, 352, 55)) +>value : Symbol(value, Decl(immutable.ts, 352, 38)) +>F : Symbol(F, Decl(immutable.ts, 352, 13)) +>context : Symbol(context, Decl(immutable.ts, 352, 82)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Keyed : Symbol(Keyed, Decl(immutable.ts, 336, 51), Decl(immutable.ts, 337, 26), Decl(immutable.ts, 338, 86), Decl(immutable.ts, 339, 83)) +>K : Symbol(K, Decl(immutable.ts, 340, 27)) +>F : Symbol(F, Decl(immutable.ts, 352, 13)) filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this; ->filter : Symbol(Keyed.filter, Decl(immutable.d.ts, 351, 115), Decl(immutable.d.ts, 352, 122)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 353, 13)) ->value : Symbol(value, Decl(immutable.d.ts, 353, 25)) ->V : Symbol(V, Decl(immutable.d.ts, 340, 29)) ->key : Symbol(key, Decl(immutable.d.ts, 353, 34)) ->K : Symbol(K, Decl(immutable.d.ts, 340, 27)) ->iter : Symbol(iter, Decl(immutable.d.ts, 353, 42)) ->context : Symbol(context, Decl(immutable.d.ts, 353, 62)) +>filter : Symbol(Keyed.filter, Decl(immutable.ts, 351, 115), Decl(immutable.ts, 352, 122)) +>predicate : Symbol(predicate, Decl(immutable.ts, 353, 13)) +>value : Symbol(value, Decl(immutable.ts, 353, 25)) +>V : Symbol(V, Decl(immutable.ts, 340, 29)) +>key : Symbol(key, Decl(immutable.ts, 353, 34)) +>K : Symbol(K, Decl(immutable.ts, 340, 27)) +>iter : Symbol(iter, Decl(immutable.ts, 353, 42)) +>context : Symbol(context, Decl(immutable.ts, 353, 62)) [Symbol.iterator](): IterableIterator<[K, V]>; >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) ->K : Symbol(K, Decl(immutable.d.ts, 340, 27)) ->V : Symbol(V, Decl(immutable.d.ts, 340, 29)) +>K : Symbol(K, Decl(immutable.ts, 340, 27)) +>V : Symbol(V, Decl(immutable.ts, 340, 29)) } export module Indexed {} ->Indexed : Symbol(Indexed, Decl(immutable.d.ts, 355, 5), Decl(immutable.d.ts, 356, 28), Decl(immutable.d.ts, 357, 79)) +>Indexed : Symbol(Indexed, Decl(immutable.ts, 355, 5), Decl(immutable.ts, 356, 28), Decl(immutable.ts, 357, 79)) export function Indexed(collection: Iterable): Collection.Indexed; ->Indexed : Symbol(Indexed, Decl(immutable.d.ts, 355, 5), Decl(immutable.d.ts, 356, 28), Decl(immutable.d.ts, 357, 79)) ->T : Symbol(T, Decl(immutable.d.ts, 357, 28)) ->collection : Symbol(collection, Decl(immutable.d.ts, 357, 31)) +>Indexed : Symbol(Indexed, Decl(immutable.ts, 355, 5), Decl(immutable.ts, 356, 28), Decl(immutable.ts, 357, 79)) +>T : Symbol(T, Decl(immutable.ts, 357, 28)) +>collection : Symbol(collection, Decl(immutable.ts, 357, 31)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 357, 28)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Indexed : Symbol(Indexed, Decl(immutable.d.ts, 355, 5), Decl(immutable.d.ts, 356, 28), Decl(immutable.d.ts, 357, 79)) ->T : Symbol(T, Decl(immutable.d.ts, 357, 28)) +>T : Symbol(T, Decl(immutable.ts, 357, 28)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Indexed : Symbol(Indexed, Decl(immutable.ts, 355, 5), Decl(immutable.ts, 356, 28), Decl(immutable.ts, 357, 79)) +>T : Symbol(T, Decl(immutable.ts, 357, 28)) export interface Indexed extends Collection { ->Indexed : Symbol(Indexed, Decl(immutable.d.ts, 355, 5), Decl(immutable.d.ts, 356, 28), Decl(immutable.d.ts, 357, 79)) ->T : Symbol(T, Decl(immutable.d.ts, 358, 29)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->T : Symbol(T, Decl(immutable.d.ts, 358, 29)) +>Indexed : Symbol(Indexed, Decl(immutable.ts, 355, 5), Decl(immutable.ts, 356, 28), Decl(immutable.ts, 357, 79)) +>T : Symbol(T, Decl(immutable.ts, 358, 29)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>T : Symbol(T, Decl(immutable.ts, 358, 29)) toJS(): Array; ->toJS : Symbol(Indexed.toJS, Decl(immutable.d.ts, 358, 63)) +>toJS : Symbol(Indexed.toJS, Decl(immutable.ts, 358, 63)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) toJSON(): Array; ->toJSON : Symbol(Indexed.toJSON, Decl(immutable.d.ts, 359, 25)) +>toJSON : Symbol(Indexed.toJSON, Decl(immutable.ts, 359, 25)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 358, 29)) +>T : Symbol(T, Decl(immutable.ts, 358, 29)) // Reading values get(index: number, notSetValue: NSV): T | NSV; ->get : Symbol(Indexed.get, Decl(immutable.d.ts, 360, 25), Decl(immutable.d.ts, 362, 57)) ->NSV : Symbol(NSV, Decl(immutable.d.ts, 362, 10)) ->index : Symbol(index, Decl(immutable.d.ts, 362, 15)) ->notSetValue : Symbol(notSetValue, Decl(immutable.d.ts, 362, 29)) ->NSV : Symbol(NSV, Decl(immutable.d.ts, 362, 10)) ->T : Symbol(T, Decl(immutable.d.ts, 358, 29)) ->NSV : Symbol(NSV, Decl(immutable.d.ts, 362, 10)) +>get : Symbol(Indexed.get, Decl(immutable.ts, 360, 25), Decl(immutable.ts, 362, 57)) +>NSV : Symbol(NSV, Decl(immutable.ts, 362, 10)) +>index : Symbol(index, Decl(immutable.ts, 362, 15)) +>notSetValue : Symbol(notSetValue, Decl(immutable.ts, 362, 29)) +>NSV : Symbol(NSV, Decl(immutable.ts, 362, 10)) +>T : Symbol(T, Decl(immutable.ts, 358, 29)) +>NSV : Symbol(NSV, Decl(immutable.ts, 362, 10)) get(index: number): T | undefined; ->get : Symbol(Indexed.get, Decl(immutable.d.ts, 360, 25), Decl(immutable.d.ts, 362, 57)) ->index : Symbol(index, Decl(immutable.d.ts, 363, 10)) ->T : Symbol(T, Decl(immutable.d.ts, 358, 29)) +>get : Symbol(Indexed.get, Decl(immutable.ts, 360, 25), Decl(immutable.ts, 362, 57)) +>index : Symbol(index, Decl(immutable.ts, 363, 10)) +>T : Symbol(T, Decl(immutable.ts, 358, 29)) // Conversion to Seq toSeq(): Seq.Indexed; ->toSeq : Symbol(Indexed.toSeq, Decl(immutable.d.ts, 363, 40)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Indexed : Symbol(Seq.Indexed, Decl(immutable.d.ts, 281, 5), Decl(immutable.d.ts, 284, 5), Decl(immutable.d.ts, 285, 48), Decl(immutable.d.ts, 286, 49), Decl(immutable.d.ts, 287, 72)) ->T : Symbol(T, Decl(immutable.d.ts, 358, 29)) +>toSeq : Symbol(Indexed.toSeq, Decl(immutable.ts, 363, 40)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Indexed : Symbol(Seq.Indexed, Decl(immutable.ts, 281, 5), Decl(immutable.ts, 284, 5), Decl(immutable.ts, 285, 48), Decl(immutable.ts, 286, 49), Decl(immutable.ts, 287, 72)) +>T : Symbol(T, Decl(immutable.ts, 358, 29)) fromEntrySeq(): Seq.Keyed; ->fromEntrySeq : Symbol(Indexed.fromEntrySeq, Decl(immutable.d.ts, 365, 30)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Keyed : Symbol(Seq.Keyed, Decl(immutable.d.ts, 263, 56), Decl(immutable.d.ts, 264, 26), Decl(immutable.d.ts, 265, 79), Decl(immutable.d.ts, 266, 76), Decl(immutable.d.ts, 267, 51) ... and 1 more) +>fromEntrySeq : Symbol(Indexed.fromEntrySeq, Decl(immutable.ts, 365, 30)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Keyed : Symbol(Seq.Keyed, Decl(immutable.ts, 263, 56), Decl(immutable.ts, 264, 26), Decl(immutable.ts, 265, 79), Decl(immutable.ts, 266, 76), Decl(immutable.ts, 267, 51) ... and 1 more) // Combination interpose(separator: T): this; ->interpose : Symbol(Indexed.interpose, Decl(immutable.d.ts, 366, 42)) ->separator : Symbol(separator, Decl(immutable.d.ts, 368, 16)) ->T : Symbol(T, Decl(immutable.d.ts, 358, 29)) +>interpose : Symbol(Indexed.interpose, Decl(immutable.ts, 366, 42)) +>separator : Symbol(separator, Decl(immutable.ts, 368, 16)) +>T : Symbol(T, Decl(immutable.ts, 358, 29)) interleave(...collections: Array>): this; ->interleave : Symbol(Indexed.interleave, Decl(immutable.d.ts, 368, 36)) ->collections : Symbol(collections, Decl(immutable.d.ts, 369, 17)) +>interleave : Symbol(Indexed.interleave, Decl(immutable.ts, 368, 36)) +>collections : Symbol(collections, Decl(immutable.ts, 369, 17)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->T : Symbol(T, Decl(immutable.d.ts, 358, 29)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>T : Symbol(T, Decl(immutable.ts, 358, 29)) splice(index: number, removeNum: number, ...values: Array): this; ->splice : Symbol(Indexed.splice, Decl(immutable.d.ts, 369, 66)) ->index : Symbol(index, Decl(immutable.d.ts, 370, 13)) ->removeNum : Symbol(removeNum, Decl(immutable.d.ts, 370, 27)) ->values : Symbol(values, Decl(immutable.d.ts, 370, 46)) +>splice : Symbol(Indexed.splice, Decl(immutable.ts, 369, 66)) +>index : Symbol(index, Decl(immutable.ts, 370, 13)) +>removeNum : Symbol(removeNum, Decl(immutable.ts, 370, 27)) +>values : Symbol(values, Decl(immutable.ts, 370, 46)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 358, 29)) +>T : Symbol(T, Decl(immutable.ts, 358, 29)) zip(...collections: Array>): Collection.Indexed; ->zip : Symbol(Indexed.zip, Decl(immutable.d.ts, 370, 74)) ->collections : Symbol(collections, Decl(immutable.d.ts, 371, 10)) +>zip : Symbol(Indexed.zip, Decl(immutable.ts, 370, 74)) +>collections : Symbol(collections, Decl(immutable.ts, 371, 10)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Indexed : Symbol(Indexed, Decl(immutable.d.ts, 355, 5), Decl(immutable.d.ts, 356, 28), Decl(immutable.d.ts, 357, 79)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Indexed : Symbol(Indexed, Decl(immutable.ts, 355, 5), Decl(immutable.ts, 356, 28), Decl(immutable.ts, 357, 79)) zipWith(zipper: (value: T, otherValue: U) => Z, otherCollection: Collection): Collection.Indexed; ->zipWith : Symbol(Indexed.zipWith, Decl(immutable.d.ts, 371, 80), Decl(immutable.d.ts, 372, 120), Decl(immutable.d.ts, 373, 175)) ->U : Symbol(U, Decl(immutable.d.ts, 372, 14)) ->Z : Symbol(Z, Decl(immutable.d.ts, 372, 16)) ->zipper : Symbol(zipper, Decl(immutable.d.ts, 372, 20)) ->value : Symbol(value, Decl(immutable.d.ts, 372, 29)) ->T : Symbol(T, Decl(immutable.d.ts, 358, 29)) ->otherValue : Symbol(otherValue, Decl(immutable.d.ts, 372, 38)) ->U : Symbol(U, Decl(immutable.d.ts, 372, 14)) ->Z : Symbol(Z, Decl(immutable.d.ts, 372, 16)) ->otherCollection : Symbol(otherCollection, Decl(immutable.d.ts, 372, 59)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->U : Symbol(U, Decl(immutable.d.ts, 372, 14)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Indexed : Symbol(Indexed, Decl(immutable.d.ts, 355, 5), Decl(immutable.d.ts, 356, 28), Decl(immutable.d.ts, 357, 79)) ->Z : Symbol(Z, Decl(immutable.d.ts, 372, 16)) +>zipWith : Symbol(Indexed.zipWith, Decl(immutable.ts, 371, 80), Decl(immutable.ts, 372, 120), Decl(immutable.ts, 373, 175)) +>U : Symbol(U, Decl(immutable.ts, 372, 14)) +>Z : Symbol(Z, Decl(immutable.ts, 372, 16)) +>zipper : Symbol(zipper, Decl(immutable.ts, 372, 20)) +>value : Symbol(value, Decl(immutable.ts, 372, 29)) +>T : Symbol(T, Decl(immutable.ts, 358, 29)) +>otherValue : Symbol(otherValue, Decl(immutable.ts, 372, 38)) +>U : Symbol(U, Decl(immutable.ts, 372, 14)) +>Z : Symbol(Z, Decl(immutable.ts, 372, 16)) +>otherCollection : Symbol(otherCollection, Decl(immutable.ts, 372, 59)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>U : Symbol(U, Decl(immutable.ts, 372, 14)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Indexed : Symbol(Indexed, Decl(immutable.ts, 355, 5), Decl(immutable.ts, 356, 28), Decl(immutable.ts, 357, 79)) +>Z : Symbol(Z, Decl(immutable.ts, 372, 16)) zipWith(zipper: (value: T, otherValue: U, thirdValue: V) => Z, otherCollection: Collection, thirdCollection: Collection): Collection.Indexed; ->zipWith : Symbol(Indexed.zipWith, Decl(immutable.d.ts, 371, 80), Decl(immutable.d.ts, 372, 120), Decl(immutable.d.ts, 373, 175)) ->U : Symbol(U, Decl(immutable.d.ts, 373, 14)) ->V : Symbol(V, Decl(immutable.d.ts, 373, 16)) ->Z : Symbol(Z, Decl(immutable.d.ts, 373, 19)) ->zipper : Symbol(zipper, Decl(immutable.d.ts, 373, 23)) ->value : Symbol(value, Decl(immutable.d.ts, 373, 32)) ->T : Symbol(T, Decl(immutable.d.ts, 358, 29)) ->otherValue : Symbol(otherValue, Decl(immutable.d.ts, 373, 41)) ->U : Symbol(U, Decl(immutable.d.ts, 373, 14)) ->thirdValue : Symbol(thirdValue, Decl(immutable.d.ts, 373, 56)) ->V : Symbol(V, Decl(immutable.d.ts, 373, 16)) ->Z : Symbol(Z, Decl(immutable.d.ts, 373, 19)) ->otherCollection : Symbol(otherCollection, Decl(immutable.d.ts, 373, 77)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->U : Symbol(U, Decl(immutable.d.ts, 373, 14)) ->thirdCollection : Symbol(thirdCollection, Decl(immutable.d.ts, 373, 114)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->V : Symbol(V, Decl(immutable.d.ts, 373, 16)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Indexed : Symbol(Indexed, Decl(immutable.d.ts, 355, 5), Decl(immutable.d.ts, 356, 28), Decl(immutable.d.ts, 357, 79)) ->Z : Symbol(Z, Decl(immutable.d.ts, 373, 19)) +>zipWith : Symbol(Indexed.zipWith, Decl(immutable.ts, 371, 80), Decl(immutable.ts, 372, 120), Decl(immutable.ts, 373, 175)) +>U : Symbol(U, Decl(immutable.ts, 373, 14)) +>V : Symbol(V, Decl(immutable.ts, 373, 16)) +>Z : Symbol(Z, Decl(immutable.ts, 373, 19)) +>zipper : Symbol(zipper, Decl(immutable.ts, 373, 23)) +>value : Symbol(value, Decl(immutable.ts, 373, 32)) +>T : Symbol(T, Decl(immutable.ts, 358, 29)) +>otherValue : Symbol(otherValue, Decl(immutable.ts, 373, 41)) +>U : Symbol(U, Decl(immutable.ts, 373, 14)) +>thirdValue : Symbol(thirdValue, Decl(immutable.ts, 373, 56)) +>V : Symbol(V, Decl(immutable.ts, 373, 16)) +>Z : Symbol(Z, Decl(immutable.ts, 373, 19)) +>otherCollection : Symbol(otherCollection, Decl(immutable.ts, 373, 77)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>U : Symbol(U, Decl(immutable.ts, 373, 14)) +>thirdCollection : Symbol(thirdCollection, Decl(immutable.ts, 373, 114)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>V : Symbol(V, Decl(immutable.ts, 373, 16)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Indexed : Symbol(Indexed, Decl(immutable.ts, 355, 5), Decl(immutable.ts, 356, 28), Decl(immutable.ts, 357, 79)) +>Z : Symbol(Z, Decl(immutable.ts, 373, 19)) zipWith(zipper: (...any: Array) => Z, ...collections: Array>): Collection.Indexed; ->zipWith : Symbol(Indexed.zipWith, Decl(immutable.d.ts, 371, 80), Decl(immutable.d.ts, 372, 120), Decl(immutable.d.ts, 373, 175)) ->Z : Symbol(Z, Decl(immutable.d.ts, 374, 14)) ->zipper : Symbol(zipper, Decl(immutable.d.ts, 374, 17)) ->any : Symbol(any, Decl(immutable.d.ts, 374, 26)) +>zipWith : Symbol(Indexed.zipWith, Decl(immutable.ts, 371, 80), Decl(immutable.ts, 372, 120), Decl(immutable.ts, 373, 175)) +>Z : Symbol(Z, Decl(immutable.ts, 374, 14)) +>zipper : Symbol(zipper, Decl(immutable.ts, 374, 17)) +>any : Symbol(any, Decl(immutable.ts, 374, 26)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->Z : Symbol(Z, Decl(immutable.d.ts, 374, 14)) ->collections : Symbol(collections, Decl(immutable.d.ts, 374, 51)) +>Z : Symbol(Z, Decl(immutable.ts, 374, 14)) +>collections : Symbol(collections, Decl(immutable.ts, 374, 51)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Indexed : Symbol(Indexed, Decl(immutable.d.ts, 355, 5), Decl(immutable.d.ts, 356, 28), Decl(immutable.d.ts, 357, 79)) ->Z : Symbol(Z, Decl(immutable.d.ts, 374, 14)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Indexed : Symbol(Indexed, Decl(immutable.ts, 355, 5), Decl(immutable.ts, 356, 28), Decl(immutable.ts, 357, 79)) +>Z : Symbol(Z, Decl(immutable.ts, 374, 14)) // Search for value indexOf(searchValue: T): number; ->indexOf : Symbol(Indexed.indexOf, Decl(immutable.d.ts, 374, 120)) ->searchValue : Symbol(searchValue, Decl(immutable.d.ts, 376, 14)) ->T : Symbol(T, Decl(immutable.d.ts, 358, 29)) +>indexOf : Symbol(Indexed.indexOf, Decl(immutable.ts, 374, 120)) +>searchValue : Symbol(searchValue, Decl(immutable.ts, 376, 14)) +>T : Symbol(T, Decl(immutable.ts, 358, 29)) lastIndexOf(searchValue: T): number; ->lastIndexOf : Symbol(Indexed.lastIndexOf, Decl(immutable.d.ts, 376, 38)) ->searchValue : Symbol(searchValue, Decl(immutable.d.ts, 377, 18)) ->T : Symbol(T, Decl(immutable.d.ts, 358, 29)) +>lastIndexOf : Symbol(Indexed.lastIndexOf, Decl(immutable.ts, 376, 38)) +>searchValue : Symbol(searchValue, Decl(immutable.ts, 377, 18)) +>T : Symbol(T, Decl(immutable.ts, 358, 29)) findIndex(predicate: (value: T, index: number, iter: this) => boolean, context?: any): number; ->findIndex : Symbol(Indexed.findIndex, Decl(immutable.d.ts, 377, 42)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 378, 16)) ->value : Symbol(value, Decl(immutable.d.ts, 378, 28)) ->T : Symbol(T, Decl(immutable.d.ts, 358, 29)) ->index : Symbol(index, Decl(immutable.d.ts, 378, 37)) ->iter : Symbol(iter, Decl(immutable.d.ts, 378, 52)) ->context : Symbol(context, Decl(immutable.d.ts, 378, 76)) +>findIndex : Symbol(Indexed.findIndex, Decl(immutable.ts, 377, 42)) +>predicate : Symbol(predicate, Decl(immutable.ts, 378, 16)) +>value : Symbol(value, Decl(immutable.ts, 378, 28)) +>T : Symbol(T, Decl(immutable.ts, 358, 29)) +>index : Symbol(index, Decl(immutable.ts, 378, 37)) +>iter : Symbol(iter, Decl(immutable.ts, 378, 52)) +>context : Symbol(context, Decl(immutable.ts, 378, 76)) findLastIndex(predicate: (value: T, index: number, iter: this) => boolean, context?: any): number; ->findLastIndex : Symbol(Indexed.findLastIndex, Decl(immutable.d.ts, 378, 100)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 379, 20)) ->value : Symbol(value, Decl(immutable.d.ts, 379, 32)) ->T : Symbol(T, Decl(immutable.d.ts, 358, 29)) ->index : Symbol(index, Decl(immutable.d.ts, 379, 41)) ->iter : Symbol(iter, Decl(immutable.d.ts, 379, 56)) ->context : Symbol(context, Decl(immutable.d.ts, 379, 80)) +>findLastIndex : Symbol(Indexed.findLastIndex, Decl(immutable.ts, 378, 100)) +>predicate : Symbol(predicate, Decl(immutable.ts, 379, 20)) +>value : Symbol(value, Decl(immutable.ts, 379, 32)) +>T : Symbol(T, Decl(immutable.ts, 358, 29)) +>index : Symbol(index, Decl(immutable.ts, 379, 41)) +>iter : Symbol(iter, Decl(immutable.ts, 379, 56)) +>context : Symbol(context, Decl(immutable.ts, 379, 80)) // Sequence algorithms concat(...valuesOrCollections: Array | C>): Collection.Indexed; ->concat : Symbol(Indexed.concat, Decl(immutable.d.ts, 379, 104)) ->C : Symbol(C, Decl(immutable.d.ts, 381, 13)) ->valuesOrCollections : Symbol(valuesOrCollections, Decl(immutable.d.ts, 381, 16)) +>concat : Symbol(Indexed.concat, Decl(immutable.ts, 379, 104)) +>C : Symbol(C, Decl(immutable.ts, 381, 13)) +>valuesOrCollections : Symbol(valuesOrCollections, Decl(immutable.ts, 381, 16)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->C : Symbol(C, Decl(immutable.d.ts, 381, 13)) ->C : Symbol(C, Decl(immutable.d.ts, 381, 13)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Indexed : Symbol(Indexed, Decl(immutable.d.ts, 355, 5), Decl(immutable.d.ts, 356, 28), Decl(immutable.d.ts, 357, 79)) ->T : Symbol(T, Decl(immutable.d.ts, 358, 29)) ->C : Symbol(C, Decl(immutable.d.ts, 381, 13)) +>C : Symbol(C, Decl(immutable.ts, 381, 13)) +>C : Symbol(C, Decl(immutable.ts, 381, 13)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Indexed : Symbol(Indexed, Decl(immutable.ts, 355, 5), Decl(immutable.ts, 356, 28), Decl(immutable.ts, 357, 79)) +>T : Symbol(T, Decl(immutable.ts, 358, 29)) +>C : Symbol(C, Decl(immutable.ts, 381, 13)) map(mapper: (value: T, key: number, iter: this) => M, context?: any): Collection.Indexed; ->map : Symbol(Indexed.map, Decl(immutable.d.ts, 381, 91)) ->M : Symbol(M, Decl(immutable.d.ts, 382, 10)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 382, 13)) ->value : Symbol(value, Decl(immutable.d.ts, 382, 22)) ->T : Symbol(T, Decl(immutable.d.ts, 358, 29)) ->key : Symbol(key, Decl(immutable.d.ts, 382, 31)) ->iter : Symbol(iter, Decl(immutable.d.ts, 382, 44)) ->M : Symbol(M, Decl(immutable.d.ts, 382, 10)) ->context : Symbol(context, Decl(immutable.d.ts, 382, 62)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Indexed : Symbol(Indexed, Decl(immutable.d.ts, 355, 5), Decl(immutable.d.ts, 356, 28), Decl(immutable.d.ts, 357, 79)) ->M : Symbol(M, Decl(immutable.d.ts, 382, 10)) +>map : Symbol(Indexed.map, Decl(immutable.ts, 381, 91)) +>M : Symbol(M, Decl(immutable.ts, 382, 10)) +>mapper : Symbol(mapper, Decl(immutable.ts, 382, 13)) +>value : Symbol(value, Decl(immutable.ts, 382, 22)) +>T : Symbol(T, Decl(immutable.ts, 358, 29)) +>key : Symbol(key, Decl(immutable.ts, 382, 31)) +>iter : Symbol(iter, Decl(immutable.ts, 382, 44)) +>M : Symbol(M, Decl(immutable.ts, 382, 10)) +>context : Symbol(context, Decl(immutable.ts, 382, 62)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Indexed : Symbol(Indexed, Decl(immutable.ts, 355, 5), Decl(immutable.ts, 356, 28), Decl(immutable.ts, 357, 79)) +>M : Symbol(M, Decl(immutable.ts, 382, 10)) flatMap(mapper: (value: T, key: number, iter: this) => Iterable, context?: any): Collection.Indexed; ->flatMap : Symbol(Indexed.flatMap, Decl(immutable.d.ts, 382, 101)) ->M : Symbol(M, Decl(immutable.d.ts, 383, 14)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 383, 17)) ->value : Symbol(value, Decl(immutable.d.ts, 383, 26)) ->T : Symbol(T, Decl(immutable.d.ts, 358, 29)) ->key : Symbol(key, Decl(immutable.d.ts, 383, 35)) ->iter : Symbol(iter, Decl(immutable.d.ts, 383, 48)) +>flatMap : Symbol(Indexed.flatMap, Decl(immutable.ts, 382, 101)) +>M : Symbol(M, Decl(immutable.ts, 383, 14)) +>mapper : Symbol(mapper, Decl(immutable.ts, 383, 17)) +>value : Symbol(value, Decl(immutable.ts, 383, 26)) +>T : Symbol(T, Decl(immutable.ts, 358, 29)) +>key : Symbol(key, Decl(immutable.ts, 383, 35)) +>iter : Symbol(iter, Decl(immutable.ts, 383, 48)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->M : Symbol(M, Decl(immutable.d.ts, 383, 14)) ->context : Symbol(context, Decl(immutable.d.ts, 383, 76)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Indexed : Symbol(Indexed, Decl(immutable.d.ts, 355, 5), Decl(immutable.d.ts, 356, 28), Decl(immutable.d.ts, 357, 79)) ->M : Symbol(M, Decl(immutable.d.ts, 383, 14)) +>M : Symbol(M, Decl(immutable.ts, 383, 14)) +>context : Symbol(context, Decl(immutable.ts, 383, 76)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Indexed : Symbol(Indexed, Decl(immutable.ts, 355, 5), Decl(immutable.ts, 356, 28), Decl(immutable.ts, 357, 79)) +>M : Symbol(M, Decl(immutable.ts, 383, 14)) filter(predicate: (value: T, index: number, iter: this) => value is F, context?: any): Collection.Indexed; ->filter : Symbol(Indexed.filter, Decl(immutable.d.ts, 383, 115), Decl(immutable.d.ts, 384, 128)) ->F : Symbol(F, Decl(immutable.d.ts, 384, 13)) ->T : Symbol(T, Decl(immutable.d.ts, 358, 29)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 384, 26)) ->value : Symbol(value, Decl(immutable.d.ts, 384, 38)) ->T : Symbol(T, Decl(immutable.d.ts, 358, 29)) ->index : Symbol(index, Decl(immutable.d.ts, 384, 47)) ->iter : Symbol(iter, Decl(immutable.d.ts, 384, 62)) ->value : Symbol(value, Decl(immutable.d.ts, 384, 38)) ->F : Symbol(F, Decl(immutable.d.ts, 384, 13)) ->context : Symbol(context, Decl(immutable.d.ts, 384, 89)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Indexed : Symbol(Indexed, Decl(immutable.d.ts, 355, 5), Decl(immutable.d.ts, 356, 28), Decl(immutable.d.ts, 357, 79)) ->F : Symbol(F, Decl(immutable.d.ts, 384, 13)) +>filter : Symbol(Indexed.filter, Decl(immutable.ts, 383, 115), Decl(immutable.ts, 384, 128)) +>F : Symbol(F, Decl(immutable.ts, 384, 13)) +>T : Symbol(T, Decl(immutable.ts, 358, 29)) +>predicate : Symbol(predicate, Decl(immutable.ts, 384, 26)) +>value : Symbol(value, Decl(immutable.ts, 384, 38)) +>T : Symbol(T, Decl(immutable.ts, 358, 29)) +>index : Symbol(index, Decl(immutable.ts, 384, 47)) +>iter : Symbol(iter, Decl(immutable.ts, 384, 62)) +>value : Symbol(value, Decl(immutable.ts, 384, 38)) +>F : Symbol(F, Decl(immutable.ts, 384, 13)) +>context : Symbol(context, Decl(immutable.ts, 384, 89)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Indexed : Symbol(Indexed, Decl(immutable.ts, 355, 5), Decl(immutable.ts, 356, 28), Decl(immutable.ts, 357, 79)) +>F : Symbol(F, Decl(immutable.ts, 384, 13)) filter(predicate: (value: T, index: number, iter: this) => any, context?: any): this; ->filter : Symbol(Indexed.filter, Decl(immutable.d.ts, 383, 115), Decl(immutable.d.ts, 384, 128)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 385, 13)) ->value : Symbol(value, Decl(immutable.d.ts, 385, 25)) ->T : Symbol(T, Decl(immutable.d.ts, 358, 29)) ->index : Symbol(index, Decl(immutable.d.ts, 385, 34)) ->iter : Symbol(iter, Decl(immutable.d.ts, 385, 49)) ->context : Symbol(context, Decl(immutable.d.ts, 385, 69)) +>filter : Symbol(Indexed.filter, Decl(immutable.ts, 383, 115), Decl(immutable.ts, 384, 128)) +>predicate : Symbol(predicate, Decl(immutable.ts, 385, 13)) +>value : Symbol(value, Decl(immutable.ts, 385, 25)) +>T : Symbol(T, Decl(immutable.ts, 358, 29)) +>index : Symbol(index, Decl(immutable.ts, 385, 34)) +>iter : Symbol(iter, Decl(immutable.ts, 385, 49)) +>context : Symbol(context, Decl(immutable.ts, 385, 69)) [Symbol.iterator](): IterableIterator; >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 358, 29)) +>T : Symbol(T, Decl(immutable.ts, 358, 29)) } export module Set {} ->Set : Symbol(Set, Decl(immutable.d.ts, 387, 5), Decl(immutable.d.ts, 388, 24), Decl(immutable.d.ts, 389, 71)) +>Set : Symbol(Set, Decl(immutable.ts, 387, 5), Decl(immutable.ts, 388, 24), Decl(immutable.ts, 389, 71)) export function Set(collection: Iterable): Collection.Set; ->Set : Symbol(Set, Decl(immutable.d.ts, 387, 5), Decl(immutable.d.ts, 388, 24), Decl(immutable.d.ts, 389, 71)) ->T : Symbol(T, Decl(immutable.d.ts, 389, 24)) ->collection : Symbol(collection, Decl(immutable.d.ts, 389, 27)) +>Set : Symbol(Set, Decl(immutable.ts, 387, 5), Decl(immutable.ts, 388, 24), Decl(immutable.ts, 389, 71)) +>T : Symbol(T, Decl(immutable.ts, 389, 24)) +>collection : Symbol(collection, Decl(immutable.ts, 389, 27)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 389, 24)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Set : Symbol(Set, Decl(immutable.d.ts, 387, 5), Decl(immutable.d.ts, 388, 24), Decl(immutable.d.ts, 389, 71)) ->T : Symbol(T, Decl(immutable.d.ts, 389, 24)) +>T : Symbol(T, Decl(immutable.ts, 389, 24)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Set : Symbol(Set, Decl(immutable.ts, 387, 5), Decl(immutable.ts, 388, 24), Decl(immutable.ts, 389, 71)) +>T : Symbol(T, Decl(immutable.ts, 389, 24)) export interface Set extends Collection { ->Set : Symbol(Set, Decl(immutable.d.ts, 387, 5), Decl(immutable.d.ts, 388, 24), Decl(immutable.d.ts, 389, 71)) ->T : Symbol(T, Decl(immutable.d.ts, 390, 25)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->T : Symbol(T, Decl(immutable.d.ts, 390, 25)) +>Set : Symbol(Set, Decl(immutable.ts, 387, 5), Decl(immutable.ts, 388, 24), Decl(immutable.ts, 389, 71)) +>T : Symbol(T, Decl(immutable.ts, 390, 25)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>T : Symbol(T, Decl(immutable.ts, 390, 25)) toJS(): Array; ->toJS : Symbol(Set.toJS, Decl(immutable.d.ts, 390, 58)) +>toJS : Symbol(Set.toJS, Decl(immutable.ts, 390, 58)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) toJSON(): Array; ->toJSON : Symbol(Set.toJSON, Decl(immutable.d.ts, 391, 25)) +>toJSON : Symbol(Set.toJSON, Decl(immutable.ts, 391, 25)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 390, 25)) +>T : Symbol(T, Decl(immutable.ts, 390, 25)) toSeq(): Seq.Set; ->toSeq : Symbol(Set.toSeq, Decl(immutable.d.ts, 392, 25)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Set : Symbol(Seq.Set, Decl(immutable.d.ts, 297, 5), Decl(immutable.d.ts, 300, 5), Decl(immutable.d.ts, 301, 40), Decl(immutable.d.ts, 302, 41), Decl(immutable.d.ts, 303, 64)) ->T : Symbol(T, Decl(immutable.d.ts, 390, 25)) +>toSeq : Symbol(Set.toSeq, Decl(immutable.ts, 392, 25)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Set : Symbol(Seq.Set, Decl(immutable.ts, 297, 5), Decl(immutable.ts, 300, 5), Decl(immutable.ts, 301, 40), Decl(immutable.ts, 302, 41), Decl(immutable.ts, 303, 64)) +>T : Symbol(T, Decl(immutable.ts, 390, 25)) // Sequence algorithms concat(...valuesOrCollections: Array | C>): Collection.Set; ->concat : Symbol(Set.concat, Decl(immutable.d.ts, 393, 26)) ->C : Symbol(C, Decl(immutable.d.ts, 395, 13)) ->valuesOrCollections : Symbol(valuesOrCollections, Decl(immutable.d.ts, 395, 16)) +>concat : Symbol(Set.concat, Decl(immutable.ts, 393, 26)) +>C : Symbol(C, Decl(immutable.ts, 395, 13)) +>valuesOrCollections : Symbol(valuesOrCollections, Decl(immutable.ts, 395, 16)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->C : Symbol(C, Decl(immutable.d.ts, 395, 13)) ->C : Symbol(C, Decl(immutable.d.ts, 395, 13)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Set : Symbol(Set, Decl(immutable.d.ts, 387, 5), Decl(immutable.d.ts, 388, 24), Decl(immutable.d.ts, 389, 71)) ->T : Symbol(T, Decl(immutable.d.ts, 390, 25)) ->C : Symbol(C, Decl(immutable.d.ts, 395, 13)) +>C : Symbol(C, Decl(immutable.ts, 395, 13)) +>C : Symbol(C, Decl(immutable.ts, 395, 13)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Set : Symbol(Set, Decl(immutable.ts, 387, 5), Decl(immutable.ts, 388, 24), Decl(immutable.ts, 389, 71)) +>T : Symbol(T, Decl(immutable.ts, 390, 25)) +>C : Symbol(C, Decl(immutable.ts, 395, 13)) map(mapper: (value: T, key: never, iter: this) => M, context?: any): Collection.Set; ->map : Symbol(Set.map, Decl(immutable.d.ts, 395, 87)) ->M : Symbol(M, Decl(immutable.d.ts, 396, 10)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 396, 13)) ->value : Symbol(value, Decl(immutable.d.ts, 396, 22)) ->T : Symbol(T, Decl(immutable.d.ts, 390, 25)) ->key : Symbol(key, Decl(immutable.d.ts, 396, 31)) ->iter : Symbol(iter, Decl(immutable.d.ts, 396, 43)) ->M : Symbol(M, Decl(immutable.d.ts, 396, 10)) ->context : Symbol(context, Decl(immutable.d.ts, 396, 61)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Set : Symbol(Set, Decl(immutable.d.ts, 387, 5), Decl(immutable.d.ts, 388, 24), Decl(immutable.d.ts, 389, 71)) ->M : Symbol(M, Decl(immutable.d.ts, 396, 10)) +>map : Symbol(Set.map, Decl(immutable.ts, 395, 87)) +>M : Symbol(M, Decl(immutable.ts, 396, 10)) +>mapper : Symbol(mapper, Decl(immutable.ts, 396, 13)) +>value : Symbol(value, Decl(immutable.ts, 396, 22)) +>T : Symbol(T, Decl(immutable.ts, 390, 25)) +>key : Symbol(key, Decl(immutable.ts, 396, 31)) +>iter : Symbol(iter, Decl(immutable.ts, 396, 43)) +>M : Symbol(M, Decl(immutable.ts, 396, 10)) +>context : Symbol(context, Decl(immutable.ts, 396, 61)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Set : Symbol(Set, Decl(immutable.ts, 387, 5), Decl(immutable.ts, 388, 24), Decl(immutable.ts, 389, 71)) +>M : Symbol(M, Decl(immutable.ts, 396, 10)) flatMap(mapper: (value: T, key: never, iter: this) => Iterable, context?: any): Collection.Set; ->flatMap : Symbol(Set.flatMap, Decl(immutable.d.ts, 396, 96)) ->M : Symbol(M, Decl(immutable.d.ts, 397, 14)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 397, 17)) ->value : Symbol(value, Decl(immutable.d.ts, 397, 26)) ->T : Symbol(T, Decl(immutable.d.ts, 390, 25)) ->key : Symbol(key, Decl(immutable.d.ts, 397, 35)) ->iter : Symbol(iter, Decl(immutable.d.ts, 397, 47)) +>flatMap : Symbol(Set.flatMap, Decl(immutable.ts, 396, 96)) +>M : Symbol(M, Decl(immutable.ts, 397, 14)) +>mapper : Symbol(mapper, Decl(immutable.ts, 397, 17)) +>value : Symbol(value, Decl(immutable.ts, 397, 26)) +>T : Symbol(T, Decl(immutable.ts, 390, 25)) +>key : Symbol(key, Decl(immutable.ts, 397, 35)) +>iter : Symbol(iter, Decl(immutable.ts, 397, 47)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->M : Symbol(M, Decl(immutable.d.ts, 397, 14)) ->context : Symbol(context, Decl(immutable.d.ts, 397, 75)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Set : Symbol(Set, Decl(immutable.d.ts, 387, 5), Decl(immutable.d.ts, 388, 24), Decl(immutable.d.ts, 389, 71)) ->M : Symbol(M, Decl(immutable.d.ts, 397, 14)) +>M : Symbol(M, Decl(immutable.ts, 397, 14)) +>context : Symbol(context, Decl(immutable.ts, 397, 75)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Set : Symbol(Set, Decl(immutable.ts, 387, 5), Decl(immutable.ts, 388, 24), Decl(immutable.ts, 389, 71)) +>M : Symbol(M, Decl(immutable.ts, 397, 14)) filter(predicate: (value: T, key: never, iter: this) => value is F, context?: any): Collection.Set; ->filter : Symbol(Set.filter, Decl(immutable.d.ts, 397, 111), Decl(immutable.d.ts, 398, 121)) ->F : Symbol(F, Decl(immutable.d.ts, 398, 13)) ->T : Symbol(T, Decl(immutable.d.ts, 390, 25)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 398, 26)) ->value : Symbol(value, Decl(immutable.d.ts, 398, 38)) ->T : Symbol(T, Decl(immutable.d.ts, 390, 25)) ->key : Symbol(key, Decl(immutable.d.ts, 398, 47)) ->iter : Symbol(iter, Decl(immutable.d.ts, 398, 59)) ->value : Symbol(value, Decl(immutable.d.ts, 398, 38)) ->F : Symbol(F, Decl(immutable.d.ts, 398, 13)) ->context : Symbol(context, Decl(immutable.d.ts, 398, 86)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Set : Symbol(Set, Decl(immutable.d.ts, 387, 5), Decl(immutable.d.ts, 388, 24), Decl(immutable.d.ts, 389, 71)) ->F : Symbol(F, Decl(immutable.d.ts, 398, 13)) +>filter : Symbol(Set.filter, Decl(immutable.ts, 397, 111), Decl(immutable.ts, 398, 121)) +>F : Symbol(F, Decl(immutable.ts, 398, 13)) +>T : Symbol(T, Decl(immutable.ts, 390, 25)) +>predicate : Symbol(predicate, Decl(immutable.ts, 398, 26)) +>value : Symbol(value, Decl(immutable.ts, 398, 38)) +>T : Symbol(T, Decl(immutable.ts, 390, 25)) +>key : Symbol(key, Decl(immutable.ts, 398, 47)) +>iter : Symbol(iter, Decl(immutable.ts, 398, 59)) +>value : Symbol(value, Decl(immutable.ts, 398, 38)) +>F : Symbol(F, Decl(immutable.ts, 398, 13)) +>context : Symbol(context, Decl(immutable.ts, 398, 86)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Set : Symbol(Set, Decl(immutable.ts, 387, 5), Decl(immutable.ts, 388, 24), Decl(immutable.ts, 389, 71)) +>F : Symbol(F, Decl(immutable.ts, 398, 13)) filter(predicate: (value: T, key: never, iter: this) => any, context?: any): this; ->filter : Symbol(Set.filter, Decl(immutable.d.ts, 397, 111), Decl(immutable.d.ts, 398, 121)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 399, 13)) ->value : Symbol(value, Decl(immutable.d.ts, 399, 25)) ->T : Symbol(T, Decl(immutable.d.ts, 390, 25)) ->key : Symbol(key, Decl(immutable.d.ts, 399, 34)) ->iter : Symbol(iter, Decl(immutable.d.ts, 399, 46)) ->context : Symbol(context, Decl(immutable.d.ts, 399, 66)) +>filter : Symbol(Set.filter, Decl(immutable.ts, 397, 111), Decl(immutable.ts, 398, 121)) +>predicate : Symbol(predicate, Decl(immutable.ts, 399, 13)) +>value : Symbol(value, Decl(immutable.ts, 399, 25)) +>T : Symbol(T, Decl(immutable.ts, 390, 25)) +>key : Symbol(key, Decl(immutable.ts, 399, 34)) +>iter : Symbol(iter, Decl(immutable.ts, 399, 46)) +>context : Symbol(context, Decl(immutable.ts, 399, 66)) [Symbol.iterator](): IterableIterator; >Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --)) >iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) >IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 390, 25)) +>T : Symbol(T, Decl(immutable.ts, 390, 25)) } } export function Collection>(collection: I): I; ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->I : Symbol(I, Decl(immutable.d.ts, 403, 29)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->collection : Symbol(collection, Decl(immutable.d.ts, 403, 61)) ->I : Symbol(I, Decl(immutable.d.ts, 403, 29)) ->I : Symbol(I, Decl(immutable.d.ts, 403, 29)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>I : Symbol(I, Decl(immutable.ts, 403, 29)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>collection : Symbol(collection, Decl(immutable.ts, 403, 61)) +>I : Symbol(I, Decl(immutable.ts, 403, 29)) +>I : Symbol(I, Decl(immutable.ts, 403, 29)) export function Collection(collection: Iterable): Collection.Indexed; ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->T : Symbol(T, Decl(immutable.d.ts, 404, 29)) ->collection : Symbol(collection, Decl(immutable.d.ts, 404, 32)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>T : Symbol(T, Decl(immutable.ts, 404, 29)) +>collection : Symbol(collection, Decl(immutable.ts, 404, 32)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->T : Symbol(T, Decl(immutable.d.ts, 404, 29)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Indexed : Symbol(Collection.Indexed, Decl(immutable.d.ts, 355, 5), Decl(immutable.d.ts, 356, 28), Decl(immutable.d.ts, 357, 79)) ->T : Symbol(T, Decl(immutable.d.ts, 404, 29)) +>T : Symbol(T, Decl(immutable.ts, 404, 29)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Indexed : Symbol(Collection.Indexed, Decl(immutable.ts, 355, 5), Decl(immutable.ts, 356, 28), Decl(immutable.ts, 357, 79)) +>T : Symbol(T, Decl(immutable.ts, 404, 29)) export function Collection(obj: {[key: string]: V}): Collection.Keyed; ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->V : Symbol(V, Decl(immutable.d.ts, 405, 29)) ->obj : Symbol(obj, Decl(immutable.d.ts, 405, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 405, 39)) ->V : Symbol(V, Decl(immutable.d.ts, 405, 29)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->Keyed : Symbol(Collection.Keyed, Decl(immutable.d.ts, 336, 51), Decl(immutable.d.ts, 337, 26), Decl(immutable.d.ts, 338, 86), Decl(immutable.d.ts, 339, 83)) ->V : Symbol(V, Decl(immutable.d.ts, 405, 29)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>V : Symbol(V, Decl(immutable.ts, 405, 29)) +>obj : Symbol(obj, Decl(immutable.ts, 405, 32)) +>key : Symbol(key, Decl(immutable.ts, 405, 39)) +>V : Symbol(V, Decl(immutable.ts, 405, 29)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>Keyed : Symbol(Collection.Keyed, Decl(immutable.ts, 336, 51), Decl(immutable.ts, 337, 26), Decl(immutable.ts, 338, 86), Decl(immutable.ts, 339, 83)) +>V : Symbol(V, Decl(immutable.ts, 405, 29)) export interface Collection extends ValueObject { ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->ValueObject : Symbol(ValueObject, Decl(immutable.d.ts, 13, 76)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>ValueObject : Symbol(ValueObject, Decl(immutable.ts, 13, 76)) // Value equality equals(other: any): boolean; ->equals : Symbol(Collection.equals, Decl(immutable.d.ts, 406, 57)) ->other : Symbol(other, Decl(immutable.d.ts, 408, 11)) +>equals : Symbol(Collection.equals, Decl(immutable.ts, 406, 57)) +>other : Symbol(other, Decl(immutable.ts, 408, 11)) hashCode(): number; ->hashCode : Symbol(Collection.hashCode, Decl(immutable.d.ts, 408, 32)) +>hashCode : Symbol(Collection.hashCode, Decl(immutable.ts, 408, 32)) // Reading values get(key: K, notSetValue: NSV): V | NSV; ->get : Symbol(Collection.get, Decl(immutable.d.ts, 409, 23), Decl(immutable.d.ts, 411, 48)) ->NSV : Symbol(NSV, Decl(immutable.d.ts, 411, 8)) ->key : Symbol(key, Decl(immutable.d.ts, 411, 13)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->notSetValue : Symbol(notSetValue, Decl(immutable.d.ts, 411, 20)) ->NSV : Symbol(NSV, Decl(immutable.d.ts, 411, 8)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->NSV : Symbol(NSV, Decl(immutable.d.ts, 411, 8)) +>get : Symbol(Collection.get, Decl(immutable.ts, 409, 23), Decl(immutable.ts, 411, 48)) +>NSV : Symbol(NSV, Decl(immutable.ts, 411, 8)) +>key : Symbol(key, Decl(immutable.ts, 411, 13)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>notSetValue : Symbol(notSetValue, Decl(immutable.ts, 411, 20)) +>NSV : Symbol(NSV, Decl(immutable.ts, 411, 8)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>NSV : Symbol(NSV, Decl(immutable.ts, 411, 8)) get(key: K): V | undefined; ->get : Symbol(Collection.get, Decl(immutable.d.ts, 409, 23), Decl(immutable.d.ts, 411, 48)) ->key : Symbol(key, Decl(immutable.d.ts, 412, 8)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>get : Symbol(Collection.get, Decl(immutable.ts, 409, 23), Decl(immutable.ts, 411, 48)) +>key : Symbol(key, Decl(immutable.ts, 412, 8)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) has(key: K): boolean; ->has : Symbol(Collection.has, Decl(immutable.d.ts, 412, 31)) ->key : Symbol(key, Decl(immutable.d.ts, 413, 8)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) +>has : Symbol(Collection.has, Decl(immutable.ts, 412, 31)) +>key : Symbol(key, Decl(immutable.ts, 413, 8)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) includes(value: V): boolean; ->includes : Symbol(Collection.includes, Decl(immutable.d.ts, 413, 25)) ->value : Symbol(value, Decl(immutable.d.ts, 414, 13)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>includes : Symbol(Collection.includes, Decl(immutable.ts, 413, 25)) +>value : Symbol(value, Decl(immutable.ts, 414, 13)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) contains(value: V): boolean; ->contains : Symbol(Collection.contains, Decl(immutable.d.ts, 414, 32)) ->value : Symbol(value, Decl(immutable.d.ts, 415, 13)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>contains : Symbol(Collection.contains, Decl(immutable.ts, 414, 32)) +>value : Symbol(value, Decl(immutable.ts, 415, 13)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) first(): V | undefined; ->first : Symbol(Collection.first, Decl(immutable.d.ts, 415, 32)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>first : Symbol(Collection.first, Decl(immutable.ts, 415, 32)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) last(): V | undefined; ->last : Symbol(Collection.last, Decl(immutable.d.ts, 416, 27)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>last : Symbol(Collection.last, Decl(immutable.ts, 416, 27)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) // Reading deep values getIn(searchKeyPath: Iterable, notSetValue?: any): any; ->getIn : Symbol(Collection.getIn, Decl(immutable.d.ts, 417, 26)) ->searchKeyPath : Symbol(searchKeyPath, Decl(immutable.d.ts, 419, 10)) +>getIn : Symbol(Collection.getIn, Decl(immutable.ts, 417, 26)) +>searchKeyPath : Symbol(searchKeyPath, Decl(immutable.ts, 419, 10)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->notSetValue : Symbol(notSetValue, Decl(immutable.d.ts, 419, 39)) +>notSetValue : Symbol(notSetValue, Decl(immutable.ts, 419, 39)) hasIn(searchKeyPath: Iterable): boolean; ->hasIn : Symbol(Collection.hasIn, Decl(immutable.d.ts, 419, 64)) ->searchKeyPath : Symbol(searchKeyPath, Decl(immutable.d.ts, 420, 10)) +>hasIn : Symbol(Collection.hasIn, Decl(immutable.ts, 419, 64)) +>searchKeyPath : Symbol(searchKeyPath, Decl(immutable.ts, 420, 10)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) // Persistent changes update(updater: (value: this) => R): R; ->update : Symbol(Collection.update, Decl(immutable.d.ts, 420, 49)) ->R : Symbol(R, Decl(immutable.d.ts, 422, 11)) ->updater : Symbol(updater, Decl(immutable.d.ts, 422, 14)) ->value : Symbol(value, Decl(immutable.d.ts, 422, 24)) ->R : Symbol(R, Decl(immutable.d.ts, 422, 11)) ->R : Symbol(R, Decl(immutable.d.ts, 422, 11)) +>update : Symbol(Collection.update, Decl(immutable.ts, 420, 49)) +>R : Symbol(R, Decl(immutable.ts, 422, 11)) +>updater : Symbol(updater, Decl(immutable.ts, 422, 14)) +>value : Symbol(value, Decl(immutable.ts, 422, 24)) +>R : Symbol(R, Decl(immutable.ts, 422, 11)) +>R : Symbol(R, Decl(immutable.ts, 422, 11)) // Conversion to JavaScript types toJS(): Array | { [key: string]: any }; ->toJS : Symbol(Collection.toJS, Decl(immutable.d.ts, 422, 46)) +>toJS : Symbol(Collection.toJS, Decl(immutable.ts, 422, 46)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->key : Symbol(key, Decl(immutable.d.ts, 424, 28)) +>key : Symbol(key, Decl(immutable.ts, 424, 28)) toJSON(): Array | { [key: string]: V }; ->toJSON : Symbol(Collection.toJSON, Decl(immutable.d.ts, 424, 48)) +>toJSON : Symbol(Collection.toJSON, Decl(immutable.ts, 424, 48)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 425, 28)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>key : Symbol(key, Decl(immutable.ts, 425, 28)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) toArray(): Array; ->toArray : Symbol(Collection.toArray, Decl(immutable.d.ts, 425, 46)) +>toArray : Symbol(Collection.toArray, Decl(immutable.ts, 425, 46)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) toObject(): { [key: string]: V }; ->toObject : Symbol(Collection.toObject, Decl(immutable.d.ts, 426, 24)) ->key : Symbol(key, Decl(immutable.d.ts, 427, 19)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>toObject : Symbol(Collection.toObject, Decl(immutable.ts, 426, 24)) +>key : Symbol(key, Decl(immutable.ts, 427, 19)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) // Conversion to Collections toMap(): Map; ->toMap : Symbol(Collection.toMap, Decl(immutable.d.ts, 427, 37)) ->Map : Symbol(Map, Decl(immutable.d.ts, 62, 3), Decl(immutable.d.ts, 66, 3), Decl(immutable.d.ts, 67, 69), Decl(immutable.d.ts, 68, 71), Decl(immutable.d.ts, 69, 66) ... and 2 more) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>toMap : Symbol(Collection.toMap, Decl(immutable.ts, 427, 37)) +>Map : Symbol(Map, Decl(immutable.ts, 62, 3), Decl(immutable.ts, 66, 3), Decl(immutable.ts, 67, 69), Decl(immutable.ts, 68, 71), Decl(immutable.ts, 69, 66) ... and 2 more) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) toOrderedMap(): OrderedMap; ->toOrderedMap : Symbol(Collection.toOrderedMap, Decl(immutable.d.ts, 429, 23)) ->OrderedMap : Symbol(OrderedMap, Decl(immutable.d.ts, 108, 3), Decl(immutable.d.ts, 111, 3), Decl(immutable.d.ts, 112, 83), Decl(immutable.d.ts, 113, 85), Decl(immutable.d.ts, 114, 80) ... and 2 more) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>toOrderedMap : Symbol(Collection.toOrderedMap, Decl(immutable.ts, 429, 23)) +>OrderedMap : Symbol(OrderedMap, Decl(immutable.ts, 108, 3), Decl(immutable.ts, 111, 3), Decl(immutable.ts, 112, 83), Decl(immutable.ts, 113, 85), Decl(immutable.ts, 114, 80) ... and 2 more) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) toSet(): Set; ->toSet : Symbol(Collection.toSet, Decl(immutable.d.ts, 430, 37)) ->Set : Symbol(Set, Decl(immutable.d.ts, 127, 3), Decl(immutable.d.ts, 135, 3), Decl(immutable.d.ts, 136, 34), Decl(immutable.d.ts, 137, 35), Decl(immutable.d.ts, 138, 58)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>toSet : Symbol(Collection.toSet, Decl(immutable.ts, 430, 37)) +>Set : Symbol(Set, Decl(immutable.ts, 127, 3), Decl(immutable.ts, 135, 3), Decl(immutable.ts, 136, 34), Decl(immutable.ts, 137, 35), Decl(immutable.ts, 138, 58)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) toOrderedSet(): OrderedSet; ->toOrderedSet : Symbol(Collection.toOrderedSet, Decl(immutable.d.ts, 431, 20)) ->OrderedSet : Symbol(OrderedSet, Decl(immutable.d.ts, 159, 3), Decl(immutable.d.ts, 165, 3), Decl(immutable.d.ts, 166, 48), Decl(immutable.d.ts, 167, 49), Decl(immutable.d.ts, 168, 72)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>toOrderedSet : Symbol(Collection.toOrderedSet, Decl(immutable.ts, 431, 20)) +>OrderedSet : Symbol(OrderedSet, Decl(immutable.ts, 159, 3), Decl(immutable.ts, 165, 3), Decl(immutable.ts, 166, 48), Decl(immutable.ts, 167, 49), Decl(immutable.ts, 168, 72)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) toList(): List; ->toList : Symbol(Collection.toList, Decl(immutable.d.ts, 432, 34)) ->List : Symbol(List, Decl(immutable.d.ts, 17, 3), Decl(immutable.d.ts, 21, 3), Decl(immutable.d.ts, 22, 36), Decl(immutable.d.ts, 23, 37), Decl(immutable.d.ts, 24, 60)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>toList : Symbol(Collection.toList, Decl(immutable.ts, 432, 34)) +>List : Symbol(List, Decl(immutable.ts, 17, 3), Decl(immutable.ts, 21, 3), Decl(immutable.ts, 22, 36), Decl(immutable.ts, 23, 37), Decl(immutable.ts, 24, 60)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) toStack(): Stack; ->toStack : Symbol(Collection.toStack, Decl(immutable.d.ts, 433, 22)) ->Stack : Symbol(Stack, Decl(immutable.d.ts, 180, 3), Decl(immutable.d.ts, 184, 3), Decl(immutable.d.ts, 185, 38), Decl(immutable.d.ts, 186, 39), Decl(immutable.d.ts, 187, 62)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>toStack : Symbol(Collection.toStack, Decl(immutable.ts, 433, 22)) +>Stack : Symbol(Stack, Decl(immutable.ts, 180, 3), Decl(immutable.ts, 184, 3), Decl(immutable.ts, 185, 38), Decl(immutable.ts, 186, 39), Decl(immutable.ts, 187, 62)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) // Conversion to Seq toSeq(): this; ->toSeq : Symbol(Collection.toSeq, Decl(immutable.d.ts, 434, 24)) +>toSeq : Symbol(Collection.toSeq, Decl(immutable.ts, 434, 24)) toKeyedSeq(): Seq.Keyed; ->toKeyedSeq : Symbol(Collection.toKeyedSeq, Decl(immutable.d.ts, 436, 18)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Keyed : Symbol(Seq.Keyed, Decl(immutable.d.ts, 263, 56), Decl(immutable.d.ts, 264, 26), Decl(immutable.d.ts, 265, 79), Decl(immutable.d.ts, 266, 76), Decl(immutable.d.ts, 267, 51) ... and 1 more) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>toKeyedSeq : Symbol(Collection.toKeyedSeq, Decl(immutable.ts, 436, 18)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Keyed : Symbol(Seq.Keyed, Decl(immutable.ts, 263, 56), Decl(immutable.ts, 264, 26), Decl(immutable.ts, 265, 79), Decl(immutable.ts, 266, 76), Decl(immutable.ts, 267, 51) ... and 1 more) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) toIndexedSeq(): Seq.Indexed; ->toIndexedSeq : Symbol(Collection.toIndexedSeq, Decl(immutable.d.ts, 437, 34)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Indexed : Symbol(Seq.Indexed, Decl(immutable.d.ts, 281, 5), Decl(immutable.d.ts, 284, 5), Decl(immutable.d.ts, 285, 48), Decl(immutable.d.ts, 286, 49), Decl(immutable.d.ts, 287, 72)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>toIndexedSeq : Symbol(Collection.toIndexedSeq, Decl(immutable.ts, 437, 34)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Indexed : Symbol(Seq.Indexed, Decl(immutable.ts, 281, 5), Decl(immutable.ts, 284, 5), Decl(immutable.ts, 285, 48), Decl(immutable.ts, 286, 49), Decl(immutable.ts, 287, 72)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) toSetSeq(): Seq.Set; ->toSetSeq : Symbol(Collection.toSetSeq, Decl(immutable.d.ts, 438, 35)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Set : Symbol(Seq.Set, Decl(immutable.d.ts, 297, 5), Decl(immutable.d.ts, 300, 5), Decl(immutable.d.ts, 301, 40), Decl(immutable.d.ts, 302, 41), Decl(immutable.d.ts, 303, 64)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>toSetSeq : Symbol(Collection.toSetSeq, Decl(immutable.ts, 438, 35)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Set : Symbol(Seq.Set, Decl(immutable.ts, 297, 5), Decl(immutable.ts, 300, 5), Decl(immutable.ts, 301, 40), Decl(immutable.ts, 302, 41), Decl(immutable.ts, 303, 64)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) // Iterators keys(): IterableIterator; ->keys : Symbol(Collection.keys, Decl(immutable.d.ts, 439, 27)) +>keys : Symbol(Collection.keys, Decl(immutable.ts, 439, 27)) >IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) values(): IterableIterator; ->values : Symbol(Collection.values, Decl(immutable.d.ts, 441, 32)) +>values : Symbol(Collection.values, Decl(immutable.ts, 441, 32)) >IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) entries(): IterableIterator<[K, V]>; ->entries : Symbol(Collection.entries, Decl(immutable.d.ts, 442, 34)) +>entries : Symbol(Collection.entries, Decl(immutable.ts, 442, 34)) >IterableIterator : Symbol(IterableIterator, Decl(lib.es2015.iterable.d.ts, --, --)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) // Collections (Seq) keySeq(): Seq.Indexed; ->keySeq : Symbol(Collection.keySeq, Decl(immutable.d.ts, 443, 40)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Indexed : Symbol(Seq.Indexed, Decl(immutable.d.ts, 281, 5), Decl(immutable.d.ts, 284, 5), Decl(immutable.d.ts, 285, 48), Decl(immutable.d.ts, 286, 49), Decl(immutable.d.ts, 287, 72)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) +>keySeq : Symbol(Collection.keySeq, Decl(immutable.ts, 443, 40)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Indexed : Symbol(Seq.Indexed, Decl(immutable.ts, 281, 5), Decl(immutable.ts, 284, 5), Decl(immutable.ts, 285, 48), Decl(immutable.ts, 286, 49), Decl(immutable.ts, 287, 72)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) valueSeq(): Seq.Indexed; ->valueSeq : Symbol(Collection.valueSeq, Decl(immutable.d.ts, 445, 29)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Indexed : Symbol(Seq.Indexed, Decl(immutable.d.ts, 281, 5), Decl(immutable.d.ts, 284, 5), Decl(immutable.d.ts, 285, 48), Decl(immutable.d.ts, 286, 49), Decl(immutable.d.ts, 287, 72)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>valueSeq : Symbol(Collection.valueSeq, Decl(immutable.ts, 445, 29)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Indexed : Symbol(Seq.Indexed, Decl(immutable.ts, 281, 5), Decl(immutable.ts, 284, 5), Decl(immutable.ts, 285, 48), Decl(immutable.ts, 286, 49), Decl(immutable.ts, 287, 72)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) entrySeq(): Seq.Indexed<[K, V]>; ->entrySeq : Symbol(Collection.entrySeq, Decl(immutable.d.ts, 446, 31)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Indexed : Symbol(Seq.Indexed, Decl(immutable.d.ts, 281, 5), Decl(immutable.d.ts, 284, 5), Decl(immutable.d.ts, 285, 48), Decl(immutable.d.ts, 286, 49), Decl(immutable.d.ts, 287, 72)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>entrySeq : Symbol(Collection.entrySeq, Decl(immutable.ts, 446, 31)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Indexed : Symbol(Seq.Indexed, Decl(immutable.ts, 281, 5), Decl(immutable.ts, 284, 5), Decl(immutable.ts, 285, 48), Decl(immutable.ts, 286, 49), Decl(immutable.ts, 287, 72)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) // Sequence algorithms map(mapper: (value: V, key: K, iter: this) => M, context?: any): Collection; ->map : Symbol(Collection.map, Decl(immutable.d.ts, 447, 36)) ->M : Symbol(M, Decl(immutable.d.ts, 449, 8)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 449, 11)) ->value : Symbol(value, Decl(immutable.d.ts, 449, 20)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 449, 29)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 449, 37)) ->M : Symbol(M, Decl(immutable.d.ts, 449, 8)) ->context : Symbol(context, Decl(immutable.d.ts, 449, 55)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->M : Symbol(M, Decl(immutable.d.ts, 449, 8)) +>map : Symbol(Collection.map, Decl(immutable.ts, 447, 36)) +>M : Symbol(M, Decl(immutable.ts, 449, 8)) +>mapper : Symbol(mapper, Decl(immutable.ts, 449, 11)) +>value : Symbol(value, Decl(immutable.ts, 449, 20)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>key : Symbol(key, Decl(immutable.ts, 449, 29)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 449, 37)) +>M : Symbol(M, Decl(immutable.ts, 449, 8)) +>context : Symbol(context, Decl(immutable.ts, 449, 55)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>M : Symbol(M, Decl(immutable.ts, 449, 8)) filter(predicate: (value: V, key: K, iter: this) => value is F, context?: any): Collection; ->filter : Symbol(Collection.filter, Decl(immutable.d.ts, 449, 89), Decl(immutable.d.ts, 450, 114)) ->F : Symbol(F, Decl(immutable.d.ts, 450, 11)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 450, 24)) ->value : Symbol(value, Decl(immutable.d.ts, 450, 36)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 450, 45)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 450, 53)) ->value : Symbol(value, Decl(immutable.d.ts, 450, 36)) ->F : Symbol(F, Decl(immutable.d.ts, 450, 11)) ->context : Symbol(context, Decl(immutable.d.ts, 450, 80)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->F : Symbol(F, Decl(immutable.d.ts, 450, 11)) +>filter : Symbol(Collection.filter, Decl(immutable.ts, 449, 89), Decl(immutable.ts, 450, 114)) +>F : Symbol(F, Decl(immutable.ts, 450, 11)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>predicate : Symbol(predicate, Decl(immutable.ts, 450, 24)) +>value : Symbol(value, Decl(immutable.ts, 450, 36)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>key : Symbol(key, Decl(immutable.ts, 450, 45)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 450, 53)) +>value : Symbol(value, Decl(immutable.ts, 450, 36)) +>F : Symbol(F, Decl(immutable.ts, 450, 11)) +>context : Symbol(context, Decl(immutable.ts, 450, 80)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>F : Symbol(F, Decl(immutable.ts, 450, 11)) filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this; ->filter : Symbol(Collection.filter, Decl(immutable.d.ts, 449, 89), Decl(immutable.d.ts, 450, 114)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 451, 11)) ->value : Symbol(value, Decl(immutable.d.ts, 451, 23)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 451, 32)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 451, 40)) ->context : Symbol(context, Decl(immutable.d.ts, 451, 60)) +>filter : Symbol(Collection.filter, Decl(immutable.ts, 449, 89), Decl(immutable.ts, 450, 114)) +>predicate : Symbol(predicate, Decl(immutable.ts, 451, 11)) +>value : Symbol(value, Decl(immutable.ts, 451, 23)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>key : Symbol(key, Decl(immutable.ts, 451, 32)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 451, 40)) +>context : Symbol(context, Decl(immutable.ts, 451, 60)) filterNot(predicate: (value: V, key: K, iter: this) => boolean, context?: any): this; ->filterNot : Symbol(Collection.filterNot, Decl(immutable.d.ts, 451, 82)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 452, 14)) ->value : Symbol(value, Decl(immutable.d.ts, 452, 26)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 452, 35)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 452, 43)) ->context : Symbol(context, Decl(immutable.d.ts, 452, 67)) +>filterNot : Symbol(Collection.filterNot, Decl(immutable.ts, 451, 82)) +>predicate : Symbol(predicate, Decl(immutable.ts, 452, 14)) +>value : Symbol(value, Decl(immutable.ts, 452, 26)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>key : Symbol(key, Decl(immutable.ts, 452, 35)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 452, 43)) +>context : Symbol(context, Decl(immutable.ts, 452, 67)) reverse(): this; ->reverse : Symbol(Collection.reverse, Decl(immutable.d.ts, 452, 89)) +>reverse : Symbol(Collection.reverse, Decl(immutable.ts, 452, 89)) sort(comparator?: (valueA: V, valueB: V) => number): this; ->sort : Symbol(Collection.sort, Decl(immutable.d.ts, 453, 20)) ->comparator : Symbol(comparator, Decl(immutable.d.ts, 454, 9)) ->valueA : Symbol(valueA, Decl(immutable.d.ts, 454, 23)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->valueB : Symbol(valueB, Decl(immutable.d.ts, 454, 33)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>sort : Symbol(Collection.sort, Decl(immutable.ts, 453, 20)) +>comparator : Symbol(comparator, Decl(immutable.ts, 454, 9)) +>valueA : Symbol(valueA, Decl(immutable.ts, 454, 23)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>valueB : Symbol(valueB, Decl(immutable.ts, 454, 33)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) sortBy(comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: (valueA: C, valueB: C) => number): this; ->sortBy : Symbol(Collection.sortBy, Decl(immutable.d.ts, 454, 62)) ->C : Symbol(C, Decl(immutable.d.ts, 455, 11)) ->comparatorValueMapper : Symbol(comparatorValueMapper, Decl(immutable.d.ts, 455, 14)) ->value : Symbol(value, Decl(immutable.d.ts, 455, 38)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 455, 47)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 455, 55)) ->C : Symbol(C, Decl(immutable.d.ts, 455, 11)) ->comparator : Symbol(comparator, Decl(immutable.d.ts, 455, 73)) ->valueA : Symbol(valueA, Decl(immutable.d.ts, 455, 88)) ->C : Symbol(C, Decl(immutable.d.ts, 455, 11)) ->valueB : Symbol(valueB, Decl(immutable.d.ts, 455, 98)) ->C : Symbol(C, Decl(immutable.d.ts, 455, 11)) +>sortBy : Symbol(Collection.sortBy, Decl(immutable.ts, 454, 62)) +>C : Symbol(C, Decl(immutable.ts, 455, 11)) +>comparatorValueMapper : Symbol(comparatorValueMapper, Decl(immutable.ts, 455, 14)) +>value : Symbol(value, Decl(immutable.ts, 455, 38)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>key : Symbol(key, Decl(immutable.ts, 455, 47)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 455, 55)) +>C : Symbol(C, Decl(immutable.ts, 455, 11)) +>comparator : Symbol(comparator, Decl(immutable.ts, 455, 73)) +>valueA : Symbol(valueA, Decl(immutable.ts, 455, 88)) +>C : Symbol(C, Decl(immutable.ts, 455, 11)) +>valueB : Symbol(valueB, Decl(immutable.ts, 455, 98)) +>C : Symbol(C, Decl(immutable.ts, 455, 11)) groupBy(grouper: (value: V, key: K, iter: this) => G, context?: any): /*Map*/Seq.Keyed>; ->groupBy : Symbol(Collection.groupBy, Decl(immutable.d.ts, 455, 127)) ->G : Symbol(G, Decl(immutable.d.ts, 456, 12)) ->grouper : Symbol(grouper, Decl(immutable.d.ts, 456, 15)) ->value : Symbol(value, Decl(immutable.d.ts, 456, 25)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 456, 34)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 456, 42)) ->G : Symbol(G, Decl(immutable.d.ts, 456, 12)) ->context : Symbol(context, Decl(immutable.d.ts, 456, 60)) ->Seq : Symbol(Seq, Decl(immutable.d.ts, 260, 78), Decl(immutable.d.ts, 314, 3), Decl(immutable.d.ts, 315, 58), Decl(immutable.d.ts, 316, 81), Decl(immutable.d.ts, 317, 76) ... and 4 more) ->Keyed : Symbol(Seq.Keyed, Decl(immutable.d.ts, 263, 56), Decl(immutable.d.ts, 264, 26), Decl(immutable.d.ts, 265, 79), Decl(immutable.d.ts, 266, 76), Decl(immutable.d.ts, 267, 51) ... and 1 more) ->G : Symbol(G, Decl(immutable.d.ts, 456, 12)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>groupBy : Symbol(Collection.groupBy, Decl(immutable.ts, 455, 127)) +>G : Symbol(G, Decl(immutable.ts, 456, 12)) +>grouper : Symbol(grouper, Decl(immutable.ts, 456, 15)) +>value : Symbol(value, Decl(immutable.ts, 456, 25)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>key : Symbol(key, Decl(immutable.ts, 456, 34)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 456, 42)) +>G : Symbol(G, Decl(immutable.ts, 456, 12)) +>context : Symbol(context, Decl(immutable.ts, 456, 60)) +>Seq : Symbol(Seq, Decl(immutable.ts, 260, 78), Decl(immutable.ts, 314, 3), Decl(immutable.ts, 315, 58), Decl(immutable.ts, 316, 81), Decl(immutable.ts, 317, 76) ... and 4 more) +>Keyed : Symbol(Seq.Keyed, Decl(immutable.ts, 263, 56), Decl(immutable.ts, 264, 26), Decl(immutable.ts, 265, 79), Decl(immutable.ts, 266, 76), Decl(immutable.ts, 267, 51) ... and 1 more) +>G : Symbol(G, Decl(immutable.ts, 456, 12)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) // Side effects forEach(sideEffect: (value: V, key: K, iter: this) => any, context?: any): number; ->forEach : Symbol(Collection.forEach, Decl(immutable.d.ts, 456, 123)) ->sideEffect : Symbol(sideEffect, Decl(immutable.d.ts, 458, 12)) ->value : Symbol(value, Decl(immutable.d.ts, 458, 25)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 458, 34)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 458, 42)) ->context : Symbol(context, Decl(immutable.d.ts, 458, 62)) +>forEach : Symbol(Collection.forEach, Decl(immutable.ts, 456, 123)) +>sideEffect : Symbol(sideEffect, Decl(immutable.ts, 458, 12)) +>value : Symbol(value, Decl(immutable.ts, 458, 25)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>key : Symbol(key, Decl(immutable.ts, 458, 34)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 458, 42)) +>context : Symbol(context, Decl(immutable.ts, 458, 62)) // Creating subsets slice(begin?: number, end?: number): this; ->slice : Symbol(Collection.slice, Decl(immutable.d.ts, 458, 86)) ->begin : Symbol(begin, Decl(immutable.d.ts, 460, 10)) ->end : Symbol(end, Decl(immutable.d.ts, 460, 25)) +>slice : Symbol(Collection.slice, Decl(immutable.ts, 458, 86)) +>begin : Symbol(begin, Decl(immutable.ts, 460, 10)) +>end : Symbol(end, Decl(immutable.ts, 460, 25)) rest(): this; ->rest : Symbol(Collection.rest, Decl(immutable.d.ts, 460, 46)) +>rest : Symbol(Collection.rest, Decl(immutable.ts, 460, 46)) butLast(): this; ->butLast : Symbol(Collection.butLast, Decl(immutable.d.ts, 461, 17)) +>butLast : Symbol(Collection.butLast, Decl(immutable.ts, 461, 17)) skip(amount: number): this; ->skip : Symbol(Collection.skip, Decl(immutable.d.ts, 462, 20)) ->amount : Symbol(amount, Decl(immutable.d.ts, 463, 9)) +>skip : Symbol(Collection.skip, Decl(immutable.ts, 462, 20)) +>amount : Symbol(amount, Decl(immutable.ts, 463, 9)) skipLast(amount: number): this; ->skipLast : Symbol(Collection.skipLast, Decl(immutable.d.ts, 463, 31)) ->amount : Symbol(amount, Decl(immutable.d.ts, 464, 13)) +>skipLast : Symbol(Collection.skipLast, Decl(immutable.ts, 463, 31)) +>amount : Symbol(amount, Decl(immutable.ts, 464, 13)) skipWhile(predicate: (value: V, key: K, iter: this) => boolean, context?: any): this; ->skipWhile : Symbol(Collection.skipWhile, Decl(immutable.d.ts, 464, 35)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 465, 14)) ->value : Symbol(value, Decl(immutable.d.ts, 465, 26)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 465, 35)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 465, 43)) ->context : Symbol(context, Decl(immutable.d.ts, 465, 67)) +>skipWhile : Symbol(Collection.skipWhile, Decl(immutable.ts, 464, 35)) +>predicate : Symbol(predicate, Decl(immutable.ts, 465, 14)) +>value : Symbol(value, Decl(immutable.ts, 465, 26)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>key : Symbol(key, Decl(immutable.ts, 465, 35)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 465, 43)) +>context : Symbol(context, Decl(immutable.ts, 465, 67)) skipUntil(predicate: (value: V, key: K, iter: this) => boolean, context?: any): this; ->skipUntil : Symbol(Collection.skipUntil, Decl(immutable.d.ts, 465, 89)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 466, 14)) ->value : Symbol(value, Decl(immutable.d.ts, 466, 26)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 466, 35)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 466, 43)) ->context : Symbol(context, Decl(immutable.d.ts, 466, 67)) +>skipUntil : Symbol(Collection.skipUntil, Decl(immutable.ts, 465, 89)) +>predicate : Symbol(predicate, Decl(immutable.ts, 466, 14)) +>value : Symbol(value, Decl(immutable.ts, 466, 26)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>key : Symbol(key, Decl(immutable.ts, 466, 35)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 466, 43)) +>context : Symbol(context, Decl(immutable.ts, 466, 67)) take(amount: number): this; ->take : Symbol(Collection.take, Decl(immutable.d.ts, 466, 89)) ->amount : Symbol(amount, Decl(immutable.d.ts, 467, 9)) +>take : Symbol(Collection.take, Decl(immutable.ts, 466, 89)) +>amount : Symbol(amount, Decl(immutable.ts, 467, 9)) takeLast(amount: number): this; ->takeLast : Symbol(Collection.takeLast, Decl(immutable.d.ts, 467, 31)) ->amount : Symbol(amount, Decl(immutable.d.ts, 468, 13)) +>takeLast : Symbol(Collection.takeLast, Decl(immutable.ts, 467, 31)) +>amount : Symbol(amount, Decl(immutable.ts, 468, 13)) takeWhile(predicate: (value: V, key: K, iter: this) => boolean, context?: any): this; ->takeWhile : Symbol(Collection.takeWhile, Decl(immutable.d.ts, 468, 35)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 469, 14)) ->value : Symbol(value, Decl(immutable.d.ts, 469, 26)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 469, 35)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 469, 43)) ->context : Symbol(context, Decl(immutable.d.ts, 469, 67)) +>takeWhile : Symbol(Collection.takeWhile, Decl(immutable.ts, 468, 35)) +>predicate : Symbol(predicate, Decl(immutable.ts, 469, 14)) +>value : Symbol(value, Decl(immutable.ts, 469, 26)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>key : Symbol(key, Decl(immutable.ts, 469, 35)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 469, 43)) +>context : Symbol(context, Decl(immutable.ts, 469, 67)) takeUntil(predicate: (value: V, key: K, iter: this) => boolean, context?: any): this; ->takeUntil : Symbol(Collection.takeUntil, Decl(immutable.d.ts, 469, 89)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 470, 14)) ->value : Symbol(value, Decl(immutable.d.ts, 470, 26)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 470, 35)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 470, 43)) ->context : Symbol(context, Decl(immutable.d.ts, 470, 67)) +>takeUntil : Symbol(Collection.takeUntil, Decl(immutable.ts, 469, 89)) +>predicate : Symbol(predicate, Decl(immutable.ts, 470, 14)) +>value : Symbol(value, Decl(immutable.ts, 470, 26)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>key : Symbol(key, Decl(immutable.ts, 470, 35)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 470, 43)) +>context : Symbol(context, Decl(immutable.ts, 470, 67)) // Combination concat(...valuesOrCollections: Array): Collection; ->concat : Symbol(Collection.concat, Decl(immutable.d.ts, 470, 89)) ->valuesOrCollections : Symbol(valuesOrCollections, Decl(immutable.d.ts, 472, 11)) +>concat : Symbol(Collection.concat, Decl(immutable.ts, 470, 89)) +>valuesOrCollections : Symbol(valuesOrCollections, Decl(immutable.ts, 472, 11)) >Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) flatten(depth?: number): Collection; ->flatten : Symbol(Collection.flatten, Decl(immutable.d.ts, 472, 69), Decl(immutable.d.ts, 473, 50)) ->depth : Symbol(depth, Decl(immutable.d.ts, 473, 12)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) +>flatten : Symbol(Collection.flatten, Decl(immutable.ts, 472, 69), Decl(immutable.ts, 473, 50)) +>depth : Symbol(depth, Decl(immutable.ts, 473, 12)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) flatten(shallow?: boolean): Collection; ->flatten : Symbol(Collection.flatten, Decl(immutable.d.ts, 472, 69), Decl(immutable.d.ts, 473, 50)) ->shallow : Symbol(shallow, Decl(immutable.d.ts, 474, 12)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) +>flatten : Symbol(Collection.flatten, Decl(immutable.ts, 472, 69), Decl(immutable.ts, 473, 50)) +>shallow : Symbol(shallow, Decl(immutable.ts, 474, 12)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) flatMap(mapper: (value: V, key: K, iter: this) => Iterable, context?: any): Collection; ->flatMap : Symbol(Collection.flatMap, Decl(immutable.d.ts, 474, 53)) ->M : Symbol(M, Decl(immutable.d.ts, 475, 12)) ->mapper : Symbol(mapper, Decl(immutable.d.ts, 475, 15)) ->value : Symbol(value, Decl(immutable.d.ts, 475, 24)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 475, 33)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 475, 41)) +>flatMap : Symbol(Collection.flatMap, Decl(immutable.ts, 474, 53)) +>M : Symbol(M, Decl(immutable.ts, 475, 12)) +>mapper : Symbol(mapper, Decl(immutable.ts, 475, 15)) +>value : Symbol(value, Decl(immutable.ts, 475, 24)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>key : Symbol(key, Decl(immutable.ts, 475, 33)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 475, 41)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->M : Symbol(M, Decl(immutable.d.ts, 475, 12)) ->context : Symbol(context, Decl(immutable.d.ts, 475, 69)) ->Collection : Symbol(Collection, Decl(immutable.d.ts, 331, 3), Decl(immutable.d.ts, 402, 3), Decl(immutable.d.ts, 403, 79), Decl(immutable.d.ts, 404, 80), Decl(immutable.d.ts, 405, 86)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->M : Symbol(M, Decl(immutable.d.ts, 475, 12)) +>M : Symbol(M, Decl(immutable.ts, 475, 12)) +>context : Symbol(context, Decl(immutable.ts, 475, 69)) +>Collection : Symbol(Collection, Decl(immutable.ts, 331, 3), Decl(immutable.ts, 402, 3), Decl(immutable.ts, 403, 79), Decl(immutable.ts, 404, 80), Decl(immutable.ts, 405, 86)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>M : Symbol(M, Decl(immutable.ts, 475, 12)) // Reducing a value reduce(reducer: (reduction: R, value: V, key: K, iter: this) => R, initialReduction: R, context?: any): R; ->reduce : Symbol(Collection.reduce, Decl(immutable.d.ts, 475, 103), Decl(immutable.d.ts, 477, 113)) ->R : Symbol(R, Decl(immutable.d.ts, 477, 11)) ->reducer : Symbol(reducer, Decl(immutable.d.ts, 477, 14)) ->reduction : Symbol(reduction, Decl(immutable.d.ts, 477, 24)) ->R : Symbol(R, Decl(immutable.d.ts, 477, 11)) ->value : Symbol(value, Decl(immutable.d.ts, 477, 37)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 477, 47)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 477, 55)) ->R : Symbol(R, Decl(immutable.d.ts, 477, 11)) ->initialReduction : Symbol(initialReduction, Decl(immutable.d.ts, 477, 73)) ->R : Symbol(R, Decl(immutable.d.ts, 477, 11)) ->context : Symbol(context, Decl(immutable.d.ts, 477, 94)) ->R : Symbol(R, Decl(immutable.d.ts, 477, 11)) +>reduce : Symbol(Collection.reduce, Decl(immutable.ts, 475, 103), Decl(immutable.ts, 477, 113)) +>R : Symbol(R, Decl(immutable.ts, 477, 11)) +>reducer : Symbol(reducer, Decl(immutable.ts, 477, 14)) +>reduction : Symbol(reduction, Decl(immutable.ts, 477, 24)) +>R : Symbol(R, Decl(immutable.ts, 477, 11)) +>value : Symbol(value, Decl(immutable.ts, 477, 37)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>key : Symbol(key, Decl(immutable.ts, 477, 47)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 477, 55)) +>R : Symbol(R, Decl(immutable.ts, 477, 11)) +>initialReduction : Symbol(initialReduction, Decl(immutable.ts, 477, 73)) +>R : Symbol(R, Decl(immutable.ts, 477, 11)) +>context : Symbol(context, Decl(immutable.ts, 477, 94)) +>R : Symbol(R, Decl(immutable.ts, 477, 11)) reduce(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R; ->reduce : Symbol(Collection.reduce, Decl(immutable.d.ts, 475, 103), Decl(immutable.d.ts, 477, 113)) ->R : Symbol(R, Decl(immutable.d.ts, 478, 11)) ->reducer : Symbol(reducer, Decl(immutable.d.ts, 478, 14)) ->reduction : Symbol(reduction, Decl(immutable.d.ts, 478, 24)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->R : Symbol(R, Decl(immutable.d.ts, 478, 11)) ->value : Symbol(value, Decl(immutable.d.ts, 478, 41)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 478, 51)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 478, 59)) ->R : Symbol(R, Decl(immutable.d.ts, 478, 11)) ->R : Symbol(R, Decl(immutable.d.ts, 478, 11)) +>reduce : Symbol(Collection.reduce, Decl(immutable.ts, 475, 103), Decl(immutable.ts, 477, 113)) +>R : Symbol(R, Decl(immutable.ts, 478, 11)) +>reducer : Symbol(reducer, Decl(immutable.ts, 478, 14)) +>reduction : Symbol(reduction, Decl(immutable.ts, 478, 24)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>R : Symbol(R, Decl(immutable.ts, 478, 11)) +>value : Symbol(value, Decl(immutable.ts, 478, 41)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>key : Symbol(key, Decl(immutable.ts, 478, 51)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 478, 59)) +>R : Symbol(R, Decl(immutable.ts, 478, 11)) +>R : Symbol(R, Decl(immutable.ts, 478, 11)) reduceRight(reducer: (reduction: R, value: V, key: K, iter: this) => R, initialReduction: R, context?: any): R; ->reduceRight : Symbol(Collection.reduceRight, Decl(immutable.d.ts, 478, 81), Decl(immutable.d.ts, 479, 118)) ->R : Symbol(R, Decl(immutable.d.ts, 479, 16)) ->reducer : Symbol(reducer, Decl(immutable.d.ts, 479, 19)) ->reduction : Symbol(reduction, Decl(immutable.d.ts, 479, 29)) ->R : Symbol(R, Decl(immutable.d.ts, 479, 16)) ->value : Symbol(value, Decl(immutable.d.ts, 479, 42)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 479, 52)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 479, 60)) ->R : Symbol(R, Decl(immutable.d.ts, 479, 16)) ->initialReduction : Symbol(initialReduction, Decl(immutable.d.ts, 479, 78)) ->R : Symbol(R, Decl(immutable.d.ts, 479, 16)) ->context : Symbol(context, Decl(immutable.d.ts, 479, 99)) ->R : Symbol(R, Decl(immutable.d.ts, 479, 16)) +>reduceRight : Symbol(Collection.reduceRight, Decl(immutable.ts, 478, 81), Decl(immutable.ts, 479, 118)) +>R : Symbol(R, Decl(immutable.ts, 479, 16)) +>reducer : Symbol(reducer, Decl(immutable.ts, 479, 19)) +>reduction : Symbol(reduction, Decl(immutable.ts, 479, 29)) +>R : Symbol(R, Decl(immutable.ts, 479, 16)) +>value : Symbol(value, Decl(immutable.ts, 479, 42)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>key : Symbol(key, Decl(immutable.ts, 479, 52)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 479, 60)) +>R : Symbol(R, Decl(immutable.ts, 479, 16)) +>initialReduction : Symbol(initialReduction, Decl(immutable.ts, 479, 78)) +>R : Symbol(R, Decl(immutable.ts, 479, 16)) +>context : Symbol(context, Decl(immutable.ts, 479, 99)) +>R : Symbol(R, Decl(immutable.ts, 479, 16)) reduceRight(reducer: (reduction: V | R, value: V, key: K, iter: this) => R): R; ->reduceRight : Symbol(Collection.reduceRight, Decl(immutable.d.ts, 478, 81), Decl(immutable.d.ts, 479, 118)) ->R : Symbol(R, Decl(immutable.d.ts, 480, 16)) ->reducer : Symbol(reducer, Decl(immutable.d.ts, 480, 19)) ->reduction : Symbol(reduction, Decl(immutable.d.ts, 480, 29)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->R : Symbol(R, Decl(immutable.d.ts, 480, 16)) ->value : Symbol(value, Decl(immutable.d.ts, 480, 46)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 480, 56)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 480, 64)) ->R : Symbol(R, Decl(immutable.d.ts, 480, 16)) ->R : Symbol(R, Decl(immutable.d.ts, 480, 16)) +>reduceRight : Symbol(Collection.reduceRight, Decl(immutable.ts, 478, 81), Decl(immutable.ts, 479, 118)) +>R : Symbol(R, Decl(immutable.ts, 480, 16)) +>reducer : Symbol(reducer, Decl(immutable.ts, 480, 19)) +>reduction : Symbol(reduction, Decl(immutable.ts, 480, 29)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>R : Symbol(R, Decl(immutable.ts, 480, 16)) +>value : Symbol(value, Decl(immutable.ts, 480, 46)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>key : Symbol(key, Decl(immutable.ts, 480, 56)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 480, 64)) +>R : Symbol(R, Decl(immutable.ts, 480, 16)) +>R : Symbol(R, Decl(immutable.ts, 480, 16)) every(predicate: (value: V, key: K, iter: this) => boolean, context?: any): boolean; ->every : Symbol(Collection.every, Decl(immutable.d.ts, 480, 86)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 481, 10)) ->value : Symbol(value, Decl(immutable.d.ts, 481, 22)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 481, 31)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 481, 39)) ->context : Symbol(context, Decl(immutable.d.ts, 481, 63)) +>every : Symbol(Collection.every, Decl(immutable.ts, 480, 86)) +>predicate : Symbol(predicate, Decl(immutable.ts, 481, 10)) +>value : Symbol(value, Decl(immutable.ts, 481, 22)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>key : Symbol(key, Decl(immutable.ts, 481, 31)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 481, 39)) +>context : Symbol(context, Decl(immutable.ts, 481, 63)) some(predicate: (value: V, key: K, iter: this) => boolean, context?: any): boolean; ->some : Symbol(Collection.some, Decl(immutable.d.ts, 481, 88)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 482, 9)) ->value : Symbol(value, Decl(immutable.d.ts, 482, 21)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 482, 30)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 482, 38)) ->context : Symbol(context, Decl(immutable.d.ts, 482, 62)) +>some : Symbol(Collection.some, Decl(immutable.ts, 481, 88)) +>predicate : Symbol(predicate, Decl(immutable.ts, 482, 9)) +>value : Symbol(value, Decl(immutable.ts, 482, 21)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>key : Symbol(key, Decl(immutable.ts, 482, 30)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 482, 38)) +>context : Symbol(context, Decl(immutable.ts, 482, 62)) join(separator?: string): string; ->join : Symbol(Collection.join, Decl(immutable.d.ts, 482, 87)) ->separator : Symbol(separator, Decl(immutable.d.ts, 483, 9)) +>join : Symbol(Collection.join, Decl(immutable.ts, 482, 87)) +>separator : Symbol(separator, Decl(immutable.ts, 483, 9)) isEmpty(): boolean; ->isEmpty : Symbol(Collection.isEmpty, Decl(immutable.d.ts, 483, 37)) +>isEmpty : Symbol(Collection.isEmpty, Decl(immutable.ts, 483, 37)) count(): number; ->count : Symbol(Collection.count, Decl(immutable.d.ts, 484, 23), Decl(immutable.d.ts, 485, 20)) +>count : Symbol(Collection.count, Decl(immutable.ts, 484, 23), Decl(immutable.ts, 485, 20)) count(predicate: (value: V, key: K, iter: this) => boolean, context?: any): number; ->count : Symbol(Collection.count, Decl(immutable.d.ts, 484, 23), Decl(immutable.d.ts, 485, 20)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 486, 10)) ->value : Symbol(value, Decl(immutable.d.ts, 486, 22)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 486, 31)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 486, 39)) ->context : Symbol(context, Decl(immutable.d.ts, 486, 63)) +>count : Symbol(Collection.count, Decl(immutable.ts, 484, 23), Decl(immutable.ts, 485, 20)) +>predicate : Symbol(predicate, Decl(immutable.ts, 486, 10)) +>value : Symbol(value, Decl(immutable.ts, 486, 22)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>key : Symbol(key, Decl(immutable.ts, 486, 31)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 486, 39)) +>context : Symbol(context, Decl(immutable.ts, 486, 63)) countBy(grouper: (value: V, key: K, iter: this) => G, context?: any): Map; ->countBy : Symbol(Collection.countBy, Decl(immutable.d.ts, 486, 87)) ->G : Symbol(G, Decl(immutable.d.ts, 487, 12)) ->grouper : Symbol(grouper, Decl(immutable.d.ts, 487, 15)) ->value : Symbol(value, Decl(immutable.d.ts, 487, 25)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 487, 34)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 487, 42)) ->G : Symbol(G, Decl(immutable.d.ts, 487, 12)) ->context : Symbol(context, Decl(immutable.d.ts, 487, 60)) ->Map : Symbol(Map, Decl(immutable.d.ts, 62, 3), Decl(immutable.d.ts, 66, 3), Decl(immutable.d.ts, 67, 69), Decl(immutable.d.ts, 68, 71), Decl(immutable.d.ts, 69, 66) ... and 2 more) ->G : Symbol(G, Decl(immutable.d.ts, 487, 12)) +>countBy : Symbol(Collection.countBy, Decl(immutable.ts, 486, 87)) +>G : Symbol(G, Decl(immutable.ts, 487, 12)) +>grouper : Symbol(grouper, Decl(immutable.ts, 487, 15)) +>value : Symbol(value, Decl(immutable.ts, 487, 25)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>key : Symbol(key, Decl(immutable.ts, 487, 34)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 487, 42)) +>G : Symbol(G, Decl(immutable.ts, 487, 12)) +>context : Symbol(context, Decl(immutable.ts, 487, 60)) +>Map : Symbol(Map, Decl(immutable.ts, 62, 3), Decl(immutable.ts, 66, 3), Decl(immutable.ts, 67, 69), Decl(immutable.ts, 68, 71), Decl(immutable.ts, 69, 66) ... and 2 more) +>G : Symbol(G, Decl(immutable.ts, 487, 12)) // Search for value find(predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V): V | undefined; ->find : Symbol(Collection.find, Decl(immutable.d.ts, 487, 92)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 489, 9)) ->value : Symbol(value, Decl(immutable.d.ts, 489, 21)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 489, 30)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 489, 38)) ->context : Symbol(context, Decl(immutable.d.ts, 489, 62)) ->notSetValue : Symbol(notSetValue, Decl(immutable.d.ts, 489, 77)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>find : Symbol(Collection.find, Decl(immutable.ts, 487, 92)) +>predicate : Symbol(predicate, Decl(immutable.ts, 489, 9)) +>value : Symbol(value, Decl(immutable.ts, 489, 21)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>key : Symbol(key, Decl(immutable.ts, 489, 30)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 489, 38)) +>context : Symbol(context, Decl(immutable.ts, 489, 62)) +>notSetValue : Symbol(notSetValue, Decl(immutable.ts, 489, 77)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) findLast(predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V): V | undefined; ->findLast : Symbol(Collection.findLast, Decl(immutable.d.ts, 489, 110)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 490, 13)) ->value : Symbol(value, Decl(immutable.d.ts, 490, 25)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 490, 34)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 490, 42)) ->context : Symbol(context, Decl(immutable.d.ts, 490, 66)) ->notSetValue : Symbol(notSetValue, Decl(immutable.d.ts, 490, 81)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>findLast : Symbol(Collection.findLast, Decl(immutable.ts, 489, 110)) +>predicate : Symbol(predicate, Decl(immutable.ts, 490, 13)) +>value : Symbol(value, Decl(immutable.ts, 490, 25)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>key : Symbol(key, Decl(immutable.ts, 490, 34)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 490, 42)) +>context : Symbol(context, Decl(immutable.ts, 490, 66)) +>notSetValue : Symbol(notSetValue, Decl(immutable.ts, 490, 81)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) findEntry(predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V): [K, V] | undefined; ->findEntry : Symbol(Collection.findEntry, Decl(immutable.d.ts, 490, 114)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 491, 14)) ->value : Symbol(value, Decl(immutable.d.ts, 491, 26)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 491, 35)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 491, 43)) ->context : Symbol(context, Decl(immutable.d.ts, 491, 67)) ->notSetValue : Symbol(notSetValue, Decl(immutable.d.ts, 491, 82)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>findEntry : Symbol(Collection.findEntry, Decl(immutable.ts, 490, 114)) +>predicate : Symbol(predicate, Decl(immutable.ts, 491, 14)) +>value : Symbol(value, Decl(immutable.ts, 491, 26)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>key : Symbol(key, Decl(immutable.ts, 491, 35)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 491, 43)) +>context : Symbol(context, Decl(immutable.ts, 491, 67)) +>notSetValue : Symbol(notSetValue, Decl(immutable.ts, 491, 82)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) findLastEntry(predicate: (value: V, key: K, iter: this) => boolean, context?: any, notSetValue?: V): [K, V] | undefined; ->findLastEntry : Symbol(Collection.findLastEntry, Decl(immutable.d.ts, 491, 120)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 492, 18)) ->value : Symbol(value, Decl(immutable.d.ts, 492, 30)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 492, 39)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 492, 47)) ->context : Symbol(context, Decl(immutable.d.ts, 492, 71)) ->notSetValue : Symbol(notSetValue, Decl(immutable.d.ts, 492, 86)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>findLastEntry : Symbol(Collection.findLastEntry, Decl(immutable.ts, 491, 120)) +>predicate : Symbol(predicate, Decl(immutable.ts, 492, 18)) +>value : Symbol(value, Decl(immutable.ts, 492, 30)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>key : Symbol(key, Decl(immutable.ts, 492, 39)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 492, 47)) +>context : Symbol(context, Decl(immutable.ts, 492, 71)) +>notSetValue : Symbol(notSetValue, Decl(immutable.ts, 492, 86)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) findKey(predicate: (value: V, key: K, iter: this) => boolean, context?: any): K | undefined; ->findKey : Symbol(Collection.findKey, Decl(immutable.d.ts, 492, 124)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 493, 12)) ->value : Symbol(value, Decl(immutable.d.ts, 493, 24)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 493, 33)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 493, 41)) ->context : Symbol(context, Decl(immutable.d.ts, 493, 65)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) +>findKey : Symbol(Collection.findKey, Decl(immutable.ts, 492, 124)) +>predicate : Symbol(predicate, Decl(immutable.ts, 493, 12)) +>value : Symbol(value, Decl(immutable.ts, 493, 24)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>key : Symbol(key, Decl(immutable.ts, 493, 33)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 493, 41)) +>context : Symbol(context, Decl(immutable.ts, 493, 65)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) findLastKey(predicate: (value: V, key: K, iter: this) => boolean, context?: any): K | undefined; ->findLastKey : Symbol(Collection.findLastKey, Decl(immutable.d.ts, 493, 96)) ->predicate : Symbol(predicate, Decl(immutable.d.ts, 494, 16)) ->value : Symbol(value, Decl(immutable.d.ts, 494, 28)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 494, 37)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 494, 45)) ->context : Symbol(context, Decl(immutable.d.ts, 494, 69)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) +>findLastKey : Symbol(Collection.findLastKey, Decl(immutable.ts, 493, 96)) +>predicate : Symbol(predicate, Decl(immutable.ts, 494, 16)) +>value : Symbol(value, Decl(immutable.ts, 494, 28)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>key : Symbol(key, Decl(immutable.ts, 494, 37)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 494, 45)) +>context : Symbol(context, Decl(immutable.ts, 494, 69)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) keyOf(searchValue: V): K | undefined; ->keyOf : Symbol(Collection.keyOf, Decl(immutable.d.ts, 494, 100)) ->searchValue : Symbol(searchValue, Decl(immutable.d.ts, 495, 10)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) +>keyOf : Symbol(Collection.keyOf, Decl(immutable.ts, 494, 100)) +>searchValue : Symbol(searchValue, Decl(immutable.ts, 495, 10)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) lastKeyOf(searchValue: V): K | undefined; ->lastKeyOf : Symbol(Collection.lastKeyOf, Decl(immutable.d.ts, 495, 41)) ->searchValue : Symbol(searchValue, Decl(immutable.d.ts, 496, 14)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) +>lastKeyOf : Symbol(Collection.lastKeyOf, Decl(immutable.ts, 495, 41)) +>searchValue : Symbol(searchValue, Decl(immutable.ts, 496, 14)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) max(comparator?: (valueA: V, valueB: V) => number): V | undefined; ->max : Symbol(Collection.max, Decl(immutable.d.ts, 496, 45)) ->comparator : Symbol(comparator, Decl(immutable.d.ts, 497, 8)) ->valueA : Symbol(valueA, Decl(immutable.d.ts, 497, 22)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->valueB : Symbol(valueB, Decl(immutable.d.ts, 497, 32)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>max : Symbol(Collection.max, Decl(immutable.ts, 496, 45)) +>comparator : Symbol(comparator, Decl(immutable.ts, 497, 8)) +>valueA : Symbol(valueA, Decl(immutable.ts, 497, 22)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>valueB : Symbol(valueB, Decl(immutable.ts, 497, 32)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) maxBy(comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: (valueA: C, valueB: C) => number): V | undefined; ->maxBy : Symbol(Collection.maxBy, Decl(immutable.d.ts, 497, 70)) ->C : Symbol(C, Decl(immutable.d.ts, 498, 10)) ->comparatorValueMapper : Symbol(comparatorValueMapper, Decl(immutable.d.ts, 498, 13)) ->value : Symbol(value, Decl(immutable.d.ts, 498, 37)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 498, 46)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 498, 54)) ->C : Symbol(C, Decl(immutable.d.ts, 498, 10)) ->comparator : Symbol(comparator, Decl(immutable.d.ts, 498, 72)) ->valueA : Symbol(valueA, Decl(immutable.d.ts, 498, 87)) ->C : Symbol(C, Decl(immutable.d.ts, 498, 10)) ->valueB : Symbol(valueB, Decl(immutable.d.ts, 498, 97)) ->C : Symbol(C, Decl(immutable.d.ts, 498, 10)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>maxBy : Symbol(Collection.maxBy, Decl(immutable.ts, 497, 70)) +>C : Symbol(C, Decl(immutable.ts, 498, 10)) +>comparatorValueMapper : Symbol(comparatorValueMapper, Decl(immutable.ts, 498, 13)) +>value : Symbol(value, Decl(immutable.ts, 498, 37)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>key : Symbol(key, Decl(immutable.ts, 498, 46)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 498, 54)) +>C : Symbol(C, Decl(immutable.ts, 498, 10)) +>comparator : Symbol(comparator, Decl(immutable.ts, 498, 72)) +>valueA : Symbol(valueA, Decl(immutable.ts, 498, 87)) +>C : Symbol(C, Decl(immutable.ts, 498, 10)) +>valueB : Symbol(valueB, Decl(immutable.ts, 498, 97)) +>C : Symbol(C, Decl(immutable.ts, 498, 10)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) min(comparator?: (valueA: V, valueB: V) => number): V | undefined; ->min : Symbol(Collection.min, Decl(immutable.d.ts, 498, 135)) ->comparator : Symbol(comparator, Decl(immutable.d.ts, 499, 8)) ->valueA : Symbol(valueA, Decl(immutable.d.ts, 499, 22)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->valueB : Symbol(valueB, Decl(immutable.d.ts, 499, 32)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>min : Symbol(Collection.min, Decl(immutable.ts, 498, 135)) +>comparator : Symbol(comparator, Decl(immutable.ts, 499, 8)) +>valueA : Symbol(valueA, Decl(immutable.ts, 499, 22)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>valueB : Symbol(valueB, Decl(immutable.ts, 499, 32)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) minBy(comparatorValueMapper: (value: V, key: K, iter: this) => C, comparator?: (valueA: C, valueB: C) => number): V | undefined; ->minBy : Symbol(Collection.minBy, Decl(immutable.d.ts, 499, 70)) ->C : Symbol(C, Decl(immutable.d.ts, 500, 10)) ->comparatorValueMapper : Symbol(comparatorValueMapper, Decl(immutable.d.ts, 500, 13)) ->value : Symbol(value, Decl(immutable.d.ts, 500, 37)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) ->key : Symbol(key, Decl(immutable.d.ts, 500, 46)) ->K : Symbol(K, Decl(immutable.d.ts, 406, 30)) ->iter : Symbol(iter, Decl(immutable.d.ts, 500, 54)) ->C : Symbol(C, Decl(immutable.d.ts, 500, 10)) ->comparator : Symbol(comparator, Decl(immutable.d.ts, 500, 72)) ->valueA : Symbol(valueA, Decl(immutable.d.ts, 500, 87)) ->C : Symbol(C, Decl(immutable.d.ts, 500, 10)) ->valueB : Symbol(valueB, Decl(immutable.d.ts, 500, 97)) ->C : Symbol(C, Decl(immutable.d.ts, 500, 10)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>minBy : Symbol(Collection.minBy, Decl(immutable.ts, 499, 70)) +>C : Symbol(C, Decl(immutable.ts, 500, 10)) +>comparatorValueMapper : Symbol(comparatorValueMapper, Decl(immutable.ts, 500, 13)) +>value : Symbol(value, Decl(immutable.ts, 500, 37)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) +>key : Symbol(key, Decl(immutable.ts, 500, 46)) +>K : Symbol(K, Decl(immutable.ts, 406, 30)) +>iter : Symbol(iter, Decl(immutable.ts, 500, 54)) +>C : Symbol(C, Decl(immutable.ts, 500, 10)) +>comparator : Symbol(comparator, Decl(immutable.ts, 500, 72)) +>valueA : Symbol(valueA, Decl(immutable.ts, 500, 87)) +>C : Symbol(C, Decl(immutable.ts, 500, 10)) +>valueB : Symbol(valueB, Decl(immutable.ts, 500, 97)) +>C : Symbol(C, Decl(immutable.ts, 500, 10)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) // Comparison isSubset(iter: Iterable): boolean; ->isSubset : Symbol(Collection.isSubset, Decl(immutable.d.ts, 500, 135)) ->iter : Symbol(iter, Decl(immutable.d.ts, 502, 13)) +>isSubset : Symbol(Collection.isSubset, Decl(immutable.ts, 500, 135)) +>iter : Symbol(iter, Decl(immutable.ts, 502, 13)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) isSuperset(iter: Iterable): boolean; ->isSuperset : Symbol(Collection.isSuperset, Decl(immutable.d.ts, 502, 41)) ->iter : Symbol(iter, Decl(immutable.d.ts, 503, 15)) +>isSuperset : Symbol(Collection.isSuperset, Decl(immutable.ts, 502, 41)) +>iter : Symbol(iter, Decl(immutable.ts, 503, 15)) >Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --)) ->V : Symbol(V, Decl(immutable.d.ts, 406, 32)) +>V : Symbol(V, Decl(immutable.ts, 406, 32)) readonly size: number; ->size : Symbol(Collection.size, Decl(immutable.d.ts, 503, 43)) +>size : Symbol(Collection.size, Decl(immutable.ts, 503, 43)) } } declare module "immutable" { export = Immutable ->Immutable : Symbol(Immutable, Decl(immutable.d.ts, 0, 0)) +>Immutable : Symbol(Immutable, Decl(immutable.ts, 0, 0)) } diff --git a/tests/baselines/reference/complexRecursiveCollections.types b/tests/baselines/reference/complexRecursiveCollections.types index 382a2b86e79..e3d4a01196e 100644 --- a/tests/baselines/reference/complexRecursiveCollections.types +++ b/tests/baselines/reference/complexRecursiveCollections.types @@ -1,4 +1,4 @@ -=== tests/cases/compiler/complex.d.ts === +=== tests/cases/compiler/complex.ts === interface Ara { t: T } >Ara : Ara >T : T @@ -156,7 +156,7 @@ interface N2 extends N1 { >N2 : N2 >T : T } -=== tests/cases/compiler/immutable.d.ts === +=== tests/cases/compiler/immutable.ts === // Test that complex recursive collections can pass the `extends` assignability check without // running out of memory. This bug was exposed in Typescript 2.4 when more generic signatures // started being checked. diff --git a/tests/cases/compiler/complexRecursiveCollections.ts b/tests/cases/compiler/complexRecursiveCollections.ts index 68054aac0f9..ed8906ff441 100644 --- a/tests/cases/compiler/complexRecursiveCollections.ts +++ b/tests/cases/compiler/complexRecursiveCollections.ts @@ -1,5 +1,6 @@ +// @skipLibCheck: true // @lib: es6 -// @Filename: complex.d.ts +// @Filename: complex.ts interface Ara { t: T } interface Collection { map(mapper: (value: V, key: K, iter: this) => M): Collection; @@ -20,7 +21,7 @@ interface N2 extends N1 { flatMap(mapper: (value: T, key: void, iter: this) => Ara, context?: any): N2; toSeq(): N2; } -// @Filename: immutable.d.ts +// @Filename: immutable.ts // Test that complex recursive collections can pass the `extends` assignability check without // running out of memory. This bug was exposed in Typescript 2.4 when more generic signatures // started being checked. diff --git a/tests/cases/conformance/jsx/checkJsxChildrenProperty1.tsx b/tests/cases/conformance/jsx/checkJsxChildrenProperty1.tsx index 70b58c03f6a..09c003c376c 100644 --- a/tests/cases/conformance/jsx/checkJsxChildrenProperty1.tsx +++ b/tests/cases/conformance/jsx/checkJsxChildrenProperty1.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/checkJsxChildrenProperty13.tsx b/tests/cases/conformance/jsx/checkJsxChildrenProperty13.tsx index 1584bf43159..0c2d2507864 100644 --- a/tests/cases/conformance/jsx/checkJsxChildrenProperty13.tsx +++ b/tests/cases/conformance/jsx/checkJsxChildrenProperty13.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/checkJsxChildrenProperty2.tsx b/tests/cases/conformance/jsx/checkJsxChildrenProperty2.tsx index 65bc0f50b12..632b9d5d849 100644 --- a/tests/cases/conformance/jsx/checkJsxChildrenProperty2.tsx +++ b/tests/cases/conformance/jsx/checkJsxChildrenProperty2.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/checkJsxChildrenProperty4.tsx b/tests/cases/conformance/jsx/checkJsxChildrenProperty4.tsx index 34877f2000c..277f2fb55c2 100644 --- a/tests/cases/conformance/jsx/checkJsxChildrenProperty4.tsx +++ b/tests/cases/conformance/jsx/checkJsxChildrenProperty4.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/checkJsxChildrenProperty6.tsx b/tests/cases/conformance/jsx/checkJsxChildrenProperty6.tsx index c7c709dd369..40801539f54 100644 --- a/tests/cases/conformance/jsx/checkJsxChildrenProperty6.tsx +++ b/tests/cases/conformance/jsx/checkJsxChildrenProperty6.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/checkJsxChildrenProperty7.tsx b/tests/cases/conformance/jsx/checkJsxChildrenProperty7.tsx index 82297737a11..0a5d120dd19 100644 --- a/tests/cases/conformance/jsx/checkJsxChildrenProperty7.tsx +++ b/tests/cases/conformance/jsx/checkJsxChildrenProperty7.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/checkJsxChildrenProperty8.tsx b/tests/cases/conformance/jsx/checkJsxChildrenProperty8.tsx index 44e9f7e0652..c9c5d70ae37 100644 --- a/tests/cases/conformance/jsx/checkJsxChildrenProperty8.tsx +++ b/tests/cases/conformance/jsx/checkJsxChildrenProperty8.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/checkJsxChildrenProperty9.tsx b/tests/cases/conformance/jsx/checkJsxChildrenProperty9.tsx index 5453262b7d4..7d3d65fbc6f 100644 --- a/tests/cases/conformance/jsx/checkJsxChildrenProperty9.tsx +++ b/tests/cases/conformance/jsx/checkJsxChildrenProperty9.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/commentEmittingInPreserveJsx1.tsx b/tests/cases/conformance/jsx/commentEmittingInPreserveJsx1.tsx index 323cd029189..ebdb36aed15 100644 --- a/tests/cases/conformance/jsx/commentEmittingInPreserveJsx1.tsx +++ b/tests/cases/conformance/jsx/commentEmittingInPreserveJsx1.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxAttributeResolution15.tsx b/tests/cases/conformance/jsx/tsxAttributeResolution15.tsx index ce2e12fd2bb..01dedf4711e 100644 --- a/tests/cases/conformance/jsx/tsxAttributeResolution15.tsx +++ b/tests/cases/conformance/jsx/tsxAttributeResolution15.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxAttributeResolution16.tsx b/tests/cases/conformance/jsx/tsxAttributeResolution16.tsx index 811a1b47174..15e8089a5ae 100644 --- a/tests/cases/conformance/jsx/tsxAttributeResolution16.tsx +++ b/tests/cases/conformance/jsx/tsxAttributeResolution16.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxDefaultAttributesResolution1.tsx b/tests/cases/conformance/jsx/tsxDefaultAttributesResolution1.tsx index 03314b400ee..b80252bee1b 100644 --- a/tests/cases/conformance/jsx/tsxDefaultAttributesResolution1.tsx +++ b/tests/cases/conformance/jsx/tsxDefaultAttributesResolution1.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxDefaultAttributesResolution2.tsx b/tests/cases/conformance/jsx/tsxDefaultAttributesResolution2.tsx index b00655b5a57..27b1e24e23f 100644 --- a/tests/cases/conformance/jsx/tsxDefaultAttributesResolution2.tsx +++ b/tests/cases/conformance/jsx/tsxDefaultAttributesResolution2.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxDefaultAttributesResolution3.tsx b/tests/cases/conformance/jsx/tsxDefaultAttributesResolution3.tsx index 303e6ef891d..981cdabf464 100644 --- a/tests/cases/conformance/jsx/tsxDefaultAttributesResolution3.tsx +++ b/tests/cases/conformance/jsx/tsxDefaultAttributesResolution3.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxGenericAttributesType1.tsx b/tests/cases/conformance/jsx/tsxGenericAttributesType1.tsx index e6b7fc18ef7..ebb80771856 100644 --- a/tests/cases/conformance/jsx/tsxGenericAttributesType1.tsx +++ b/tests/cases/conformance/jsx/tsxGenericAttributesType1.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxGenericAttributesType2.tsx b/tests/cases/conformance/jsx/tsxGenericAttributesType2.tsx index 48acd55546f..0b226f9cf90 100644 --- a/tests/cases/conformance/jsx/tsxGenericAttributesType2.tsx +++ b/tests/cases/conformance/jsx/tsxGenericAttributesType2.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxGenericAttributesType3.tsx b/tests/cases/conformance/jsx/tsxGenericAttributesType3.tsx index b683c5e7970..28364b93afc 100644 --- a/tests/cases/conformance/jsx/tsxGenericAttributesType3.tsx +++ b/tests/cases/conformance/jsx/tsxGenericAttributesType3.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxGenericAttributesType5.tsx b/tests/cases/conformance/jsx/tsxGenericAttributesType5.tsx index d0215da7397..ba8d9a284ca 100644 --- a/tests/cases/conformance/jsx/tsxGenericAttributesType5.tsx +++ b/tests/cases/conformance/jsx/tsxGenericAttributesType5.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxGenericAttributesType6.tsx b/tests/cases/conformance/jsx/tsxGenericAttributesType6.tsx index d70df8a0cf7..22634ae9f7d 100644 --- a/tests/cases/conformance/jsx/tsxGenericAttributesType6.tsx +++ b/tests/cases/conformance/jsx/tsxGenericAttributesType6.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxGenericAttributesType7.tsx b/tests/cases/conformance/jsx/tsxGenericAttributesType7.tsx index 3044fda23df..07c6f05da1c 100644 --- a/tests/cases/conformance/jsx/tsxGenericAttributesType7.tsx +++ b/tests/cases/conformance/jsx/tsxGenericAttributesType7.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxGenericAttributesType8.tsx b/tests/cases/conformance/jsx/tsxGenericAttributesType8.tsx index b1d3a7445c8..77d391f7f39 100644 --- a/tests/cases/conformance/jsx/tsxGenericAttributesType8.tsx +++ b/tests/cases/conformance/jsx/tsxGenericAttributesType8.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxGenericAttributesType9.tsx b/tests/cases/conformance/jsx/tsxGenericAttributesType9.tsx index 32a1af66f84..5a3f2b19845 100644 --- a/tests/cases/conformance/jsx/tsxGenericAttributesType9.tsx +++ b/tests/cases/conformance/jsx/tsxGenericAttributesType9.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxReactComponentWithDefaultTypeParameter1.tsx b/tests/cases/conformance/jsx/tsxReactComponentWithDefaultTypeParameter1.tsx index 5a8434dfe64..9d9ae5442cd 100644 --- a/tests/cases/conformance/jsx/tsxReactComponentWithDefaultTypeParameter1.tsx +++ b/tests/cases/conformance/jsx/tsxReactComponentWithDefaultTypeParameter1.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxReactComponentWithDefaultTypeParameter2.tsx b/tests/cases/conformance/jsx/tsxReactComponentWithDefaultTypeParameter2.tsx index 2aa4afc2e2e..84c4ffcef45 100644 --- a/tests/cases/conformance/jsx/tsxReactComponentWithDefaultTypeParameter2.tsx +++ b/tests/cases/conformance/jsx/tsxReactComponentWithDefaultTypeParameter2.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxReactComponentWithDefaultTypeParameter3.tsx b/tests/cases/conformance/jsx/tsxReactComponentWithDefaultTypeParameter3.tsx index e4a045f1362..abae7e36853 100644 --- a/tests/cases/conformance/jsx/tsxReactComponentWithDefaultTypeParameter3.tsx +++ b/tests/cases/conformance/jsx/tsxReactComponentWithDefaultTypeParameter3.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution1.tsx b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution1.tsx index a14a7ffe59c..dfaaa8b3b72 100644 --- a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution1.tsx +++ b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution1.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution10.tsx b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution10.tsx index 6410f075ae9..733731731e4 100644 --- a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution10.tsx +++ b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution10.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution11.tsx b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution11.tsx index c8008623441..458cac5bc98 100644 --- a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution11.tsx +++ b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution11.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution12.tsx b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution12.tsx index 457a3f29810..4e0baa8677b 100644 --- a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution12.tsx +++ b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution12.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution13.tsx b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution13.tsx index b665654514c..a9ebb4caba4 100644 --- a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution13.tsx +++ b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution13.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution14.tsx b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution14.tsx index b9edcc8ab75..5bfe228d10a 100644 --- a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution14.tsx +++ b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution14.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution15.tsx b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution15.tsx index 5ede01c0eab..2ee07507c08 100644 --- a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution15.tsx +++ b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution15.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution16.tsx b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution16.tsx index 98616661857..d197e29fed3 100644 --- a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution16.tsx +++ b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution16.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution2.tsx b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution2.tsx index 7ec1d871189..f32b367b718 100644 --- a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution2.tsx +++ b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution2.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution4.tsx b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution4.tsx index 8afec4b69c8..3d39a1a7cc9 100644 --- a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution4.tsx +++ b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution4.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution5.tsx b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution5.tsx index 22045c81451..dcea930fa25 100644 --- a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution5.tsx +++ b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution5.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution6.tsx b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution6.tsx index 35a190e10cc..5c7d9448d12 100644 --- a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution6.tsx +++ b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution6.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution7.tsx b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution7.tsx index 55e3222c022..34cd8254b7a 100644 --- a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution7.tsx +++ b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution7.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution8.tsx b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution8.tsx index 937678605d6..04e61e32eb9 100644 --- a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution8.tsx +++ b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution8.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution9.tsx b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution9.tsx index 9f2a63a56b6..c14003774c2 100644 --- a/tests/cases/conformance/jsx/tsxSpreadAttributesResolution9.tsx +++ b/tests/cases/conformance/jsx/tsxSpreadAttributesResolution9.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload3.tsx b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload3.tsx index e4e8fe9f096..1c2afd82533 100644 --- a/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload3.tsx +++ b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload3.tsx @@ -2,6 +2,7 @@ // @jsx: preserve // @module: amd // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts interface Context { diff --git a/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload4.tsx b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload4.tsx index b96073b4cc0..93ac29e4d84 100644 --- a/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload4.tsx +++ b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload4.tsx @@ -2,6 +2,7 @@ // @jsx: preserve // @module: amd // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react') diff --git a/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload5.tsx b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload5.tsx index 34be082b3c8..b32393c44ce 100644 --- a/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload5.tsx +++ b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentOverload5.tsx @@ -2,6 +2,7 @@ // @jsx: preserve // @module: amd // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react') diff --git a/tests/cases/conformance/jsx/tsxStatelessFunctionComponentWithDefaultTypeParameter1.tsx b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentWithDefaultTypeParameter1.tsx index f1a0fa20e0e..d9256ee6607 100644 --- a/tests/cases/conformance/jsx/tsxStatelessFunctionComponentWithDefaultTypeParameter1.tsx +++ b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentWithDefaultTypeParameter1.tsx @@ -2,6 +2,7 @@ // @jsx: preserve // @module: amd // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react') diff --git a/tests/cases/conformance/jsx/tsxStatelessFunctionComponentWithDefaultTypeParameter2.tsx b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentWithDefaultTypeParameter2.tsx index cfc1fbb5794..2117aedfac1 100644 --- a/tests/cases/conformance/jsx/tsxStatelessFunctionComponentWithDefaultTypeParameter2.tsx +++ b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentWithDefaultTypeParameter2.tsx @@ -2,6 +2,7 @@ // @jsx: preserve // @module: amd // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react') diff --git a/tests/cases/conformance/jsx/tsxStatelessFunctionComponents2.tsx b/tests/cases/conformance/jsx/tsxStatelessFunctionComponents2.tsx index d2a6586b436..01e848f574e 100644 --- a/tests/cases/conformance/jsx/tsxStatelessFunctionComponents2.tsx +++ b/tests/cases/conformance/jsx/tsxStatelessFunctionComponents2.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: preserve // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxStatelessFunctionComponents3.tsx b/tests/cases/conformance/jsx/tsxStatelessFunctionComponents3.tsx index 48ce5fb5efb..9490e913f92 100644 --- a/tests/cases/conformance/jsx/tsxStatelessFunctionComponents3.tsx +++ b/tests/cases/conformance/jsx/tsxStatelessFunctionComponents3.tsx @@ -2,6 +2,7 @@ // @jsx: preserve // @module: amd // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxStatelessFunctionComponentsWithTypeArguments1.tsx b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentsWithTypeArguments1.tsx index f910ef665e6..75b9915853b 100644 --- a/tests/cases/conformance/jsx/tsxStatelessFunctionComponentsWithTypeArguments1.tsx +++ b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentsWithTypeArguments1.tsx @@ -2,6 +2,7 @@ // @jsx: preserve // @module: amd // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react') diff --git a/tests/cases/conformance/jsx/tsxStatelessFunctionComponentsWithTypeArguments4.tsx b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentsWithTypeArguments4.tsx index 4be582dab5c..6cd88999425 100644 --- a/tests/cases/conformance/jsx/tsxStatelessFunctionComponentsWithTypeArguments4.tsx +++ b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentsWithTypeArguments4.tsx @@ -2,6 +2,7 @@ // @jsx: preserve // @module: amd // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react') diff --git a/tests/cases/conformance/jsx/tsxStatelessFunctionComponentsWithTypeArguments5.tsx b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentsWithTypeArguments5.tsx index c19bfdf43bd..dcc87018818 100644 --- a/tests/cases/conformance/jsx/tsxStatelessFunctionComponentsWithTypeArguments5.tsx +++ b/tests/cases/conformance/jsx/tsxStatelessFunctionComponentsWithTypeArguments5.tsx @@ -2,6 +2,7 @@ // @jsx: preserve // @module: amd // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react') diff --git a/tests/cases/conformance/jsx/tsxUnionElementType1.tsx b/tests/cases/conformance/jsx/tsxUnionElementType1.tsx index 300f0e95172..91457469a8d 100644 --- a/tests/cases/conformance/jsx/tsxUnionElementType1.tsx +++ b/tests/cases/conformance/jsx/tsxUnionElementType1.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: react // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxUnionElementType2.tsx b/tests/cases/conformance/jsx/tsxUnionElementType2.tsx index 6a9ccd42b2e..ae0c0843b81 100644 --- a/tests/cases/conformance/jsx/tsxUnionElementType2.tsx +++ b/tests/cases/conformance/jsx/tsxUnionElementType2.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: react // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxUnionElementType3.tsx b/tests/cases/conformance/jsx/tsxUnionElementType3.tsx index 5582150bf8c..6e021bc99fa 100644 --- a/tests/cases/conformance/jsx/tsxUnionElementType3.tsx +++ b/tests/cases/conformance/jsx/tsxUnionElementType3.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: react // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxUnionElementType4.tsx b/tests/cases/conformance/jsx/tsxUnionElementType4.tsx index 725f93643c1..e7d7b6ff5ff 100644 --- a/tests/cases/conformance/jsx/tsxUnionElementType4.tsx +++ b/tests/cases/conformance/jsx/tsxUnionElementType4.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: react // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxUnionElementType5.tsx b/tests/cases/conformance/jsx/tsxUnionElementType5.tsx index 9341bc5805a..2f3d96f4ecc 100644 --- a/tests/cases/conformance/jsx/tsxUnionElementType5.tsx +++ b/tests/cases/conformance/jsx/tsxUnionElementType5.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: react // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxUnionElementType6.tsx b/tests/cases/conformance/jsx/tsxUnionElementType6.tsx index 99d7b980894..e4d2514dbd4 100644 --- a/tests/cases/conformance/jsx/tsxUnionElementType6.tsx +++ b/tests/cases/conformance/jsx/tsxUnionElementType6.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: react // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/jsx/tsxUnionTypeComponent2.tsx b/tests/cases/conformance/jsx/tsxUnionTypeComponent2.tsx index dbd14f6c27f..394e5e07d34 100644 --- a/tests/cases/conformance/jsx/tsxUnionTypeComponent2.tsx +++ b/tests/cases/conformance/jsx/tsxUnionTypeComponent2.tsx @@ -1,6 +1,7 @@ // @filename: file.tsx // @jsx: react // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react'); diff --git a/tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStringLiteralsInJsxAttributes02.tsx b/tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStringLiteralsInJsxAttributes02.tsx index 1fa798c850f..53171833d9d 100644 --- a/tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStringLiteralsInJsxAttributes02.tsx +++ b/tests/cases/conformance/types/contextualTypes/jsxAttributes/contextuallyTypedStringLiteralsInJsxAttributes02.tsx @@ -2,6 +2,7 @@ // @jsx: preserve // @module: amd // @noLib: true +// @skipLibCheck: true // @libFiles: react.d.ts,lib.d.ts import React = require('react') From da41217f435ca49647eb77ebafb4e293f7223bf6 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Wed, 4 Oct 2017 15:15:29 -0700 Subject: [PATCH 024/137] Binding element with parent type any is any Previously if the binding element had an initializer, then that type would be used. But this is incorrect: ```ts function f(x: any) { let { d = 1 } = x; // d should have type any not number. // f can be called with anything: } f({ d: 0 }); f({ d: 'hi' }); f({}); ``` --- src/compiler/checker.ts | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index fbe192c5629..347d8c911f3 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4151,13 +4151,13 @@ namespace ts { if (parentType === unknownType) { return unknownType; } - // If no type was specified or inferred for parent, or if the specified or inferred type is any, - // infer from the initializer of the binding element if one is present. Otherwise, go with the - // undefined or any type of the parent. - if (!parentType || isTypeAny(parentType)) { - if (declaration.initializer) { - return checkDeclarationInitializer(declaration); - } + // If no type was specified or inferred for parent, + // infer from the initializer of the binding element if one is present. + // Otherwise, go with the undefined type of the parent. + if (!parentType) { + return declaration.initializer ? checkDeclarationInitializer(declaration) : parentType; + } + if (isTypeAny(parentType)) { return parentType; } @@ -4183,9 +4183,6 @@ namespace ts { // computed properties with non-literal names are treated as 'any' return anyType; } - if (declaration.initializer) { - getContextualType(declaration.initializer); - } // Use type of the specified property, or otherwise, for a numeric name, the type of the numeric index signature, // or otherwise the type of the string index signature. From 2ae70a1c2bea93b2f7a589ba8cc2cb830b64cbef Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Wed, 4 Oct 2017 15:24:23 -0700 Subject: [PATCH 025/137] Update baselines --- ...cturingArrayBindingPatternAndAssignment1ES5.types | 4 ++-- ...rrayBindingPatternAndAssignment1ES5iterable.types | 4 ++-- ...cturingArrayBindingPatternAndAssignment1ES6.types | 4 ++-- ...turingObjectBindingPatternAndAssignment1ES5.types | 2 +- ...turingObjectBindingPatternAndAssignment1ES6.types | 2 +- ...ructuringObjectBindingPatternAndAssignment4.types | 12 ++++++------ tests/baselines/reference/objectRestParameter.types | 2 +- .../baselines/reference/objectRestParameterES5.types | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.types b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.types index e2a6174e61f..d0d8561b808 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.types +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.types @@ -28,9 +28,9 @@ var [a0, a1]: any = undefined; >undefined : undefined var [a2 = false, a3 = 1]: any = undefined; ->a2 : boolean +>a2 : any >false : false ->a3 : number +>a3 : any >1 : 1 >undefined : undefined diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5iterable.types b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5iterable.types index a650bbad2d2..09dc481c477 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5iterable.types +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5iterable.types @@ -28,9 +28,9 @@ var [a0, a1]: any = undefined; >undefined : undefined var [a2 = false, a3 = 1]: any = undefined; ->a2 : boolean +>a2 : any >false : false ->a3 : number +>a3 : any >1 : 1 >undefined : undefined diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.types b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.types index b6f54b55799..a07ea6ca017 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.types +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.types @@ -28,9 +28,9 @@ var [a0, a1]: any = undefined; >undefined : undefined var [a2 = false, a3 = 1]: any = undefined; ->a2 : boolean +>a2 : any >false : false ->a3 : number +>a3 : any >1 : 1 >undefined : undefined diff --git a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.types b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.types index e0aedcbb167..203815fa9c8 100644 --- a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.types +++ b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES5.types @@ -39,7 +39,7 @@ var {1: b3} = { 1: "string" }; >"string" : "string" var {b4 = 1}: any = { b4: 100000 }; ->b4 : number +>b4 : any >1 : 1 >{ b4: 100000 } : { b4: number; } >b4 : number diff --git a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES6.types b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES6.types index 7d68d32ac51..1c3d1f4d00c 100644 --- a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES6.types +++ b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment1ES6.types @@ -39,7 +39,7 @@ var {1: b3} = { 1: "string" }; >"string" : "string" var {b4 = 1}: any = { b4: 100000 }; ->b4 : number +>b4 : any >1 : 1 >{ b4: 100000 } : { b4: number; } >b4 : number diff --git a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment4.types b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment4.types index 24f7e8ed0ba..104c694fbbd 100644 --- a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment4.types +++ b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment4.types @@ -1,20 +1,20 @@ === tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment4.ts === const { a = 1, ->a : 1 +>a : any >1 : 1 b = 2, ->b : 2 +>b : any >2 : 2 c = b, // ok ->c : 2 ->b : 2 +>c : any +>b : any d = a, // ok ->d : 1 ->a : 1 +>d : any +>a : any e = f, // error >e : any diff --git a/tests/baselines/reference/objectRestParameter.types b/tests/baselines/reference/objectRestParameter.types index 3d0d1bb619b..831ac9df59f 100644 --- a/tests/baselines/reference/objectRestParameter.types +++ b/tests/baselines/reference/objectRestParameter.types @@ -77,7 +77,7 @@ class C { } function foobar({ bar={}, ...opts }: any = {}) { >foobar : ({ bar, ...opts }?: any) => void ->bar : {} +>bar : any >{} : {} >opts : any >{} : {} diff --git a/tests/baselines/reference/objectRestParameterES5.types b/tests/baselines/reference/objectRestParameterES5.types index e0ebee39317..1b8dd29e29e 100644 --- a/tests/baselines/reference/objectRestParameterES5.types +++ b/tests/baselines/reference/objectRestParameterES5.types @@ -77,7 +77,7 @@ class C { } function foobar({ bar={}, ...opts }: any = {}) { >foobar : ({ bar, ...opts }?: any) => void ->bar : {} +>bar : any >{} : {} >opts : any >{} : {} From ee05d0eb1cfadee576defbae31e8c474b9efcd9e Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 4 Oct 2017 16:03:16 -0700 Subject: [PATCH 026/137] Compile public api so that all the updates are ensured to be correct --- src/harness/unittests/publicApi.ts | 34 ++++++++++++++++--- src/server/project.ts | 2 +- .../reference/api/tsserverlibrary.d.ts | 2 +- 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/harness/unittests/publicApi.ts b/src/harness/unittests/publicApi.ts index bb37dbe9d8d..35acfec57f5 100644 --- a/src/harness/unittests/publicApi.ts +++ b/src/harness/unittests/publicApi.ts @@ -1,10 +1,34 @@ /// describe("Public APIs", () => { - it("for the language service and compiler should be acknowledged when they change", () => { - Harness.Baseline.runBaseline("api/typescript.d.ts", () => Harness.IO.readFile("built/local/typescript.d.ts")); + function verifyApi(fileName: string) { + const builtFile = `built/local/${fileName}`; + const api = `api/${fileName}`; + let fileContent: string; + before(() => { + fileContent = Harness.IO.readFile(builtFile); + }); + + it("should be acknowledged when they change", () => { + Harness.Baseline.runBaseline(api, () => fileContent); + }); + + it("should compile", () => { + const testFile: Harness.Compiler.TestFile = { + unitName: builtFile, + content: fileContent + }; + const inputFiles = [testFile]; + const output = Harness.Compiler.compileFiles(inputFiles, [], /*harnessSettings*/ undefined, /*options*/ {}, /*currentDirectory*/ undefined); + assert(!output.result.errors || !output.result.errors.length, Harness.Compiler.minimalDiagnosticsToString(output.result.errors, /*pretty*/ true)); + }); + } + + describe("for the language service and compiler", () => { + verifyApi("typescript.d.ts"); }); - it("for the language server should be acknowledged when they change", () => { - Harness.Baseline.runBaseline("api/tsserverlibrary.d.ts", () => Harness.IO.readFile("built/local/tsserverlibrary.d.ts")); + + describe("for the language server", () => { + verifyApi("tsserverlibrary.d.ts"); }); -}); \ No newline at end of file +}); diff --git a/src/server/project.ts b/src/server/project.ts index 655f3ed0cfc..ac18738027b 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -296,7 +296,7 @@ namespace ts.server { } } - getCancellationToken() { + getCancellationToken(): HostCancellationToken { return this.cancellationToken; } diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 1feb6b7d073..3bb2ed11674 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -7104,7 +7104,7 @@ declare namespace ts.server { getScriptKind(fileName: string): ScriptKind; getScriptVersion(filename: string): string; getScriptSnapshot(filename: string): IScriptSnapshot; - getCancellationToken(): ThrottledCancellationToken; + getCancellationToken(): HostCancellationToken; getCurrentDirectory(): string; getDefaultLibFileName(): string; useCaseSensitiveFileNames(): boolean; From 249725d4b72a0dcdd5524457c813330002ed07a3 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 4 Oct 2017 13:25:56 -0700 Subject: [PATCH 027/137] Do not report config file errors if the file opened isnt from configured project and that project doesnt have the config errors Fixes #16635 --- src/harness/unittests/telemetry.ts | 34 +++++++--- .../unittests/tsserverProjectSystem.ts | 67 ++++++++++++++++++- src/server/editorServices.ts | 28 +++++--- src/server/project.ts | 6 +- src/server/session.ts | 8 +-- .../reference/api/tsserverlibrary.d.ts | 1 + 6 files changed, 116 insertions(+), 28 deletions(-) diff --git a/src/harness/unittests/telemetry.ts b/src/harness/unittests/telemetry.ts index 7c098066321..d2a54fdc1bb 100644 --- a/src/harness/unittests/telemetry.ts +++ b/src/harness/unittests/telemetry.ts @@ -7,7 +7,7 @@ namespace ts.projectSystem { const file = makeFile("/a.js"); const et = new EventTracker([file]); et.service.openClientFile(file.path); - assert.equal(et.getEvents().length, 0); + assert.equal(et.getEventsWithName(ts.server.ProjectInfoTelemetryEvent).length, 0); }); it("only sends an event once", () => { @@ -25,12 +25,12 @@ namespace ts.projectSystem { et.service.openClientFile(file2.path); checkNumberOfProjects(et.service, { inferredProjects: 1 }); - assert.equal(et.getEvents().length, 0); + assert.equal(et.getEventsWithName(ts.server.ProjectInfoTelemetryEvent).length, 0); et.service.openClientFile(file.path); checkNumberOfProjects(et.service, { configuredProjects: 1, inferredProjects: 1 }); - assert.equal(et.getEvents().length, 0); + assert.equal(et.getEventsWithName(ts.server.ProjectInfoTelemetryEvent).length, 0); }); it("counts files by extension", () => { @@ -219,7 +219,7 @@ namespace ts.projectSystem { const et = new EventTracker([tsconfig, file]); et.host.getFileSize = () => server.maxProgramSizeForNonTsFiles + 1; et.service.openClientFile(file.path); - et.getEvent(server.ProjectLanguageServiceStateEvent, /*mayBeMore*/ true); + et.getEvent(server.ProjectLanguageServiceStateEvent); et.assertProjectInfoTelemetryEvent({ projectId: Harness.mockHash("/jsconfig.json"), fileStats: fileStats({ js: 1 }), @@ -255,6 +255,17 @@ namespace ts.projectSystem { return events; } + getEventsWithName(eventName: T["eventName"]): ReadonlyArray { + let events: T[]; + removeWhere(this.events, event => { + if (event.eventName === eventName) { + (events || (events = [])).push(event as T); + return true; + } + }); + return events || emptyArray; + } + assertProjectInfoTelemetryEvent(partial: Partial, configFile?: string): void { assert.deepEqual(this.getEvent(ts.server.ProjectInfoTelemetryEvent), { projectId: Harness.mockHash(configFile || "/tsconfig.json"), @@ -278,10 +289,17 @@ namespace ts.projectSystem { }); } - getEvent(eventName: T["eventName"], mayBeMore = false): T["data"] { - if (mayBeMore) { assert(this.events.length !== 0); } - else { assert.equal(this.events.length, 1); } - const event = this.events.shift(); + getEvent(eventName: T["eventName"]): T["data"] { + let event: server.ProjectServiceEvent; + removeWhere(this.events, e => { + if (e.eventName === eventName) { + if (event) { + assert(false, "more than one event found"); + } + event = e; + return true; + } + }); assert.equal(event.eventName, eventName); return event.data; } diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index 06e2beeaaa6..e8b18ea3b54 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -463,7 +463,7 @@ namespace ts.projectSystem { const { configFileName, configFileErrors } = projectService.openClientFile(file1.path); assert(configFileName, "should find config file"); - assert.isTrue(!configFileErrors, `expect no errors in config file, got ${JSON.stringify(configFileErrors)}`); + assert.isTrue(!configFileErrors || configFileErrors.length === 0, `expect no errors in config file, got ${JSON.stringify(configFileErrors)}`); checkNumberOfInferredProjects(projectService, 0); checkNumberOfConfiguredProjects(projectService, 1); @@ -503,7 +503,7 @@ namespace ts.projectSystem { const { configFileName, configFileErrors } = projectService.openClientFile(file1.path); assert(configFileName, "should find config file"); - assert.isTrue(!configFileErrors, `expect no errors in config file, got ${JSON.stringify(configFileErrors)}`); + assert.isTrue(!configFileErrors || configFileErrors.length === 0, `expect no errors in config file, got ${JSON.stringify(configFileErrors)}`); checkNumberOfInferredProjects(projectService, 0); checkNumberOfConfiguredProjects(projectService, 1); @@ -3169,6 +3169,69 @@ namespace ts.projectSystem { host.runQueuedTimeoutCallbacks(); serverEventManager.checkEventCountOfType("configFileDiag", 3); }); + + it("are generated when the config file doesnot include file opened but has errors", () => { + const serverEventManager = new TestServerEventManager(); + const file = { + path: "/a/b/app.ts", + content: "let x = 10" + }; + const file2 = { + path: "/a/b/test.ts", + content: "let x = 10" + }; + const configFile = { + path: "/a/b/tsconfig.json", + content: `{ + "compilerOptions": { + "foo": "bar", + "allowJS": true + }, + "files": ["app.ts"] + }` + }; + + const host = createServerHost([file, file2, libFile, configFile]); + const session = createSession(host, { + canUseEvents: true, + eventHandler: serverEventManager.handler + }); + openFilesForSession([file2], session); + serverEventManager.checkEventCountOfType("configFileDiag", 1); + for (const event of serverEventManager.events) { + if (event.eventName === "configFileDiag") { + assert.equal(event.data.configFileName, configFile.path); + assert.equal(event.data.triggerFile, file2.path); + return; + } + } + }); + + it("are not generated when the config file doesnot include file opened and doesnt contain any errors", () => { + const serverEventManager = new TestServerEventManager(); + const file = { + path: "/a/b/app.ts", + content: "let x = 10" + }; + const file2 = { + path: "/a/b/test.ts", + content: "let x = 10" + }; + const configFile = { + path: "/a/b/tsconfig.json", + content: `{ + "files": ["app.ts"] + }` + }; + + const host = createServerHost([file, file2, libFile, configFile]); + const session = createSession(host, { + canUseEvents: true, + eventHandler: serverEventManager.handler + }); + openFilesForSession([file2], session); + serverEventManager.checkEventCountOfType("configFileDiag", 0); + }); }); describe("skipLibCheck", () => { diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 25a285929be..32358ba3c4c 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -1561,14 +1561,17 @@ namespace ts.server { project.watchWildcards(projectOptions.wildcardDirectories); } this.updateNonInferredProject(project, projectOptions.files, fileNamePropertyReader, projectOptions.compilerOptions, projectOptions.typeAcquisition, projectOptions.compileOnSave); + this.sendConfigFileDiagEvent(project, configFileName); + } + private sendConfigFileDiagEvent(project: ConfiguredProject, triggerFile: NormalizedPath) { if (!this.eventHandler) { return; } this.eventHandler({ eventName: ConfigFileDiagEvent, - data: { configFileName, diagnostics: project.getGlobalProjectErrors() || [], triggerFile: configFileName } + data: { configFileName: project.getConfigFilePath(), diagnostics: project.getAllProjectErrors(), triggerFile } }); } @@ -1888,6 +1891,7 @@ namespace ts.server { openClientFileWithNormalizedPath(fileName: NormalizedPath, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, projectRootPath?: NormalizedPath): OpenConfiguredProjectResult { let configFileName: NormalizedPath; + let sendConfigFileDiagEvent = false; let configFileErrors: ReadonlyArray; const info = this.getOrCreateScriptInfoOpenedByClientForNormalizedPath(fileName, fileContent, scriptKind, hasMixedContent); @@ -1898,14 +1902,8 @@ namespace ts.server { project = this.findConfiguredProjectByProjectName(configFileName); if (!project) { project = this.createConfiguredProject(configFileName); - - // even if opening config file was successful, it could still - // contain errors that were tolerated. - const errors = project.getGlobalProjectErrors(); - if (errors && errors.length > 0) { - // set configFileErrors only when the errors array is non-empty - configFileErrors = errors; - } + // Send the event only if the project got created as part of this open request + sendConfigFileDiagEvent = true; } } } @@ -1919,10 +1917,21 @@ namespace ts.server { // At this point if file is part of any any configured or external project, then it would be present in the containing projects // So if it still doesnt have any containing projects, it needs to be part of inferred project if (info.isOrphan()) { + // Since the file isnt part of configured project, + // report config file and its error only if config file found had errors (and hence may be didnt include the file) + if (sendConfigFileDiagEvent && !project.getAllProjectErrors().length) { + configFileName = undefined; + sendConfigFileDiagEvent = false; + } this.assignOrphanScriptInfoToInferredProject(info, projectRootPath); } this.addToListOfOpenFiles(info); + if (sendConfigFileDiagEvent) { + configFileErrors = project.getAllProjectErrors(); + this.sendConfigFileDiagEvent(project as ConfiguredProject, fileName); + } + // Remove the configured projects that have zero references from open files. // This was postponed from closeOpenFile to after opening next file, // so that we can reuse the project if we need to right away @@ -1938,6 +1947,7 @@ namespace ts.server { // the file from that old project is reopened because of opening file from here. this.deleteOrphanScriptInfoNotInAnyProject(); this.printProjects(); + return { configFileName, configFileErrors }; } diff --git a/src/server/project.ts b/src/server/project.ts index 655f3ed0cfc..203355ad9db 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -1271,14 +1271,14 @@ namespace ts.server { * Get the errors that dont have any file name associated */ getGlobalProjectErrors(): ReadonlyArray { - return filter(this.projectErrors, diagnostic => !diagnostic.file); + return filter(this.projectErrors, diagnostic => !diagnostic.file) || emptyArray; } /** * Get all the project errors */ getAllProjectErrors(): ReadonlyArray { - return this.projectErrors; + return this.projectErrors || emptyArray; } setProjectErrors(projectErrors: Diagnostic[]) { @@ -1335,6 +1335,8 @@ namespace ts.server { } this.stopWatchingWildCards(); + this.projectErrors = undefined; + this.configFileSpecs = undefined; } addOpenRef() { diff --git a/src/server/session.ts b/src/server/session.ts index 57dac7ec799..59762f8191b 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -969,13 +969,7 @@ namespace ts.server { * @param fileContent is a version of the file content that is known to be more up to date than the one on disk */ private openClientFile(fileName: NormalizedPath, fileContent?: string, scriptKind?: ScriptKind, projectRootPath?: NormalizedPath) { - const { configFileName, configFileErrors } = this.projectService.openClientFileWithNormalizedPath(fileName, fileContent, scriptKind, /*hasMixedContent*/ false, projectRootPath); - if (this.eventHandler) { - this.eventHandler({ - eventName: "configFileDiag", - data: { triggerFile: fileName, configFileName, diagnostics: configFileErrors || emptyArray } - }); - } + this.projectService.openClientFileWithNormalizedPath(fileName, fileContent, scriptKind, /*hasMixedContent*/ false, projectRootPath); } private getPosition(args: protocol.FileLocationRequestArgs, scriptInfo: ScriptInfo): number { diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 1feb6b7d073..b9b72dec922 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -7517,6 +7517,7 @@ declare namespace ts.server { private createConfiguredProject(configFileName); private updateNonInferredProjectFiles(project, files, propertyReader); private updateNonInferredProject(project, newUncheckedFiles, propertyReader, newOptions, newTypeAcquisition, compileOnSave); + private sendConfigFileDiagEvent(project, triggerFile); private getOrCreateInferredProjectForProjectRootPathIfEnabled(info, projectRootPath); private getOrCreateSingleInferredProjectIfEnabled(); private createInferredProject(rootDirectoryForResolution, isSingleInferredProject?, projectRootPath?); From bf4ca30bc30b273f9bae31a2992a8c2481d8a850 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 4 Oct 2017 17:29:06 -0700 Subject: [PATCH 028/137] Let builder find out from imports/typereference directives if file references have changed. This is needed to ensure that the ambient module addition takes effect Fixes #15632 --- src/compiler/builder.ts | 7 +- src/compiler/program.ts | 3 +- src/compiler/types.ts | 2 - src/harness/unittests/tscWatchMode.ts | 142 ++++++++++++++++++++++++++ 4 files changed, 146 insertions(+), 8 deletions(-) diff --git a/src/compiler/builder.ts b/src/compiler/builder.ts index 6bb94ea2de7..03eb5b7e8ae 100644 --- a/src/compiler/builder.ts +++ b/src/compiler/builder.ts @@ -77,8 +77,8 @@ namespace ts { */ onUpdateSourceFile(program: Program, sourceFile: SourceFile): void; /** - * Called when source file has not changed but has some of the resolutions invalidated - * If returned true, builder will mark the file as changed (noting that something associated with file has changed) + * Called when source file has not changed + * If returned true, builder will mark the file as changed (noting that something associated with file has changed eg. module resolution) */ onUpdateSourceFileWithSameVersion(program: Program, sourceFile: SourceFile): boolean; /** @@ -161,8 +161,7 @@ namespace ts { existingInfo.version = sourceFile.version; emitHandler.onUpdateSourceFile(program, sourceFile); } - else if (program.hasInvalidatedResolution(sourceFile.path) && - emitHandler.onUpdateSourceFileWithSameVersion(program, sourceFile)) { + else if (emitHandler.onUpdateSourceFileWithSameVersion(program, sourceFile)) { registerChangedFile(sourceFile.path, sourceFile.fileName); } } diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 24d7707f50d..757e7827f27 100755 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -663,8 +663,7 @@ namespace ts { dropDiagnosticsProducingTypeChecker, getSourceFileFromReference, sourceFileToPackageName, - redirectTargetsSet, - hasInvalidatedResolution + redirectTargetsSet }; verifyCompilerOptions(); diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 578c2d23c4f..a6fccabd4dc 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2525,8 +2525,6 @@ namespace ts { /* @internal */ sourceFileToPackageName: Map; /** Set of all source files that some other source file redirects to. */ /* @internal */ redirectTargetsSet: Map; - /** Returns true when file in the program had invalidated resolution at the time of program creation. */ - /* @internal */ hasInvalidatedResolution: HasInvalidatedResolution; } /* @internal */ diff --git a/src/harness/unittests/tscWatchMode.ts b/src/harness/unittests/tscWatchMode.ts index 5267bbcf047..31d79df21c1 100644 --- a/src/harness/unittests/tscWatchMode.ts +++ b/src/harness/unittests/tscWatchMode.ts @@ -1655,5 +1655,147 @@ namespace ts.tscWatch { assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called."); checkOutputDoesNotContain(host, [barNotFound]); }); + + it("works when module resolution changes to ambient module", () => { + const root = { + path: "/a/b/foo.ts", + content: `import * as fs from "fs";` + }; + + const packageJson = { + path: "/a/b/node_modules/@types/node/package.json", + content: ` +{ + "main": "" +} +` + }; + + const nodeType = { + path: "/a/b/node_modules/@types/node/index.d.ts", + content: ` +declare module "fs" { + export interface Stats { + isFile(): boolean; + isDirectory(): boolean; + isBlockDevice(): boolean; + isCharacterDevice(): boolean; + isSymbolicLink(): boolean; + isFIFO(): boolean; + isSocket(): boolean; + dev: number; + ino: number; + mode: number; + nlink: number; + uid: number; + gid: number; + rdev: number; + size: number; + blksize: number; + blocks: number; + atimeMs: number; + mtimeMs: number; + ctimeMs: number; + birthtimeMs: number; + atime: Date; + mtime: Date; + ctime: Date; + birthtime: Date; + } +}` + }; + + const files = [root, libFile]; + const filesWithNodeType = files.concat(packageJson, nodeType); + const host = createWatchedSystem(files, { currentDirectory: "/a/b" }); + + createWatchModeWithoutConfigFile([root.path], host, { }); + + const fsNotFound = `foo.ts(1,21): error TS2307: Cannot find module 'fs'.\n`; + checkOutputContains(host, [fsNotFound]); + host.clearOutput(); + + host.reloadFS(filesWithNodeType); + host.runQueuedTimeoutCallbacks(); + checkOutputDoesNotContain(host, [fsNotFound]); + }); + + it("works when included file with ambient module changes", () => { + const root = { + path: "/a/b/foo.ts", + content: ` +import * as fs from "fs"; +import * as u from "url"; +` + }; + + const file = { + path: "/a/b/bar.d.ts", + content: ` +declare module "url" { + export interface Url { + href?: string; + protocol?: string; + auth?: string; + hostname?: string; + port?: string; + host?: string; + pathname?: string; + search?: string; + query?: string | any; + slashes?: boolean; + hash?: string; + path?: string; + } +} +` + }; + + const fileContentWithFS = ` +declare module "fs" { + export interface Stats { + isFile(): boolean; + isDirectory(): boolean; + isBlockDevice(): boolean; + isCharacterDevice(): boolean; + isSymbolicLink(): boolean; + isFIFO(): boolean; + isSocket(): boolean; + dev: number; + ino: number; + mode: number; + nlink: number; + uid: number; + gid: number; + rdev: number; + size: number; + blksize: number; + blocks: number; + atimeMs: number; + mtimeMs: number; + ctimeMs: number; + birthtimeMs: number; + atime: Date; + mtime: Date; + ctime: Date; + birthtime: Date; + } +} +`; + + const files = [root, file, libFile]; + const host = createWatchedSystem(files, { currentDirectory: "/a/b" }); + + createWatchModeWithoutConfigFile([root.path, file.path], host, {}); + + const fsNotFound = `foo.ts(2,21): error TS2307: Cannot find module 'fs'.\n`; + checkOutputContains(host, [fsNotFound]); + host.clearOutput(); + + file.content += fileContentWithFS; + host.reloadFS(files); + host.runQueuedTimeoutCallbacks(); + checkOutputDoesNotContain(host, [fsNotFound]); + }); }); } From b69652b137c280b16f7325b8dedd3bf029339f27 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Thu, 5 Oct 2017 09:01:39 -0700 Subject: [PATCH 029/137] Set symbol on union of spreads Previously, it was only set on the top-level type, and only if that top-level type was an object type. Now it uses `forEachType` to set the symbol on every object type in the union as well, if `getSpreadType` returns a union. --- src/compiler/checker.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index fbe192c5629..d7585bd6e9a 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -13917,13 +13917,15 @@ namespace ts { if (propertiesArray.length > 0) { spread = getSpreadType(spread, createObjectLiteralType()); } - if (spread.flags & TypeFlags.Object) { - // only set the symbol and flags if this is a (fresh) object type - spread.flags |= propagatedFlags; - spread.flags |= TypeFlags.FreshLiteral; - (spread as ObjectType).objectFlags |= ObjectFlags.ObjectLiteral; - spread.symbol = node.symbol; - } + // only set the symbol and flags if this is a (fresh) object type + forEachType(spread, t => { + if (t.flags & TypeFlags.Object) { + t.flags |= propagatedFlags; + t.flags |= TypeFlags.FreshLiteral; + (t as ObjectType).objectFlags |= ObjectFlags.ObjectLiteral; + t.symbol = node.symbol + } + }); return spread; } From 0cb12b32a5abbe37b847fd93c94a435319480e61 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Thu, 5 Oct 2017 09:03:03 -0700 Subject: [PATCH 030/137] Test:{} in union from spread gets implicit index signature Also tighten up the existing test code in the file. --- .../objectSpreadIndexSignature.errors.txt | 19 ++++++ .../reference/objectSpreadIndexSignature.js | 28 ++++----- .../objectSpreadIndexSignature.symbols | 63 +++++++++---------- .../objectSpreadIndexSignature.types | 56 ++++++++--------- .../spread/objectSpreadIndexSignature.ts | 21 +++---- 5 files changed, 98 insertions(+), 89 deletions(-) create mode 100644 tests/baselines/reference/objectSpreadIndexSignature.errors.txt diff --git a/tests/baselines/reference/objectSpreadIndexSignature.errors.txt b/tests/baselines/reference/objectSpreadIndexSignature.errors.txt new file mode 100644 index 00000000000..ee7425909c2 --- /dev/null +++ b/tests/baselines/reference/objectSpreadIndexSignature.errors.txt @@ -0,0 +1,19 @@ +tests/cases/conformance/types/spread/objectSpreadIndexSignature.ts(6,1): error TS7017: Element implicitly has an 'any' type because type '{ b: number; a: number; }' has no index signature. + + +==== tests/cases/conformance/types/spread/objectSpreadIndexSignature.ts (1 errors) ==== + declare let indexed1: { [n: string]: number; a: number; }; + declare let indexed2: { [n: string]: boolean; c: boolean; }; + declare let indexed3: { [n: string]: number }; + let i = { ...indexed1, b: 11 }; + // only indexed has indexer, so i[101]: any + i[101]; + ~~~~~~ +!!! error TS7017: Element implicitly has an 'any' type because type '{ b: number; a: number; }' has no index signature. + let ii = { ...indexed1, ...indexed2 }; + // both have indexer, so i[1001]: number | boolean + ii[1001]; + + declare const b: boolean; + indexed3 = { ...b ? indexed3 : undefined }; + \ No newline at end of file diff --git a/tests/baselines/reference/objectSpreadIndexSignature.js b/tests/baselines/reference/objectSpreadIndexSignature.js index 22e92e6a844..283129036da 100644 --- a/tests/baselines/reference/objectSpreadIndexSignature.js +++ b/tests/baselines/reference/objectSpreadIndexSignature.js @@ -1,23 +1,20 @@ //// [objectSpreadIndexSignature.ts] -interface Indexed { - [n: string]: number; - a: number; -} -interface Indexed2 { - [n: string]: boolean; - c: boolean; -} -let indexed: Indexed; -let indexed2: Indexed2; -let i = { ...indexed, b: 11 }; +declare let indexed1: { [n: string]: number; a: number; }; +declare let indexed2: { [n: string]: boolean; c: boolean; }; +declare let indexed3: { [n: string]: number }; +let i = { ...indexed1, b: 11 }; // only indexed has indexer, so i[101]: any i[101]; -let ii = { ...indexed, ...indexed2 }; +let ii = { ...indexed1, ...indexed2 }; // both have indexer, so i[1001]: number | boolean ii[1001]; + +declare const b: boolean; +indexed3 = { ...b ? indexed3 : undefined }; //// [objectSpreadIndexSignature.js] +"use strict"; var __assign = (this && this.__assign) || Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; @@ -26,11 +23,10 @@ var __assign = (this && this.__assign) || Object.assign || function(t) { } return t; }; -var indexed; -var indexed2; -var i = __assign({}, indexed, { b: 11 }); +var i = __assign({}, indexed1, { b: 11 }); // only indexed has indexer, so i[101]: any i[101]; -var ii = __assign({}, indexed, indexed2); +var ii = __assign({}, indexed1, indexed2); // both have indexer, so i[1001]: number | boolean ii[1001]; +indexed3 = __assign({}, b ? indexed3 : undefined); diff --git a/tests/baselines/reference/objectSpreadIndexSignature.symbols b/tests/baselines/reference/objectSpreadIndexSignature.symbols index cd64b157196..d08cfff53ff 100644 --- a/tests/baselines/reference/objectSpreadIndexSignature.symbols +++ b/tests/baselines/reference/objectSpreadIndexSignature.symbols @@ -1,45 +1,42 @@ === tests/cases/conformance/types/spread/objectSpreadIndexSignature.ts === -interface Indexed { ->Indexed : Symbol(Indexed, Decl(objectSpreadIndexSignature.ts, 0, 0)) +declare let indexed1: { [n: string]: number; a: number; }; +>indexed1 : Symbol(indexed1, Decl(objectSpreadIndexSignature.ts, 0, 11)) +>n : Symbol(n, Decl(objectSpreadIndexSignature.ts, 0, 25)) +>a : Symbol(a, Decl(objectSpreadIndexSignature.ts, 0, 44)) - [n: string]: number; ->n : Symbol(n, Decl(objectSpreadIndexSignature.ts, 1, 5)) +declare let indexed2: { [n: string]: boolean; c: boolean; }; +>indexed2 : Symbol(indexed2, Decl(objectSpreadIndexSignature.ts, 1, 11)) +>n : Symbol(n, Decl(objectSpreadIndexSignature.ts, 1, 25)) +>c : Symbol(c, Decl(objectSpreadIndexSignature.ts, 1, 45)) - a: number; ->a : Symbol(Indexed.a, Decl(objectSpreadIndexSignature.ts, 1, 24)) -} -interface Indexed2 { ->Indexed2 : Symbol(Indexed2, Decl(objectSpreadIndexSignature.ts, 3, 1)) +declare let indexed3: { [n: string]: number }; +>indexed3 : Symbol(indexed3, Decl(objectSpreadIndexSignature.ts, 2, 11)) +>n : Symbol(n, Decl(objectSpreadIndexSignature.ts, 2, 25)) - [n: string]: boolean; ->n : Symbol(n, Decl(objectSpreadIndexSignature.ts, 5, 5)) - - c: boolean; ->c : Symbol(Indexed2.c, Decl(objectSpreadIndexSignature.ts, 5, 25)) -} -let indexed: Indexed; ->indexed : Symbol(indexed, Decl(objectSpreadIndexSignature.ts, 8, 3)) ->Indexed : Symbol(Indexed, Decl(objectSpreadIndexSignature.ts, 0, 0)) - -let indexed2: Indexed2; ->indexed2 : Symbol(indexed2, Decl(objectSpreadIndexSignature.ts, 9, 3)) ->Indexed2 : Symbol(Indexed2, Decl(objectSpreadIndexSignature.ts, 3, 1)) - -let i = { ...indexed, b: 11 }; ->i : Symbol(i, Decl(objectSpreadIndexSignature.ts, 10, 3)) ->indexed : Symbol(indexed, Decl(objectSpreadIndexSignature.ts, 8, 3)) ->b : Symbol(b, Decl(objectSpreadIndexSignature.ts, 10, 21)) +let i = { ...indexed1, b: 11 }; +>i : Symbol(i, Decl(objectSpreadIndexSignature.ts, 3, 3)) +>indexed1 : Symbol(indexed1, Decl(objectSpreadIndexSignature.ts, 0, 11)) +>b : Symbol(b, Decl(objectSpreadIndexSignature.ts, 3, 22)) // only indexed has indexer, so i[101]: any i[101]; ->i : Symbol(i, Decl(objectSpreadIndexSignature.ts, 10, 3)) +>i : Symbol(i, Decl(objectSpreadIndexSignature.ts, 3, 3)) -let ii = { ...indexed, ...indexed2 }; ->ii : Symbol(ii, Decl(objectSpreadIndexSignature.ts, 13, 3)) ->indexed : Symbol(indexed, Decl(objectSpreadIndexSignature.ts, 8, 3)) ->indexed2 : Symbol(indexed2, Decl(objectSpreadIndexSignature.ts, 9, 3)) +let ii = { ...indexed1, ...indexed2 }; +>ii : Symbol(ii, Decl(objectSpreadIndexSignature.ts, 6, 3)) +>indexed1 : Symbol(indexed1, Decl(objectSpreadIndexSignature.ts, 0, 11)) +>indexed2 : Symbol(indexed2, Decl(objectSpreadIndexSignature.ts, 1, 11)) // both have indexer, so i[1001]: number | boolean ii[1001]; ->ii : Symbol(ii, Decl(objectSpreadIndexSignature.ts, 13, 3)) +>ii : Symbol(ii, Decl(objectSpreadIndexSignature.ts, 6, 3)) + +declare const b: boolean; +>b : Symbol(b, Decl(objectSpreadIndexSignature.ts, 10, 13)) + +indexed3 = { ...b ? indexed3 : undefined }; +>indexed3 : Symbol(indexed3, Decl(objectSpreadIndexSignature.ts, 2, 11)) +>b : Symbol(b, Decl(objectSpreadIndexSignature.ts, 10, 13)) +>indexed3 : Symbol(indexed3, Decl(objectSpreadIndexSignature.ts, 2, 11)) +>undefined : Symbol(undefined) diff --git a/tests/baselines/reference/objectSpreadIndexSignature.types b/tests/baselines/reference/objectSpreadIndexSignature.types index 5eebc2ffa02..eff3b04b8f6 100644 --- a/tests/baselines/reference/objectSpreadIndexSignature.types +++ b/tests/baselines/reference/objectSpreadIndexSignature.types @@ -1,34 +1,22 @@ === tests/cases/conformance/types/spread/objectSpreadIndexSignature.ts === -interface Indexed { ->Indexed : Indexed - - [n: string]: number; +declare let indexed1: { [n: string]: number; a: number; }; +>indexed1 : { [n: string]: number; a: number; } >n : string - - a: number; >a : number -} -interface Indexed2 { ->Indexed2 : Indexed2 - [n: string]: boolean; +declare let indexed2: { [n: string]: boolean; c: boolean; }; +>indexed2 : { [n: string]: boolean; c: boolean; } +>n : string +>c : boolean + +declare let indexed3: { [n: string]: number }; +>indexed3 : { [n: string]: number; } >n : string - c: boolean; ->c : boolean -} -let indexed: Indexed; ->indexed : Indexed ->Indexed : Indexed - -let indexed2: Indexed2; ->indexed2 : Indexed2 ->Indexed2 : Indexed2 - -let i = { ...indexed, b: 11 }; +let i = { ...indexed1, b: 11 }; >i : { b: number; a: number; } ->{ ...indexed, b: 11 } : { b: number; a: number; } ->indexed : Indexed +>{ ...indexed1, b: 11 } : { b: number; a: number; } +>indexed1 : { [n: string]: number; a: number; } >b : number >11 : 11 @@ -38,11 +26,11 @@ i[101]; >i : { b: number; a: number; } >101 : 101 -let ii = { ...indexed, ...indexed2 }; +let ii = { ...indexed1, ...indexed2 }; >ii : { [x: string]: number | boolean; c: boolean; a: number; } ->{ ...indexed, ...indexed2 } : { [x: string]: number | boolean; c: boolean; a: number; } ->indexed : Indexed ->indexed2 : Indexed2 +>{ ...indexed1, ...indexed2 } : { [x: string]: number | boolean; c: boolean; a: number; } +>indexed1 : { [n: string]: number; a: number; } +>indexed2 : { [n: string]: boolean; c: boolean; } // both have indexer, so i[1001]: number | boolean ii[1001]; @@ -50,3 +38,15 @@ ii[1001]; >ii : { [x: string]: number | boolean; c: boolean; a: number; } >1001 : 1001 +declare const b: boolean; +>b : boolean + +indexed3 = { ...b ? indexed3 : undefined }; +>indexed3 = { ...b ? indexed3 : undefined } : {} | { [n: string]: number; } +>indexed3 : { [n: string]: number; } +>{ ...b ? indexed3 : undefined } : {} | { [n: string]: number; } +>b ? indexed3 : undefined : { [n: string]: number; } | undefined +>b : boolean +>indexed3 : { [n: string]: number; } +>undefined : undefined + diff --git a/tests/cases/conformance/types/spread/objectSpreadIndexSignature.ts b/tests/cases/conformance/types/spread/objectSpreadIndexSignature.ts index ae46f2547d5..83649d465f1 100644 --- a/tests/cases/conformance/types/spread/objectSpreadIndexSignature.ts +++ b/tests/cases/conformance/types/spread/objectSpreadIndexSignature.ts @@ -1,16 +1,13 @@ -interface Indexed { - [n: string]: number; - a: number; -} -interface Indexed2 { - [n: string]: boolean; - c: boolean; -} -let indexed: Indexed; -let indexed2: Indexed2; -let i = { ...indexed, b: 11 }; +// @strict: true +declare let indexed1: { [n: string]: number; a: number; }; +declare let indexed2: { [n: string]: boolean; c: boolean; }; +declare let indexed3: { [n: string]: number }; +let i = { ...indexed1, b: 11 }; // only indexed has indexer, so i[101]: any i[101]; -let ii = { ...indexed, ...indexed2 }; +let ii = { ...indexed1, ...indexed2 }; // both have indexer, so i[1001]: number | boolean ii[1001]; + +declare const b: boolean; +indexed3 = { ...b ? indexed3 : undefined }; From 97ee9516d671eb52fe96fa6694f6a2bbe12fcf29 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Thu, 5 Oct 2017 09:10:55 -0700 Subject: [PATCH 031/137] Update baselines --- .../excessPropertyCheckWithUnions.symbols | 144 +++++++++++++ .../excessPropertyCheckWithUnions.types | 196 ++++++++++++++++++ 2 files changed, 340 insertions(+) create mode 100644 tests/baselines/reference/excessPropertyCheckWithUnions.symbols create mode 100644 tests/baselines/reference/excessPropertyCheckWithUnions.types diff --git a/tests/baselines/reference/excessPropertyCheckWithUnions.symbols b/tests/baselines/reference/excessPropertyCheckWithUnions.symbols new file mode 100644 index 00000000000..332166e396c --- /dev/null +++ b/tests/baselines/reference/excessPropertyCheckWithUnions.symbols @@ -0,0 +1,144 @@ +=== tests/cases/compiler/excessPropertyCheckWithUnions.ts === +type ADT = { +>ADT : Symbol(ADT, Decl(excessPropertyCheckWithUnions.ts, 0, 0)) + + tag: "A", +>tag : Symbol(tag, Decl(excessPropertyCheckWithUnions.ts, 0, 12)) + + a1: string +>a1 : Symbol(a1, Decl(excessPropertyCheckWithUnions.ts, 1, 13)) + +} | { + tag: "D", +>tag : Symbol(tag, Decl(excessPropertyCheckWithUnions.ts, 3, 5)) + + d20: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 +>d20 : Symbol(d20, Decl(excessPropertyCheckWithUnions.ts, 4, 13)) + +} | { + tag: "T", +>tag : Symbol(tag, Decl(excessPropertyCheckWithUnions.ts, 6, 5)) +} +let wrong: ADT = { tag: "T", a1: "extra" } +>wrong : Symbol(wrong, Decl(excessPropertyCheckWithUnions.ts, 9, 3)) +>ADT : Symbol(ADT, Decl(excessPropertyCheckWithUnions.ts, 0, 0)) +>tag : Symbol(tag, Decl(excessPropertyCheckWithUnions.ts, 9, 18)) +>a1 : Symbol(a1, Decl(excessPropertyCheckWithUnions.ts, 9, 28)) + +wrong = { tag: "A", d20: 12 } +>wrong : Symbol(wrong, Decl(excessPropertyCheckWithUnions.ts, 9, 3)) +>tag : Symbol(tag, Decl(excessPropertyCheckWithUnions.ts, 10, 9)) +>d20 : Symbol(d20, Decl(excessPropertyCheckWithUnions.ts, 10, 19)) + +wrong = { tag: "D" } +>wrong : Symbol(wrong, Decl(excessPropertyCheckWithUnions.ts, 9, 3)) +>tag : Symbol(tag, Decl(excessPropertyCheckWithUnions.ts, 11, 9)) + +type Ambiguous = { +>Ambiguous : Symbol(Ambiguous, Decl(excessPropertyCheckWithUnions.ts, 11, 20)) + + tag: "A", +>tag : Symbol(tag, Decl(excessPropertyCheckWithUnions.ts, 13, 18)) + + x: string +>x : Symbol(x, Decl(excessPropertyCheckWithUnions.ts, 14, 13)) + +} | { + tag: "A", +>tag : Symbol(tag, Decl(excessPropertyCheckWithUnions.ts, 16, 5)) + + y: number +>y : Symbol(y, Decl(excessPropertyCheckWithUnions.ts, 17, 13)) + +} | { + tag: "B", +>tag : Symbol(tag, Decl(excessPropertyCheckWithUnions.ts, 19, 5)) + + z: boolean +>z : Symbol(z, Decl(excessPropertyCheckWithUnions.ts, 20, 13)) + +} | { + tag: "C" +>tag : Symbol(tag, Decl(excessPropertyCheckWithUnions.ts, 22, 5)) +} +let amb: Ambiguous +>amb : Symbol(amb, Decl(excessPropertyCheckWithUnions.ts, 25, 3)) +>Ambiguous : Symbol(Ambiguous, Decl(excessPropertyCheckWithUnions.ts, 11, 20)) + +// no error for ambiguous tag, even when it could satisfy both constituents at once +amb = { tag: "A", x: "hi" } +>amb : Symbol(amb, Decl(excessPropertyCheckWithUnions.ts, 25, 3)) +>tag : Symbol(tag, Decl(excessPropertyCheckWithUnions.ts, 27, 7)) +>x : Symbol(x, Decl(excessPropertyCheckWithUnions.ts, 27, 17)) + +amb = { tag: "A", y: 12 } +>amb : Symbol(amb, Decl(excessPropertyCheckWithUnions.ts, 25, 3)) +>tag : Symbol(tag, Decl(excessPropertyCheckWithUnions.ts, 28, 7)) +>y : Symbol(y, Decl(excessPropertyCheckWithUnions.ts, 28, 17)) + +amb = { tag: "A", x: "hi", y: 12 } +>amb : Symbol(amb, Decl(excessPropertyCheckWithUnions.ts, 25, 3)) +>tag : Symbol(tag, Decl(excessPropertyCheckWithUnions.ts, 29, 7)) +>x : Symbol(x, Decl(excessPropertyCheckWithUnions.ts, 29, 17)) +>y : Symbol(y, Decl(excessPropertyCheckWithUnions.ts, 29, 26)) + +// correctly error on excess property 'extra', even when ambiguous +amb = { tag: "A", x: "hi", extra: 12 } +>amb : Symbol(amb, Decl(excessPropertyCheckWithUnions.ts, 25, 3)) +>tag : Symbol(tag, Decl(excessPropertyCheckWithUnions.ts, 32, 7)) +>x : Symbol(x, Decl(excessPropertyCheckWithUnions.ts, 32, 17)) +>extra : Symbol(extra, Decl(excessPropertyCheckWithUnions.ts, 32, 26)) + +amb = { tag: "A", y: 12, extra: 12 } +>amb : Symbol(amb, Decl(excessPropertyCheckWithUnions.ts, 25, 3)) +>tag : Symbol(tag, Decl(excessPropertyCheckWithUnions.ts, 33, 7)) +>y : Symbol(y, Decl(excessPropertyCheckWithUnions.ts, 33, 17)) +>extra : Symbol(extra, Decl(excessPropertyCheckWithUnions.ts, 33, 24)) + +// assignability errors still work. +// But note that the error for `z: true` is the fallback one of reporting on +// the last constituent since assignability error reporting can't find a single best discriminant either. +amb = { tag: "A" } +>amb : Symbol(amb, Decl(excessPropertyCheckWithUnions.ts, 25, 3)) +>tag : Symbol(tag, Decl(excessPropertyCheckWithUnions.ts, 38, 7)) + +amb = { tag: "A", z: true } +>amb : Symbol(amb, Decl(excessPropertyCheckWithUnions.ts, 25, 3)) +>tag : Symbol(tag, Decl(excessPropertyCheckWithUnions.ts, 39, 7)) +>z : Symbol(z, Decl(excessPropertyCheckWithUnions.ts, 39, 17)) + +type Overlapping = +>Overlapping : Symbol(Overlapping, Decl(excessPropertyCheckWithUnions.ts, 39, 27)) + + | { a: 1, b: 1, first: string } +>a : Symbol(a, Decl(excessPropertyCheckWithUnions.ts, 42, 7)) +>b : Symbol(b, Decl(excessPropertyCheckWithUnions.ts, 42, 13)) +>first : Symbol(first, Decl(excessPropertyCheckWithUnions.ts, 42, 19)) + + | { a: 2, second: string } +>a : Symbol(a, Decl(excessPropertyCheckWithUnions.ts, 43, 7)) +>second : Symbol(second, Decl(excessPropertyCheckWithUnions.ts, 43, 13)) + + | { b: 3, third: string } +>b : Symbol(b, Decl(excessPropertyCheckWithUnions.ts, 44, 7)) +>third : Symbol(third, Decl(excessPropertyCheckWithUnions.ts, 44, 13)) + +let over: Overlapping +>over : Symbol(over, Decl(excessPropertyCheckWithUnions.ts, 45, 3)) +>Overlapping : Symbol(Overlapping, Decl(excessPropertyCheckWithUnions.ts, 39, 27)) + +// these two are not reported because there are two discriminant properties +over = { a: 1, b: 1, first: "ok", second: "error" } +>over : Symbol(over, Decl(excessPropertyCheckWithUnions.ts, 45, 3)) +>a : Symbol(a, Decl(excessPropertyCheckWithUnions.ts, 48, 8)) +>b : Symbol(b, Decl(excessPropertyCheckWithUnions.ts, 48, 14)) +>first : Symbol(first, Decl(excessPropertyCheckWithUnions.ts, 48, 20)) +>second : Symbol(second, Decl(excessPropertyCheckWithUnions.ts, 48, 33)) + +over = { a: 1, b: 1, first: "ok", third: "error" } +>over : Symbol(over, Decl(excessPropertyCheckWithUnions.ts, 45, 3)) +>a : Symbol(a, Decl(excessPropertyCheckWithUnions.ts, 49, 8)) +>b : Symbol(b, Decl(excessPropertyCheckWithUnions.ts, 49, 14)) +>first : Symbol(first, Decl(excessPropertyCheckWithUnions.ts, 49, 20)) +>third : Symbol(third, Decl(excessPropertyCheckWithUnions.ts, 49, 33)) + diff --git a/tests/baselines/reference/excessPropertyCheckWithUnions.types b/tests/baselines/reference/excessPropertyCheckWithUnions.types new file mode 100644 index 00000000000..1d6bdd32eb2 --- /dev/null +++ b/tests/baselines/reference/excessPropertyCheckWithUnions.types @@ -0,0 +1,196 @@ +=== tests/cases/compiler/excessPropertyCheckWithUnions.ts === +type ADT = { +>ADT : ADT + + tag: "A", +>tag : "A" + + a1: string +>a1 : string + +} | { + tag: "D", +>tag : "D" + + d20: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 +>d20 : 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 + +} | { + tag: "T", +>tag : "T" +} +let wrong: ADT = { tag: "T", a1: "extra" } +>wrong : ADT +>ADT : ADT +>{ tag: "T", a1: "extra" } : { tag: "T"; a1: string; } +>tag : string +>"T" : "T" +>a1 : string +>"extra" : "extra" + +wrong = { tag: "A", d20: 12 } +>wrong = { tag: "A", d20: 12 } : { tag: "A"; d20: 12; } +>wrong : ADT +>{ tag: "A", d20: 12 } : { tag: "A"; d20: 12; } +>tag : string +>"A" : "A" +>d20 : number +>12 : 12 + +wrong = { tag: "D" } +>wrong = { tag: "D" } : { tag: "D"; } +>wrong : ADT +>{ tag: "D" } : { tag: "D"; } +>tag : string +>"D" : "D" + +type Ambiguous = { +>Ambiguous : Ambiguous + + tag: "A", +>tag : "A" + + x: string +>x : string + +} | { + tag: "A", +>tag : "A" + + y: number +>y : number + +} | { + tag: "B", +>tag : "B" + + z: boolean +>z : boolean + +} | { + tag: "C" +>tag : "C" +} +let amb: Ambiguous +>amb : Ambiguous +>Ambiguous : Ambiguous + +// no error for ambiguous tag, even when it could satisfy both constituents at once +amb = { tag: "A", x: "hi" } +>amb = { tag: "A", x: "hi" } : { tag: "A"; x: string; } +>amb : Ambiguous +>{ tag: "A", x: "hi" } : { tag: "A"; x: string; } +>tag : string +>"A" : "A" +>x : string +>"hi" : "hi" + +amb = { tag: "A", y: 12 } +>amb = { tag: "A", y: 12 } : { tag: "A"; y: number; } +>amb : Ambiguous +>{ tag: "A", y: 12 } : { tag: "A"; y: number; } +>tag : string +>"A" : "A" +>y : number +>12 : 12 + +amb = { tag: "A", x: "hi", y: 12 } +>amb = { tag: "A", x: "hi", y: 12 } : { tag: "A"; x: string; y: number; } +>amb : Ambiguous +>{ tag: "A", x: "hi", y: 12 } : { tag: "A"; x: string; y: number; } +>tag : string +>"A" : "A" +>x : string +>"hi" : "hi" +>y : number +>12 : 12 + +// correctly error on excess property 'extra', even when ambiguous +amb = { tag: "A", x: "hi", extra: 12 } +>amb = { tag: "A", x: "hi", extra: 12 } : { tag: "A"; x: string; extra: number; } +>amb : Ambiguous +>{ tag: "A", x: "hi", extra: 12 } : { tag: "A"; x: string; extra: number; } +>tag : string +>"A" : "A" +>x : string +>"hi" : "hi" +>extra : number +>12 : 12 + +amb = { tag: "A", y: 12, extra: 12 } +>amb = { tag: "A", y: 12, extra: 12 } : { tag: "A"; y: number; extra: number; } +>amb : Ambiguous +>{ tag: "A", y: 12, extra: 12 } : { tag: "A"; y: number; extra: number; } +>tag : string +>"A" : "A" +>y : number +>12 : 12 +>extra : number +>12 : 12 + +// assignability errors still work. +// But note that the error for `z: true` is the fallback one of reporting on +// the last constituent since assignability error reporting can't find a single best discriminant either. +amb = { tag: "A" } +>amb = { tag: "A" } : { tag: "A"; } +>amb : Ambiguous +>{ tag: "A" } : { tag: "A"; } +>tag : string +>"A" : "A" + +amb = { tag: "A", z: true } +>amb = { tag: "A", z: true } : { tag: "A"; z: true; } +>amb : Ambiguous +>{ tag: "A", z: true } : { tag: "A"; z: true; } +>tag : string +>"A" : "A" +>z : boolean +>true : true + +type Overlapping = +>Overlapping : Overlapping + + | { a: 1, b: 1, first: string } +>a : 1 +>b : 1 +>first : string + + | { a: 2, second: string } +>a : 2 +>second : string + + | { b: 3, third: string } +>b : 3 +>third : string + +let over: Overlapping +>over : Overlapping +>Overlapping : Overlapping + +// these two are not reported because there are two discriminant properties +over = { a: 1, b: 1, first: "ok", second: "error" } +>over = { a: 1, b: 1, first: "ok", second: "error" } : { a: 1; b: 1; first: string; second: string; } +>over : Overlapping +>{ a: 1, b: 1, first: "ok", second: "error" } : { a: 1; b: 1; first: string; second: string; } +>a : number +>1 : 1 +>b : number +>1 : 1 +>first : string +>"ok" : "ok" +>second : string +>"error" : "error" + +over = { a: 1, b: 1, first: "ok", third: "error" } +>over = { a: 1, b: 1, first: "ok", third: "error" } : { a: 1; b: 1; first: string; third: string; } +>over : Overlapping +>{ a: 1, b: 1, first: "ok", third: "error" } : { a: 1; b: 1; first: string; third: string; } +>a : number +>1 : 1 +>b : number +>1 : 1 +>first : string +>"ok" : "ok" +>third : string +>"error" : "error" + From 2facead886b2850df151dca9cf2852f0e68f800c Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 5 Oct 2017 09:54:21 -0700 Subject: [PATCH 032/137] Update tests after the merge from master --- src/harness/unittests/tsserverProjectSystem.ts | 11 +++++------ src/harness/virtualFileSystemWithWatch.ts | 12 ++++++++---- tests/baselines/reference/api/tsserverlibrary.d.ts | 7 +------ 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index 06e2beeaaa6..e594093605a 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -352,8 +352,6 @@ namespace ts.projectSystem { verifyDiagnostics(actual, []); } - const typeRootFromTsserverLocation = "/node_modules/@types"; - export function getTypeRootsFromLocation(currentDirectory: string) { currentDirectory = normalizePath(currentDirectory); const result: string[] = []; @@ -401,7 +399,7 @@ namespace ts.projectSystem { const configFiles = flatMap(configFileLocations, location => [location + "tsconfig.json", location + "jsconfig.json"]); checkWatchedFiles(host, configFiles.concat(libFile.path, moduleFile.path)); checkWatchedDirectories(host, [], /*recursive*/ false); - checkWatchedDirectories(host, ["/a/b/c", typeRootFromTsserverLocation], /*recursive*/ true); + checkWatchedDirectories(host, ["/a/b/c", ...getTypeRootsFromLocation(getDirectoryPath(appFile.path))], /*recursive*/ true); }); it("can handle tsconfig file name with difference casing", () => { @@ -4331,7 +4329,7 @@ namespace ts.projectSystem { function verifyCalledOnEachEntry(callback: CalledMaps, expectedKeys: Map) { const calledMap = calledMaps[callback]; - assert.equal(calledMap.size, expectedKeys.size, `${callback}: incorrect size of map: Actual keys: ${arrayFrom(calledMap.keys())} Expected: ${arrayFrom(expectedKeys.keys())}`); + ts.TestFSWithWatch.verifyMapSize(callback, calledMap, arrayFrom(expectedKeys.keys())); expectedKeys.forEach((called, name) => { assert.isTrue(calledMap.has(name), `${callback} is expected to contain ${name}, actual keys: ${arrayFrom(calledMap.keys())}`); assert.equal(calledMap.get(name).length, called, `${callback} is expected to be called ${called} times with ${name}. Actual entry: ${calledMap.get(name)}`); @@ -4413,6 +4411,7 @@ namespace ts.projectSystem { } const f2Lookups = getLocationsForModuleLookup("f2"); callsTrackingHost.verifyCalledOnEachEntryNTimes(CalledMapsWithSingleArg.fileExists, f2Lookups, 1); + const typeRootLocations = getTypeRootsFromLocation(getDirectoryPath(root.path)); const f2DirLookups = getLocationsForDirectoryLookup(); callsTrackingHost.verifyCalledOnEachEntry(CalledMapsWithSingleArg.directoryExists, f2DirLookups); callsTrackingHost.verifyNoCall(CalledMapsWithSingleArg.getDirectories); @@ -4423,7 +4422,7 @@ namespace ts.projectSystem { verifyImportedDiagnostics(); const f1Lookups = f2Lookups.map(s => s.replace("f2", "f1")); f1Lookups.length = f1Lookups.indexOf(imported.path) + 1; - const f1DirLookups = ["/c/d", "/c", typeRootFromTsserverLocation]; + const f1DirLookups = ["/c/d", "/c", ...typeRootLocations]; vertifyF1Lookups(); // setting compiler options discards module resolution cache @@ -4475,7 +4474,7 @@ namespace ts.projectSystem { function getLocationsForDirectoryLookup() { const result = createMap(); // Type root - result.set(typeRootFromTsserverLocation, 1); + typeRootLocations.forEach(location => result.set(location, 1)); forEachAncestorDirectory(getDirectoryPath(root.path), ancestor => { // To resolve modules result.set(ancestor, 2); diff --git a/src/harness/virtualFileSystemWithWatch.ts b/src/harness/virtualFileSystemWithWatch.ts index c16f57235e4..ff782bbf7d2 100644 --- a/src/harness/virtualFileSystemWithWatch.ts +++ b/src/harness/virtualFileSystemWithWatch.ts @@ -95,7 +95,7 @@ namespace ts.TestFSWithWatch { } } - function getDiffInKeys(map: Map, expectedKeys: ReadonlyArray) { + function getDiffInKeys(map: Map, expectedKeys: ReadonlyArray) { if (map.size === expectedKeys.length) { return ""; } @@ -122,8 +122,12 @@ namespace ts.TestFSWithWatch { return `\n\nNotInActual: ${notInActual}\nDuplicates: ${duplicates}\nInActualButNotInExpected: ${inActualNotExpected}`; } - function checkMapKeys(caption: string, map: Map, expectedKeys: ReadonlyArray) { + export function verifyMapSize(caption: string, map: Map, expectedKeys: ReadonlyArray) { assert.equal(map.size, expectedKeys.length, `${caption}: incorrect size of map: Actual keys: ${arrayFrom(map.keys())} Expected: ${expectedKeys}${getDiffInKeys(map, expectedKeys)}`); + } + + function checkMapKeys(caption: string, map: Map, expectedKeys: ReadonlyArray) { + verifyMapSize(caption, map, expectedKeys); for (const name of expectedKeys) { assert.isTrue(map.has(name), `${caption} is expected to contain ${name}, actual keys: ${arrayFrom(map.keys())}`); } @@ -548,7 +552,7 @@ namespace ts.TestFSWithWatch { const folder = this.toFolder(directoryName); // base folder has to be present - const base = getDirectoryPath(folder.fullPath); + const base = getDirectoryPath(folder.path); const baseFolder = this.fs.get(base) as Folder; Debug.assert(isFolder(baseFolder)); @@ -560,7 +564,7 @@ namespace ts.TestFSWithWatch { const file = this.toFile({ path, content }); // base folder has to be present - const base = getDirectoryPath(file.fullPath); + const base = getDirectoryPath(file.path); const folder = this.fs.get(base) as Folder; Debug.assert(isFolder(folder)); diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 3bb2ed11674..713188e9da8 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -7131,7 +7131,6 @@ declare namespace ts.server { enableLanguageService(): void; disableLanguageService(): void; getProjectName(): string; - abstract getProjectRootPath(): string | undefined; abstract getTypeAcquisition(): TypeAcquisition; getExternalFiles(): SortedReadonlyArray; getSourceFile(path: Path): SourceFile; @@ -7184,7 +7183,6 @@ declare namespace ts.server { addRoot(info: ScriptInfo): void; removeRoot(info: ScriptInfo): void; isProjectWithSingleRoot(): boolean; - getProjectRootPath(): string; close(): void; getTypeAcquisition(): TypeAcquisition; } @@ -7211,7 +7209,6 @@ declare namespace ts.server { enablePlugins(): void; private enablePlugin(pluginConfigEntry, searchPaths); private enableProxy(pluginModuleFactory, configEntry); - getProjectRootPath(): string; /** * Get the errors that dont have any file name associated */ @@ -7237,11 +7234,9 @@ declare namespace ts.server { class ExternalProject extends Project { externalProjectName: string; compileOnSaveEnabled: boolean; - private readonly projectFilePath; excludedFiles: ReadonlyArray; private typeAcquisition; getExcludedFiles(): ReadonlyArray; - getProjectRootPath(): string; getTypeAcquisition(): TypeAcquisition; setTypeAcquisition(newTypeAcquisition: TypeAcquisition): void; } @@ -7519,7 +7514,7 @@ declare namespace ts.server { private updateNonInferredProject(project, newUncheckedFiles, propertyReader, newOptions, newTypeAcquisition, compileOnSave); private getOrCreateInferredProjectForProjectRootPathIfEnabled(info, projectRootPath); private getOrCreateSingleInferredProjectIfEnabled(); - private createInferredProject(rootDirectoryForResolution, isSingleInferredProject?, projectRootPath?); + private createInferredProject(currentDirectory, isSingleInferredProject?, projectRootPath?); getScriptInfo(uncheckedFileName: string): ScriptInfo; private watchClosedScriptInfo(info); private stopWatchingScriptInfo(info); From 32d705dbb53b48d2d473547d7ec566d3df818df8 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 5 Oct 2017 11:29:00 -0700 Subject: [PATCH 033/137] Fine tune logging so that only triggers in watch are logged in normal logging vs verbose --- src/compiler/watch.ts | 8 ++++---- src/compiler/watchUtilities.ts | 31 +++++++++++++++++++++++++------ src/server/editorServices.ts | 5 +++++ 3 files changed, 34 insertions(+), 10 deletions(-) diff --git a/src/compiler/watch.ts b/src/compiler/watch.ts index 779efb62c46..2ab3ccc5ce6 100644 --- a/src/compiler/watch.ts +++ b/src/compiler/watch.ts @@ -249,10 +249,10 @@ namespace ts { let hasChangedAutomaticTypeDirectiveNames = false; // True if the automatic type directives have changed const loggingEnabled = compilerOptions.diagnostics || compilerOptions.extendedDiagnostics; - const writeLog: (s: string) => void = loggingEnabled ? s => system.write(s) : noop; - const watchFile = loggingEnabled ? ts.addFileWatcherWithLogging : ts.addFileWatcher; - const watchFilePath = loggingEnabled ? ts.addFilePathWatcherWithLogging : ts.addFilePathWatcher; - const watchDirectoryWorker = loggingEnabled ? ts.addDirectoryWatcherWithLogging : ts.addDirectoryWatcher; + const writeLog: (s: string) => void = loggingEnabled ? s => { system.write(s); system.write(system.newLine); } : noop; + const watchFile = compilerOptions.extendedDiagnostics ? ts.addFileWatcherWithLogging : loggingEnabled ? ts.addFileWatcherWithOnlyTriggerLogging : ts.addFileWatcher; + const watchFilePath = compilerOptions.extendedDiagnostics ? ts.addFilePathWatcherWithLogging : ts.addFilePathWatcher; + const watchDirectoryWorker = compilerOptions.extendedDiagnostics ? ts.addDirectoryWatcherWithLogging : ts.addDirectoryWatcher; watchingHost = watchingHost || createWatchingSystemHost(compilerOptions.pretty); const { system, parseConfigFile, reportDiagnostic, reportWatchDiagnostic, beforeCompile, afterCompile } = watchingHost; diff --git a/src/compiler/watchUtilities.ts b/src/compiler/watchUtilities.ts index de415293954..26bf689401a 100644 --- a/src/compiler/watchUtilities.ts +++ b/src/compiler/watchUtilities.ts @@ -82,7 +82,12 @@ namespace ts { export function addFileWatcherWithLogging(host: System, file: string, cb: FileWatcherCallback, log: (s: string) => void): FileWatcher { const watcherCaption = `FileWatcher:: `; - return createWatcherWithLogging(addFileWatcher, watcherCaption, log, host, file, cb); + return createWatcherWithLogging(addFileWatcher, watcherCaption, log, /*logOnlyTrigger*/ false, host, file, cb); + } + + export function addFileWatcherWithOnlyTriggerLogging(host: System, file: string, cb: FileWatcherCallback, log: (s: string) => void): FileWatcher { + const watcherCaption = `FileWatcher:: `; + return createWatcherWithLogging(addFileWatcher, watcherCaption, log, /*logOnlyTrigger*/ true, host, file, cb); } export type FilePathWatcherCallback = (fileName: string, eventKind: FileWatcherEventKind, filePath: Path) => void; @@ -92,7 +97,12 @@ namespace ts { export function addFilePathWatcherWithLogging(host: System, file: string, cb: FilePathWatcherCallback, path: Path, log: (s: string) => void): FileWatcher { const watcherCaption = `FileWatcher:: `; - return createWatcherWithLogging(addFileWatcher, watcherCaption, log, host, file, cb, path); + return createWatcherWithLogging(addFileWatcher, watcherCaption, log, /*logOnlyTrigger*/ false, host, file, cb, path); + } + + export function addFilePathWatcherWithOnlyTriggerLogging(host: System, file: string, cb: FilePathWatcherCallback, path: Path, log: (s: string) => void): FileWatcher { + const watcherCaption = `FileWatcher:: `; + return createWatcherWithLogging(addFileWatcher, watcherCaption, log, /*logOnlyTrigger*/ true, host, file, cb, path); } export function addDirectoryWatcher(host: System, directory: string, cb: DirectoryWatcherCallback, flags: WatchDirectoryFlags): FileWatcher { @@ -102,14 +112,21 @@ namespace ts { export function addDirectoryWatcherWithLogging(host: System, directory: string, cb: DirectoryWatcherCallback, flags: WatchDirectoryFlags, log: (s: string) => void): FileWatcher { const watcherCaption = `DirectoryWatcher ${(flags & WatchDirectoryFlags.Recursive) !== 0 ? "recursive" : ""}:: `; - return createWatcherWithLogging(addDirectoryWatcher, watcherCaption, log, host, directory, cb, flags); + return createWatcherWithLogging(addDirectoryWatcher, watcherCaption, log, /*logOnlyTrigger*/ false, host, directory, cb, flags); + } + + export function addDirectoryWatcherWithOnlyTriggerLogging(host: System, directory: string, cb: DirectoryWatcherCallback, flags: WatchDirectoryFlags, log: (s: string) => void): FileWatcher { + const watcherCaption = `DirectoryWatcher ${(flags & WatchDirectoryFlags.Recursive) !== 0 ? "recursive" : ""}:: `; + return createWatcherWithLogging(addDirectoryWatcher, watcherCaption, log, /*logOnlyTrigger*/ true, host, directory, cb, flags); } type WatchCallback = (fileName: string, cbOptional1?: T, optional?: U) => void; type AddWatch = (host: System, file: string, cb: WatchCallback, optional?: U) => FileWatcher; - function createWatcherWithLogging(addWatch: AddWatch, watcherCaption: string, log: (s: string) => void, host: System, file: string, cb: WatchCallback, optional?: U): FileWatcher { + function createWatcherWithLogging(addWatch: AddWatch, watcherCaption: string, log: (s: string) => void, logOnlyTrigger: boolean, host: System, file: string, cb: WatchCallback, optional?: U): FileWatcher { const info = `PathInfo: ${file}`; - log(`${watcherCaption}Added: ${info}`); + if (!logOnlyTrigger) { + log(`${watcherCaption}Added: ${info}`); + } const watcher = addWatch(host, file, (fileName, cbOptional1?) => { const optionalInfo = cbOptional1 !== undefined ? ` ${cbOptional1}` : ""; log(`${watcherCaption}Trigger: ${fileName}${optionalInfo} ${info}`); @@ -120,7 +137,9 @@ namespace ts { }, optional); return { close: () => { - log(`${watcherCaption}Close: ${info}`); + if (!logOnlyTrigger) { + log(`${watcherCaption}Close: ${info}`); + } watcher.close(); } }; diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 25a285929be..2916fb60c57 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -431,6 +431,11 @@ namespace ts.server { this.watchFilePath = (host, file, cb, path, watchType, project) => ts.addFilePathWatcherWithLogging(host, file, cb, path, this.createWatcherLog(watchType, project)); this.watchDirectory = (host, dir, cb, flags, watchType, project) => ts.addDirectoryWatcherWithLogging(host, dir, cb, flags, this.createWatcherLog(watchType, project)); } + else if (this.logger.loggingEnabled()) { + this.watchFile = (host, file, cb, watchType, project) => ts.addFileWatcherWithOnlyTriggerLogging(host, file, cb, this.createWatcherLog(watchType, project)); + this.watchFilePath = (host, file, cb, path, watchType, project) => ts.addFilePathWatcherWithOnlyTriggerLogging(host, file, cb, path, this.createWatcherLog(watchType, project)); + this.watchDirectory = (host, dir, cb, flags, watchType, project) => ts.addDirectoryWatcherWithOnlyTriggerLogging(host, dir, cb, flags, this.createWatcherLog(watchType, project)); + } else { this.watchFile = ts.addFileWatcher; this.watchFilePath = ts.addFilePathWatcher; From e5eccf0a22104f2242cebbf636e6ad2336d328f1 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Sat, 30 Sep 2017 00:58:09 -0700 Subject: [PATCH 034/137] Added test. --- .../codeFixAddForgottenDecoratorCall01.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/cases/fourslash/codeFixAddForgottenDecoratorCall01.ts diff --git a/tests/cases/fourslash/codeFixAddForgottenDecoratorCall01.ts b/tests/cases/fourslash/codeFixAddForgottenDecoratorCall01.ts new file mode 100644 index 00000000000..17ae7f626f0 --- /dev/null +++ b/tests/cases/fourslash/codeFixAddForgottenDecoratorCall01.ts @@ -0,0 +1,14 @@ +/// + +////declare function foo(): (...args: any[]) => void; +////class C { +//// [|@foo|] +//// bar() { +//// +//// } +////} + +verify.codeFix({ + description: "Call decorator expression.", + newRangeContent: `@foo()` +}); From ea2021dd3e49a016dac58de326601e24c02f8a09 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Sat, 30 Sep 2017 00:58:46 -0700 Subject: [PATCH 035/137] Create fix for uninvoked decorators. --- src/compiler/diagnosticMessages.json | 4 ++++ .../addMissingInvocationForDecorator.ts | 20 +++++++++++++++++++ src/services/codefixes/fixes.ts | 1 + 3 files changed, 25 insertions(+) create mode 100644 src/services/codefixes/addMissingInvocationForDecorator.ts diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 17c23660820..f3d6d4fcc47 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3709,6 +3709,10 @@ "category": "Message", "code": 90027 }, + "Call decorator expression.": { + "category": "Message", + "code": 90028 + }, "Convert function to an ES2015 class": { "category": "Message", diff --git a/src/services/codefixes/addMissingInvocationForDecorator.ts b/src/services/codefixes/addMissingInvocationForDecorator.ts new file mode 100644 index 00000000000..7f17aab6db2 --- /dev/null +++ b/src/services/codefixes/addMissingInvocationForDecorator.ts @@ -0,0 +1,20 @@ +/* @internal */ +namespace ts.codefix { + registerCodeFix({ + errorCodes: [Diagnostics._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0.code], + getCodeActions: (context: CodeFixContext) => { + const sourceFile = context.sourceFile; + const token = getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false); + const decorator = getAncestor(token, SyntaxKind.Decorator) as Decorator; + Debug.assert(!!decorator, "Expected position to be owned by a decorator."); + const replacement = createCall(decorator.expression, /*typeArguments*/ undefined, /*argumentsArray*/ undefined); + const changeTracker = textChanges.ChangeTracker.fromContext(context); + changeTracker.replaceNode(sourceFile, decorator.expression, replacement); + + return [{ + description: getLocaleSpecificMessage(Diagnostics.Call_decorator_expression), + changes: changeTracker.getChanges() + }]; + } + }); +} diff --git a/src/services/codefixes/fixes.ts b/src/services/codefixes/fixes.ts index 9bc80cad691..b024dfae7cd 100644 --- a/src/services/codefixes/fixes.ts +++ b/src/services/codefixes/fixes.ts @@ -1,3 +1,4 @@ +/// /// /// /// From c3d1b027dcf27520a2a2e64a0e95aa64ea62505f Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Thu, 5 Oct 2017 13:18:38 -0700 Subject: [PATCH 036/137] Don't use callback parameter code path when strictly checking functions --- src/compiler/checker.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 58248a8a9ee..5ea946aa898 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -8540,7 +8540,7 @@ namespace ts { } const kind = target.declaration ? target.declaration.kind : SyntaxKind.Unknown; - const strictVariance = strictFunctionTypes && kind !== SyntaxKind.MethodDeclaration && + const strictVariance = !checkAsCallback && strictFunctionTypes && kind !== SyntaxKind.MethodDeclaration && kind !== SyntaxKind.MethodSignature && kind !== SyntaxKind.Constructor; let result = Ternary.True; @@ -8579,7 +8579,7 @@ namespace ts { // similar to return values, callback parameters are output positions. This means that a Promise, // where T is used only in callback parameter positions, will be co-variant (as opposed to bi-variant) // with respect to T. - const callbacks = sourceSig && targetSig && !sourceSig.typePredicate && !targetSig.typePredicate && + const callbacks = !strictVariance && sourceSig && targetSig && !sourceSig.typePredicate && !targetSig.typePredicate && (getFalsyFlags(sourceType) & TypeFlags.Nullable) === (getFalsyFlags(targetType) & TypeFlags.Nullable); const related = callbacks ? compareSignaturesRelated(targetSig, sourceSig, /*checkAsCallback*/ true, /*ignoreReturnTypes*/ false, reportErrors, errorReporter, compareTypes) : From 0dc1c77f231762079ba106ea7fd828355c2a8852 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Thu, 5 Oct 2017 13:18:49 -0700 Subject: [PATCH 037/137] Accept new baselines --- .../strictFunctionTypesErrors.errors.txt | 32 +++++++------------ 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/tests/baselines/reference/strictFunctionTypesErrors.errors.txt b/tests/baselines/reference/strictFunctionTypesErrors.errors.txt index 2827983bd5a..661ad437ed2 100644 --- a/tests/baselines/reference/strictFunctionTypesErrors.errors.txt +++ b/tests/baselines/reference/strictFunctionTypesErrors.errors.txt @@ -40,26 +40,22 @@ tests/cases/compiler/strictFunctionTypesErrors.ts(58,1): error TS2322: Type 'Fun Type 'Object' is not assignable to type 'string'. tests/cases/compiler/strictFunctionTypesErrors.ts(61,1): error TS2322: Type 'Func, Object>' is not assignable to type 'Func, Object>'. Types of parameters 'x' and 'x' are incompatible. - Types of parameters 'x' and 'x' are incompatible. - Type 'Object' is not assignable to type 'string'. + Type 'Func' is not assignable to type 'Func'. + Types of parameters 'x' and 'x' are incompatible. + Type 'Object' is not assignable to type 'string'. tests/cases/compiler/strictFunctionTypesErrors.ts(62,1): error TS2322: Type 'Func, string>' is not assignable to type 'Func, Object>'. Types of parameters 'x' and 'x' are incompatible. - Types of parameters 'x' and 'x' are incompatible. - Type 'Object' is not assignable to type 'string'. + Type 'Func' is not assignable to type 'Func'. tests/cases/compiler/strictFunctionTypesErrors.ts(65,1): error TS2322: Type 'Func, Object>' is not assignable to type 'Func, string>'. Types of parameters 'x' and 'x' are incompatible. - Types of parameters 'x' and 'x' are incompatible. - Type 'Object' is not assignable to type 'string'. + Type 'Func' is not assignable to type 'Func'. tests/cases/compiler/strictFunctionTypesErrors.ts(66,1): error TS2322: Type 'Func, string>' is not assignable to type 'Func, string>'. Types of parameters 'x' and 'x' are incompatible. - Types of parameters 'x' and 'x' are incompatible. - Type 'Object' is not assignable to type 'string'. + Type 'Func' is not assignable to type 'Func'. tests/cases/compiler/strictFunctionTypesErrors.ts(67,1): error TS2322: Type 'Func, Object>' is not assignable to type 'Func, string>'. Type 'Object' is not assignable to type 'string'. tests/cases/compiler/strictFunctionTypesErrors.ts(74,1): error TS2322: Type 'Func>' is not assignable to type 'Func>'. Type 'Func' is not assignable to type 'Func'. - Types of parameters 'x' and 'x' are incompatible. - Type 'Object' is not assignable to type 'string'. tests/cases/compiler/strictFunctionTypesErrors.ts(75,1): error TS2322: Type 'Func>' is not assignable to type 'Func>'. Types of parameters 'x' and 'x' are incompatible. Type 'Object' is not assignable to type 'string'. @@ -210,28 +206,26 @@ tests/cases/compiler/strictFunctionTypesErrors.ts(127,1): error TS2322: Type 'Cr ~~ !!! error TS2322: Type 'Func, Object>' is not assignable to type 'Func, Object>'. !!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'Object' is not assignable to type 'string'. +!!! error TS2322: Type 'Func' is not assignable to type 'Func'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'Object' is not assignable to type 'string'. h3 = h2; // Error ~~ !!! error TS2322: Type 'Func, string>' is not assignable to type 'Func, Object>'. !!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'Object' is not assignable to type 'string'. +!!! error TS2322: Type 'Func' is not assignable to type 'Func'. h3 = h4; // Ok h4 = h1; // Error ~~ !!! error TS2322: Type 'Func, Object>' is not assignable to type 'Func, string>'. !!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'Object' is not assignable to type 'string'. +!!! error TS2322: Type 'Func' is not assignable to type 'Func'. h4 = h2; // Error ~~ !!! error TS2322: Type 'Func, string>' is not assignable to type 'Func, string>'. !!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'Object' is not assignable to type 'string'. +!!! error TS2322: Type 'Func' is not assignable to type 'Func'. h4 = h3; // Error ~~ !!! error TS2322: Type 'Func, Object>' is not assignable to type 'Func, string>'. @@ -246,8 +240,6 @@ tests/cases/compiler/strictFunctionTypesErrors.ts(127,1): error TS2322: Type 'Cr ~~ !!! error TS2322: Type 'Func>' is not assignable to type 'Func>'. !!! error TS2322: Type 'Func' is not assignable to type 'Func'. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'Object' is not assignable to type 'string'. i1 = i3; // Error ~~ !!! error TS2322: Type 'Func>' is not assignable to type 'Func>'. From aae7572c4869dd5a62acd4311e8f7fdefd1f05f6 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Thu, 5 Oct 2017 13:25:23 -0700 Subject: [PATCH 038/137] Add test --- .../strictFunctionTypesErrors.errors.txt | 29 ++++++++++++++++++- .../reference/strictFunctionTypesErrors.js | 9 ++++++ .../strictFunctionTypesErrors.symbols | 24 +++++++++++++++ .../reference/strictFunctionTypesErrors.types | 26 +++++++++++++++++ .../compiler/strictFunctionTypesErrors.ts | 7 +++++ 5 files changed, 94 insertions(+), 1 deletion(-) diff --git a/tests/baselines/reference/strictFunctionTypesErrors.errors.txt b/tests/baselines/reference/strictFunctionTypesErrors.errors.txt index 661ad437ed2..6a8204fb147 100644 --- a/tests/baselines/reference/strictFunctionTypesErrors.errors.txt +++ b/tests/baselines/reference/strictFunctionTypesErrors.errors.txt @@ -83,9 +83,18 @@ tests/cases/compiler/strictFunctionTypesErrors.ts(126,1): error TS2322: Type 'Cr tests/cases/compiler/strictFunctionTypesErrors.ts(127,1): error TS2322: Type 'Crate' is not assignable to type 'Crate'. Types of property 'item' are incompatible. Type 'Animal' is not assignable to type 'Dog'. +tests/cases/compiler/strictFunctionTypesErrors.ts(133,1): error TS2322: Type '(f: (x: Dog) => Dog) => void' is not assignable to type '(f: (x: Animal) => Animal) => void'. + Types of parameters 'f' and 'f' are incompatible. + Type '(x: Animal) => Animal' is not assignable to type '(x: Dog) => Dog'. + Type 'Animal' is not assignable to type 'Dog'. +tests/cases/compiler/strictFunctionTypesErrors.ts(134,1): error TS2322: Type '(f: (x: Animal) => Animal) => void' is not assignable to type '(f: (x: Dog) => Dog) => void'. + Types of parameters 'f' and 'f' are incompatible. + Type '(x: Dog) => Dog' is not assignable to type '(x: Animal) => Animal'. + Types of parameters 'x' and 'x' are incompatible. + Type 'Animal' is not assignable to type 'Dog'. -==== tests/cases/compiler/strictFunctionTypesErrors.ts (31 errors) ==== +==== tests/cases/compiler/strictFunctionTypesErrors.ts (33 errors) ==== export {} @@ -329,4 +338,22 @@ tests/cases/compiler/strictFunctionTypesErrors.ts(127,1): error TS2322: Type 'Cr !!! error TS2322: Type 'Crate' is not assignable to type 'Crate'. !!! error TS2322: Types of property 'item' are incompatible. !!! error TS2322: Type 'Animal' is not assignable to type 'Dog'. + + // Verify that callback parameters are strictly checked + + declare let fc1: (f: (x: Animal) => Animal) => void; + declare let fc2: (f: (x: Dog) => Dog) => void; + fc1 = fc2; // Error + ~~~ +!!! error TS2322: Type '(f: (x: Dog) => Dog) => void' is not assignable to type '(f: (x: Animal) => Animal) => void'. +!!! error TS2322: Types of parameters 'f' and 'f' are incompatible. +!!! error TS2322: Type '(x: Animal) => Animal' is not assignable to type '(x: Dog) => Dog'. +!!! error TS2322: Type 'Animal' is not assignable to type 'Dog'. + fc2 = fc1; // Error + ~~~ +!!! error TS2322: Type '(f: (x: Animal) => Animal) => void' is not assignable to type '(f: (x: Dog) => Dog) => void'. +!!! error TS2322: Types of parameters 'f' and 'f' are incompatible. +!!! error TS2322: Type '(x: Dog) => Dog' is not assignable to type '(x: Animal) => Animal'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'Animal' is not assignable to type 'Dog'. \ No newline at end of file diff --git a/tests/baselines/reference/strictFunctionTypesErrors.js b/tests/baselines/reference/strictFunctionTypesErrors.js index 2be598f0ef9..8e338fa030d 100644 --- a/tests/baselines/reference/strictFunctionTypesErrors.js +++ b/tests/baselines/reference/strictFunctionTypesErrors.js @@ -126,6 +126,13 @@ declare let dogCrate: Crate; animalCrate = dogCrate; // Error dogCrate = animalCrate; // Error + +// Verify that callback parameters are strictly checked + +declare let fc1: (f: (x: Animal) => Animal) => void; +declare let fc2: (f: (x: Dog) => Dog) => void; +fc1 = fc2; // Error +fc2 = fc1; // Error //// [strictFunctionTypesErrors.js] @@ -186,3 +193,5 @@ dogComparer2 = animalComparer2; // Ok // Errors below should elaborate the reason for invariance animalCrate = dogCrate; // Error dogCrate = animalCrate; // Error +fc1 = fc2; // Error +fc2 = fc1; // Error diff --git a/tests/baselines/reference/strictFunctionTypesErrors.symbols b/tests/baselines/reference/strictFunctionTypesErrors.symbols index 30faf83d87e..fd28775c5e1 100644 --- a/tests/baselines/reference/strictFunctionTypesErrors.symbols +++ b/tests/baselines/reference/strictFunctionTypesErrors.symbols @@ -400,3 +400,27 @@ dogCrate = animalCrate; // Error >dogCrate : Symbol(dogCrate, Decl(strictFunctionTypesErrors.ts, 121, 11)) >animalCrate : Symbol(animalCrate, Decl(strictFunctionTypesErrors.ts, 120, 11)) +// Verify that callback parameters are strictly checked + +declare let fc1: (f: (x: Animal) => Animal) => void; +>fc1 : Symbol(fc1, Decl(strictFunctionTypesErrors.ts, 130, 11)) +>f : Symbol(f, Decl(strictFunctionTypesErrors.ts, 130, 18)) +>x : Symbol(x, Decl(strictFunctionTypesErrors.ts, 130, 22)) +>Animal : Symbol(Animal, Decl(strictFunctionTypesErrors.ts, 87, 8)) +>Animal : Symbol(Animal, Decl(strictFunctionTypesErrors.ts, 87, 8)) + +declare let fc2: (f: (x: Dog) => Dog) => void; +>fc2 : Symbol(fc2, Decl(strictFunctionTypesErrors.ts, 131, 11)) +>f : Symbol(f, Decl(strictFunctionTypesErrors.ts, 131, 18)) +>x : Symbol(x, Decl(strictFunctionTypesErrors.ts, 131, 22)) +>Dog : Symbol(Dog, Decl(strictFunctionTypesErrors.ts, 89, 33)) +>Dog : Symbol(Dog, Decl(strictFunctionTypesErrors.ts, 89, 33)) + +fc1 = fc2; // Error +>fc1 : Symbol(fc1, Decl(strictFunctionTypesErrors.ts, 130, 11)) +>fc2 : Symbol(fc2, Decl(strictFunctionTypesErrors.ts, 131, 11)) + +fc2 = fc1; // Error +>fc2 : Symbol(fc2, Decl(strictFunctionTypesErrors.ts, 131, 11)) +>fc1 : Symbol(fc1, Decl(strictFunctionTypesErrors.ts, 130, 11)) + diff --git a/tests/baselines/reference/strictFunctionTypesErrors.types b/tests/baselines/reference/strictFunctionTypesErrors.types index e4372d4b8fa..45deeebabab 100644 --- a/tests/baselines/reference/strictFunctionTypesErrors.types +++ b/tests/baselines/reference/strictFunctionTypesErrors.types @@ -454,3 +454,29 @@ dogCrate = animalCrate; // Error >dogCrate : Crate >animalCrate : Crate +// Verify that callback parameters are strictly checked + +declare let fc1: (f: (x: Animal) => Animal) => void; +>fc1 : (f: (x: Animal) => Animal) => void +>f : (x: Animal) => Animal +>x : Animal +>Animal : Animal +>Animal : Animal + +declare let fc2: (f: (x: Dog) => Dog) => void; +>fc2 : (f: (x: Dog) => Dog) => void +>f : (x: Dog) => Dog +>x : Dog +>Dog : Dog +>Dog : Dog + +fc1 = fc2; // Error +>fc1 = fc2 : (f: (x: Dog) => Dog) => void +>fc1 : (f: (x: Animal) => Animal) => void +>fc2 : (f: (x: Dog) => Dog) => void + +fc2 = fc1; // Error +>fc2 = fc1 : (f: (x: Animal) => Animal) => void +>fc2 : (f: (x: Dog) => Dog) => void +>fc1 : (f: (x: Animal) => Animal) => void + diff --git a/tests/cases/compiler/strictFunctionTypesErrors.ts b/tests/cases/compiler/strictFunctionTypesErrors.ts index fbf1c0fa6da..95598d9d444 100644 --- a/tests/cases/compiler/strictFunctionTypesErrors.ts +++ b/tests/cases/compiler/strictFunctionTypesErrors.ts @@ -126,3 +126,10 @@ declare let dogCrate: Crate; animalCrate = dogCrate; // Error dogCrate = animalCrate; // Error + +// Verify that callback parameters are strictly checked + +declare let fc1: (f: (x: Animal) => Animal) => void; +declare let fc2: (f: (x: Dog) => Dog) => void; +fc1 = fc2; // Error +fc2 = fc1; // Error From a5e184118088342db9db79c49f6cb95e53f63b72 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Thu, 5 Oct 2017 15:37:47 -0700 Subject: [PATCH 039/137] Handle undefined in getSynthesizedClone --- src/compiler/factory.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index 968144c0fc7..fe183c5e806 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -47,10 +47,15 @@ namespace ts { * Creates a shallow, memberwise clone of a node with no source map location. */ /* @internal */ - export function getSynthesizedClone(node: T | undefined): T { + export function getSynthesizedClone(node: T | undefined): T | undefined { // We don't use "clone" from core.ts here, as we need to preserve the prototype chain of // the original node. We also need to exclude specific properties and only include own- // properties (to skip members already defined on the shared prototype). + + if (node === undefined) { + return undefined; + } + const clone = createSynthesizedNode(node.kind); clone.flags |= node.flags; setOriginalNode(clone, node); From 380b8df13f3ff9deaf36c6a7aa3ae0c7fd4ce960 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Thu, 5 Oct 2017 15:38:02 -0700 Subject: [PATCH 040/137] Introduce getSynthesizedDeepClone --- src/compiler/factory.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index fe183c5e806..84c28abe1a5 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -71,6 +71,15 @@ namespace ts { return clone; } + /** + * Creates a deep, memberwise clone of a node with no source map location. + */ + export function getSynthesizedDeepClone(node: T | undefined): T | undefined { + return node + ? getSynthesizedClone(visitEachChild(node, child => getSynthesizedDeepClone(child), nullTransformationContext)) + : undefined; + } + // Literals export function createLiteral(value: string): StringLiteral; From ad148dbc8800da4bbd2863a68f6f6617ee776a7a Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Thu, 5 Oct 2017 15:46:14 -0700 Subject: [PATCH 041/137] Use deep cloning, rather than thunking for repeated substitution Replaces b244cd4fb47 --- src/services/refactors/extractSymbol.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/services/refactors/extractSymbol.ts b/src/services/refactors/extractSymbol.ts index 0e2f5ebfe3c..0176841e346 100644 --- a/src/services/refactors/extractSymbol.ts +++ b/src/services/refactors/extractSymbol.ts @@ -1064,7 +1064,7 @@ namespace ts.refactor.extractSymbol { } } - function transformFunctionBody(body: Node, writes: ReadonlyArray, substitutions: ReadonlyMap<() => Node>, hasReturn: boolean): { body: Block, returnValueProperty: string } { + function transformFunctionBody(body: Node, writes: ReadonlyArray, substitutions: ReadonlyMap, hasReturn: boolean): { body: Block, returnValueProperty: string } { if (isBlock(body) && !writes && substitutions.size === 0) { // already block, no writes to propagate back, no substitutions - can use node as is return { body: createBlock(body.statements, /*multLine*/ true), returnValueProperty: undefined }; @@ -1112,21 +1112,21 @@ namespace ts.refactor.extractSymbol { const oldIgnoreReturns = ignoreReturns; ignoreReturns = ignoreReturns || isFunctionLikeDeclaration(node) || isClassLike(node); const substitution = substitutions.get(getNodeId(node).toString()); - const result = substitution ? substitution() : visitEachChild(node, visitor, nullTransformationContext); + const result = substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(node, visitor, nullTransformationContext); ignoreReturns = oldIgnoreReturns; return result; } } } - function transformConstantInitializer(initializer: Expression, substitutions: ReadonlyMap<() => Node>): Expression { + function transformConstantInitializer(initializer: Expression, substitutions: ReadonlyMap): Expression { return substitutions.size ? visitor(initializer) as Expression : initializer; function visitor(node: Node): VisitResult { const substitution = substitutions.get(getNodeId(node).toString()); - return substitution ? substitution() : visitEachChild(node, visitor, nullTransformationContext); + return substitution ? getSynthesizedDeepClone(substitution) : visitEachChild(node, visitor, nullTransformationContext); } } @@ -1255,7 +1255,7 @@ namespace ts.refactor.extractSymbol { interface ScopeUsages { readonly usages: Map; readonly typeParameterUsages: Map; // Key is type ID - readonly substitutions: Map<() => Node>; + readonly substitutions: Map; } interface ReadsAndWrites { @@ -1274,7 +1274,7 @@ namespace ts.refactor.extractSymbol { const allTypeParameterUsages = createMap(); // Key is type ID const usagesPerScope: ScopeUsages[] = []; - const substitutionsPerScope: Map<() => Node>[] = []; + const substitutionsPerScope: Map[] = []; const functionErrorsPerScope: Diagnostic[][] = []; const constantErrorsPerScope: Diagnostic[][] = []; const visibleDeclarationsInExtractedRange: Symbol[] = []; @@ -1298,8 +1298,8 @@ namespace ts.refactor.extractSymbol { // initialize results for (const scope of scopes) { - usagesPerScope.push({ usages: createMap(), typeParameterUsages: createMap(), substitutions: createMap<() => Expression>() }); - substitutionsPerScope.push(createMap<() => Expression>()); + usagesPerScope.push({ usages: createMap(), typeParameterUsages: createMap(), substitutions: createMap() }); + substitutionsPerScope.push(createMap()); functionErrorsPerScope.push( isFunctionLikeDeclaration(scope) && scope.kind !== SyntaxKind.FunctionDeclaration @@ -1598,20 +1598,20 @@ namespace ts.refactor.extractSymbol { } } - function tryReplaceWithQualifiedNameOrPropertyAccess(symbol: Symbol, scopeDecl: Node, isTypeNode: boolean): () => (PropertyAccessExpression | EntityName) { + function tryReplaceWithQualifiedNameOrPropertyAccess(symbol: Symbol, scopeDecl: Node, isTypeNode: boolean): PropertyAccessExpression | EntityName { if (!symbol) { return undefined; } if (symbol.getDeclarations().some(d => d.parent === scopeDecl)) { - return () => createIdentifier(symbol.name); + return createIdentifier(symbol.name); } const prefix = tryReplaceWithQualifiedNameOrPropertyAccess(symbol.parent, scopeDecl, isTypeNode); if (prefix === undefined) { return undefined; } return isTypeNode - ? () => createQualifiedName(prefix(), createIdentifier(symbol.name)) - : () => createPropertyAccess(prefix(), symbol.name); + ? createQualifiedName(prefix, createIdentifier(symbol.name)) + : createPropertyAccess(prefix, symbol.name); } } From 7a4c3314e816bc7a7589d1e6e52328c38f1fc693 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 5 Oct 2017 16:47:24 -0700 Subject: [PATCH 042/137] Visit default export expressions (#18977) --- src/compiler/transformers/module/module.ts | 4 ++-- ...amicImportInDefaultExportExpression.errors.txt | 11 +++++++++++ .../dynamicImportInDefaultExportExpression.js | 15 +++++++++++++++ ...dynamicImportInDefaultExportExpression.symbols | 8 ++++++++ .../dynamicImportInDefaultExportExpression.types | 13 +++++++++++++ .../dynamicImportInDefaultExportExpression.ts | 7 +++++++ 6 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 tests/baselines/reference/dynamicImportInDefaultExportExpression.errors.txt create mode 100644 tests/baselines/reference/dynamicImportInDefaultExportExpression.js create mode 100644 tests/baselines/reference/dynamicImportInDefaultExportExpression.symbols create mode 100644 tests/baselines/reference/dynamicImportInDefaultExportExpression.types create mode 100644 tests/cases/compiler/dynamicImportInDefaultExportExpression.ts diff --git a/src/compiler/transformers/module/module.ts b/src/compiler/transformers/module/module.ts index 145ac07c2f2..ecbef685649 100644 --- a/src/compiler/transformers/module/module.ts +++ b/src/compiler/transformers/module/module.ts @@ -861,10 +861,10 @@ namespace ts { if (original && hasAssociatedEndOfDeclarationMarker(original)) { // Defer exports until we encounter an EndOfDeclarationMarker node const id = getOriginalNodeId(node); - deferredExports[id] = appendExportStatement(deferredExports[id], createIdentifier("default"), node.expression, /*location*/ node, /*allowComments*/ true); + deferredExports[id] = appendExportStatement(deferredExports[id], createIdentifier("default"), visitNode(node.expression, importCallExpressionVisitor), /*location*/ node, /*allowComments*/ true); } else { - statements = appendExportStatement(statements, createIdentifier("default"), node.expression, /*location*/ node, /*allowComments*/ true); + statements = appendExportStatement(statements, createIdentifier("default"), visitNode(node.expression, importCallExpressionVisitor), /*location*/ node, /*allowComments*/ true); } return singleOrMany(statements); diff --git a/tests/baselines/reference/dynamicImportInDefaultExportExpression.errors.txt b/tests/baselines/reference/dynamicImportInDefaultExportExpression.errors.txt new file mode 100644 index 00000000000..8bf6704b743 --- /dev/null +++ b/tests/baselines/reference/dynamicImportInDefaultExportExpression.errors.txt @@ -0,0 +1,11 @@ +tests/cases/compiler/dynamicImportInDefaultExportExpression.ts(3,23): error TS2307: Cannot find module './foo2'. + + +==== tests/cases/compiler/dynamicImportInDefaultExportExpression.ts (1 errors) ==== + export default { + getInstance: function () { + return import('./foo2'); + ~~~~~~~~ +!!! error TS2307: Cannot find module './foo2'. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/dynamicImportInDefaultExportExpression.js b/tests/baselines/reference/dynamicImportInDefaultExportExpression.js new file mode 100644 index 00000000000..75e5e0d57a2 --- /dev/null +++ b/tests/baselines/reference/dynamicImportInDefaultExportExpression.js @@ -0,0 +1,15 @@ +//// [dynamicImportInDefaultExportExpression.ts] +export default { + getInstance: function () { + return import('./foo2'); + } +} + +//// [dynamicImportInDefaultExportExpression.js] +"use strict"; +exports.__esModule = true; +exports["default"] = { + getInstance: function () { + return Promise.resolve().then(function () { return require('./foo2'); }); + } +}; diff --git a/tests/baselines/reference/dynamicImportInDefaultExportExpression.symbols b/tests/baselines/reference/dynamicImportInDefaultExportExpression.symbols new file mode 100644 index 00000000000..d16b5f0a374 --- /dev/null +++ b/tests/baselines/reference/dynamicImportInDefaultExportExpression.symbols @@ -0,0 +1,8 @@ +=== tests/cases/compiler/dynamicImportInDefaultExportExpression.ts === +export default { + getInstance: function () { +>getInstance : Symbol(getInstance, Decl(dynamicImportInDefaultExportExpression.ts, 0, 16)) + + return import('./foo2'); + } +} diff --git a/tests/baselines/reference/dynamicImportInDefaultExportExpression.types b/tests/baselines/reference/dynamicImportInDefaultExportExpression.types new file mode 100644 index 00000000000..c75894a17ff --- /dev/null +++ b/tests/baselines/reference/dynamicImportInDefaultExportExpression.types @@ -0,0 +1,13 @@ +=== tests/cases/compiler/dynamicImportInDefaultExportExpression.ts === +export default { +>{ getInstance: function () { return import('./foo2'); }} : { getInstance: () => Promise; } + + getInstance: function () { +>getInstance : () => Promise +>function () { return import('./foo2'); } : () => Promise + + return import('./foo2'); +>import('./foo2') : Promise +>'./foo2' : "./foo2" + } +} diff --git a/tests/cases/compiler/dynamicImportInDefaultExportExpression.ts b/tests/cases/compiler/dynamicImportInDefaultExportExpression.ts new file mode 100644 index 00000000000..0e6ad95886b --- /dev/null +++ b/tests/cases/compiler/dynamicImportInDefaultExportExpression.ts @@ -0,0 +1,7 @@ +// @skipLibCheck: true +// @lib: es6 +export default { + getInstance: function () { + return import('./foo2'); + } +} \ No newline at end of file From 70e259aba368349f075ebe389e2f5c16dfec41db Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 6 Oct 2017 09:16:57 -0700 Subject: [PATCH 043/137] Always use callback parameter code path, but stricter if necessary --- src/compiler/checker.ts | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 5ea946aa898..305e47374cb 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -503,6 +503,12 @@ namespace ts { Inferential = 2, // Inferential typing } + const enum CallbackCheck { + None, + Bivariant, + Strict, + } + const builtinGlobals = createSymbolTable(); builtinGlobals.set(undefinedSymbol.escapedName, undefinedSymbol); @@ -8510,7 +8516,7 @@ namespace ts { function isSignatureAssignableTo(source: Signature, target: Signature, ignoreReturnTypes: boolean): boolean { - return compareSignaturesRelated(source, target, /*checkAsCallback*/ false, ignoreReturnTypes, /*reportErrors*/ false, + return compareSignaturesRelated(source, target, CallbackCheck.None, ignoreReturnTypes, /*reportErrors*/ false, /*errorReporter*/ undefined, compareTypesAssignable) !== Ternary.False; } @@ -8521,7 +8527,7 @@ namespace ts { */ function compareSignaturesRelated(source: Signature, target: Signature, - checkAsCallback: boolean, + callbackCheck: CallbackCheck, ignoreReturnTypes: boolean, reportErrors: boolean, errorReporter: ErrorReporter, @@ -8540,7 +8546,7 @@ namespace ts { } const kind = target.declaration ? target.declaration.kind : SyntaxKind.Unknown; - const strictVariance = !checkAsCallback && strictFunctionTypes && kind !== SyntaxKind.MethodDeclaration && + const strictVariance = !callbackCheck && strictFunctionTypes && kind !== SyntaxKind.MethodDeclaration && kind !== SyntaxKind.MethodSignature && kind !== SyntaxKind.Constructor; let result = Ternary.True; @@ -8579,11 +8585,11 @@ namespace ts { // similar to return values, callback parameters are output positions. This means that a Promise, // where T is used only in callback parameter positions, will be co-variant (as opposed to bi-variant) // with respect to T. - const callbacks = !strictVariance && sourceSig && targetSig && !sourceSig.typePredicate && !targetSig.typePredicate && + const callbacks = sourceSig && targetSig && !sourceSig.typePredicate && !targetSig.typePredicate && (getFalsyFlags(sourceType) & TypeFlags.Nullable) === (getFalsyFlags(targetType) & TypeFlags.Nullable); const related = callbacks ? - compareSignaturesRelated(targetSig, sourceSig, /*checkAsCallback*/ true, /*ignoreReturnTypes*/ false, reportErrors, errorReporter, compareTypes) : - !checkAsCallback && !strictVariance && compareTypes(sourceType, targetType, /*reportErrors*/ false) || compareTypes(targetType, sourceType, reportErrors); + compareSignaturesRelated(targetSig, sourceSig, strictVariance ? CallbackCheck.Strict : CallbackCheck.Bivariant, /*ignoreReturnTypes*/ false, reportErrors, errorReporter, compareTypes) : + !callbackCheck && !strictVariance && compareTypes(sourceType, targetType, /*reportErrors*/ false) || compareTypes(targetType, sourceType, reportErrors); if (!related) { if (reportErrors) { errorReporter(Diagnostics.Types_of_parameters_0_and_1_are_incompatible, @@ -8618,7 +8624,7 @@ namespace ts { // When relating callback signatures, we still need to relate return types bi-variantly as otherwise // the containing type wouldn't be co-variant. For example, interface Foo { add(cb: () => T): void } // wouldn't be co-variant for T without this rule. - result &= checkAsCallback && compareTypes(targetReturnType, sourceReturnType, /*reportErrors*/ false) || + result &= callbackCheck === CallbackCheck.Bivariant && compareTypes(targetReturnType, sourceReturnType, /*reportErrors*/ false) || compareTypes(sourceReturnType, targetReturnType, reportErrors); } @@ -9715,7 +9721,7 @@ namespace ts { */ function signatureRelatedTo(source: Signature, target: Signature, erase: boolean, reportErrors: boolean): Ternary { return compareSignaturesRelated(erase ? getErasedSignature(source) : source, erase ? getErasedSignature(target) : target, - /*checkAsCallback*/ false, /*ignoreReturnTypes*/ false, reportErrors, reportError, isRelatedTo); + CallbackCheck.None, /*ignoreReturnTypes*/ false, reportErrors, reportError, isRelatedTo); } function signaturesIdenticalTo(source: Type, target: Type, kind: SignatureKind): Ternary { From c8d52609142cd61c50b9593ee42ba8a4f649d885 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 6 Oct 2017 09:17:18 -0700 Subject: [PATCH 044/137] Accept new baselines --- .../strictFunctionTypesErrors.errors.txt | 48 ++++++++++--------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/tests/baselines/reference/strictFunctionTypesErrors.errors.txt b/tests/baselines/reference/strictFunctionTypesErrors.errors.txt index 6a8204fb147..600a58638ed 100644 --- a/tests/baselines/reference/strictFunctionTypesErrors.errors.txt +++ b/tests/baselines/reference/strictFunctionTypesErrors.errors.txt @@ -40,22 +40,26 @@ tests/cases/compiler/strictFunctionTypesErrors.ts(58,1): error TS2322: Type 'Fun Type 'Object' is not assignable to type 'string'. tests/cases/compiler/strictFunctionTypesErrors.ts(61,1): error TS2322: Type 'Func, Object>' is not assignable to type 'Func, Object>'. Types of parameters 'x' and 'x' are incompatible. - Type 'Func' is not assignable to type 'Func'. - Types of parameters 'x' and 'x' are incompatible. - Type 'Object' is not assignable to type 'string'. + Types of parameters 'x' and 'x' are incompatible. + Type 'Object' is not assignable to type 'string'. tests/cases/compiler/strictFunctionTypesErrors.ts(62,1): error TS2322: Type 'Func, string>' is not assignable to type 'Func, Object>'. Types of parameters 'x' and 'x' are incompatible. - Type 'Func' is not assignable to type 'Func'. + Types of parameters 'x' and 'x' are incompatible. + Type 'Object' is not assignable to type 'string'. tests/cases/compiler/strictFunctionTypesErrors.ts(65,1): error TS2322: Type 'Func, Object>' is not assignable to type 'Func, string>'. Types of parameters 'x' and 'x' are incompatible. - Type 'Func' is not assignable to type 'Func'. + Types of parameters 'x' and 'x' are incompatible. + Type 'Object' is not assignable to type 'string'. tests/cases/compiler/strictFunctionTypesErrors.ts(66,1): error TS2322: Type 'Func, string>' is not assignable to type 'Func, string>'. Types of parameters 'x' and 'x' are incompatible. - Type 'Func' is not assignable to type 'Func'. + Types of parameters 'x' and 'x' are incompatible. + Type 'Object' is not assignable to type 'string'. tests/cases/compiler/strictFunctionTypesErrors.ts(67,1): error TS2322: Type 'Func, Object>' is not assignable to type 'Func, string>'. Type 'Object' is not assignable to type 'string'. tests/cases/compiler/strictFunctionTypesErrors.ts(74,1): error TS2322: Type 'Func>' is not assignable to type 'Func>'. Type 'Func' is not assignable to type 'Func'. + Types of parameters 'x' and 'x' are incompatible. + Type 'Object' is not assignable to type 'string'. tests/cases/compiler/strictFunctionTypesErrors.ts(75,1): error TS2322: Type 'Func>' is not assignable to type 'Func>'. Types of parameters 'x' and 'x' are incompatible. Type 'Object' is not assignable to type 'string'. @@ -85,13 +89,11 @@ tests/cases/compiler/strictFunctionTypesErrors.ts(127,1): error TS2322: Type 'Cr Type 'Animal' is not assignable to type 'Dog'. tests/cases/compiler/strictFunctionTypesErrors.ts(133,1): error TS2322: Type '(f: (x: Dog) => Dog) => void' is not assignable to type '(f: (x: Animal) => Animal) => void'. Types of parameters 'f' and 'f' are incompatible. - Type '(x: Animal) => Animal' is not assignable to type '(x: Dog) => Dog'. - Type 'Animal' is not assignable to type 'Dog'. + Type 'Animal' is not assignable to type 'Dog'. tests/cases/compiler/strictFunctionTypesErrors.ts(134,1): error TS2322: Type '(f: (x: Animal) => Animal) => void' is not assignable to type '(f: (x: Dog) => Dog) => void'. Types of parameters 'f' and 'f' are incompatible. - Type '(x: Dog) => Dog' is not assignable to type '(x: Animal) => Animal'. - Types of parameters 'x' and 'x' are incompatible. - Type 'Animal' is not assignable to type 'Dog'. + Types of parameters 'x' and 'x' are incompatible. + Type 'Animal' is not assignable to type 'Dog'. ==== tests/cases/compiler/strictFunctionTypesErrors.ts (33 errors) ==== @@ -215,26 +217,28 @@ tests/cases/compiler/strictFunctionTypesErrors.ts(134,1): error TS2322: Type '(f ~~ !!! error TS2322: Type 'Func, Object>' is not assignable to type 'Func, Object>'. !!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'Func' is not assignable to type 'Func'. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'Object' is not assignable to type 'string'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'Object' is not assignable to type 'string'. h3 = h2; // Error ~~ !!! error TS2322: Type 'Func, string>' is not assignable to type 'Func, Object>'. !!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'Func' is not assignable to type 'Func'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'Object' is not assignable to type 'string'. h3 = h4; // Ok h4 = h1; // Error ~~ !!! error TS2322: Type 'Func, Object>' is not assignable to type 'Func, string>'. !!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'Func' is not assignable to type 'Func'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'Object' is not assignable to type 'string'. h4 = h2; // Error ~~ !!! error TS2322: Type 'Func, string>' is not assignable to type 'Func, string>'. !!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'Func' is not assignable to type 'Func'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'Object' is not assignable to type 'string'. h4 = h3; // Error ~~ !!! error TS2322: Type 'Func, Object>' is not assignable to type 'Func, string>'. @@ -249,6 +253,8 @@ tests/cases/compiler/strictFunctionTypesErrors.ts(134,1): error TS2322: Type '(f ~~ !!! error TS2322: Type 'Func>' is not assignable to type 'Func>'. !!! error TS2322: Type 'Func' is not assignable to type 'Func'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'Object' is not assignable to type 'string'. i1 = i3; // Error ~~ !!! error TS2322: Type 'Func>' is not assignable to type 'Func>'. @@ -347,13 +353,11 @@ tests/cases/compiler/strictFunctionTypesErrors.ts(134,1): error TS2322: Type '(f ~~~ !!! error TS2322: Type '(f: (x: Dog) => Dog) => void' is not assignable to type '(f: (x: Animal) => Animal) => void'. !!! error TS2322: Types of parameters 'f' and 'f' are incompatible. -!!! error TS2322: Type '(x: Animal) => Animal' is not assignable to type '(x: Dog) => Dog'. -!!! error TS2322: Type 'Animal' is not assignable to type 'Dog'. +!!! error TS2322: Type 'Animal' is not assignable to type 'Dog'. fc2 = fc1; // Error ~~~ !!! error TS2322: Type '(f: (x: Animal) => Animal) => void' is not assignable to type '(f: (x: Dog) => Dog) => void'. !!! error TS2322: Types of parameters 'f' and 'f' are incompatible. -!!! error TS2322: Type '(x: Dog) => Dog' is not assignable to type '(x: Animal) => Animal'. -!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. -!!! error TS2322: Type 'Animal' is not assignable to type 'Dog'. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'Animal' is not assignable to type 'Dog'. \ No newline at end of file From 7fcf51960ddc753754876c9905c84726ff0ff97e Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Fri, 6 Oct 2017 09:22:10 -0700 Subject: [PATCH 045/137] Add tests --- .../strictFunctionTypesErrors.errors.txt | 43 +++++++++- .../reference/strictFunctionTypesErrors.js | 43 +++++++++- .../strictFunctionTypesErrors.symbols | 78 +++++++++++++++++ .../reference/strictFunctionTypesErrors.types | 84 +++++++++++++++++++ .../compiler/strictFunctionTypesErrors.ts | 22 +++++ 5 files changed, 267 insertions(+), 3 deletions(-) diff --git a/tests/baselines/reference/strictFunctionTypesErrors.errors.txt b/tests/baselines/reference/strictFunctionTypesErrors.errors.txt index 600a58638ed..d8e36e43060 100644 --- a/tests/baselines/reference/strictFunctionTypesErrors.errors.txt +++ b/tests/baselines/reference/strictFunctionTypesErrors.errors.txt @@ -94,9 +94,17 @@ tests/cases/compiler/strictFunctionTypesErrors.ts(134,1): error TS2322: Type '(f Types of parameters 'f' and 'f' are incompatible. Types of parameters 'x' and 'x' are incompatible. Type 'Animal' is not assignable to type 'Dog'. +tests/cases/compiler/strictFunctionTypesErrors.ts(147,5): error TS2322: Type '(cb: (x: Animal) => Animal) => void' is not assignable to type '(cb: (x: Dog) => Animal) => void'. + Types of parameters 'cb' and 'cb' are incompatible. + Types of parameters 'x' and 'x' are incompatible. + Type 'Animal' is not assignable to type 'Dog'. +tests/cases/compiler/strictFunctionTypesErrors.ts(155,5): error TS2322: Type '(cb: (x: Animal) => Animal) => void' is not assignable to type '(cb: (x: Dog) => Animal) => void'. + Types of parameters 'cb' and 'cb' are incompatible. + Types of parameters 'x' and 'x' are incompatible. + Type 'Animal' is not assignable to type 'Dog'. -==== tests/cases/compiler/strictFunctionTypesErrors.ts (33 errors) ==== +==== tests/cases/compiler/strictFunctionTypesErrors.ts (35 errors) ==== export {} @@ -360,4 +368,35 @@ tests/cases/compiler/strictFunctionTypesErrors.ts(134,1): error TS2322: Type '(f !!! error TS2322: Types of parameters 'f' and 'f' are incompatible. !!! error TS2322: Types of parameters 'x' and 'x' are incompatible. !!! error TS2322: Type 'Animal' is not assignable to type 'Dog'. - \ No newline at end of file + + // Verify that callback parameters aren't loosely checked when types + // originate in method declarations + + namespace n1 { + class Foo { + static f1(x: Animal): Animal { throw "wat"; } + static f2(x: Dog): Animal { throw "wat"; }; + } + declare let f1: (cb: typeof Foo.f1) => void; + declare let f2: (cb: typeof Foo.f2) => void; + f1 = f2; + f2 = f1; // Error + ~~ +!!! error TS2322: Type '(cb: (x: Animal) => Animal) => void' is not assignable to type '(cb: (x: Dog) => Animal) => void'. +!!! error TS2322: Types of parameters 'cb' and 'cb' are incompatible. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'Animal' is not assignable to type 'Dog'. + } + + namespace n2 { + type BivariantHack = { foo(x: Input): Output }["foo"]; + declare let f1: (cb: BivariantHack) => void; + declare let f2: (cb: BivariantHack) => void; + f1 = f2; + f2 = f1; // Error + ~~ +!!! error TS2322: Type '(cb: (x: Animal) => Animal) => void' is not assignable to type '(cb: (x: Dog) => Animal) => void'. +!!! error TS2322: Types of parameters 'cb' and 'cb' are incompatible. +!!! error TS2322: Types of parameters 'x' and 'x' are incompatible. +!!! error TS2322: Type 'Animal' is not assignable to type 'Dog'. + } \ No newline at end of file diff --git a/tests/baselines/reference/strictFunctionTypesErrors.js b/tests/baselines/reference/strictFunctionTypesErrors.js index 8e338fa030d..d0608f6c1ac 100644 --- a/tests/baselines/reference/strictFunctionTypesErrors.js +++ b/tests/baselines/reference/strictFunctionTypesErrors.js @@ -133,7 +133,28 @@ declare let fc1: (f: (x: Animal) => Animal) => void; declare let fc2: (f: (x: Dog) => Dog) => void; fc1 = fc2; // Error fc2 = fc1; // Error - + +// Verify that callback parameters aren't loosely checked when types +// originate in method declarations + +namespace n1 { + class Foo { + static f1(x: Animal): Animal { throw "wat"; } + static f2(x: Dog): Animal { throw "wat"; }; + } + declare let f1: (cb: typeof Foo.f1) => void; + declare let f2: (cb: typeof Foo.f2) => void; + f1 = f2; + f2 = f1; // Error +} + +namespace n2 { + type BivariantHack = { foo(x: Input): Output }["foo"]; + declare let f1: (cb: BivariantHack) => void; + declare let f2: (cb: BivariantHack) => void; + f1 = f2; + f2 = f1; // Error +} //// [strictFunctionTypesErrors.js] "use strict"; @@ -195,3 +216,23 @@ animalCrate = dogCrate; // Error dogCrate = animalCrate; // Error fc1 = fc2; // Error fc2 = fc1; // Error +// Verify that callback parameters aren't loosely checked when types +// originate in method declarations +var n1; +(function (n1) { + var Foo = /** @class */ (function () { + function Foo() { + } + Foo.f1 = function (x) { throw "wat"; }; + Foo.f2 = function (x) { throw "wat"; }; + ; + return Foo; + }()); + f1 = f2; + f2 = f1; // Error +})(n1 || (n1 = {})); +var n2; +(function (n2) { + f1 = f2; + f2 = f1; // Error +})(n2 || (n2 = {})); diff --git a/tests/baselines/reference/strictFunctionTypesErrors.symbols b/tests/baselines/reference/strictFunctionTypesErrors.symbols index fd28775c5e1..c85c337ca44 100644 --- a/tests/baselines/reference/strictFunctionTypesErrors.symbols +++ b/tests/baselines/reference/strictFunctionTypesErrors.symbols @@ -424,3 +424,81 @@ fc2 = fc1; // Error >fc2 : Symbol(fc2, Decl(strictFunctionTypesErrors.ts, 131, 11)) >fc1 : Symbol(fc1, Decl(strictFunctionTypesErrors.ts, 130, 11)) +// Verify that callback parameters aren't loosely checked when types +// originate in method declarations + +namespace n1 { +>n1 : Symbol(n1, Decl(strictFunctionTypesErrors.ts, 133, 10)) + + class Foo { +>Foo : Symbol(Foo, Decl(strictFunctionTypesErrors.ts, 138, 14)) + + static f1(x: Animal): Animal { throw "wat"; } +>f1 : Symbol(Foo.f1, Decl(strictFunctionTypesErrors.ts, 139, 15)) +>x : Symbol(x, Decl(strictFunctionTypesErrors.ts, 140, 18)) +>Animal : Symbol(Animal, Decl(strictFunctionTypesErrors.ts, 87, 8)) +>Animal : Symbol(Animal, Decl(strictFunctionTypesErrors.ts, 87, 8)) + + static f2(x: Dog): Animal { throw "wat"; }; +>f2 : Symbol(Foo.f2, Decl(strictFunctionTypesErrors.ts, 140, 53)) +>x : Symbol(x, Decl(strictFunctionTypesErrors.ts, 141, 18)) +>Dog : Symbol(Dog, Decl(strictFunctionTypesErrors.ts, 89, 33)) +>Animal : Symbol(Animal, Decl(strictFunctionTypesErrors.ts, 87, 8)) + } + declare let f1: (cb: typeof Foo.f1) => void; +>f1 : Symbol(f1, Decl(strictFunctionTypesErrors.ts, 143, 15)) +>cb : Symbol(cb, Decl(strictFunctionTypesErrors.ts, 143, 21)) +>Foo.f1 : Symbol(Foo.f1, Decl(strictFunctionTypesErrors.ts, 139, 15)) +>Foo : Symbol(Foo, Decl(strictFunctionTypesErrors.ts, 138, 14)) +>f1 : Symbol(Foo.f1, Decl(strictFunctionTypesErrors.ts, 139, 15)) + + declare let f2: (cb: typeof Foo.f2) => void; +>f2 : Symbol(f2, Decl(strictFunctionTypesErrors.ts, 144, 15)) +>cb : Symbol(cb, Decl(strictFunctionTypesErrors.ts, 144, 21)) +>Foo.f2 : Symbol(Foo.f2, Decl(strictFunctionTypesErrors.ts, 140, 53)) +>Foo : Symbol(Foo, Decl(strictFunctionTypesErrors.ts, 138, 14)) +>f2 : Symbol(Foo.f2, Decl(strictFunctionTypesErrors.ts, 140, 53)) + + f1 = f2; +>f1 : Symbol(f1, Decl(strictFunctionTypesErrors.ts, 143, 15)) +>f2 : Symbol(f2, Decl(strictFunctionTypesErrors.ts, 144, 15)) + + f2 = f1; // Error +>f2 : Symbol(f2, Decl(strictFunctionTypesErrors.ts, 144, 15)) +>f1 : Symbol(f1, Decl(strictFunctionTypesErrors.ts, 143, 15)) +} + +namespace n2 { +>n2 : Symbol(n2, Decl(strictFunctionTypesErrors.ts, 147, 1)) + + type BivariantHack = { foo(x: Input): Output }["foo"]; +>BivariantHack : Symbol(BivariantHack, Decl(strictFunctionTypesErrors.ts, 149, 14)) +>Input : Symbol(Input, Decl(strictFunctionTypesErrors.ts, 150, 23)) +>Output : Symbol(Output, Decl(strictFunctionTypesErrors.ts, 150, 29)) +>foo : Symbol(foo, Decl(strictFunctionTypesErrors.ts, 150, 41)) +>x : Symbol(x, Decl(strictFunctionTypesErrors.ts, 150, 46)) +>Input : Symbol(Input, Decl(strictFunctionTypesErrors.ts, 150, 23)) +>Output : Symbol(Output, Decl(strictFunctionTypesErrors.ts, 150, 29)) + + declare let f1: (cb: BivariantHack) => void; +>f1 : Symbol(f1, Decl(strictFunctionTypesErrors.ts, 151, 15)) +>cb : Symbol(cb, Decl(strictFunctionTypesErrors.ts, 151, 21)) +>BivariantHack : Symbol(BivariantHack, Decl(strictFunctionTypesErrors.ts, 149, 14)) +>Animal : Symbol(Animal, Decl(strictFunctionTypesErrors.ts, 87, 8)) +>Animal : Symbol(Animal, Decl(strictFunctionTypesErrors.ts, 87, 8)) + + declare let f2: (cb: BivariantHack) => void; +>f2 : Symbol(f2, Decl(strictFunctionTypesErrors.ts, 152, 15)) +>cb : Symbol(cb, Decl(strictFunctionTypesErrors.ts, 152, 21)) +>BivariantHack : Symbol(BivariantHack, Decl(strictFunctionTypesErrors.ts, 149, 14)) +>Dog : Symbol(Dog, Decl(strictFunctionTypesErrors.ts, 89, 33)) +>Animal : Symbol(Animal, Decl(strictFunctionTypesErrors.ts, 87, 8)) + + f1 = f2; +>f1 : Symbol(f1, Decl(strictFunctionTypesErrors.ts, 151, 15)) +>f2 : Symbol(f2, Decl(strictFunctionTypesErrors.ts, 152, 15)) + + f2 = f1; // Error +>f2 : Symbol(f2, Decl(strictFunctionTypesErrors.ts, 152, 15)) +>f1 : Symbol(f1, Decl(strictFunctionTypesErrors.ts, 151, 15)) +} diff --git a/tests/baselines/reference/strictFunctionTypesErrors.types b/tests/baselines/reference/strictFunctionTypesErrors.types index 45deeebabab..1890279258c 100644 --- a/tests/baselines/reference/strictFunctionTypesErrors.types +++ b/tests/baselines/reference/strictFunctionTypesErrors.types @@ -480,3 +480,87 @@ fc2 = fc1; // Error >fc2 : (f: (x: Dog) => Dog) => void >fc1 : (f: (x: Animal) => Animal) => void +// Verify that callback parameters aren't loosely checked when types +// originate in method declarations + +namespace n1 { +>n1 : typeof n1 + + class Foo { +>Foo : Foo + + static f1(x: Animal): Animal { throw "wat"; } +>f1 : (x: Animal) => Animal +>x : Animal +>Animal : Animal +>Animal : Animal +>"wat" : "wat" + + static f2(x: Dog): Animal { throw "wat"; }; +>f2 : (x: Dog) => Animal +>x : Dog +>Dog : Dog +>Animal : Animal +>"wat" : "wat" + } + declare let f1: (cb: typeof Foo.f1) => void; +>f1 : (cb: (x: Animal) => Animal) => void +>cb : (x: Animal) => Animal +>Foo.f1 : (x: Animal) => Animal +>Foo : typeof Foo +>f1 : (x: Animal) => Animal + + declare let f2: (cb: typeof Foo.f2) => void; +>f2 : (cb: (x: Dog) => Animal) => void +>cb : (x: Dog) => Animal +>Foo.f2 : (x: Dog) => Animal +>Foo : typeof Foo +>f2 : (x: Dog) => Animal + + f1 = f2; +>f1 = f2 : (cb: (x: Dog) => Animal) => void +>f1 : (cb: (x: Animal) => Animal) => void +>f2 : (cb: (x: Dog) => Animal) => void + + f2 = f1; // Error +>f2 = f1 : (cb: (x: Animal) => Animal) => void +>f2 : (cb: (x: Dog) => Animal) => void +>f1 : (cb: (x: Animal) => Animal) => void +} + +namespace n2 { +>n2 : typeof n2 + + type BivariantHack = { foo(x: Input): Output }["foo"]; +>BivariantHack : (x: Input) => Output +>Input : Input +>Output : Output +>foo : (x: Input) => Output +>x : Input +>Input : Input +>Output : Output + + declare let f1: (cb: BivariantHack) => void; +>f1 : (cb: (x: Animal) => Animal) => void +>cb : (x: Animal) => Animal +>BivariantHack : (x: Input) => Output +>Animal : Animal +>Animal : Animal + + declare let f2: (cb: BivariantHack) => void; +>f2 : (cb: (x: Dog) => Animal) => void +>cb : (x: Dog) => Animal +>BivariantHack : (x: Input) => Output +>Dog : Dog +>Animal : Animal + + f1 = f2; +>f1 = f2 : (cb: (x: Dog) => Animal) => void +>f1 : (cb: (x: Animal) => Animal) => void +>f2 : (cb: (x: Dog) => Animal) => void + + f2 = f1; // Error +>f2 = f1 : (cb: (x: Animal) => Animal) => void +>f2 : (cb: (x: Dog) => Animal) => void +>f1 : (cb: (x: Animal) => Animal) => void +} diff --git a/tests/cases/compiler/strictFunctionTypesErrors.ts b/tests/cases/compiler/strictFunctionTypesErrors.ts index 95598d9d444..3f86f2529c0 100644 --- a/tests/cases/compiler/strictFunctionTypesErrors.ts +++ b/tests/cases/compiler/strictFunctionTypesErrors.ts @@ -133,3 +133,25 @@ declare let fc1: (f: (x: Animal) => Animal) => void; declare let fc2: (f: (x: Dog) => Dog) => void; fc1 = fc2; // Error fc2 = fc1; // Error + +// Verify that callback parameters aren't loosely checked when types +// originate in method declarations + +namespace n1 { + class Foo { + static f1(x: Animal): Animal { throw "wat"; } + static f2(x: Dog): Animal { throw "wat"; }; + } + declare let f1: (cb: typeof Foo.f1) => void; + declare let f2: (cb: typeof Foo.f2) => void; + f1 = f2; + f2 = f1; // Error +} + +namespace n2 { + type BivariantHack = { foo(x: Input): Output }["foo"]; + declare let f1: (cb: BivariantHack) => void; + declare let f2: (cb: BivariantHack) => void; + f1 = f2; + f2 = f1; // Error +} \ No newline at end of file From 5c9f8c56d95eee6bc897c8dfb64c398bf0e273fd Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Fri, 6 Oct 2017 10:20:12 -0700 Subject: [PATCH 046/137] Mark getSynthesizedDeepClone @internal --- src/compiler/factory.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index 84c28abe1a5..7d703ffe062 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -74,6 +74,7 @@ namespace ts { /** * Creates a deep, memberwise clone of a node with no source map location. */ + /* @internal */ export function getSynthesizedDeepClone(node: T | undefined): T | undefined { return node ? getSynthesizedClone(visitEachChild(node, child => getSynthesizedDeepClone(child), nullTransformationContext)) From 3b9bbb3e55c91775b9b1633bcd4cf6417d280b6b Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 6 Oct 2017 10:31:45 -0700 Subject: [PATCH 047/137] Remove duplicate assignment (#18994) --- src/compiler/checker.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 58248a8a9ee..bb37d09888b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -18451,9 +18451,8 @@ namespace ts { checkGrammarDecorators(node) || checkGrammarModifiers(node); checkVariableLikeDeclaration(node); - let func = getContainingFunction(node); + const func = getContainingFunction(node); if (hasModifier(node, ModifierFlags.ParameterPropertyModifier)) { - func = getContainingFunction(node); if (!(func.kind === SyntaxKind.Constructor && nodeIsPresent(func.body))) { error(node, Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } From fbf8df66f006553bc720751389e18d98a3f9b3cf Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Fri, 6 Oct 2017 14:27:32 -0700 Subject: [PATCH 048/137] accept baselines --- tests/baselines/reference/APISample_jsdoc.js | 4 ++-- tests/baselines/reference/api/tsserverlibrary.d.ts | 4 ++++ tests/baselines/reference/api/typescript.d.ts | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/baselines/reference/APISample_jsdoc.js b/tests/baselines/reference/APISample_jsdoc.js index 33857d06a6a..c74e188f38b 100644 --- a/tests/baselines/reference/APISample_jsdoc.js +++ b/tests/baselines/reference/APISample_jsdoc.js @@ -101,7 +101,7 @@ function getAllTags(node: ts.Node) { function getSomeOtherTags(node: ts.Node) { const tags: (ts.JSDocTag | undefined)[] = []; - tags.push(ts.getJSDocAugmentsOrExtendsTag(node)); + tags.push(ts.getJSDocAugmentsTag(node)); tags.push(ts.getJSDocClassTag(node)); tags.push(ts.getJSDocReturnTag(node)); const type = ts.getJSDocTypeTag(node); @@ -200,7 +200,7 @@ function getAllTags(node) { } function getSomeOtherTags(node) { var tags = []; - tags.push(ts.getJSDocAugmentsOrExtendsTag(node)); + tags.push(ts.getJSDocAugmentsTag(node)); tags.push(ts.getJSDocClassTag(node)); tags.push(ts.getJSDocReturnTag(node)); var type = ts.getJSDocTypeTag(node); diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 3bb2ed11674..ca8696b11fb 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -1442,6 +1442,10 @@ declare namespace ts { interface JSDocUnknownTag extends JSDocTag { kind: SyntaxKind.JSDocTag; } + /** + * Note that `@extends` is a synonym of `@augments`. + * Both tags are represented by this interface. + */ interface JSDocAugmentsTag extends JSDocTag { kind: SyntaxKind.JSDocAugmentsTag; class: ExpressionWithTypeArguments & { diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index d41db2eb413..820be44f1f1 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -1442,6 +1442,10 @@ declare namespace ts { interface JSDocUnknownTag extends JSDocTag { kind: SyntaxKind.JSDocTag; } + /** + * Note that `@extends` is a synonym of `@augments`. + * Both tags are represented by this interface. + */ interface JSDocAugmentsTag extends JSDocTag { kind: SyntaxKind.JSDocAugmentsTag; class: ExpressionWithTypeArguments & { From 71f885212451e09da16c8808361c46f3fc38227f Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 6 Oct 2017 14:29:45 -0700 Subject: [PATCH 049/137] Have getNameOfDeclaration return `x` for `export default x`. (#18616) --- src/compiler/binder.ts | 6 ++- src/compiler/utilities.ts | 46 +++++++++++-------- src/services/findAllReferences.ts | 5 +- src/services/importTracker.ts | 3 -- src/services/symbolDisplay.ts | 20 +++++--- .../duplicateExportAssignments.errors.txt | 44 +++++++++--------- .../baselines/reference/es5-commonjs7.symbols | 2 +- .../reference/exportDefaultVariable.symbols | 2 +- ...ationBindMultipleDefaultExports.errors.txt | 4 +- .../multipleDefaultExports01.errors.txt | 4 +- .../multipleExportAssignments.errors.txt | 8 ++-- ...AssignmentsInAmbientDeclaration.errors.txt | 8 ++-- .../reference/typeAliasExport.symbols | 2 +- ...indAllRefsDefaultImportThroughNamespace.ts | 15 +++--- .../findAllRefsForDefaultExport04.ts | 6 +-- ...currencesIsDefinitionOfComputedProperty.ts | 6 ++- 16 files changed, 100 insertions(+), 81 deletions(-) diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 796c9603423..28193535ce9 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -230,6 +230,10 @@ namespace ts { // Should not be called on a declaration with a computed property name, // unless it is a well known Symbol. function getDeclarationName(node: Declaration): __String { + if (node.kind === SyntaxKind.ExportAssignment) { + return (node).isExportEquals ? InternalSymbolName.ExportEquals : InternalSymbolName.Default; + } + const name = getNameOfDeclaration(node); if (name) { if (isAmbientModule(node)) { @@ -261,8 +265,6 @@ namespace ts { return InternalSymbolName.Index; case SyntaxKind.ExportDeclaration: return InternalSymbolName.ExportStar; - case SyntaxKind.ExportAssignment: - return (node).isExportEquals ? InternalSymbolName.ExportEquals : InternalSymbolName.Default; case SyntaxKind.BinaryExpression: if (getSpecialPropertyAssignmentKind(node as BinaryExpression) === SpecialPropertyAssignmentKind.ModuleExports) { // module.exports = ... diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index f0eb394adb7..ce209cbd811 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -4112,27 +4112,35 @@ namespace ts { if (!declaration) { return undefined; } - if (isJSDocPropertyLikeTag(declaration) && declaration.name.kind === SyntaxKind.QualifiedName) { - return declaration.name.right; - } - if (declaration.kind === SyntaxKind.BinaryExpression) { - const expr = declaration as BinaryExpression; - switch (getSpecialPropertyAssignmentKind(expr)) { - case SpecialPropertyAssignmentKind.ExportsProperty: - case SpecialPropertyAssignmentKind.ThisProperty: - case SpecialPropertyAssignmentKind.Property: - case SpecialPropertyAssignmentKind.PrototypeProperty: - return (expr.left as PropertyAccessExpression).name; - default: - return undefined; + switch (declaration.kind) { + case SyntaxKind.JSDocPropertyTag: + case SyntaxKind.JSDocParameterTag: { + const { name } = declaration as JSDocPropertyLikeTag; + if (name.kind === SyntaxKind.QualifiedName) { + return name.right; + } + break; + } + case SyntaxKind.BinaryExpression: { + const expr = declaration as BinaryExpression; + switch (getSpecialPropertyAssignmentKind(expr)) { + case SpecialPropertyAssignmentKind.ExportsProperty: + case SpecialPropertyAssignmentKind.ThisProperty: + case SpecialPropertyAssignmentKind.Property: + case SpecialPropertyAssignmentKind.PrototypeProperty: + return (expr.left as PropertyAccessExpression).name; + default: + return undefined; + } + } + case SyntaxKind.JSDocTypedefTag: + return getNameOfJSDocTypedef(declaration as JSDocTypedefTag); + case SyntaxKind.ExportAssignment: { + const { expression } = declaration as ExportAssignment; + return isIdentifier(expression) ? expression : undefined; } } - else if (declaration.kind === SyntaxKind.JSDocTypedefTag) { - return getNameOfJSDocTypedef(declaration as JSDocTypedefTag); - } - else { - return (declaration as NamedDeclaration).name; - } + return (declaration as NamedDeclaration).name; } /** diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts index d4e660295a0..e43a2cbfd8e 100644 --- a/src/services/findAllReferences.ts +++ b/src/services/findAllReferences.ts @@ -482,7 +482,10 @@ namespace ts.FindAllReferences.Core { /** @param allSearchSymbols set of additinal symbols for use by `includes`. */ createSearch(location: Node, symbol: Symbol, comingFrom: ImportExport | undefined, searchOptions: { text?: string, allSearchSymbols?: Symbol[] } = {}): Search { // Note: if this is an external module symbol, the name doesn't include quotes. - const { text = stripQuotes(getDeclaredName(this.checker, symbol, location)), allSearchSymbols = undefined } = searchOptions; + const { + text = stripQuotes(unescapeLeadingUnderscores((getLocalSymbolForExportDefault(symbol) || symbol).escapedName)), + allSearchSymbols = undefined, + } = searchOptions; const escapedText = escapeLeadingUnderscores(text); const parents = this.options.implementations && getParentSymbolsOfPropertyAccess(location, symbol, this.checker); return { diff --git a/src/services/importTracker.ts b/src/services/importTracker.ts index a6152230218..f12df4613c0 100644 --- a/src/services/importTracker.ts +++ b/src/services/importTracker.ts @@ -609,9 +609,6 @@ namespace ts.FindAllReferences { } return forEach(symbol.declarations, decl => { - if (isExportAssignment(decl)) { - return isIdentifier(decl.expression) ? decl.expression.escapedText : undefined; - } const name = getNameOfDeclaration(decl); return name && name.kind === SyntaxKind.Identifier && name.escapedText; }); diff --git a/src/services/symbolDisplay.ts b/src/services/symbolDisplay.ts index a399610d823..d38d21f1092 100644 --- a/src/services/symbolDisplay.ts +++ b/src/services/symbolDisplay.ts @@ -341,13 +341,19 @@ namespace ts.SymbolDisplay { } if (symbolFlags & SymbolFlags.Alias) { addNewLineIfDisplayPartsExist(); - if (symbol.declarations[0].kind === SyntaxKind.NamespaceExportDeclaration) { - displayParts.push(keywordPart(SyntaxKind.ExportKeyword)); - displayParts.push(spacePart()); - displayParts.push(keywordPart(SyntaxKind.NamespaceKeyword)); - } - else { - displayParts.push(keywordPart(SyntaxKind.ImportKeyword)); + switch (symbol.declarations[0].kind) { + case SyntaxKind.NamespaceExportDeclaration: + displayParts.push(keywordPart(SyntaxKind.ExportKeyword)); + displayParts.push(spacePart()); + displayParts.push(keywordPart(SyntaxKind.NamespaceKeyword)); + break; + case SyntaxKind.ExportAssignment: + displayParts.push(keywordPart(SyntaxKind.ExportKeyword)); + displayParts.push(spacePart()); + displayParts.push(keywordPart((symbol.declarations[0] as ExportAssignment).isExportEquals ? SyntaxKind.EqualsToken : SyntaxKind.DefaultKeyword)); + break; + default: + displayParts.push(keywordPart(SyntaxKind.ImportKeyword)); } displayParts.push(spacePart()); addFullSymbolName(symbol); diff --git a/tests/baselines/reference/duplicateExportAssignments.errors.txt b/tests/baselines/reference/duplicateExportAssignments.errors.txt index 17ad0a39847..0ad9507c9a6 100644 --- a/tests/baselines/reference/duplicateExportAssignments.errors.txt +++ b/tests/baselines/reference/duplicateExportAssignments.errors.txt @@ -1,34 +1,34 @@ -tests/cases/conformance/externalModules/foo1.ts(3,1): error TS2300: Duplicate identifier 'export='. -tests/cases/conformance/externalModules/foo1.ts(4,1): error TS2300: Duplicate identifier 'export='. -tests/cases/conformance/externalModules/foo2.ts(3,1): error TS2300: Duplicate identifier 'export='. -tests/cases/conformance/externalModules/foo2.ts(4,1): error TS2300: Duplicate identifier 'export='. -tests/cases/conformance/externalModules/foo3.ts(7,1): error TS2300: Duplicate identifier 'export='. -tests/cases/conformance/externalModules/foo3.ts(8,1): error TS2300: Duplicate identifier 'export='. -tests/cases/conformance/externalModules/foo4.ts(1,1): error TS2300: Duplicate identifier 'export='. -tests/cases/conformance/externalModules/foo4.ts(8,1): error TS2300: Duplicate identifier 'export='. -tests/cases/conformance/externalModules/foo5.ts(4,1): error TS2300: Duplicate identifier 'export='. -tests/cases/conformance/externalModules/foo5.ts(5,1): error TS2300: Duplicate identifier 'export='. -tests/cases/conformance/externalModules/foo5.ts(6,1): error TS2300: Duplicate identifier 'export='. +tests/cases/conformance/externalModules/foo1.ts(3,10): error TS2300: Duplicate identifier 'export='. +tests/cases/conformance/externalModules/foo1.ts(4,10): error TS2300: Duplicate identifier 'export='. +tests/cases/conformance/externalModules/foo2.ts(3,10): error TS2300: Duplicate identifier 'export='. +tests/cases/conformance/externalModules/foo2.ts(4,10): error TS2300: Duplicate identifier 'export='. +tests/cases/conformance/externalModules/foo3.ts(7,10): error TS2300: Duplicate identifier 'export='. +tests/cases/conformance/externalModules/foo3.ts(8,10): error TS2300: Duplicate identifier 'export='. +tests/cases/conformance/externalModules/foo4.ts(1,10): error TS2300: Duplicate identifier 'export='. +tests/cases/conformance/externalModules/foo4.ts(8,10): error TS2300: Duplicate identifier 'export='. +tests/cases/conformance/externalModules/foo5.ts(4,10): error TS2300: Duplicate identifier 'export='. +tests/cases/conformance/externalModules/foo5.ts(5,10): error TS2300: Duplicate identifier 'export='. +tests/cases/conformance/externalModules/foo5.ts(6,10): error TS2300: Duplicate identifier 'export='. ==== tests/cases/conformance/externalModules/foo1.ts (2 errors) ==== var x = 10; var y = 20; export = x; - ~~~~~~~~~~~ + ~ !!! error TS2300: Duplicate identifier 'export='. export = y; - ~~~~~~~~~~~ + ~ !!! error TS2300: Duplicate identifier 'export='. ==== tests/cases/conformance/externalModules/foo2.ts (2 errors) ==== var x = 10; class y {}; export = x; - ~~~~~~~~~~~ + ~ !!! error TS2300: Duplicate identifier 'export='. export = y; - ~~~~~~~~~~~ + ~ !!! error TS2300: Duplicate identifier 'export='. ==== tests/cases/conformance/externalModules/foo3.ts (2 errors) ==== @@ -39,15 +39,15 @@ tests/cases/conformance/externalModules/foo5.ts(6,1): error TS2300: Duplicate id y: number; } export = x; - ~~~~~~~~~~~ + ~ !!! error TS2300: Duplicate identifier 'export='. export = y; - ~~~~~~~~~~~ + ~ !!! error TS2300: Duplicate identifier 'export='. ==== tests/cases/conformance/externalModules/foo4.ts (2 errors) ==== export = x; - ~~~~~~~~~~~ + ~ !!! error TS2300: Duplicate identifier 'export='. function x(){ return 42; @@ -56,7 +56,7 @@ tests/cases/conformance/externalModules/foo5.ts(6,1): error TS2300: Duplicate id return 42; } export = y; - ~~~~~~~~~~~ + ~ !!! error TS2300: Duplicate identifier 'export='. ==== tests/cases/conformance/externalModules/foo5.ts (3 errors) ==== @@ -64,12 +64,12 @@ tests/cases/conformance/externalModules/foo5.ts(6,1): error TS2300: Duplicate id var y = "test"; var z = {}; export = x; - ~~~~~~~~~~~ + ~ !!! error TS2300: Duplicate identifier 'export='. export = y; - ~~~~~~~~~~~ + ~ !!! error TS2300: Duplicate identifier 'export='. export = z; - ~~~~~~~~~~~ + ~ !!! error TS2300: Duplicate identifier 'export='. \ No newline at end of file diff --git a/tests/baselines/reference/es5-commonjs7.symbols b/tests/baselines/reference/es5-commonjs7.symbols index ed8247a6878..eb6dc062573 100644 --- a/tests/baselines/reference/es5-commonjs7.symbols +++ b/tests/baselines/reference/es5-commonjs7.symbols @@ -1,6 +1,6 @@ === tests/cases/compiler/test.d.ts === export default undefined; ->undefined : Symbol(default) +>undefined : Symbol(undefined) export var __esModule; >__esModule : Symbol(__esModule, Decl(test.d.ts, 1, 10)) diff --git a/tests/baselines/reference/exportDefaultVariable.symbols b/tests/baselines/reference/exportDefaultVariable.symbols index cd7ebed926c..9c924c32f4e 100644 --- a/tests/baselines/reference/exportDefaultVariable.symbols +++ b/tests/baselines/reference/exportDefaultVariable.symbols @@ -6,6 +6,6 @@ declare var io: any; declare module 'module' { export default io; ->io : Symbol(default, Decl(exportDefaultVariable.ts, 2, 11)) +>io : Symbol(io, Decl(exportDefaultVariable.ts, 2, 11)) } diff --git a/tests/baselines/reference/jsFileCompilationBindMultipleDefaultExports.errors.txt b/tests/baselines/reference/jsFileCompilationBindMultipleDefaultExports.errors.txt index 9a9a7a12db9..246b8f20cac 100644 --- a/tests/baselines/reference/jsFileCompilationBindMultipleDefaultExports.errors.txt +++ b/tests/baselines/reference/jsFileCompilationBindMultipleDefaultExports.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/a.js(1,22): error TS2528: A module cannot have multiple default exports. tests/cases/compiler/a.js(1,22): error TS2652: Merged declaration 'a' cannot include a default export declaration. Consider adding a separate 'export default a' declaration instead. -tests/cases/compiler/a.js(3,1): error TS2528: A module cannot have multiple default exports. +tests/cases/compiler/a.js(3,15): error TS2528: A module cannot have multiple default exports. tests/cases/compiler/a.js(3,16): error TS1109: Expression expected. tests/cases/compiler/a.js(3,20): error TS2652: Merged declaration 'a' cannot include a default export declaration. Consider adding a separate 'export default a' declaration instead. @@ -13,7 +13,7 @@ tests/cases/compiler/a.js(3,20): error TS2652: Merged declaration 'a' cannot inc !!! error TS2652: Merged declaration 'a' cannot include a default export declaration. Consider adding a separate 'export default a' declaration instead. } export default var a = 10; - ~~~~~~~~~~~~~~ + !!! error TS2528: A module cannot have multiple default exports. ~~~ !!! error TS1109: Expression expected. diff --git a/tests/baselines/reference/multipleDefaultExports01.errors.txt b/tests/baselines/reference/multipleDefaultExports01.errors.txt index b53d4113ded..eff0203387c 100644 --- a/tests/baselines/reference/multipleDefaultExports01.errors.txt +++ b/tests/baselines/reference/multipleDefaultExports01.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/es6/modules/m1.ts(1,22): error TS2528: A module cannot have multiple default exports. tests/cases/conformance/es6/modules/m1.ts(5,25): error TS2528: A module cannot have multiple default exports. -tests/cases/conformance/es6/modules/m1.ts(10,1): error TS2528: A module cannot have multiple default exports. +tests/cases/conformance/es6/modules/m1.ts(10,16): error TS2528: A module cannot have multiple default exports. tests/cases/conformance/es6/modules/m2.ts(3,1): error TS2348: Value of type 'typeof foo' is not callable. Did you mean to include 'new'? @@ -19,7 +19,7 @@ tests/cases/conformance/es6/modules/m2.ts(3,1): error TS2348: Value of type 'typ var x = 10; export default x; - ~~~~~~~~~~~~~~~~~ + ~ !!! error TS2528: A module cannot have multiple default exports. ==== tests/cases/conformance/es6/modules/m2.ts (1 errors) ==== diff --git a/tests/baselines/reference/multipleExportAssignments.errors.txt b/tests/baselines/reference/multipleExportAssignments.errors.txt index 5fbabc2b4db..c9f5eb7cf79 100644 --- a/tests/baselines/reference/multipleExportAssignments.errors.txt +++ b/tests/baselines/reference/multipleExportAssignments.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/multipleExportAssignments.ts(13,1): error TS2300: Duplicate identifier 'export='. -tests/cases/compiler/multipleExportAssignments.ts(14,1): error TS2300: Duplicate identifier 'export='. +tests/cases/compiler/multipleExportAssignments.ts(13,10): error TS2300: Duplicate identifier 'export='. +tests/cases/compiler/multipleExportAssignments.ts(14,10): error TS2300: Duplicate identifier 'export='. ==== tests/cases/compiler/multipleExportAssignments.ts (2 errors) ==== @@ -16,10 +16,10 @@ tests/cases/compiler/multipleExportAssignments.ts(14,1): error TS2300: Duplicate test2(): connectModule; }; export = server; - ~~~~~~~~~~~~~~~~ + ~~~~~~ !!! error TS2300: Duplicate identifier 'export='. export = connectExport; - ~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~ !!! error TS2300: Duplicate identifier 'export='. \ No newline at end of file diff --git a/tests/baselines/reference/multipleExportAssignmentsInAmbientDeclaration.errors.txt b/tests/baselines/reference/multipleExportAssignmentsInAmbientDeclaration.errors.txt index c6427a5cc28..792e2dd5968 100644 --- a/tests/baselines/reference/multipleExportAssignmentsInAmbientDeclaration.errors.txt +++ b/tests/baselines/reference/multipleExportAssignmentsInAmbientDeclaration.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/multipleExportAssignmentsInAmbientDeclaration.ts(4,5): error TS2300: Duplicate identifier 'export='. -tests/cases/compiler/multipleExportAssignmentsInAmbientDeclaration.ts(5,5): error TS2300: Duplicate identifier 'export='. +tests/cases/compiler/multipleExportAssignmentsInAmbientDeclaration.ts(4,14): error TS2300: Duplicate identifier 'export='. +tests/cases/compiler/multipleExportAssignmentsInAmbientDeclaration.ts(5,14): error TS2300: Duplicate identifier 'export='. ==== tests/cases/compiler/multipleExportAssignmentsInAmbientDeclaration.ts (2 errors) ==== @@ -7,9 +7,9 @@ tests/cases/compiler/multipleExportAssignmentsInAmbientDeclaration.ts(5,5): erro var a: number var b: number; export = a; - ~~~~~~~~~~~ + ~ !!! error TS2300: Duplicate identifier 'export='. export = b; - ~~~~~~~~~~~ + ~ !!! error TS2300: Duplicate identifier 'export='. } \ No newline at end of file diff --git a/tests/baselines/reference/typeAliasExport.symbols b/tests/baselines/reference/typeAliasExport.symbols index e019ca7a10b..5ffe181ca70 100644 --- a/tests/baselines/reference/typeAliasExport.symbols +++ b/tests/baselines/reference/typeAliasExport.symbols @@ -1,7 +1,7 @@ === tests/cases/compiler/typeAliasExport.ts === declare module "a" { export default undefined ->undefined : Symbol(default) +>undefined : Symbol(undefined) export var a; >a : Symbol(a, Decl(typeAliasExport.ts, 2, 12), Decl(typeAliasExport.ts, 2, 15)) diff --git a/tests/cases/fourslash/findAllRefsDefaultImportThroughNamespace.ts b/tests/cases/fourslash/findAllRefsDefaultImportThroughNamespace.ts index e5f77631324..1411a106c89 100644 --- a/tests/cases/fourslash/findAllRefsDefaultImportThroughNamespace.ts +++ b/tests/cases/fourslash/findAllRefsDefaultImportThroughNamespace.ts @@ -1,7 +1,7 @@ /// // @Filename: /a.ts -////export default function [|{| "isWriteAccess": true, "isDefinition": true |}f|]() {} +////export [|{| "isWriteAccess": true, "isDefinition": true |}default|] function [|{| "isWriteAccess": true, "isDefinition": true |}f|]() {} // @Filename: /b.ts ////export import a = require("./a"); @@ -13,16 +13,17 @@ ////declare const x: { [|{| "isWriteAccess": true, "isDefinition": true |}default|]: number }; ////x.[|default|]; -const [r0, r1, r2, r3] = test.ranges(); +const [r0, r1, r2, r3, r4] = test.ranges(); -verify.singleReferenceGroup("function f(): void", [r0, r1]); -verify.singleReferenceGroup("(property) default: number", [r2, r3]); +verify.referenceGroups([r0], [{ definition: "function f(): void", ranges: [r1, r2] }]); +verify.singleReferenceGroup("function f(): void", [r1, r2]); +verify.singleReferenceGroup("(property) default: number", [r3, r4]); -verify.rangesAreRenameLocations([r0]); +verify.rangesAreRenameLocations([r1]); // Can't rename a default import. -goTo.rangeStart(r1); +goTo.rangeStart(r2); verify.renameInfoFailed(); // Can rename a default property. -verify.rangesAreRenameLocations([r2, r3]); +verify.rangesAreRenameLocations([r3, r4]); diff --git a/tests/cases/fourslash/findAllRefsForDefaultExport04.ts b/tests/cases/fourslash/findAllRefsForDefaultExport04.ts index 1b5eb7a282d..093910d1cb5 100644 --- a/tests/cases/fourslash/findAllRefsForDefaultExport04.ts +++ b/tests/cases/fourslash/findAllRefsForDefaultExport04.ts @@ -14,12 +14,10 @@ verify.referenceGroups([r0, r2], [ { definition: "import a", ranges: [r3, r4] } ]); verify.referenceGroups(r1, [ - // TODO:GH#17990 - { definition: "import default", ranges: [r1] }, + { definition: "export default a", ranges: [r1] }, { definition: "import a", ranges: [r3, r4] }, ]); verify.referenceGroups([r3, r4], [ { definition: "import a", ranges: [r3, r4] }, - // TODO:GH#17990 - { definition: "import default", ranges: [r1] }, + { definition: "export default a", ranges: [r1] }, ]); diff --git a/tests/cases/fourslash/getOccurrencesIsDefinitionOfComputedProperty.ts b/tests/cases/fourslash/getOccurrencesIsDefinitionOfComputedProperty.ts index 7d6cb0a48af..329a72c30fd 100644 --- a/tests/cases/fourslash/getOccurrencesIsDefinitionOfComputedProperty.ts +++ b/tests/cases/fourslash/getOccurrencesIsDefinitionOfComputedProperty.ts @@ -6,4 +6,8 @@ const ranges = test.ranges(); const [r0, r1, r2] = ranges; verify.referenceGroups(r0, [{ definition: '(property) ["foo"]: number', ranges }]); -verify.referenceGroups([r1, r2], undefined); // TODO: fix +verify.referenceGroups([r1, r2], [ + // TODO: these are the same thing, should be in the same group. + { definition: "(property) [\"foo\"]: number", ranges: [r0] }, + { definition: "(property) [\"foo\"]: number", ranges: [r1, r2] }, +]); From e821c2b6e9f244264779045fd1720fb9d16c0bb2 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 6 Oct 2017 15:05:00 -0700 Subject: [PATCH 050/137] A parameter not declared as a rest parameter is not one (#18825) --- src/compiler/checker.ts | 2 +- src/compiler/utilities.ts | 22 ++++--------------- ...ileCompilationRestParamJsDocFunction.types | 4 ++-- .../reference/jsdocPrefixPostfixParsing.types | 2 +- 4 files changed, 8 insertions(+), 22 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index e1a60c3c5e2..a8e18c432a6 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -20298,7 +20298,7 @@ namespace ts { function checkCollisionWithArgumentsInGeneratedCode(node: SignatureDeclaration) { // no rest parameters \ declaration context \ overload - no codegen impact - if (!hasDeclaredRestParameter(node) || isInAmbientContext(node) || nodeIsMissing((node).body)) { + if (!hasRestParameter(node) || isInAmbientContext(node) || nodeIsMissing((node).body)) { return; } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index ce209cbd811..bdf8d81aa96 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -1604,26 +1604,12 @@ namespace ts { } export function hasRestParameter(s: SignatureDeclaration): boolean { - return isRestParameter(lastOrUndefined(s.parameters)); + const last = lastOrUndefined(s.parameters); + return last && isRestParameter(last); } - export function hasDeclaredRestParameter(s: SignatureDeclaration): boolean { - return isDeclaredRestParam(lastOrUndefined(s.parameters)); - } - - export function isRestParameter(node: ParameterDeclaration) { - if (isInJavaScriptFile(node)) { - if (node.type && node.type.kind === SyntaxKind.JSDocVariadicType || - forEach(getJSDocParameterTags(node), - t => t.typeExpression && t.typeExpression.type.kind === SyntaxKind.JSDocVariadicType)) { - return true; - } - } - return isDeclaredRestParam(node); - } - - export function isDeclaredRestParam(node: ParameterDeclaration) { - return node && node.dotDotDotToken !== undefined; + export function isRestParameter(node: ParameterDeclaration): boolean { + return node.dotDotDotToken !== undefined; } export const enum AssignmentKind { diff --git a/tests/baselines/reference/jsFileCompilationRestParamJsDocFunction.types b/tests/baselines/reference/jsFileCompilationRestParamJsDocFunction.types index 54bc7938689..72c3388f226 100644 --- a/tests/baselines/reference/jsFileCompilationRestParamJsDocFunction.types +++ b/tests/baselines/reference/jsFileCompilationRestParamJsDocFunction.types @@ -10,7 +10,7 @@ * @returns {*} Returns the result of `func`. */ function apply(func, thisArg, args) { ->apply : (func: Function, thisArg: any, ...args: any[]) => any +>apply : (func: Function, thisArg: any, args: any[]) => any >func : Function >thisArg : any >args : any[] @@ -84,5 +84,5 @@ function apply(func, thisArg, args) { } export default apply; ->apply : (func: Function, thisArg: any, ...args: any[]) => any +>apply : (func: Function, thisArg: any, args: any[]) => any diff --git a/tests/baselines/reference/jsdocPrefixPostfixParsing.types b/tests/baselines/reference/jsdocPrefixPostfixParsing.types index b5ddec68cba..9961af48e27 100644 --- a/tests/baselines/reference/jsdocPrefixPostfixParsing.types +++ b/tests/baselines/reference/jsdocPrefixPostfixParsing.types @@ -16,7 +16,7 @@ * @param {...number?[]!} k - (number[] | null)[] */ function f(x, y, z, a, b, c, d, e, f, g, h, i, j, k) { ->f : (x: number[], y: number[], z: number[], a: (number | null)[], b: number[] | null, c: number[] | null, d: number[] | null, ...e: (number | null)[], f: number[] | null, g: number[] | null, h: number[] | null, i: number[][], j: number[][] | null, k: (number[] | null)[]) => void +>f : (x: number[], y: number[], z: number[], a: (number | null)[], b: number[] | null, c: number[] | null, d: number[] | null, e: (number | null)[], f: number[] | null, g: number[] | null, h: number[] | null, i: number[][], j: number[][] | null, k: (number[] | null)[]) => void >x : number[] >y : number[] >z : number[] From 0afaadba3b83dfbad89a8c2c5d812ef8ab783361 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Fri, 6 Oct 2017 15:56:39 -0700 Subject: [PATCH 051/137] add error for multiple tags --- src/compiler/checker.ts | 14 ++++-- src/compiler/diagnosticMessages.json | 4 ++ src/compiler/utilities.ts | 6 +++ .../fourslash/jsDocAugmentsAndExtends.ts | 50 +++++++++++++++++++ 4 files changed, 70 insertions(+), 4 deletions(-) create mode 100644 tests/cases/fourslash/jsDocAugmentsAndExtends.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 718fd76625f..31c9acd8fb1 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -20009,14 +20009,20 @@ namespace ts { } function checkJSDocAugmentsTag(node: JSDocAugmentsTag): void { - const cls = getJSDocHost(node); - if (!isClassDeclaration(cls) && !isClassExpression(cls)) { - error(cls, Diagnostics.JSDoc_augments_is_not_attached_to_a_class_declaration); + const classLike = getJSDocHost(node); + if (!isClassDeclaration(classLike) && !isClassExpression(classLike)) { + error(classLike, Diagnostics.JSDoc_augments_is_not_attached_to_a_class_declaration); return; } + const augmentsTags = getAllJSDocTagsOfKind(classLike, SyntaxKind.JSDocAugmentsTag); + Debug.assert(augmentsTags.length > 0); + if (augmentsTags.length > 1) { + error(augmentsTags[1], Diagnostics.The_total_number_of_augments_and_extends_tags_allowed_for_a_single_class_declaration_is_at_most_1); + } + const name = getIdentifierFromEntityNameExpression(node.class.expression); - const extend = getClassExtendsHeritageClauseElement(cls); + const extend = getClassExtendsHeritageClauseElement(classLike); if (extend) { const className = getIdentifierFromEntityNameExpression(extend.expression); if (className && name.escapedText !== className.escapedText) { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index f3d6d4fcc47..64c4d99d349 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3527,6 +3527,10 @@ "category": "Error", "code": 8024 }, + "The total number of `@augments` and `@extends` tags allowed for a single class declaration is at most 1.": { + "category": "Error", + "code": 8025 + }, "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clause.": { "category": "Error", "code": 9002 diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index f0eb394adb7..825b310ddeb 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -4247,6 +4247,12 @@ namespace ts { return find(tags, doc => doc.kind === kind); } + /** Gets all JSDoc tags of a specified kind, or undefined if not present. */ + export function getAllJSDocTagsOfKind(node: Node, kind: SyntaxKind): ReadonlyArray | undefined { + const tags = getJSDocTags(node); + return filter(tags, doc => doc.kind === kind); + } + } // Simple node tests of the form `node.kind === SyntaxKind.Foo`. diff --git a/tests/cases/fourslash/jsDocAugmentsAndExtends.ts b/tests/cases/fourslash/jsDocAugmentsAndExtends.ts new file mode 100644 index 00000000000..e76a617a3cf --- /dev/null +++ b/tests/cases/fourslash/jsDocAugmentsAndExtends.ts @@ -0,0 +1,50 @@ +/// + +// @allowJs: true +// @checkJs: true +// @Filename: dummy.js + +//// /** +//// * @augments {Thing} +//// * @extends {Thing} +//// */ +//// class MyStringThing extends Thing { +//// constructor() { +//// var x = this.mine; +//// x/**/; +//// } +//// } + +// @Filename: declarations.d.ts +//// declare class Thing { +//// mine: T; +//// } + +// if more than one tag is present, report an error and take the type of the first entry. + +goTo.marker(); +verify.quickInfoIs("(local var) x: number"); +verify.getSemanticDiagnostics( +`[ + { + "message": "The total number of \`@augments\` and \`@extends\` tags allowed for a single class declaration is at most 1.", + "start": 36, + "length": 24, + "category": "error", + "code": 8025 + }, + { + "message": "Constructors for derived classes must contain a \'super\' call.", + "start": 105, + "length": 59, + "category": "error", + "code": 2377 + }, + { + "message": "\'super\' must be called before accessing \'this\' in the constructor of a derived class.", + "start": 137, + "length": 4, + "category": "error", + "code": 17009 + } +]`); \ No newline at end of file From 932b1b038c712b73eda432b5296263fe32af6a6d Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Fri, 6 Oct 2017 16:16:37 -0700 Subject: [PATCH 052/137] better error message --- src/compiler/checker.ts | 2 +- src/compiler/diagnosticMessages.json | 2 +- .../cases/fourslash/jsDocAugmentsAndExtends.ts | 17 ++--------------- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 31c9acd8fb1..aa5d10c475c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -20018,7 +20018,7 @@ namespace ts { const augmentsTags = getAllJSDocTagsOfKind(classLike, SyntaxKind.JSDocAugmentsTag); Debug.assert(augmentsTags.length > 0); if (augmentsTags.length > 1) { - error(augmentsTags[1], Diagnostics.The_total_number_of_augments_and_extends_tags_allowed_for_a_single_class_declaration_is_at_most_1); + error(augmentsTags[1], Diagnostics.Class_declarations_cannot_have_more_than_one_augments_or_extends_tag); } const name = getIdentifierFromEntityNameExpression(node.class.expression); diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 64c4d99d349..e0de43a97db 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3527,7 +3527,7 @@ "category": "Error", "code": 8024 }, - "The total number of `@augments` and `@extends` tags allowed for a single class declaration is at most 1.": { + "Class declarations cannot have more than one `@augments` or `@extends` tag.": { "category": "Error", "code": 8025 }, diff --git a/tests/cases/fourslash/jsDocAugmentsAndExtends.ts b/tests/cases/fourslash/jsDocAugmentsAndExtends.ts index e76a617a3cf..10f33260268 100644 --- a/tests/cases/fourslash/jsDocAugmentsAndExtends.ts +++ b/tests/cases/fourslash/jsDocAugmentsAndExtends.ts @@ -10,6 +10,7 @@ //// */ //// class MyStringThing extends Thing { //// constructor() { +//// super(); //// var x = this.mine; //// x/**/; //// } @@ -27,24 +28,10 @@ verify.quickInfoIs("(local var) x: number"); verify.getSemanticDiagnostics( `[ { - "message": "The total number of \`@augments\` and \`@extends\` tags allowed for a single class declaration is at most 1.", + "message": "Class declarations cannot have more than one \`@augments\` or \`@extends\` tag.", "start": 36, "length": 24, "category": "error", "code": 8025 - }, - { - "message": "Constructors for derived classes must contain a \'super\' call.", - "start": 105, - "length": 59, - "category": "error", - "code": 2377 - }, - { - "message": "\'super\' must be called before accessing \'this\' in the constructor of a derived class.", - "start": 137, - "length": 4, - "category": "error", - "code": 17009 } ]`); \ No newline at end of file From 9e00df590d638cad1266e388385396aea2879cc3 Mon Sep 17 00:00:00 2001 From: Charles Pierce Date: Fri, 6 Oct 2017 19:46:29 -0700 Subject: [PATCH 053/137] Error when accessing abstract property in constructor #9230 --- src/compiler/checker.ts | 28 ++++++++-- src/compiler/diagnosticMessages.json | 4 ++ .../abstractPropertyInConstructor.errors.txt | 25 +++++++++ .../abstractPropertyInConstructor.js | 30 ++++++++++ .../abstractPropertyInConstructor.symbols | 48 ++++++++++++++++ .../abstractPropertyInConstructor.types | 56 +++++++++++++++++++ .../compiler/abstractPropertyInConstructor.ts | 15 +++++ 7 files changed, 201 insertions(+), 5 deletions(-) create mode 100644 tests/baselines/reference/abstractPropertyInConstructor.errors.txt create mode 100644 tests/baselines/reference/abstractPropertyInConstructor.js create mode 100644 tests/baselines/reference/abstractPropertyInConstructor.symbols create mode 100644 tests/baselines/reference/abstractPropertyInConstructor.types create mode 100644 tests/cases/compiler/abstractPropertyInConstructor.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a8e18c432a6..9a483ae50ed 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -14826,11 +14826,7 @@ namespace ts { // where this references the constructor function object of a derived class, // a super property access is permitted and must specify a public static member function of the base class. if (languageVersion < ScriptTarget.ES2015) { - const hasNonMethodDeclaration = forEachProperty(prop, p => { - const propKind = getDeclarationKindFromSymbol(p); - return propKind !== SyntaxKind.MethodDeclaration && propKind !== SyntaxKind.MethodSignature; - }); - if (hasNonMethodDeclaration) { + if (symbolHasNonMethodDeclaration(prop)) { error(errorNode, Diagnostics.Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword); return false; } @@ -14845,6 +14841,17 @@ namespace ts { } } + // Referencing Abstract Properties within Constructors is not allowed + if ((flags & ModifierFlags.Abstract) && symbolHasNonMethodDeclaration(prop)) { + const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop)); + const declaringClassConstructor = declaringClassDeclaration && findConstructorDeclaration(declaringClassDeclaration); + + if (declaringClassConstructor && isNodeWithinFunction(node, declaringClassConstructor)) { + error(errorNode, Diagnostics.Abstract_property_0_in_class_1_cannot_be_accessed_in_constructor, symbolToString(prop), typeToString(getDeclaringClass(prop))); + return false; + } + } + // Public properties are otherwise accessible. if (!(flags & ModifierFlags.NonPublicAccessibilityModifier)) { return true; @@ -14896,6 +14903,13 @@ namespace ts { return true; } + function symbolHasNonMethodDeclaration(symbol: Symbol) { + return forEachProperty(symbol, prop => { + const propKind = getDeclarationKindFromSymbol(prop); + return propKind !== SyntaxKind.MethodDeclaration && propKind !== SyntaxKind.MethodSignature; + }); + } + function checkNonNullExpression(node: Expression | QualifiedName) { return checkNonNullType(checkExpression(node), node); } @@ -23139,6 +23153,10 @@ namespace ts { return result; } + function isNodeWithinFunction(node: Node, functionDeclaration: FunctionLike) { + return getContainingFunction(node) === functionDeclaration; + } + function isNodeWithinClass(node: Node, classDeclaration: ClassLikeDeclaration) { return !!forEachEnclosingClass(node, n => n === classDeclaration); } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index f3d6d4fcc47..e2d514ba268 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2220,6 +2220,10 @@ "category": "Error", "code": 2714 }, + "Abstract property '{0}' in class '{1}' cannot be accessed in constructor.": { + "category": "Error", + "code": 2715 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", diff --git a/tests/baselines/reference/abstractPropertyInConstructor.errors.txt b/tests/baselines/reference/abstractPropertyInConstructor.errors.txt new file mode 100644 index 00000000000..7e654b440c6 --- /dev/null +++ b/tests/baselines/reference/abstractPropertyInConstructor.errors.txt @@ -0,0 +1,25 @@ +tests/cases/compiler/abstractPropertyInConstructor.ts(4,24): error TS2715: Abstract property 'prop' in class 'AbstractClass' cannot be accessed in constructor. +tests/cases/compiler/abstractPropertyInConstructor.ts(5,14): error TS2715: Abstract property 'prop' in class 'AbstractClass' cannot be accessed in constructor. + + +==== tests/cases/compiler/abstractPropertyInConstructor.ts (2 errors) ==== + abstract class AbstractClass { + constructor(str: string) { + this.method(parseInt(str)); + let val = this.prop.toLowerCase(); + ~~~~ +!!! error TS2715: Abstract property 'prop' in class 'AbstractClass' cannot be accessed in constructor. + this.prop = "Hello World"; + ~~~~ +!!! error TS2715: Abstract property 'prop' in class 'AbstractClass' cannot be accessed in constructor. + } + + abstract prop: string; + + abstract method(num: number): void; + + method2() { + this.prop = this.prop + "!"; + } + } + \ No newline at end of file diff --git a/tests/baselines/reference/abstractPropertyInConstructor.js b/tests/baselines/reference/abstractPropertyInConstructor.js new file mode 100644 index 00000000000..c6d7de6c037 --- /dev/null +++ b/tests/baselines/reference/abstractPropertyInConstructor.js @@ -0,0 +1,30 @@ +//// [abstractPropertyInConstructor.ts] +abstract class AbstractClass { + constructor(str: string) { + this.method(parseInt(str)); + let val = this.prop.toLowerCase(); + this.prop = "Hello World"; + } + + abstract prop: string; + + abstract method(num: number): void; + + method2() { + this.prop = this.prop + "!"; + } +} + + +//// [abstractPropertyInConstructor.js] +var AbstractClass = /** @class */ (function () { + function AbstractClass(str) { + this.method(parseInt(str)); + var val = this.prop.toLowerCase(); + this.prop = "Hello World"; + } + AbstractClass.prototype.method2 = function () { + this.prop = this.prop + "!"; + }; + return AbstractClass; +}()); diff --git a/tests/baselines/reference/abstractPropertyInConstructor.symbols b/tests/baselines/reference/abstractPropertyInConstructor.symbols new file mode 100644 index 00000000000..7d634f80267 --- /dev/null +++ b/tests/baselines/reference/abstractPropertyInConstructor.symbols @@ -0,0 +1,48 @@ +=== tests/cases/compiler/abstractPropertyInConstructor.ts === +abstract class AbstractClass { +>AbstractClass : Symbol(AbstractClass, Decl(abstractPropertyInConstructor.ts, 0, 0)) + + constructor(str: string) { +>str : Symbol(str, Decl(abstractPropertyInConstructor.ts, 1, 16)) + + this.method(parseInt(str)); +>this.method : Symbol(AbstractClass.method, Decl(abstractPropertyInConstructor.ts, 7, 26)) +>this : Symbol(AbstractClass, Decl(abstractPropertyInConstructor.ts, 0, 0)) +>method : Symbol(AbstractClass.method, Decl(abstractPropertyInConstructor.ts, 7, 26)) +>parseInt : Symbol(parseInt, Decl(lib.d.ts, --, --)) +>str : Symbol(str, Decl(abstractPropertyInConstructor.ts, 1, 16)) + + let val = this.prop.toLowerCase(); +>val : Symbol(val, Decl(abstractPropertyInConstructor.ts, 3, 11)) +>this.prop.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) +>this.prop : Symbol(AbstractClass.prop, Decl(abstractPropertyInConstructor.ts, 5, 5)) +>this : Symbol(AbstractClass, Decl(abstractPropertyInConstructor.ts, 0, 0)) +>prop : Symbol(AbstractClass.prop, Decl(abstractPropertyInConstructor.ts, 5, 5)) +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) + + this.prop = "Hello World"; +>this.prop : Symbol(AbstractClass.prop, Decl(abstractPropertyInConstructor.ts, 5, 5)) +>this : Symbol(AbstractClass, Decl(abstractPropertyInConstructor.ts, 0, 0)) +>prop : Symbol(AbstractClass.prop, Decl(abstractPropertyInConstructor.ts, 5, 5)) + } + + abstract prop: string; +>prop : Symbol(AbstractClass.prop, Decl(abstractPropertyInConstructor.ts, 5, 5)) + + abstract method(num: number): void; +>method : Symbol(AbstractClass.method, Decl(abstractPropertyInConstructor.ts, 7, 26)) +>num : Symbol(num, Decl(abstractPropertyInConstructor.ts, 9, 20)) + + method2() { +>method2 : Symbol(AbstractClass.method2, Decl(abstractPropertyInConstructor.ts, 9, 39)) + + this.prop = this.prop + "!"; +>this.prop : Symbol(AbstractClass.prop, Decl(abstractPropertyInConstructor.ts, 5, 5)) +>this : Symbol(AbstractClass, Decl(abstractPropertyInConstructor.ts, 0, 0)) +>prop : Symbol(AbstractClass.prop, Decl(abstractPropertyInConstructor.ts, 5, 5)) +>this.prop : Symbol(AbstractClass.prop, Decl(abstractPropertyInConstructor.ts, 5, 5)) +>this : Symbol(AbstractClass, Decl(abstractPropertyInConstructor.ts, 0, 0)) +>prop : Symbol(AbstractClass.prop, Decl(abstractPropertyInConstructor.ts, 5, 5)) + } +} + diff --git a/tests/baselines/reference/abstractPropertyInConstructor.types b/tests/baselines/reference/abstractPropertyInConstructor.types new file mode 100644 index 00000000000..05f7a7752e6 --- /dev/null +++ b/tests/baselines/reference/abstractPropertyInConstructor.types @@ -0,0 +1,56 @@ +=== tests/cases/compiler/abstractPropertyInConstructor.ts === +abstract class AbstractClass { +>AbstractClass : AbstractClass + + constructor(str: string) { +>str : string + + this.method(parseInt(str)); +>this.method(parseInt(str)) : void +>this.method : (num: number) => void +>this : this +>method : (num: number) => void +>parseInt(str) : number +>parseInt : (s: string, radix?: number) => number +>str : string + + let val = this.prop.toLowerCase(); +>val : string +>this.prop.toLowerCase() : string +>this.prop.toLowerCase : () => string +>this.prop : string +>this : this +>prop : string +>toLowerCase : () => string + + this.prop = "Hello World"; +>this.prop = "Hello World" : "Hello World" +>this.prop : string +>this : this +>prop : string +>"Hello World" : "Hello World" + } + + abstract prop: string; +>prop : string + + abstract method(num: number): void; +>method : (num: number) => void +>num : number + + method2() { +>method2 : () => void + + this.prop = this.prop + "!"; +>this.prop = this.prop + "!" : string +>this.prop : string +>this : this +>prop : string +>this.prop + "!" : string +>this.prop : string +>this : this +>prop : string +>"!" : "!" + } +} + diff --git a/tests/cases/compiler/abstractPropertyInConstructor.ts b/tests/cases/compiler/abstractPropertyInConstructor.ts new file mode 100644 index 00000000000..5376aae9d6f --- /dev/null +++ b/tests/cases/compiler/abstractPropertyInConstructor.ts @@ -0,0 +1,15 @@ +abstract class AbstractClass { + constructor(str: string) { + this.method(parseInt(str)); + let val = this.prop.toLowerCase(); + this.prop = "Hello World"; + } + + abstract prop: string; + + abstract method(num: number): void; + + method2() { + this.prop = this.prop + "!"; + } +} From 8a55baf9a3caf88c7e89e563ec51466644981df4 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 9 Oct 2017 09:58:02 -0700 Subject: [PATCH 054/137] In @typedef tag, handle property with no type (#19013) --- src/compiler/binder.ts | 2 +- src/compiler/parser.ts | 2 +- src/compiler/types.ts | 2 +- tests/baselines/reference/api/tsserverlibrary.d.ts | 2 +- tests/baselines/reference/api/typescript.d.ts | 2 +- .../jsdocTypedef_propertyWithNoType.symbols | 11 +++++++++++ .../reference/jsdocTypedef_propertyWithNoType.types | 13 +++++++++++++ .../compiler/jsdocTypedef_propertyWithNoType.ts | 12 ++++++++++++ 8 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 tests/baselines/reference/jsdocTypedef_propertyWithNoType.symbols create mode 100644 tests/baselines/reference/jsdocTypedef_propertyWithNoType.types create mode 100644 tests/cases/compiler/jsdocTypedef_propertyWithNoType.ts diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 28193535ce9..9b977eb6bfc 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -2146,7 +2146,7 @@ namespace ts { // falls through case SyntaxKind.JSDocPropertyTag: const propTag = node as JSDocPropertyLikeTag; - const flags = propTag.isBracketed || propTag.typeExpression.type.kind === SyntaxKind.JSDocOptionalType ? + const flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === SyntaxKind.JSDocOptionalType ? SymbolFlags.Property | SymbolFlags.Optional : SymbolFlags.Property; return declareSymbolAndAddToSymbolTable(propTag, flags, SymbolFlags.PropertyExcludes); diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index ebdf390f5b2..db6c5f23cfd 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -6699,7 +6699,7 @@ namespace ts { if (typeExpression && typeExpression.type.kind === SyntaxKind.ArrayType) { jsdocTypeLiteral.isArrayType = true; } - typedefTag.typeExpression = childTypeTag && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? + typedefTag.typeExpression = childTypeTag && childTypeTag.typeExpression && !isObjectOrObjectArrayTypeReference(childTypeTag.typeExpression.type) ? childTypeTag.typeExpression : finishNode(jsdocTypeLiteral); } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 578c2d23c4f..f1d4740ccac 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2194,7 +2194,7 @@ namespace ts { export interface JSDocPropertyLikeTag extends JSDocTag, Declaration { parent: JSDoc; name: EntityName; - typeExpression: JSDocTypeExpression; + typeExpression?: JSDocTypeExpression; /** Whether the property name came before the type -- non-standard for JSDoc, but Typescript-like */ isNameFirst: boolean; isBracketed: boolean; diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 3bb2ed11674..7fe07813adc 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -1473,7 +1473,7 @@ declare namespace ts { interface JSDocPropertyLikeTag extends JSDocTag, Declaration { parent: JSDoc; name: EntityName; - typeExpression: JSDocTypeExpression; + typeExpression?: JSDocTypeExpression; /** Whether the property name came before the type -- non-standard for JSDoc, but Typescript-like */ isNameFirst: boolean; isBracketed: boolean; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index d41db2eb413..a5bb674d511 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -1473,7 +1473,7 @@ declare namespace ts { interface JSDocPropertyLikeTag extends JSDocTag, Declaration { parent: JSDoc; name: EntityName; - typeExpression: JSDocTypeExpression; + typeExpression?: JSDocTypeExpression; /** Whether the property name came before the type -- non-standard for JSDoc, but Typescript-like */ isNameFirst: boolean; isBracketed: boolean; diff --git a/tests/baselines/reference/jsdocTypedef_propertyWithNoType.symbols b/tests/baselines/reference/jsdocTypedef_propertyWithNoType.symbols new file mode 100644 index 00000000000..0bac06e2e61 --- /dev/null +++ b/tests/baselines/reference/jsdocTypedef_propertyWithNoType.symbols @@ -0,0 +1,11 @@ +=== /a.js === +/** + * @typedef Foo + * @property foo + */ + +/** @type {Foo} */ +const x = { foo: 0 }; +>x : Symbol(x, Decl(a.js, 6, 5)) +>foo : Symbol(foo, Decl(a.js, 6, 11)) + diff --git a/tests/baselines/reference/jsdocTypedef_propertyWithNoType.types b/tests/baselines/reference/jsdocTypedef_propertyWithNoType.types new file mode 100644 index 00000000000..7d7326fc80c --- /dev/null +++ b/tests/baselines/reference/jsdocTypedef_propertyWithNoType.types @@ -0,0 +1,13 @@ +=== /a.js === +/** + * @typedef Foo + * @property foo + */ + +/** @type {Foo} */ +const x = { foo: 0 }; +>x : { foo: any; } +>{ foo: 0 } : { foo: number; } +>foo : number +>0 : 0 + diff --git a/tests/cases/compiler/jsdocTypedef_propertyWithNoType.ts b/tests/cases/compiler/jsdocTypedef_propertyWithNoType.ts new file mode 100644 index 00000000000..bcabe980915 --- /dev/null +++ b/tests/cases/compiler/jsdocTypedef_propertyWithNoType.ts @@ -0,0 +1,12 @@ +// @allowJs: true +// @checkJs: true +// @noEmit: true + +// @Filename: /a.js +/** + * @typedef Foo + * @property foo + */ + +/** @type {Foo} */ +const x = { foo: 0 }; From 79f5d968a120e469dbaf432aaad101a708989a6d Mon Sep 17 00:00:00 2001 From: Charles Pierce Date: Mon, 9 Oct 2017 10:57:08 -0700 Subject: [PATCH 055/137] Use ancestor walk to determine if property access is within constructor #9230 --- src/compiler/checker.ts | 17 ++++-- src/compiler/diagnosticMessages.json | 2 +- .../abstractPropertyInConstructor.errors.txt | 26 +++++++--- .../abstractPropertyInConstructor.js | 20 ++++++- .../abstractPropertyInConstructor.symbols | 52 +++++++++++++------ .../abstractPropertyInConstructor.types | 27 +++++++++- .../compiler/abstractPropertyInConstructor.ts | 11 +++- 7 files changed, 123 insertions(+), 32 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 9a483ae50ed..8afee9455cf 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -14844,10 +14844,9 @@ namespace ts { // Referencing Abstract Properties within Constructors is not allowed if ((flags & ModifierFlags.Abstract) && symbolHasNonMethodDeclaration(prop)) { const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop)); - const declaringClassConstructor = declaringClassDeclaration && findConstructorDeclaration(declaringClassDeclaration); - if (declaringClassConstructor && isNodeWithinFunction(node, declaringClassConstructor)) { - error(errorNode, Diagnostics.Abstract_property_0_in_class_1_cannot_be_accessed_in_constructor, symbolToString(prop), typeToString(getDeclaringClass(prop))); + if (declaringClassDeclaration && isNodeWithinConstructor(node, declaringClassDeclaration)) { + error(errorNode, Diagnostics.Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor, symbolToString(prop), typeToString(getDeclaringClass(prop))); return false; } } @@ -23153,8 +23152,16 @@ namespace ts { return result; } - function isNodeWithinFunction(node: Node, functionDeclaration: FunctionLike) { - return getContainingFunction(node) === functionDeclaration; + function isNodeWithinConstructor(node: Node, classDeclaration: ClassLikeDeclaration) { + return findAncestor(node, element => { + if (isConstructorDeclaration(element) && nodeIsPresent(element.body)) { + return true; + } else if (element === classDeclaration || isFunctionLikeDeclaration(element)) { + return "quit"; + } + + return false; + }); } function isNodeWithinClass(node: Node, classDeclaration: ClassLikeDeclaration) { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index e2d514ba268..9b220a880b0 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2220,7 +2220,7 @@ "category": "Error", "code": 2714 }, - "Abstract property '{0}' in class '{1}' cannot be accessed in constructor.": { + "Abstract property '{0}' in class '{1}' cannot be accessed in the constructor.": { "category": "Error", "code": 2715 }, diff --git a/tests/baselines/reference/abstractPropertyInConstructor.errors.txt b/tests/baselines/reference/abstractPropertyInConstructor.errors.txt index 7e654b440c6..461dd713d3b 100644 --- a/tests/baselines/reference/abstractPropertyInConstructor.errors.txt +++ b/tests/baselines/reference/abstractPropertyInConstructor.errors.txt @@ -1,20 +1,32 @@ -tests/cases/compiler/abstractPropertyInConstructor.ts(4,24): error TS2715: Abstract property 'prop' in class 'AbstractClass' cannot be accessed in constructor. -tests/cases/compiler/abstractPropertyInConstructor.ts(5,14): error TS2715: Abstract property 'prop' in class 'AbstractClass' cannot be accessed in constructor. +tests/cases/compiler/abstractPropertyInConstructor.ts(4,24): error TS2715: Abstract property 'prop' in class 'AbstractClass' cannot be accessed in the constructor. +tests/cases/compiler/abstractPropertyInConstructor.ts(7,18): error TS2715: Abstract property 'prop' in class 'AbstractClass' cannot be accessed in the constructor. +tests/cases/compiler/abstractPropertyInConstructor.ts(9,14): error TS2715: Abstract property 'cb' in class 'AbstractClass' cannot be accessed in the constructor. -==== tests/cases/compiler/abstractPropertyInConstructor.ts (2 errors) ==== +==== tests/cases/compiler/abstractPropertyInConstructor.ts (3 errors) ==== abstract class AbstractClass { constructor(str: string) { this.method(parseInt(str)); let val = this.prop.toLowerCase(); ~~~~ -!!! error TS2715: Abstract property 'prop' in class 'AbstractClass' cannot be accessed in constructor. - this.prop = "Hello World"; - ~~~~ -!!! error TS2715: Abstract property 'prop' in class 'AbstractClass' cannot be accessed in constructor. +!!! error TS2715: Abstract property 'prop' in class 'AbstractClass' cannot be accessed in the constructor. + + if (!str) { + this.prop = "Hello World"; + ~~~~ +!!! error TS2715: Abstract property 'prop' in class 'AbstractClass' cannot be accessed in the constructor. + } + this.cb(str); + ~~ +!!! error TS2715: Abstract property 'cb' in class 'AbstractClass' cannot be accessed in the constructor. + + const innerFunction = () => { + return this.prop; + } } abstract prop: string; + abstract cb: (s: string) => void; abstract method(num: number): void; diff --git a/tests/baselines/reference/abstractPropertyInConstructor.js b/tests/baselines/reference/abstractPropertyInConstructor.js index c6d7de6c037..18a2937a191 100644 --- a/tests/baselines/reference/abstractPropertyInConstructor.js +++ b/tests/baselines/reference/abstractPropertyInConstructor.js @@ -3,10 +3,19 @@ abstract class AbstractClass { constructor(str: string) { this.method(parseInt(str)); let val = this.prop.toLowerCase(); - this.prop = "Hello World"; + + if (!str) { + this.prop = "Hello World"; + } + this.cb(str); + + const innerFunction = () => { + return this.prop; + } } abstract prop: string; + abstract cb: (s: string) => void; abstract method(num: number): void; @@ -19,9 +28,16 @@ abstract class AbstractClass { //// [abstractPropertyInConstructor.js] var AbstractClass = /** @class */ (function () { function AbstractClass(str) { + var _this = this; this.method(parseInt(str)); var val = this.prop.toLowerCase(); - this.prop = "Hello World"; + if (!str) { + this.prop = "Hello World"; + } + this.cb(str); + var innerFunction = function () { + return _this.prop; + }; } AbstractClass.prototype.method2 = function () { this.prop = this.prop + "!"; diff --git a/tests/baselines/reference/abstractPropertyInConstructor.symbols b/tests/baselines/reference/abstractPropertyInConstructor.symbols index 7d634f80267..0d542ffb0a8 100644 --- a/tests/baselines/reference/abstractPropertyInConstructor.symbols +++ b/tests/baselines/reference/abstractPropertyInConstructor.symbols @@ -6,43 +6,65 @@ abstract class AbstractClass { >str : Symbol(str, Decl(abstractPropertyInConstructor.ts, 1, 16)) this.method(parseInt(str)); ->this.method : Symbol(AbstractClass.method, Decl(abstractPropertyInConstructor.ts, 7, 26)) +>this.method : Symbol(AbstractClass.method, Decl(abstractPropertyInConstructor.ts, 16, 37)) >this : Symbol(AbstractClass, Decl(abstractPropertyInConstructor.ts, 0, 0)) ->method : Symbol(AbstractClass.method, Decl(abstractPropertyInConstructor.ts, 7, 26)) +>method : Symbol(AbstractClass.method, Decl(abstractPropertyInConstructor.ts, 16, 37)) >parseInt : Symbol(parseInt, Decl(lib.d.ts, --, --)) >str : Symbol(str, Decl(abstractPropertyInConstructor.ts, 1, 16)) let val = this.prop.toLowerCase(); >val : Symbol(val, Decl(abstractPropertyInConstructor.ts, 3, 11)) >this.prop.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) ->this.prop : Symbol(AbstractClass.prop, Decl(abstractPropertyInConstructor.ts, 5, 5)) +>this.prop : Symbol(AbstractClass.prop, Decl(abstractPropertyInConstructor.ts, 13, 5)) >this : Symbol(AbstractClass, Decl(abstractPropertyInConstructor.ts, 0, 0)) ->prop : Symbol(AbstractClass.prop, Decl(abstractPropertyInConstructor.ts, 5, 5)) +>prop : Symbol(AbstractClass.prop, Decl(abstractPropertyInConstructor.ts, 13, 5)) >toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --)) - this.prop = "Hello World"; ->this.prop : Symbol(AbstractClass.prop, Decl(abstractPropertyInConstructor.ts, 5, 5)) + if (!str) { +>str : Symbol(str, Decl(abstractPropertyInConstructor.ts, 1, 16)) + + this.prop = "Hello World"; +>this.prop : Symbol(AbstractClass.prop, Decl(abstractPropertyInConstructor.ts, 13, 5)) >this : Symbol(AbstractClass, Decl(abstractPropertyInConstructor.ts, 0, 0)) ->prop : Symbol(AbstractClass.prop, Decl(abstractPropertyInConstructor.ts, 5, 5)) +>prop : Symbol(AbstractClass.prop, Decl(abstractPropertyInConstructor.ts, 13, 5)) + } + this.cb(str); +>this.cb : Symbol(AbstractClass.cb, Decl(abstractPropertyInConstructor.ts, 15, 26)) +>this : Symbol(AbstractClass, Decl(abstractPropertyInConstructor.ts, 0, 0)) +>cb : Symbol(AbstractClass.cb, Decl(abstractPropertyInConstructor.ts, 15, 26)) +>str : Symbol(str, Decl(abstractPropertyInConstructor.ts, 1, 16)) + + const innerFunction = () => { +>innerFunction : Symbol(innerFunction, Decl(abstractPropertyInConstructor.ts, 10, 13)) + + return this.prop; +>this.prop : Symbol(AbstractClass.prop, Decl(abstractPropertyInConstructor.ts, 13, 5)) +>this : Symbol(AbstractClass, Decl(abstractPropertyInConstructor.ts, 0, 0)) +>prop : Symbol(AbstractClass.prop, Decl(abstractPropertyInConstructor.ts, 13, 5)) + } } abstract prop: string; ->prop : Symbol(AbstractClass.prop, Decl(abstractPropertyInConstructor.ts, 5, 5)) +>prop : Symbol(AbstractClass.prop, Decl(abstractPropertyInConstructor.ts, 13, 5)) + + abstract cb: (s: string) => void; +>cb : Symbol(AbstractClass.cb, Decl(abstractPropertyInConstructor.ts, 15, 26)) +>s : Symbol(s, Decl(abstractPropertyInConstructor.ts, 16, 18)) abstract method(num: number): void; ->method : Symbol(AbstractClass.method, Decl(abstractPropertyInConstructor.ts, 7, 26)) ->num : Symbol(num, Decl(abstractPropertyInConstructor.ts, 9, 20)) +>method : Symbol(AbstractClass.method, Decl(abstractPropertyInConstructor.ts, 16, 37)) +>num : Symbol(num, Decl(abstractPropertyInConstructor.ts, 18, 20)) method2() { ->method2 : Symbol(AbstractClass.method2, Decl(abstractPropertyInConstructor.ts, 9, 39)) +>method2 : Symbol(AbstractClass.method2, Decl(abstractPropertyInConstructor.ts, 18, 39)) this.prop = this.prop + "!"; ->this.prop : Symbol(AbstractClass.prop, Decl(abstractPropertyInConstructor.ts, 5, 5)) +>this.prop : Symbol(AbstractClass.prop, Decl(abstractPropertyInConstructor.ts, 13, 5)) >this : Symbol(AbstractClass, Decl(abstractPropertyInConstructor.ts, 0, 0)) ->prop : Symbol(AbstractClass.prop, Decl(abstractPropertyInConstructor.ts, 5, 5)) ->this.prop : Symbol(AbstractClass.prop, Decl(abstractPropertyInConstructor.ts, 5, 5)) +>prop : Symbol(AbstractClass.prop, Decl(abstractPropertyInConstructor.ts, 13, 5)) +>this.prop : Symbol(AbstractClass.prop, Decl(abstractPropertyInConstructor.ts, 13, 5)) >this : Symbol(AbstractClass, Decl(abstractPropertyInConstructor.ts, 0, 0)) ->prop : Symbol(AbstractClass.prop, Decl(abstractPropertyInConstructor.ts, 5, 5)) +>prop : Symbol(AbstractClass.prop, Decl(abstractPropertyInConstructor.ts, 13, 5)) } } diff --git a/tests/baselines/reference/abstractPropertyInConstructor.types b/tests/baselines/reference/abstractPropertyInConstructor.types index 05f7a7752e6..0ffb5f1bdfd 100644 --- a/tests/baselines/reference/abstractPropertyInConstructor.types +++ b/tests/baselines/reference/abstractPropertyInConstructor.types @@ -23,17 +23,42 @@ abstract class AbstractClass { >prop : string >toLowerCase : () => string - this.prop = "Hello World"; + if (!str) { +>!str : boolean +>str : string + + this.prop = "Hello World"; >this.prop = "Hello World" : "Hello World" >this.prop : string >this : this >prop : string >"Hello World" : "Hello World" + } + this.cb(str); +>this.cb(str) : void +>this.cb : (s: string) => void +>this : this +>cb : (s: string) => void +>str : string + + const innerFunction = () => { +>innerFunction : () => string +>() => { return this.prop; } : () => string + + return this.prop; +>this.prop : string +>this : this +>prop : string + } } abstract prop: string; >prop : string + abstract cb: (s: string) => void; +>cb : (s: string) => void +>s : string + abstract method(num: number): void; >method : (num: number) => void >num : number diff --git a/tests/cases/compiler/abstractPropertyInConstructor.ts b/tests/cases/compiler/abstractPropertyInConstructor.ts index 5376aae9d6f..457fdb473b1 100644 --- a/tests/cases/compiler/abstractPropertyInConstructor.ts +++ b/tests/cases/compiler/abstractPropertyInConstructor.ts @@ -2,10 +2,19 @@ abstract class AbstractClass { constructor(str: string) { this.method(parseInt(str)); let val = this.prop.toLowerCase(); - this.prop = "Hello World"; + + if (!str) { + this.prop = "Hello World"; + } + this.cb(str); + + const innerFunction = () => { + return this.prop; + } } abstract prop: string; + abstract cb: (s: string) => void; abstract method(num: number): void; From 2796ebfe35ca08518ed196b522181bc0deff2373 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 9 Oct 2017 11:04:28 -0700 Subject: [PATCH 056/137] In resolveNameHelper, use a lastNonBlockLocation (#18918) --- src/compiler/checker.ts | 6 ++- .../noUnusedLocals_selfReference.errors.txt | 16 ++++-- .../reference/noUnusedLocals_selfReference.js | 14 ++++- .../noUnusedLocals_selfReference.symbols | 53 +++++++++++-------- .../noUnusedLocals_selfReference.types | 13 ++++- .../compiler/noUnusedLocals_selfReference.ts | 7 ++- 6 files changed, 77 insertions(+), 32 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a8e18c432a6..58ac3bc52c0 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -908,6 +908,7 @@ namespace ts { const originalLocation = location; // needed for did-you-mean error reporting, which gathers candidates starting from the original location let result: Symbol; let lastLocation: Node; + let lastNonBlockLocation: Node; let propertyWithInvalidInitializer: Node; const errorLocation = location; let grandparent: Node; @@ -1126,6 +1127,9 @@ namespace ts { } break; } + if (location.kind !== SyntaxKind.Block) { + lastNonBlockLocation = location; + } lastLocation = location; location = location.parent; } @@ -1133,7 +1137,7 @@ namespace ts { // We just climbed up parents looking for the name, meaning that we started in a descendant node of `lastLocation`. // If `result === lastLocation.symbol`, that means that we are somewhere inside `lastLocation` looking up a name, and resolving to `lastLocation` itself. // That means that this is a self-reference of `lastLocation`, and shouldn't count this when considering whether `lastLocation` is used. - if (isUse && result && nameNotFoundMessage && noUnusedIdentifiers && result !== lastLocation.symbol) { + if (isUse && result && nameNotFoundMessage && noUnusedIdentifiers && result !== lastNonBlockLocation.symbol) { result.isReferenced = true; } diff --git a/tests/baselines/reference/noUnusedLocals_selfReference.errors.txt b/tests/baselines/reference/noUnusedLocals_selfReference.errors.txt index e4a0d478cb4..603bc54d448 100644 --- a/tests/baselines/reference/noUnusedLocals_selfReference.errors.txt +++ b/tests/baselines/reference/noUnusedLocals_selfReference.errors.txt @@ -1,14 +1,22 @@ tests/cases/compiler/noUnusedLocals_selfReference.ts(3,10): error TS6133: 'f' is declared but its value is never read. -tests/cases/compiler/noUnusedLocals_selfReference.ts(4,7): error TS6133: 'C' is declared but its value is never read. -tests/cases/compiler/noUnusedLocals_selfReference.ts(7,6): error TS6133: 'E' is declared but its value is never read. +tests/cases/compiler/noUnusedLocals_selfReference.ts(5,14): error TS6133: 'g' is declared but its value is never read. +tests/cases/compiler/noUnusedLocals_selfReference.ts(9,7): error TS6133: 'C' is declared but its value is never read. +tests/cases/compiler/noUnusedLocals_selfReference.ts(12,6): error TS6133: 'E' is declared but its value is never read. -==== tests/cases/compiler/noUnusedLocals_selfReference.ts (3 errors) ==== +==== tests/cases/compiler/noUnusedLocals_selfReference.ts (4 errors) ==== export {}; // Make this a module scope, so these are local variables. - function f() { f; } + function f() { ~ !!! error TS6133: 'f' is declared but its value is never read. + f; + function g() { + ~ +!!! error TS6133: 'g' is declared but its value is never read. + g; + } + } class C { ~ !!! error TS6133: 'C' is declared but its value is never read. diff --git a/tests/baselines/reference/noUnusedLocals_selfReference.js b/tests/baselines/reference/noUnusedLocals_selfReference.js index 5f206fbc3dc..a8f3d6a8aed 100644 --- a/tests/baselines/reference/noUnusedLocals_selfReference.js +++ b/tests/baselines/reference/noUnusedLocals_selfReference.js @@ -1,7 +1,12 @@ //// [noUnusedLocals_selfReference.ts] export {}; // Make this a module scope, so these are local variables. -function f() { f; } +function f() { + f; + function g() { + g; + } +} class C { m() { C; } } @@ -19,7 +24,12 @@ P; //// [noUnusedLocals_selfReference.js] "use strict"; exports.__esModule = true; -function f() { f; } +function f() { + f; + function g() { + g; + } +} var C = /** @class */ (function () { function C() { } diff --git a/tests/baselines/reference/noUnusedLocals_selfReference.symbols b/tests/baselines/reference/noUnusedLocals_selfReference.symbols index dcd815b2619..015a78d87d3 100644 --- a/tests/baselines/reference/noUnusedLocals_selfReference.symbols +++ b/tests/baselines/reference/noUnusedLocals_selfReference.symbols @@ -1,43 +1,52 @@ === tests/cases/compiler/noUnusedLocals_selfReference.ts === export {}; // Make this a module scope, so these are local variables. -function f() { f; } ->f : Symbol(f, Decl(noUnusedLocals_selfReference.ts, 0, 10)) +function f() { >f : Symbol(f, Decl(noUnusedLocals_selfReference.ts, 0, 10)) + f; +>f : Symbol(f, Decl(noUnusedLocals_selfReference.ts, 0, 10)) + + function g() { +>g : Symbol(g, Decl(noUnusedLocals_selfReference.ts, 3, 6)) + + g; +>g : Symbol(g, Decl(noUnusedLocals_selfReference.ts, 3, 6)) + } +} class C { ->C : Symbol(C, Decl(noUnusedLocals_selfReference.ts, 2, 19)) +>C : Symbol(C, Decl(noUnusedLocals_selfReference.ts, 7, 1)) m() { C; } ->m : Symbol(C.m, Decl(noUnusedLocals_selfReference.ts, 3, 9)) ->C : Symbol(C, Decl(noUnusedLocals_selfReference.ts, 2, 19)) +>m : Symbol(C.m, Decl(noUnusedLocals_selfReference.ts, 8, 9)) +>C : Symbol(C, Decl(noUnusedLocals_selfReference.ts, 7, 1)) } enum E { A = 0, B = E.A } ->E : Symbol(E, Decl(noUnusedLocals_selfReference.ts, 5, 1)) ->A : Symbol(E.A, Decl(noUnusedLocals_selfReference.ts, 6, 8)) ->B : Symbol(E.B, Decl(noUnusedLocals_selfReference.ts, 6, 15)) ->E.A : Symbol(E.A, Decl(noUnusedLocals_selfReference.ts, 6, 8)) ->E : Symbol(E, Decl(noUnusedLocals_selfReference.ts, 5, 1)) ->A : Symbol(E.A, Decl(noUnusedLocals_selfReference.ts, 6, 8)) +>E : Symbol(E, Decl(noUnusedLocals_selfReference.ts, 10, 1)) +>A : Symbol(E.A, Decl(noUnusedLocals_selfReference.ts, 11, 8)) +>B : Symbol(E.B, Decl(noUnusedLocals_selfReference.ts, 11, 15)) +>E.A : Symbol(E.A, Decl(noUnusedLocals_selfReference.ts, 11, 8)) +>E : Symbol(E, Decl(noUnusedLocals_selfReference.ts, 10, 1)) +>A : Symbol(E.A, Decl(noUnusedLocals_selfReference.ts, 11, 8)) // Does not detect mutual recursion. function g() { D; } ->g : Symbol(g, Decl(noUnusedLocals_selfReference.ts, 6, 25)) ->D : Symbol(D, Decl(noUnusedLocals_selfReference.ts, 9, 19)) +>g : Symbol(g, Decl(noUnusedLocals_selfReference.ts, 11, 25)) +>D : Symbol(D, Decl(noUnusedLocals_selfReference.ts, 14, 19)) class D { m() { g; } } ->D : Symbol(D, Decl(noUnusedLocals_selfReference.ts, 9, 19)) ->m : Symbol(D.m, Decl(noUnusedLocals_selfReference.ts, 10, 9)) ->g : Symbol(g, Decl(noUnusedLocals_selfReference.ts, 6, 25)) +>D : Symbol(D, Decl(noUnusedLocals_selfReference.ts, 14, 19)) +>m : Symbol(D.m, Decl(noUnusedLocals_selfReference.ts, 15, 9)) +>g : Symbol(g, Decl(noUnusedLocals_selfReference.ts, 11, 25)) // Does not work on private methods. class P { private m() { this.m; } } ->P : Symbol(P, Decl(noUnusedLocals_selfReference.ts, 10, 22)) ->m : Symbol(P.m, Decl(noUnusedLocals_selfReference.ts, 13, 9)) ->this.m : Symbol(P.m, Decl(noUnusedLocals_selfReference.ts, 13, 9)) ->this : Symbol(P, Decl(noUnusedLocals_selfReference.ts, 10, 22)) ->m : Symbol(P.m, Decl(noUnusedLocals_selfReference.ts, 13, 9)) +>P : Symbol(P, Decl(noUnusedLocals_selfReference.ts, 15, 22)) +>m : Symbol(P.m, Decl(noUnusedLocals_selfReference.ts, 18, 9)) +>this.m : Symbol(P.m, Decl(noUnusedLocals_selfReference.ts, 18, 9)) +>this : Symbol(P, Decl(noUnusedLocals_selfReference.ts, 15, 22)) +>m : Symbol(P.m, Decl(noUnusedLocals_selfReference.ts, 18, 9)) P; ->P : Symbol(P, Decl(noUnusedLocals_selfReference.ts, 10, 22)) +>P : Symbol(P, Decl(noUnusedLocals_selfReference.ts, 15, 22)) diff --git a/tests/baselines/reference/noUnusedLocals_selfReference.types b/tests/baselines/reference/noUnusedLocals_selfReference.types index 7d2741c5681..7e75062db34 100644 --- a/tests/baselines/reference/noUnusedLocals_selfReference.types +++ b/tests/baselines/reference/noUnusedLocals_selfReference.types @@ -1,10 +1,19 @@ === tests/cases/compiler/noUnusedLocals_selfReference.ts === export {}; // Make this a module scope, so these are local variables. -function f() { f; } ->f : () => void +function f() { >f : () => void + f; +>f : () => void + + function g() { +>g : () => void + + g; +>g : () => void + } +} class C { >C : C diff --git a/tests/cases/compiler/noUnusedLocals_selfReference.ts b/tests/cases/compiler/noUnusedLocals_selfReference.ts index 8eb528743c0..fc6b02b6006 100644 --- a/tests/cases/compiler/noUnusedLocals_selfReference.ts +++ b/tests/cases/compiler/noUnusedLocals_selfReference.ts @@ -2,7 +2,12 @@ export {}; // Make this a module scope, so these are local variables. -function f() { f; } +function f() { + f; + function g() { + g; + } +} class C { m() { C; } } From 517dbf3ca77863daa5376dfb4a95088d1f0dffab Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Mon, 9 Oct 2017 11:14:24 -0700 Subject: [PATCH 057/137] Fix semicolon lint --- 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 d7585bd6e9a..a61ded007f4 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -13923,7 +13923,7 @@ namespace ts { t.flags |= propagatedFlags; t.flags |= TypeFlags.FreshLiteral; (t as ObjectType).objectFlags |= ObjectFlags.ObjectLiteral; - t.symbol = node.symbol + t.symbol = node.symbol; } }); return spread; From 8486c482371e800fcaa83c655f837f70d8ac02af Mon Sep 17 00:00:00 2001 From: Charles Pierce Date: Mon, 9 Oct 2017 13:01:30 -0700 Subject: [PATCH 058/137] Fix linting error in new function --- src/compiler/checker.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 8afee9455cf..26e851eb53d 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -23156,7 +23156,8 @@ namespace ts { return findAncestor(node, element => { if (isConstructorDeclaration(element) && nodeIsPresent(element.body)) { return true; - } else if (element === classDeclaration || isFunctionLikeDeclaration(element)) { + } + else if (element === classDeclaration || isFunctionLikeDeclaration(element)) { return "quit"; } From 264652c0ef7197116280af77c284b124071eb661 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Mon, 9 Oct 2017 13:12:27 -0700 Subject: [PATCH 059/137] Fix emit for classes with both fields and 'extends null' --- src/compiler/transformers/ts.ts | 28 +++++++++---------- .../baselines/reference/classExtendingNull.js | 17 ++++++++++- .../reference/classExtendingNull.symbols | 8 ++++++ .../reference/classExtendingNull.types | 13 +++++++++ .../classDeclarations/classExtendingNull.ts | 2 ++ 5 files changed, 53 insertions(+), 15 deletions(-) diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts index 4feb3ca0c26..e67918fd696 100644 --- a/src/compiler/transformers/ts.ts +++ b/src/compiler/transformers/ts.ts @@ -26,7 +26,7 @@ namespace ts { IsExportOfNamespace = 1 << 3, IsNamedExternalExport = 1 << 4, IsDefaultExternalExport = 1 << 5, - HasExtendsClause = 1 << 6, + IsDerivedClass = 1 << 6, UseImmediatelyInvokedFunctionExpression = 1 << 7, HasAnyDecorators = HasConstructorDecorators | HasMemberDecorators, @@ -553,7 +553,8 @@ namespace ts { function getClassFacts(node: ClassDeclaration, staticProperties: ReadonlyArray) { let facts = ClassFacts.None; if (some(staticProperties)) facts |= ClassFacts.HasStaticInitializedProperties; - if (getClassExtendsHeritageClauseElement(node)) facts |= ClassFacts.HasExtendsClause; + const extendsClauseElement = getClassExtendsHeritageClauseElement(node); + if (extendsClauseElement && skipOuterExpressions(extendsClauseElement.expression).kind !== SyntaxKind.NullKeyword) facts |= ClassFacts.IsDerivedClass; if (shouldEmitDecorateCallForClass(node)) facts |= ClassFacts.HasConstructorDecorators; if (childIsDecorated(node)) facts |= ClassFacts.HasMemberDecorators; if (isExportOfNamespace(node)) facts |= ClassFacts.IsExportOfNamespace; @@ -699,7 +700,7 @@ namespace ts { name, /*typeParameters*/ undefined, visitNodes(node.heritageClauses, visitor, isHeritageClause), - transformClassMembers(node, (facts & ClassFacts.HasExtendsClause) !== 0) + transformClassMembers(node, (facts & ClassFacts.IsDerivedClass) !== 0) ); // To better align with the old emitter, we should not emit a trailing source map @@ -814,7 +815,7 @@ namespace ts { // ${members} // } const heritageClauses = visitNodes(node.heritageClauses, visitor, isHeritageClause); - const members = transformClassMembers(node, (facts & ClassFacts.HasExtendsClause) !== 0); + const members = transformClassMembers(node, (facts & ClassFacts.IsDerivedClass) !== 0); const classExpression = createClassExpression(/*modifiers*/ undefined, name, /*typeParameters*/ undefined, heritageClauses, members); setOriginalNode(classExpression, node); setTextRange(classExpression, location); @@ -887,11 +888,11 @@ namespace ts { * Transforms the members of a class. * * @param node The current class. - * @param hasExtendsClause A value indicating whether the class has an extends clause. + * @param isDerivedClass A value indicating whether the class has an extends clause that does not extend 'null'. */ - function transformClassMembers(node: ClassDeclaration | ClassExpression, hasExtendsClause: boolean) { + function transformClassMembers(node: ClassDeclaration | ClassExpression, isDerivedClass: boolean) { const members: ClassElement[] = []; - const constructor = transformConstructor(node, hasExtendsClause); + const constructor = transformConstructor(node, isDerivedClass); if (constructor) { members.push(constructor); } @@ -904,9 +905,9 @@ namespace ts { * Transforms (or creates) a constructor for a class. * * @param node The current class. - * @param hasExtendsClause A value indicating whether the class has an extends clause. + * @param isDerivedClass A value indicating whether the class has an extends clause that does not extend 'null'. */ - function transformConstructor(node: ClassDeclaration | ClassExpression, hasExtendsClause: boolean) { + function transformConstructor(node: ClassDeclaration | ClassExpression, isDerivedClass: boolean) { // Check if we have property assignment inside class declaration. // If there is a property assignment, we need to emit constructor whether users define it or not // If there is no property assignment, we can omit constructor if users do not define it @@ -921,7 +922,7 @@ namespace ts { } const parameters = transformConstructorParameters(constructor); - const body = transformConstructorBody(node, constructor, hasExtendsClause); + const body = transformConstructorBody(node, constructor, isDerivedClass); // constructor(${parameters}) { // ${body} @@ -947,7 +948,6 @@ namespace ts { * parameter property assignments or instance property initializers. * * @param constructor The constructor declaration. - * @param hasExtendsClause A value indicating whether the class has an extends clause. */ function transformConstructorParameters(constructor: ConstructorDeclaration) { // The ES2015 spec specifies in 14.5.14. Runtime Semantics: ClassDefinitionEvaluation: @@ -975,9 +975,9 @@ namespace ts { * * @param node The current class. * @param constructor The current class constructor. - * @param hasExtendsClause A value indicating whether the class has an extends clause. + * @param isDerivedClass A value indicating whether the class has an extends clause that does not extend 'null'. */ - function transformConstructorBody(node: ClassExpression | ClassDeclaration, constructor: ConstructorDeclaration, hasExtendsClause: boolean) { + function transformConstructorBody(node: ClassExpression | ClassDeclaration, constructor: ConstructorDeclaration, isDerivedClass: boolean) { let statements: Statement[] = []; let indexOfFirstStatement = 0; @@ -1001,7 +1001,7 @@ namespace ts { const propertyAssignments = getParametersWithPropertyAssignments(constructor); addRange(statements, map(propertyAssignments, transformParameterWithPropertyAssignment)); } - else if (hasExtendsClause) { + else if (isDerivedClass) { // Add a synthetic `super` call: // // super(...arguments); diff --git a/tests/baselines/reference/classExtendingNull.js b/tests/baselines/reference/classExtendingNull.js index 6c6ae8a0167..f405f6da84c 100644 --- a/tests/baselines/reference/classExtendingNull.js +++ b/tests/baselines/reference/classExtendingNull.js @@ -1,7 +1,8 @@ //// [classExtendingNull.ts] class C1 extends null { } class C2 extends (null) { } - +class C3 extends null { x = 1; } +class C4 extends (null) { x = 1; } //// [classExtendingNull.js] var __extends = (this && this.__extends) || (function () { @@ -26,3 +27,17 @@ var C2 = /** @class */ (function (_super) { } return C2; }((null))); +var C3 = /** @class */ (function (_super) { + __extends(C3, _super); + function C3() { + this.x = 1; + } + return C3; +}(null)); +var C4 = /** @class */ (function (_super) { + __extends(C4, _super); + function C4() { + this.x = 1; + } + return C4; +}((null))); diff --git a/tests/baselines/reference/classExtendingNull.symbols b/tests/baselines/reference/classExtendingNull.symbols index 37a6162f414..eff1f18c0ca 100644 --- a/tests/baselines/reference/classExtendingNull.symbols +++ b/tests/baselines/reference/classExtendingNull.symbols @@ -5,3 +5,11 @@ class C1 extends null { } class C2 extends (null) { } >C2 : Symbol(C2, Decl(classExtendingNull.ts, 0, 25)) +class C3 extends null { x = 1; } +>C3 : Symbol(C3, Decl(classExtendingNull.ts, 1, 27)) +>x : Symbol(C3.x, Decl(classExtendingNull.ts, 2, 23)) + +class C4 extends (null) { x = 1; } +>C4 : Symbol(C4, Decl(classExtendingNull.ts, 2, 32)) +>x : Symbol(C4.x, Decl(classExtendingNull.ts, 3, 25)) + diff --git a/tests/baselines/reference/classExtendingNull.types b/tests/baselines/reference/classExtendingNull.types index 3c572a3406c..e98f8daba06 100644 --- a/tests/baselines/reference/classExtendingNull.types +++ b/tests/baselines/reference/classExtendingNull.types @@ -8,3 +8,16 @@ class C2 extends (null) { } >(null) : null >null : null +class C3 extends null { x = 1; } +>C3 : C3 +>null : null +>x : number +>1 : 1 + +class C4 extends (null) { x = 1; } +>C4 : C4 +>(null) : null +>null : null +>x : number +>1 : 1 + diff --git a/tests/cases/conformance/classes/classDeclarations/classExtendingNull.ts b/tests/cases/conformance/classes/classDeclarations/classExtendingNull.ts index 655cf44ed57..b00c047a379 100644 --- a/tests/cases/conformance/classes/classDeclarations/classExtendingNull.ts +++ b/tests/cases/conformance/classes/classDeclarations/classExtendingNull.ts @@ -1,2 +1,4 @@ class C1 extends null { } class C2 extends (null) { } +class C3 extends null { x = 1; } +class C4 extends (null) { x = 1; } \ No newline at end of file From 8b60736b61b8559fc7bd542a5e8954e258f51bd3 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 9 Oct 2017 13:39:15 -0700 Subject: [PATCH 060/137] importFixes: Remove unnecessary undefined check (#19045) --- src/services/codefixes/importFixes.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/services/codefixes/importFixes.ts b/src/services/codefixes/importFixes.ts index f516bc15de3..9b54543231d 100644 --- a/src/services/codefixes/importFixes.ts +++ b/src/services/codefixes/importFixes.ts @@ -16,7 +16,7 @@ namespace ts.codefix { moduleSpecifier?: string; } - enum ModuleSpecifierComparison { + const enum ModuleSpecifierComparison { Better, Equal, Worse @@ -26,10 +26,6 @@ namespace ts.codefix { private symbolIdToActionMap: ImportCodeAction[][] = []; addAction(symbolId: number, newAction: ImportCodeAction) { - if (!newAction) { - return; - } - const actions = this.symbolIdToActionMap[symbolId]; if (!actions) { this.symbolIdToActionMap[symbolId] = [newAction]; From 07ba90659404830f735f819b645476954c3c5d9a Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Mon, 9 Oct 2017 14:25:48 -0700 Subject: [PATCH 061/137] Handle the case when finishCachingPerDirectoryResolution is not called because of exception Fixes #18975 --- src/compiler/resolutionCache.ts | 10 ++++++++-- src/compiler/watch.ts | 10 +++++----- src/server/project.ts | 7 +++---- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/compiler/resolutionCache.ts b/src/compiler/resolutionCache.ts index aecc6989891..680ed98a84a 100644 --- a/src/compiler/resolutionCache.ts +++ b/src/compiler/resolutionCache.ts @@ -141,7 +141,10 @@ namespace ts { resolvedModuleNames.clear(); resolvedTypeReferenceDirectives.clear(); allFilesHaveInvalidatedResolution = false; - Debug.assert(perDirectoryResolvedModuleNames.size === 0 && perDirectoryResolvedTypeReferenceDirectives.size === 0); + // perDirectoryResolvedModuleNames and perDirectoryResolvedTypeReferenceDirectives could be non empty if there was exception during program update + // (between startCachingPerDirectoryResolution and finishCachingPerDirectoryResolution) + perDirectoryResolvedModuleNames.clear(); + perDirectoryResolvedTypeReferenceDirectives.clear(); } function startRecordingFilesWithChangedResolutions() { @@ -166,7 +169,10 @@ namespace ts { } function startCachingPerDirectoryResolution() { - Debug.assert(perDirectoryResolvedModuleNames.size === 0 && perDirectoryResolvedTypeReferenceDirectives.size === 0); + // perDirectoryResolvedModuleNames and perDirectoryResolvedTypeReferenceDirectives could be non empty if there was exception during program update + // (between startCachingPerDirectoryResolution and finishCachingPerDirectoryResolution) + perDirectoryResolvedModuleNames.clear(); + perDirectoryResolvedTypeReferenceDirectives.clear(); } function finishCachingPerDirectoryResolution() { diff --git a/src/compiler/watch.ts b/src/compiler/watch.ts index 2ab3ccc5ce6..1ab80e659f4 100644 --- a/src/compiler/watch.ts +++ b/src/compiler/watch.ts @@ -322,6 +322,9 @@ namespace ts { if (hasChangedCompilerOptions) { newLine = getNewLineCharacter(compilerOptions, system); + if (changesAffectModuleResolution(program && program.getCompilerOptions(), compilerOptions)) { + resolutionCache.clear(); + } } const hasInvalidatedResolution = resolutionCache.createHasInvalidatedResolution(); @@ -329,14 +332,11 @@ namespace ts { return; } - if (hasChangedCompilerOptions && changesAffectModuleResolution(program && program.getCompilerOptions(), compilerOptions)) { - resolutionCache.clear(); - } - const needsUpdateInTypeRootWatch = hasChangedCompilerOptions || !program; - hasChangedCompilerOptions = false; beforeCompile(compilerOptions); // Compile the program + const needsUpdateInTypeRootWatch = hasChangedCompilerOptions || !program; + hasChangedCompilerOptions = false; resolutionCache.startCachingPerDirectoryResolution(); compilerHost.hasInvalidatedResolution = hasInvalidatedResolution; compilerHost.hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames; diff --git a/src/server/project.ts b/src/server/project.ts index ac18738027b..5132b82a804 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -229,8 +229,8 @@ namespace ts.server { this.realpath = path => host.realpath(path); } - this.languageService = createLanguageService(this, this.documentRegistry); this.resolutionCache = createResolutionCache(this, rootDirectoryForResolution); + this.languageService = createLanguageService(this, this.documentRegistry); if (!languageServiceEnabled) { this.disableLanguageService(); } @@ -732,7 +732,6 @@ namespace ts.server { */ updateGraph(): boolean { this.resolutionCache.startRecordingFilesWithChangedResolutions(); - this.hasInvalidatedResolution = this.resolutionCache.createHasInvalidatedResolution(); let hasChanges = this.updateGraphWorker(); @@ -795,6 +794,7 @@ namespace ts.server { this.writeLog(`Starting updateGraphWorker: Project: ${this.getProjectName()}`); const start = timestamp(); + this.hasInvalidatedResolution = this.resolutionCache.createHasInvalidatedResolution(); this.resolutionCache.startCachingPerDirectoryResolution(); this.program = this.languageService.getProgram(); this.resolutionCache.finishCachingPerDirectoryResolution(); @@ -1327,14 +1327,13 @@ namespace ts.server { } close() { - super.close(); - if (this.configFileWatcher) { this.configFileWatcher.close(); this.configFileWatcher = undefined; } this.stopWatchingWildCards(); + super.close(); } addOpenRef() { From 5f3d6e753e0c89419bd3734ccf991c26ba772131 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Mon, 9 Oct 2017 14:43:51 -0700 Subject: [PATCH 062/137] update baselines --- tests/baselines/reference/api/tsserverlibrary.d.ts | 2 ++ tests/baselines/reference/api/typescript.d.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index ca8696b11fb..5f4ef1dbdfe 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -2870,6 +2870,8 @@ declare namespace ts { function getJSDocReturnType(node: Node): TypeNode | undefined; /** Get all JSDoc tags related to a node, including those on parent nodes. */ function getJSDocTags(node: Node): ReadonlyArray | undefined; + /** Gets all JSDoc tags of a specified kind, or undefined if not present. */ + function getAllJSDocTagsOfKind(node: Node, kind: SyntaxKind): ReadonlyArray | undefined; } declare namespace ts { function isNumericLiteral(node: Node): node is NumericLiteral; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 820be44f1f1..e608c7ffc3d 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -2925,6 +2925,8 @@ declare namespace ts { function getJSDocReturnType(node: Node): TypeNode | undefined; /** Get all JSDoc tags related to a node, including those on parent nodes. */ function getJSDocTags(node: Node): ReadonlyArray | undefined; + /** Gets all JSDoc tags of a specified kind, or undefined if not present. */ + function getAllJSDocTagsOfKind(node: Node, kind: SyntaxKind): ReadonlyArray | undefined; } declare namespace ts { function isNumericLiteral(node: Node): node is NumericLiteral; From bb3467b8e1c2b7897bc30e282e59bd85a8b8c714 Mon Sep 17 00:00:00 2001 From: Joe Calzaretta Date: Mon, 9 Oct 2017 17:58:41 -0400 Subject: [PATCH 063/137] Handle type guard predicates on `Array.find` (#18160) * Handle type guard predicates on `Array.find` If the `predicate` function passed to `Array.find` or `ReadonlyArray.find` is a type guard narrowing `value` to type `S`, then any returned element should also be narrowed to `S`. Adding test case and associated baselines * trailing whitespace after merge conflict --- src/lib/es2015.core.d.ts | 2 + tests/baselines/reference/arrayFind.js | 22 ++++++++++ tests/baselines/reference/arrayFind.symbols | 33 +++++++++++++++ tests/baselines/reference/arrayFind.types | 46 +++++++++++++++++++++ tests/cases/compiler/arrayFind.ts | 12 ++++++ 5 files changed, 115 insertions(+) create mode 100644 tests/baselines/reference/arrayFind.js create mode 100644 tests/baselines/reference/arrayFind.symbols create mode 100644 tests/baselines/reference/arrayFind.types create mode 100644 tests/cases/compiler/arrayFind.ts diff --git a/src/lib/es2015.core.d.ts b/src/lib/es2015.core.d.ts index 5c2438d9052..9ea773e3eef 100644 --- a/src/lib/es2015.core.d.ts +++ b/src/lib/es2015.core.d.ts @@ -10,6 +10,7 @@ interface Array { * @param thisArg If provided, it will be used as the this value for each invocation of * predicate. If it is not provided, undefined is used instead. */ + find(predicate: (this: void, value: T, index: number, obj: T[]) => value is S, thisArg?: any): S | undefined; find(predicate: (value: T, index: number, obj: T[]) => boolean, thisArg?: any): T | undefined; /** @@ -350,6 +351,7 @@ interface ReadonlyArray { * @param thisArg If provided, it will be used as the this value for each invocation of * predicate. If it is not provided, undefined is used instead. */ + find(predicate: (this: void, value: T, index: number, obj: ReadonlyArray) => value is S, thisArg?: any): S | undefined; find(predicate: (value: T, index: number, obj: ReadonlyArray) => boolean, thisArg?: any): T | undefined; /** diff --git a/tests/baselines/reference/arrayFind.js b/tests/baselines/reference/arrayFind.js new file mode 100644 index 00000000000..1926c3a8dcc --- /dev/null +++ b/tests/baselines/reference/arrayFind.js @@ -0,0 +1,22 @@ +//// [arrayFind.ts] +// test fix for #18112, type guard predicates should narrow returned element +function isNumber(x: any): x is number { + return typeof x === "number"; +} + +const arrayOfStringsNumbersAndBooleans = ["string", false, 0, "strung", 1, true]; +const foundNumber: number | undefined = arrayOfStringsNumbersAndBooleans.find(isNumber); + +const readonlyArrayOfStringsNumbersAndBooleans = arrayOfStringsNumbersAndBooleans as ReadonlyArray; +const readonlyFoundNumber: number | undefined = readonlyArrayOfStringsNumbersAndBooleans.find(isNumber); + + +//// [arrayFind.js] +// test fix for #18112, type guard predicates should narrow returned element +function isNumber(x) { + return typeof x === "number"; +} +var arrayOfStringsNumbersAndBooleans = ["string", false, 0, "strung", 1, true]; +var foundNumber = arrayOfStringsNumbersAndBooleans.find(isNumber); +var readonlyArrayOfStringsNumbersAndBooleans = arrayOfStringsNumbersAndBooleans; +var readonlyFoundNumber = readonlyArrayOfStringsNumbersAndBooleans.find(isNumber); diff --git a/tests/baselines/reference/arrayFind.symbols b/tests/baselines/reference/arrayFind.symbols new file mode 100644 index 00000000000..163d5d818ba --- /dev/null +++ b/tests/baselines/reference/arrayFind.symbols @@ -0,0 +1,33 @@ +=== tests/cases/compiler/arrayFind.ts === +// test fix for #18112, type guard predicates should narrow returned element +function isNumber(x: any): x is number { +>isNumber : Symbol(isNumber, Decl(arrayFind.ts, 0, 0)) +>x : Symbol(x, Decl(arrayFind.ts, 1, 18)) +>x : Symbol(x, Decl(arrayFind.ts, 1, 18)) + + return typeof x === "number"; +>x : Symbol(x, Decl(arrayFind.ts, 1, 18)) +} + +const arrayOfStringsNumbersAndBooleans = ["string", false, 0, "strung", 1, true]; +>arrayOfStringsNumbersAndBooleans : Symbol(arrayOfStringsNumbersAndBooleans, Decl(arrayFind.ts, 5, 5)) + +const foundNumber: number | undefined = arrayOfStringsNumbersAndBooleans.find(isNumber); +>foundNumber : Symbol(foundNumber, Decl(arrayFind.ts, 6, 5)) +>arrayOfStringsNumbersAndBooleans.find : Symbol(Array.find, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>arrayOfStringsNumbersAndBooleans : Symbol(arrayOfStringsNumbersAndBooleans, Decl(arrayFind.ts, 5, 5)) +>find : Symbol(Array.find, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>isNumber : Symbol(isNumber, Decl(arrayFind.ts, 0, 0)) + +const readonlyArrayOfStringsNumbersAndBooleans = arrayOfStringsNumbersAndBooleans as ReadonlyArray; +>readonlyArrayOfStringsNumbersAndBooleans : Symbol(readonlyArrayOfStringsNumbersAndBooleans, Decl(arrayFind.ts, 8, 5)) +>arrayOfStringsNumbersAndBooleans : Symbol(arrayOfStringsNumbersAndBooleans, Decl(arrayFind.ts, 5, 5)) +>ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) + +const readonlyFoundNumber: number | undefined = readonlyArrayOfStringsNumbersAndBooleans.find(isNumber); +>readonlyFoundNumber : Symbol(readonlyFoundNumber, Decl(arrayFind.ts, 9, 5)) +>readonlyArrayOfStringsNumbersAndBooleans.find : Symbol(ReadonlyArray.find, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>readonlyArrayOfStringsNumbersAndBooleans : Symbol(readonlyArrayOfStringsNumbersAndBooleans, Decl(arrayFind.ts, 8, 5)) +>find : Symbol(ReadonlyArray.find, Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --)) +>isNumber : Symbol(isNumber, Decl(arrayFind.ts, 0, 0)) + diff --git a/tests/baselines/reference/arrayFind.types b/tests/baselines/reference/arrayFind.types new file mode 100644 index 00000000000..5c0769cb606 --- /dev/null +++ b/tests/baselines/reference/arrayFind.types @@ -0,0 +1,46 @@ +=== tests/cases/compiler/arrayFind.ts === +// test fix for #18112, type guard predicates should narrow returned element +function isNumber(x: any): x is number { +>isNumber : (x: any) => x is number +>x : any +>x : any + + return typeof x === "number"; +>typeof x === "number" : boolean +>typeof x : "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function" +>x : any +>"number" : "number" +} + +const arrayOfStringsNumbersAndBooleans = ["string", false, 0, "strung", 1, true]; +>arrayOfStringsNumbersAndBooleans : (string | number | boolean)[] +>["string", false, 0, "strung", 1, true] : (string | number | boolean)[] +>"string" : "string" +>false : false +>0 : 0 +>"strung" : "strung" +>1 : 1 +>true : true + +const foundNumber: number | undefined = arrayOfStringsNumbersAndBooleans.find(isNumber); +>foundNumber : number +>arrayOfStringsNumbersAndBooleans.find(isNumber) : number +>arrayOfStringsNumbersAndBooleans.find : { (predicate: (this: void, value: string | number | boolean, index: number, obj: (string | number | boolean)[]) => value is S, thisArg?: any): S; (predicate: (value: string | number | boolean, index: number, obj: (string | number | boolean)[]) => boolean, thisArg?: any): string | number | boolean; } +>arrayOfStringsNumbersAndBooleans : (string | number | boolean)[] +>find : { (predicate: (this: void, value: string | number | boolean, index: number, obj: (string | number | boolean)[]) => value is S, thisArg?: any): S; (predicate: (value: string | number | boolean, index: number, obj: (string | number | boolean)[]) => boolean, thisArg?: any): string | number | boolean; } +>isNumber : (x: any) => x is number + +const readonlyArrayOfStringsNumbersAndBooleans = arrayOfStringsNumbersAndBooleans as ReadonlyArray; +>readonlyArrayOfStringsNumbersAndBooleans : ReadonlyArray +>arrayOfStringsNumbersAndBooleans as ReadonlyArray : ReadonlyArray +>arrayOfStringsNumbersAndBooleans : (string | number | boolean)[] +>ReadonlyArray : ReadonlyArray + +const readonlyFoundNumber: number | undefined = readonlyArrayOfStringsNumbersAndBooleans.find(isNumber); +>readonlyFoundNumber : number +>readonlyArrayOfStringsNumbersAndBooleans.find(isNumber) : number +>readonlyArrayOfStringsNumbersAndBooleans.find : { (predicate: (this: void, value: string | number | boolean, index: number, obj: ReadonlyArray) => value is S, thisArg?: any): S; (predicate: (value: string | number | boolean, index: number, obj: ReadonlyArray) => boolean, thisArg?: any): string | number | boolean; } +>readonlyArrayOfStringsNumbersAndBooleans : ReadonlyArray +>find : { (predicate: (this: void, value: string | number | boolean, index: number, obj: ReadonlyArray) => value is S, thisArg?: any): S; (predicate: (value: string | number | boolean, index: number, obj: ReadonlyArray) => boolean, thisArg?: any): string | number | boolean; } +>isNumber : (x: any) => x is number + diff --git a/tests/cases/compiler/arrayFind.ts b/tests/cases/compiler/arrayFind.ts new file mode 100644 index 00000000000..90883974766 --- /dev/null +++ b/tests/cases/compiler/arrayFind.ts @@ -0,0 +1,12 @@ +// @lib: es2015 + +// test fix for #18112, type guard predicates should narrow returned element +function isNumber(x: any): x is number { + return typeof x === "number"; +} + +const arrayOfStringsNumbersAndBooleans = ["string", false, 0, "strung", 1, true]; +const foundNumber: number | undefined = arrayOfStringsNumbersAndBooleans.find(isNumber); + +const readonlyArrayOfStringsNumbersAndBooleans = arrayOfStringsNumbersAndBooleans as ReadonlyArray; +const readonlyFoundNumber: number | undefined = readonlyArrayOfStringsNumbersAndBooleans.find(isNumber); From 661ecc241ebd2ac6f29f6cd7d37273e4b963be09 Mon Sep 17 00:00:00 2001 From: falsandtru Date: Tue, 10 Oct 2017 07:08:22 +0900 Subject: [PATCH 064/137] Improve Object.{values,entries} static methods (#18875) --- src/lib/es2017.object.d.ts | 4 ++-- .../useObjectValuesAndEntries1.types | 20 +++++++++---------- .../useObjectValuesAndEntries4.types | 8 ++++---- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/lib/es2017.object.d.ts b/src/lib/es2017.object.d.ts index 1d8a52da758..4014e8c2927 100644 --- a/src/lib/es2017.object.d.ts +++ b/src/lib/es2017.object.d.ts @@ -3,7 +3,7 @@ interface ObjectConstructor { * Returns an array of values of the enumerable properties of an object * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. */ - values(o: { [s: string]: T }): T[]; + values(o: { [s: string]: T } | { [n: number]: T }): T[]; /** * Returns an array of values of the enumerable properties of an object @@ -15,7 +15,7 @@ interface ObjectConstructor { * Returns an array of key/values of the enumerable properties of an object * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object. */ - entries(o: { [s: string]: T }): [string, T][]; + entries(o: { [s: string]: T } | { [n: number]: T }): [string, T][]; /** * Returns an array of key/values of the enumerable properties of an object diff --git a/tests/baselines/reference/useObjectValuesAndEntries1.types b/tests/baselines/reference/useObjectValuesAndEntries1.types index 1b537ed063d..6ea45385bbc 100644 --- a/tests/baselines/reference/useObjectValuesAndEntries1.types +++ b/tests/baselines/reference/useObjectValuesAndEntries1.types @@ -10,9 +10,9 @@ var o = { a: 1, b: 2 }; for (var x of Object.values(o)) { >x : number >Object.values(o) : number[] ->Object.values : { (o: { [s: string]: T; }): T[]; (o: any): any[]; } +>Object.values : { (o: { [s: string]: T; } | { [n: number]: T; }): T[]; (o: any): any[]; } >Object : ObjectConstructor ->values : { (o: { [s: string]: T; }): T[]; (o: any): any[]; } +>values : { (o: { [s: string]: T; } | { [n: number]: T; }): T[]; (o: any): any[]; } >o : { a: number; b: number; } let y = x; @@ -23,25 +23,25 @@ for (var x of Object.values(o)) { var entries = Object.entries(o); // <-- entries: ['a' | 'b', number][] >entries : [string, number][] >Object.entries(o) : [string, number][] ->Object.entries : { (o: { [s: string]: T; }): [string, T][]; (o: any): [string, any][]; } +>Object.entries : { (o: { [s: string]: T; } | { [n: number]: T; }): [string, T][]; (o: any): [string, any][]; } >Object : ObjectConstructor ->entries : { (o: { [s: string]: T; }): [string, T][]; (o: any): [string, any][]; } +>entries : { (o: { [s: string]: T; } | { [n: number]: T; }): [string, T][]; (o: any): [string, any][]; } >o : { a: number; b: number; } var entries1 = Object.entries(1); // <-- entries: [string, any][] >entries1 : [string, any][] >Object.entries(1) : [string, any][] ->Object.entries : { (o: { [s: string]: T; }): [string, T][]; (o: any): [string, any][]; } +>Object.entries : { (o: { [s: string]: T; } | { [n: number]: T; }): [string, T][]; (o: any): [string, any][]; } >Object : ObjectConstructor ->entries : { (o: { [s: string]: T; }): [string, T][]; (o: any): [string, any][]; } +>entries : { (o: { [s: string]: T; } | { [n: number]: T; }): [string, T][]; (o: any): [string, any][]; } >1 : 1 var entries2 = Object.entries({a: true, b: 2}) // ['a' | 'b', number | boolean][] >entries2 : [string, number | boolean][] >Object.entries({a: true, b: 2}) : [string, number | boolean][] ->Object.entries : { (o: { [s: string]: T; }): [string, T][]; (o: any): [string, any][]; } +>Object.entries : { (o: { [s: string]: T; } | { [n: number]: T; }): [string, T][]; (o: any): [string, any][]; } >Object : ObjectConstructor ->entries : { (o: { [s: string]: T; }): [string, T][]; (o: any): [string, any][]; } +>entries : { (o: { [s: string]: T; } | { [n: number]: T; }): [string, T][]; (o: any): [string, any][]; } >{a: true, b: 2} : { a: true; b: 2; } >a : boolean >true : true @@ -51,8 +51,8 @@ var entries2 = Object.entries({a: true, b: 2}) // ['a' | 'b', number | boolean][ var entries3 = Object.entries({}) // [never, any][] >entries3 : [string, {}][] >Object.entries({}) : [string, {}][] ->Object.entries : { (o: { [s: string]: T; }): [string, T][]; (o: any): [string, any][]; } +>Object.entries : { (o: { [s: string]: T; } | { [n: number]: T; }): [string, T][]; (o: any): [string, any][]; } >Object : ObjectConstructor ->entries : { (o: { [s: string]: T; }): [string, T][]; (o: any): [string, any][]; } +>entries : { (o: { [s: string]: T; } | { [n: number]: T; }): [string, T][]; (o: any): [string, any][]; } >{} : {} diff --git a/tests/baselines/reference/useObjectValuesAndEntries4.types b/tests/baselines/reference/useObjectValuesAndEntries4.types index 85810bccd26..245803a24d4 100644 --- a/tests/baselines/reference/useObjectValuesAndEntries4.types +++ b/tests/baselines/reference/useObjectValuesAndEntries4.types @@ -10,9 +10,9 @@ var o = { a: 1, b: 2 }; for (var x of Object.values(o)) { >x : number >Object.values(o) : number[] ->Object.values : { (o: { [s: string]: T; }): T[]; (o: any): any[]; } +>Object.values : { (o: { [s: string]: T; } | { [n: number]: T; }): T[]; (o: any): any[]; } >Object : ObjectConstructor ->values : { (o: { [s: string]: T; }): T[]; (o: any): any[]; } +>values : { (o: { [s: string]: T; } | { [n: number]: T; }): T[]; (o: any): any[]; } >o : { a: number; b: number; } let y = x; @@ -23,8 +23,8 @@ for (var x of Object.values(o)) { var entries = Object.entries(o); >entries : [string, number][] >Object.entries(o) : [string, number][] ->Object.entries : { (o: { [s: string]: T; }): [string, T][]; (o: any): [string, any][]; } +>Object.entries : { (o: { [s: string]: T; } | { [n: number]: T; }): [string, T][]; (o: any): [string, any][]; } >Object : ObjectConstructor ->entries : { (o: { [s: string]: T; }): [string, T][]; (o: any): [string, any][]; } +>entries : { (o: { [s: string]: T; } | { [n: number]: T; }): [string, T][]; (o: any): [string, any][]; } >o : { a: number; b: number; } From 6887dbc75028f225d25ed91815de1719e5a1e101 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Mon, 9 Oct 2017 15:24:00 -0700 Subject: [PATCH 065/137] Assert if the script info that is attached to closed project is present Adds assertion to investigate #19003 and #18928 --- src/server/editorServices.ts | 3 +++ src/server/project.ts | 21 ++++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 2916fb60c57..40c196009e3 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -832,6 +832,9 @@ namespace ts.server { this.logger.info(`remove project: ${project.getRootFiles().toString()}`); project.close(); + if (Debug.shouldAssert(AssertionLevel.Normal)) { + this.filenameToScriptInfo.forEach(info => Debug.assert(!info.isAttached(project))); + } // Remove the project from pending project updates this.pendingProjectUpdates.delete(project.getProjectName()); diff --git a/src/server/project.ts b/src/server/project.ts index 5132b82a804..e8bfd7c1b75 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -497,12 +497,7 @@ namespace ts.server { if (this.program) { // if we have a program - release all files that are enlisted in program for (const f of this.program.getSourceFiles()) { - const info = this.projectService.getScriptInfo(f.fileName); - // We might not find the script info in case its not associated with the project any more - // and project graph was not updated (eg delayed update graph in case of files changed/deleted on the disk) - if (info) { - info.detachFromProject(this); - } + this.detachScriptInfo(f.fileName); } } if (!this.program || !this.languageServiceEnabled) { @@ -512,10 +507,13 @@ namespace ts.server { root.detachFromProject(this); } } + this.rootFiles = undefined; this.rootFilesMap = undefined; this.program = undefined; this.builder = undefined; + forEach(this.externalFiles, externalFile => this.detachScriptInfo(externalFile)); + this.externalFiles = undefined; this.resolutionCache.clear(); this.resolutionCache = undefined; this.cachedUnresolvedImportsPerFile = undefined; @@ -532,6 +530,15 @@ namespace ts.server { this.languageService = undefined; } + private detachScriptInfo(uncheckedFilename: string) { + const info = this.projectService.getScriptInfo(uncheckedFilename); + // We might not find the script info in case its not associated with the project any more + // and project graph was not updated (eg delayed update graph in case of files changed/deleted on the disk) + if (info) { + info.detachFromProject(this); + } + } + isClosed() { return this.rootFiles === undefined; } @@ -791,7 +798,7 @@ namespace ts.server { private updateGraphWorker() { const oldProgram = this.program; - + Debug.assert(!this.isClosed(), "Called update graph worker of closed project"); this.writeLog(`Starting updateGraphWorker: Project: ${this.getProjectName()}`); const start = timestamp(); this.hasInvalidatedResolution = this.resolutionCache.createHasInvalidatedResolution(); From aaa06122b9d7b064d702591be063cea2c7c78e91 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Mon, 9 Oct 2017 15:40:52 -0700 Subject: [PATCH 066/137] Fix recursive reference in type parameter default --- src/compiler/checker.ts | 60 ++++++++++++++----- src/compiler/diagnosticMessages.json | 4 ++ tests/baselines/reference/genericDefaults.js | 7 ++- .../reference/genericDefaults.symbols | 6 ++ .../baselines/reference/genericDefaults.types | 6 ++ .../genericDefaultsErrors.errors.txt | 10 +++- .../reference/genericDefaultsErrors.js | 5 +- .../reference/genericDefaultsErrors.symbols | 6 ++ .../reference/genericDefaultsErrors.types | 6 ++ tests/cases/compiler/genericDefaults.ts | 5 +- tests/cases/compiler/genericDefaultsErrors.ts | 5 +- 11 files changed, 98 insertions(+), 22 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d47a77a7440..4c6973f3048 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -281,6 +281,7 @@ namespace ts { const noConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); const circularConstraintType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); + const resolvingDefaultType = createAnonymousType(undefined, emptySymbols, emptyArray, emptyArray, undefined, undefined); const markerSuperType = createType(TypeFlags.TypeParameter); const markerSubType = createType(TypeFlags.TypeParameter); @@ -6055,27 +6056,51 @@ namespace ts { return type.resolvedApparentType || (type.resolvedApparentType = getTypeWithThisArgument(type, type)); } + function getResolvedTypeParameterDefault(typeParameter: TypeParameter): Type | undefined { + if (!typeParameter.default) { + if (typeParameter.target) { + const targetDefault = getResolvedTypeParameterDefault(typeParameter.target); + typeParameter.default = targetDefault ? instantiateType(targetDefault, typeParameter.mapper) : noConstraintType; + } + else { + // To block recursion, set the initial value to the resolvingDefaultType. + typeParameter.default = resolvingDefaultType; + const defaultDeclaration = typeParameter.symbol && forEach(typeParameter.symbol.declarations, decl => isTypeParameterDeclaration(decl) && decl.default); + const defaultType = defaultDeclaration ? getTypeFromTypeNode(defaultDeclaration) : noConstraintType; + if (typeParameter.default === resolvingDefaultType) { + // If we have not been called recursively, set the correct default type. + typeParameter.default = defaultType; + } + } + } + else if (typeParameter.default === resolvingDefaultType) { + // If we are called recursively for this type parameter, mark the default as circular. + typeParameter.default = circularConstraintType; + } + return typeParameter.default; + } + /** * Gets the default type for a type parameter. * * If the type parameter is the result of an instantiation, this gets the instantiated - * default type of its target. If the type parameter has no default type, `undefined` - * is returned. - * - * This function *does not* perform a circularity check. + * default type of its target. If the type parameter has no default type or the default is + * circular, `undefined` is returned. */ function getDefaultFromTypeParameter(typeParameter: TypeParameter): Type | undefined { - if (!typeParameter.default) { - if (typeParameter.target) { - const targetDefault = getDefaultFromTypeParameter(typeParameter.target); - typeParameter.default = targetDefault ? instantiateType(targetDefault, typeParameter.mapper) : noConstraintType; - } - else { - const defaultDeclaration = typeParameter.symbol && forEach(typeParameter.symbol.declarations, decl => isTypeParameterDeclaration(decl) && decl.default); - typeParameter.default = defaultDeclaration ? getTypeFromTypeNode(defaultDeclaration) : noConstraintType; - } - } - return typeParameter.default === noConstraintType ? undefined : typeParameter.default; + const defaultType = getResolvedTypeParameterDefault(typeParameter); + return defaultType !== noConstraintType && defaultType !== circularConstraintType ? defaultType : undefined; + } + + function hasNonCircularTypeParameterDefault(typeParameter: TypeParameter) { + return getResolvedTypeParameterDefault(typeParameter) !== circularConstraintType; + } + + /** + * Indicates whether the declaration of a typeParameter has a default type. + */ + function hasTypeParameterDefault(typeParameter: TypeParameter): boolean { + return !!(typeParameter.symbol && forEach(typeParameter.symbol.declarations, decl => isTypeParameterDeclaration(decl) && decl.default)); } /** @@ -6361,7 +6386,7 @@ namespace ts { let minTypeArgumentCount = 0; if (typeParameters) { for (let i = 0; i < typeParameters.length; i++) { - if (!getDefaultFromTypeParameter(typeParameters[i])) { + if (!hasTypeParameterDefault(typeParameters[i])) { minTypeArgumentCount = i + 1; } } @@ -18478,6 +18503,9 @@ namespace ts { if (!hasNonCircularBaseConstraint(typeParameter)) { error(node.constraint, Diagnostics.Type_parameter_0_has_a_circular_constraint, typeToString(typeParameter)); } + if (!hasNonCircularTypeParameterDefault(typeParameter)) { + error(node.default, Diagnostics.Type_parameter_0_has_a_circular_default, typeToString(typeParameter)); + } const constraintType = getConstraintOfTypeParameter(typeParameter); const defaultType = getDefaultFromTypeParameter(typeParameter); if (constraintType && defaultType) { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 91ad9e52bfd..3389bc1063e 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2224,6 +2224,10 @@ "category": "Error", "code": 2715 }, + "Type parameter '{0}' has a circular default.": { + "category": "Error", + "code": 2716 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", diff --git a/tests/baselines/reference/genericDefaults.js b/tests/baselines/reference/genericDefaults.js index 06503b89d58..be6b76ea43c 100644 --- a/tests/baselines/reference/genericDefaults.js +++ b/tests/baselines/reference/genericDefaults.js @@ -487,7 +487,10 @@ const t03c00 = (>x).a; const t03c01 = (>x).a; const t03c02 = (>x).a; const t03c03 = (>x).a; -const t03c04 = (>x).a; +const t03c04 = (>x).a; + +// https://github.com/Microsoft/TypeScript/issues/16221 +interface SelfReference> {} //// [genericDefaults.js] // no inference @@ -1024,3 +1027,5 @@ declare const t03c01: [1, 1]; declare const t03c02: [number, number]; declare const t03c03: [1, 1]; declare const t03c04: [number, 1]; +interface SelfReference> { +} diff --git a/tests/baselines/reference/genericDefaults.symbols b/tests/baselines/reference/genericDefaults.symbols index 6c9e97b265e..755a34c7a63 100644 --- a/tests/baselines/reference/genericDefaults.symbols +++ b/tests/baselines/reference/genericDefaults.symbols @@ -2291,3 +2291,9 @@ const t03c04 = (>x).a; >x : Symbol(x, Decl(genericDefaults.ts, 13, 13)) >a : Symbol(a, Decl(genericDefaults.ts, 483, 47)) +// https://github.com/Microsoft/TypeScript/issues/16221 +interface SelfReference> {} +>SelfReference : Symbol(SelfReference, Decl(genericDefaults.ts, 488, 37)) +>T : Symbol(T, Decl(genericDefaults.ts, 491, 24)) +>SelfReference : Symbol(SelfReference, Decl(genericDefaults.ts, 488, 37)) + diff --git a/tests/baselines/reference/genericDefaults.types b/tests/baselines/reference/genericDefaults.types index 739588badb9..0013daefd89 100644 --- a/tests/baselines/reference/genericDefaults.types +++ b/tests/baselines/reference/genericDefaults.types @@ -2643,3 +2643,9 @@ const t03c04 = (>x).a; >x : any >a : [number, 1] +// https://github.com/Microsoft/TypeScript/issues/16221 +interface SelfReference> {} +>SelfReference : SelfReference +>T : T +>SelfReference : SelfReference + diff --git a/tests/baselines/reference/genericDefaultsErrors.errors.txt b/tests/baselines/reference/genericDefaultsErrors.errors.txt index 6200046c49f..762bb92535b 100644 --- a/tests/baselines/reference/genericDefaultsErrors.errors.txt +++ b/tests/baselines/reference/genericDefaultsErrors.errors.txt @@ -21,9 +21,10 @@ tests/cases/compiler/genericDefaultsErrors.ts(33,15): error TS2707: Generic type tests/cases/compiler/genericDefaultsErrors.ts(36,15): error TS2707: Generic type 'i09' requires between 2 and 3 type arguments. tests/cases/compiler/genericDefaultsErrors.ts(38,20): error TS2304: Cannot find name 'T'. tests/cases/compiler/genericDefaultsErrors.ts(38,20): error TS4033: Property 'x' of exported interface has or is using private name 'T'. +tests/cases/compiler/genericDefaultsErrors.ts(42,29): error TS2715: Type parameter 'T' has a circular default. -==== tests/cases/compiler/genericDefaultsErrors.ts (21 errors) ==== +==== tests/cases/compiler/genericDefaultsErrors.ts (22 errors) ==== declare const x: any; declare function f03(): void; // error @@ -106,4 +107,9 @@ tests/cases/compiler/genericDefaultsErrors.ts(38,20): error TS4033: Property 'x' !!! error TS2304: Cannot find name 'T'. ~ !!! error TS4033: Property 'x' of exported interface has or is using private name 'T'. - interface i10 {} \ No newline at end of file + interface i10 {} + + // https://github.com/Microsoft/TypeScript/issues/16221 + interface SelfReference {} + ~~~~~~~~~~~~~ +!!! error TS2715: Type parameter 'T' has a circular default. \ No newline at end of file diff --git a/tests/baselines/reference/genericDefaultsErrors.js b/tests/baselines/reference/genericDefaultsErrors.js index c737644e999..19201172b2f 100644 --- a/tests/baselines/reference/genericDefaultsErrors.js +++ b/tests/baselines/reference/genericDefaultsErrors.js @@ -37,7 +37,10 @@ type i09t03 = i09<1, 2, 3>; // ok type i09t04 = i09<1, 2, 3, 4>; // error interface i10 { x: T; } // error -interface i10 {} +interface i10 {} + +// https://github.com/Microsoft/TypeScript/issues/16221 +interface SelfReference {} //// [genericDefaultsErrors.js] f11(); // ok diff --git a/tests/baselines/reference/genericDefaultsErrors.symbols b/tests/baselines/reference/genericDefaultsErrors.symbols index 495b56ea25a..e6e5cb86062 100644 --- a/tests/baselines/reference/genericDefaultsErrors.symbols +++ b/tests/baselines/reference/genericDefaultsErrors.symbols @@ -136,3 +136,9 @@ interface i10 {} >i10 : Symbol(i10, Decl(genericDefaultsErrors.ts, 35, 30), Decl(genericDefaultsErrors.ts, 37, 23)) >T : Symbol(T, Decl(genericDefaultsErrors.ts, 38, 14)) +// https://github.com/Microsoft/TypeScript/issues/16221 +interface SelfReference {} +>SelfReference : Symbol(SelfReference, Decl(genericDefaultsErrors.ts, 38, 28)) +>T : Symbol(T, Decl(genericDefaultsErrors.ts, 41, 24)) +>SelfReference : Symbol(SelfReference, Decl(genericDefaultsErrors.ts, 38, 28)) + diff --git a/tests/baselines/reference/genericDefaultsErrors.types b/tests/baselines/reference/genericDefaultsErrors.types index 46bae67bc25..87e9af0bb07 100644 --- a/tests/baselines/reference/genericDefaultsErrors.types +++ b/tests/baselines/reference/genericDefaultsErrors.types @@ -145,3 +145,9 @@ interface i10 {} >i10 : i10 >T : T +// https://github.com/Microsoft/TypeScript/issues/16221 +interface SelfReference {} +>SelfReference : SelfReference +>T : T +>SelfReference : SelfReference + diff --git a/tests/cases/compiler/genericDefaults.ts b/tests/cases/compiler/genericDefaults.ts index 624b44c0829..e7b9c95edeb 100644 --- a/tests/cases/compiler/genericDefaults.ts +++ b/tests/cases/compiler/genericDefaults.ts @@ -487,4 +487,7 @@ const t03c00 = (>x).a; const t03c01 = (>x).a; const t03c02 = (>x).a; const t03c03 = (>x).a; -const t03c04 = (>x).a; \ No newline at end of file +const t03c04 = (>x).a; + +// https://github.com/Microsoft/TypeScript/issues/16221 +interface SelfReference> {} \ No newline at end of file diff --git a/tests/cases/compiler/genericDefaultsErrors.ts b/tests/cases/compiler/genericDefaultsErrors.ts index 4ea42beb3da..9cdba888327 100644 --- a/tests/cases/compiler/genericDefaultsErrors.ts +++ b/tests/cases/compiler/genericDefaultsErrors.ts @@ -38,4 +38,7 @@ type i09t03 = i09<1, 2, 3>; // ok type i09t04 = i09<1, 2, 3, 4>; // error interface i10 { x: T; } // error -interface i10 {} \ No newline at end of file +interface i10 {} + +// https://github.com/Microsoft/TypeScript/issues/16221 +interface SelfReference {} \ No newline at end of file From b9592d4186ac04ba9690ae6d2f86697ddcf820a9 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Mon, 9 Oct 2017 15:59:27 -0700 Subject: [PATCH 067/137] Use the parent most node_modules directory for module resolution failed lookup locations --- src/compiler/resolutionCache.ts | 14 +++---- .../unittests/tsserverProjectSystem.ts | 37 +++++++++++++++++++ 2 files changed, 43 insertions(+), 8 deletions(-) diff --git a/src/compiler/resolutionCache.ts b/src/compiler/resolutionCache.ts index aecc6989891..25545c0efbc 100644 --- a/src/compiler/resolutionCache.ts +++ b/src/compiler/resolutionCache.ts @@ -323,19 +323,17 @@ namespace ts { let dir = getDirectoryPath(getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory())); let dirPath = getDirectoryPath(failedLookupLocationPath); + // If directory path contains node module, get the most parent node_modules directory for watching + while (dirPath.indexOf("/node_modules/") !== -1) { + dir = getDirectoryPath(dir); + dirPath = getDirectoryPath(dirPath); + } + // If the directory is node_modules use it to watch if (isNodeModulesDirectory(dirPath)) { return { dir, dirPath }; } - // If directory path contains node module, get the node_modules directory for watching - if (dirPath.indexOf("/node_modules/") !== -1) { - while (!isNodeModulesDirectory(dirPath)) { - dir = getDirectoryPath(dir); - dirPath = getDirectoryPath(dirPath); - } - return { dir, dirPath }; - } // Use some ancestor of the root directory if (rootPath !== undefined) { diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index 06e2beeaaa6..2f875456e06 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -2399,6 +2399,43 @@ namespace ts.projectSystem { checkWatchedDirectories(host, watchedRecursiveDirectories, /*recursive*/ true); }); + + it("Failed lookup locations are uses parent most node_modules directory", () => { + const file1: FileOrFolder = { + path: "/a/b/src/file1.ts", + content: 'import { classc } from "module1"' + }; + const module1: FileOrFolder = { + path: "/a/b/node_modules/module1/index.d.ts", + content: `import { class2 } from "module2"; + export classc { method2a(): class2; }` + }; + const module2: FileOrFolder = { + path: "/a/b/node_modules/module2/index.d.ts", + content: "export class2 { method2() { return 10; } }" + }; + const module3: FileOrFolder = { + path: "/a/b/node_modules/module/node_modules/module3/index.d.ts", + content: "export class3 { method2() { return 10; } }" + }; + const configFile: FileOrFolder = { + path: "/a/b/src/tsconfig.json", + content: JSON.stringify({ files: [file1.path] }) + }; + const files = [file1, module1, module2, module3, configFile, libFile]; + const host = createServerHost(files); + const projectService = createProjectService(host); + projectService.openClientFile(file1.path); + checkNumberOfProjects(projectService, { configuredProjects: 1 }); + const project = projectService.configuredProjects.get(configFile.path); + assert.isDefined(project); + checkProjectActualFiles(project, [file1.path, libFile.path, module1.path, module2.path, configFile.path]); + checkWatchedFiles(host, [libFile.path, module1.path, module2.path, configFile.path]); + checkWatchedDirectories(host, [], /*recursive*/ false); + const watchedRecursiveDirectories = getTypeRootsFromLocation("/a/b/src"); + watchedRecursiveDirectories.push("/a/b/src", "/a/b/node_modules"); + checkWatchedDirectories(host, watchedRecursiveDirectories, /*recursive*/ true); + }); }); describe("Proper errors", () => { From 17a1cd069dc4d1f45f09f57186f94e45505b5ed6 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Mon, 9 Oct 2017 16:55:20 -0700 Subject: [PATCH 068/137] Add deprecation warning to getSymbolDisplayBuilder (#18953) * Add deprecation warning to getSymbolDisplayBuilder * Accept API baselines --- src/compiler/types.ts | 4 ++++ tests/baselines/reference/api/tsserverlibrary.d.ts | 4 ++++ tests/baselines/reference/api/typescript.d.ts | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 13a23b77a0a..67b8606df5e 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2653,6 +2653,10 @@ namespace ts { signatureToString(signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): string; typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; + /** + * @deprecated Use the createX factory functions or XToY typechecker methods and `createPrinter` or the `xToString` methods instead + * This will be removed in a future version. + */ getSymbolDisplayBuilder(): SymbolDisplayBuilder; getFullyQualifiedName(symbol: Symbol): string; getAugmentedPropertiesOfType(type: Type): Symbol[]; diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index ce926dfc040..6da4262e0b7 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -1731,6 +1731,10 @@ declare namespace ts { signatureToString(signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): string; typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; + /** + * @deprecated Use the createX factory functions or XToY typechecker methods and `createPrinter` or the `xToString` methods instead + * This will be removed in a future version. + */ getSymbolDisplayBuilder(): SymbolDisplayBuilder; getFullyQualifiedName(symbol: Symbol): string; getAugmentedPropertiesOfType(type: Type): Symbol[]; diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index b8fd072c852..0c74f74c741 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -1731,6 +1731,10 @@ declare namespace ts { signatureToString(signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind): string; typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): string; + /** + * @deprecated Use the createX factory functions or XToY typechecker methods and `createPrinter` or the `xToString` methods instead + * This will be removed in a future version. + */ getSymbolDisplayBuilder(): SymbolDisplayBuilder; getFullyQualifiedName(symbol: Symbol): string; getAugmentedPropertiesOfType(type: Type): Symbol[]; From d23e5f1ee2fbe67db4ed0a5ac6dc856dfc7ce9c8 Mon Sep 17 00:00:00 2001 From: falsandtru Date: Tue, 10 Oct 2017 09:11:31 +0900 Subject: [PATCH 069/137] Fix Array.{reduce,reduceRight} methods (#18987) --- src/lib/es5.d.ts | 66 ++++++++++++------- .../anyInferenceAnonymousFunctions.symbols | 12 ++-- .../anyInferenceAnonymousFunctions.types | 12 ++-- ...plicateOverloadInTypeAugmentation1.symbols | 8 +-- ...duplicateOverloadInTypeAugmentation1.types | 8 +-- ...ericContextualTypingSpecialization.symbols | 4 +- ...enericContextualTypingSpecialization.types | 4 +- .../baselines/reference/genericReduce.symbols | 12 ++-- tests/baselines/reference/genericReduce.types | 12 ++-- ...ferFromGenericFunctionReturnTypes1.symbols | 4 +- ...inferFromGenericFunctionReturnTypes1.types | 4 +- ...ferFromGenericFunctionReturnTypes2.symbols | 4 +- ...inferFromGenericFunctionReturnTypes2.types | 4 +- .../baselines/reference/parserharness.symbols | 12 ++-- tests/baselines/reference/parserharness.types | 12 ++-- .../reference/recursiveTypeRelations.symbols | 4 +- .../reference/recursiveTypeRelations.types | 4 +- .../reference/restInvalidArgumentType.types | 2 +- .../returnTypeParameterWithModules.symbols | 4 +- .../returnTypeParameterWithModules.types | 4 +- .../reference/spreadInvalidArgumentType.types | 4 +- .../unknownSymbolOffContextualType1.symbols | 4 +- .../unknownSymbolOffContextualType1.types | 4 +- 23 files changed, 115 insertions(+), 93 deletions(-) diff --git a/src/lib/es5.d.ts b/src/lib/es5.d.ts index e08534d8ba9..fd2ae5b3fdf 100644 --- a/src/lib/es5.d.ts +++ b/src/lib/es5.d.ts @@ -1050,7 +1050,8 @@ interface ReadonlyArray { * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. */ - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue?: T): T; + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T): T; + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue: T): T; /** * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. @@ -1062,7 +1063,8 @@ interface ReadonlyArray { * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. */ - reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue?: T): T; + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T): T; + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue: T): T; /** * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. @@ -1200,7 +1202,8 @@ interface Array { * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. */ - reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T; + reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T; /** * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. @@ -1212,7 +1215,8 @@ interface Array { * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. */ - reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T; + reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T; /** * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function. * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. @@ -1647,7 +1651,8 @@ interface Int8Array { * the accumulation. The first call to the callbackfn function provides this value as an argument * instead of an array value. */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number; /** * Calls the specified callback function for all the elements in an array. The return value of @@ -1671,7 +1676,8 @@ interface Int8Array { * the accumulation. The first call to the callbackfn function provides this value as an * argument instead of an array value. */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue?: number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number; /** * Calls the specified callback function for all the elements in an array, in descending order. @@ -1914,7 +1920,8 @@ interface Uint8Array { * the accumulation. The first call to the callbackfn function provides this value as an argument * instead of an array value. */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number; /** * Calls the specified callback function for all the elements in an array. The return value of @@ -1938,7 +1945,8 @@ interface Uint8Array { * the accumulation. The first call to the callbackfn function provides this value as an * argument instead of an array value. */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue?: number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number; /** * Calls the specified callback function for all the elements in an array, in descending order. @@ -2181,7 +2189,8 @@ interface Uint8ClampedArray { * the accumulation. The first call to the callbackfn function provides this value as an argument * instead of an array value. */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number; /** * Calls the specified callback function for all the elements in an array. The return value of @@ -2205,7 +2214,8 @@ interface Uint8ClampedArray { * the accumulation. The first call to the callbackfn function provides this value as an * argument instead of an array value. */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue?: number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number; /** * Calls the specified callback function for all the elements in an array, in descending order. @@ -2446,7 +2456,8 @@ interface Int16Array { * the accumulation. The first call to the callbackfn function provides this value as an argument * instead of an array value. */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number; /** * Calls the specified callback function for all the elements in an array. The return value of @@ -2470,7 +2481,8 @@ interface Int16Array { * the accumulation. The first call to the callbackfn function provides this value as an * argument instead of an array value. */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue?: number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number; /** * Calls the specified callback function for all the elements in an array, in descending order. @@ -2714,7 +2726,8 @@ interface Uint16Array { * the accumulation. The first call to the callbackfn function provides this value as an argument * instead of an array value. */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number; /** * Calls the specified callback function for all the elements in an array. The return value of @@ -2738,7 +2751,8 @@ interface Uint16Array { * the accumulation. The first call to the callbackfn function provides this value as an * argument instead of an array value. */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue?: number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number; /** * Calls the specified callback function for all the elements in an array, in descending order. @@ -2981,7 +2995,8 @@ interface Int32Array { * the accumulation. The first call to the callbackfn function provides this value as an argument * instead of an array value. */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number; /** * Calls the specified callback function for all the elements in an array. The return value of @@ -3005,7 +3020,8 @@ interface Int32Array { * the accumulation. The first call to the callbackfn function provides this value as an * argument instead of an array value. */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue?: number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number; /** * Calls the specified callback function for all the elements in an array, in descending order. @@ -3247,7 +3263,8 @@ interface Uint32Array { * the accumulation. The first call to the callbackfn function provides this value as an argument * instead of an array value. */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number; /** * Calls the specified callback function for all the elements in an array. The return value of @@ -3271,7 +3288,8 @@ interface Uint32Array { * the accumulation. The first call to the callbackfn function provides this value as an * argument instead of an array value. */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue?: number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number; /** * Calls the specified callback function for all the elements in an array, in descending order. @@ -3514,7 +3532,8 @@ interface Float32Array { * the accumulation. The first call to the callbackfn function provides this value as an argument * instead of an array value. */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number; /** * Calls the specified callback function for all the elements in an array. The return value of @@ -3538,7 +3557,8 @@ interface Float32Array { * the accumulation. The first call to the callbackfn function provides this value as an * argument instead of an array value. */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue?: number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number; /** * Calls the specified callback function for all the elements in an array, in descending order. @@ -3782,7 +3802,8 @@ interface Float64Array { * the accumulation. The first call to the callbackfn function provides this value as an argument * instead of an array value. */ - reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number; + reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number; /** * Calls the specified callback function for all the elements in an array. The return value of @@ -3806,7 +3827,8 @@ interface Float64Array { * the accumulation. The first call to the callbackfn function provides this value as an * argument instead of an array value. */ - reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue?: number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number; + reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number; /** * Calls the specified callback function for all the elements in an array, in descending order. diff --git a/tests/baselines/reference/anyInferenceAnonymousFunctions.symbols b/tests/baselines/reference/anyInferenceAnonymousFunctions.symbols index c1b5df88fb0..4aad165f40a 100644 --- a/tests/baselines/reference/anyInferenceAnonymousFunctions.symbols +++ b/tests/baselines/reference/anyInferenceAnonymousFunctions.symbols @@ -3,9 +3,9 @@ var paired: any[]; >paired : Symbol(paired, Decl(anyInferenceAnonymousFunctions.ts, 0, 3)) paired.reduce(function (a1, a2) { ->paired.reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>paired.reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >paired : Symbol(paired, Decl(anyInferenceAnonymousFunctions.ts, 0, 3)) ->reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >a1 : Symbol(a1, Decl(anyInferenceAnonymousFunctions.ts, 2, 24)) >a2 : Symbol(a2, Decl(anyInferenceAnonymousFunctions.ts, 2, 27)) @@ -15,9 +15,9 @@ paired.reduce(function (a1, a2) { } , []); paired.reduce((b1, b2) => { ->paired.reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>paired.reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >paired : Symbol(paired, Decl(anyInferenceAnonymousFunctions.ts, 0, 3)) ->reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >b1 : Symbol(b1, Decl(anyInferenceAnonymousFunctions.ts, 8, 15)) >b2 : Symbol(b2, Decl(anyInferenceAnonymousFunctions.ts, 8, 18)) @@ -27,9 +27,9 @@ paired.reduce((b1, b2) => { } , []); paired.reduce((b3, b4) => b3.concat({}), []); ->paired.reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>paired.reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >paired : Symbol(paired, Decl(anyInferenceAnonymousFunctions.ts, 0, 3)) ->reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >b3 : Symbol(b3, Decl(anyInferenceAnonymousFunctions.ts, 13, 15)) >b4 : Symbol(b4, Decl(anyInferenceAnonymousFunctions.ts, 13, 18)) >b3 : Symbol(b3, Decl(anyInferenceAnonymousFunctions.ts, 13, 15)) diff --git a/tests/baselines/reference/anyInferenceAnonymousFunctions.types b/tests/baselines/reference/anyInferenceAnonymousFunctions.types index 8dc7fdcb90f..d5f693b5453 100644 --- a/tests/baselines/reference/anyInferenceAnonymousFunctions.types +++ b/tests/baselines/reference/anyInferenceAnonymousFunctions.types @@ -4,9 +4,9 @@ var paired: any[]; paired.reduce(function (a1, a2) { >paired.reduce(function (a1, a2) { return a1.concat({});} , []) : any ->paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } +>paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >paired : any[] ->reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >function (a1, a2) { return a1.concat({});} : (a1: any, a2: any) => any >a1 : any >a2 : any @@ -23,9 +23,9 @@ paired.reduce(function (a1, a2) { paired.reduce((b1, b2) => { >paired.reduce((b1, b2) => { return b1.concat({});} , []) : any ->paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } +>paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >paired : any[] ->reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >(b1, b2) => { return b1.concat({});} : (b1: any, b2: any) => any >b1 : any >b2 : any @@ -42,9 +42,9 @@ paired.reduce((b1, b2) => { paired.reduce((b3, b4) => b3.concat({}), []); >paired.reduce((b3, b4) => b3.concat({}), []) : any ->paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } +>paired.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >paired : any[] ->reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >(b3, b4) => b3.concat({}) : (b3: any, b4: any) => any >b3 : any >b4 : any diff --git a/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.symbols b/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.symbols index 02589e011c4..31efb739e4c 100644 --- a/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.symbols +++ b/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.symbols @@ -4,7 +4,7 @@ interface Array { >T : Symbol(T, Decl(lib.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, ->reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 20), Decl(duplicateOverloadInTypeAugmentation1.ts, 2, 29)) +>reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 20), Decl(duplicateOverloadInTypeAugmentation1.ts, 2, 29)) >callbackfn : Symbol(callbackfn, Decl(duplicateOverloadInTypeAugmentation1.ts, 1, 11)) >previousValue : Symbol(previousValue, Decl(duplicateOverloadInTypeAugmentation1.ts, 1, 24)) >T : Symbol(T, Decl(lib.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) @@ -21,7 +21,7 @@ interface Array { >T : Symbol(T, Decl(lib.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 16)) reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, ->reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 20), Decl(duplicateOverloadInTypeAugmentation1.ts, 2, 29)) +>reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 20), Decl(duplicateOverloadInTypeAugmentation1.ts, 2, 29)) >U : Symbol(U, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 11)) >callbackfn : Symbol(callbackfn, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 14)) >previousValue : Symbol(previousValue, Decl(duplicateOverloadInTypeAugmentation1.ts, 3, 27)) @@ -44,9 +44,9 @@ var a: Array; var r5 = a.reduce((x, y) => x + y); >r5 : Symbol(r5, Decl(duplicateOverloadInTypeAugmentation1.ts, 7, 3)) ->a.reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 20), Decl(duplicateOverloadInTypeAugmentation1.ts, 2, 29)) +>a.reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 20), Decl(duplicateOverloadInTypeAugmentation1.ts, 2, 29)) >a : Symbol(a, Decl(duplicateOverloadInTypeAugmentation1.ts, 6, 3)) ->reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 20), Decl(duplicateOverloadInTypeAugmentation1.ts, 2, 29)) +>reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(duplicateOverloadInTypeAugmentation1.ts, 0, 20), Decl(duplicateOverloadInTypeAugmentation1.ts, 2, 29)) >x : Symbol(x, Decl(duplicateOverloadInTypeAugmentation1.ts, 7, 19)) >y : Symbol(y, Decl(duplicateOverloadInTypeAugmentation1.ts, 7, 21)) >x : Symbol(x, Decl(duplicateOverloadInTypeAugmentation1.ts, 7, 19)) diff --git a/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.types b/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.types index bc7214eb6b9..ea07ece4314 100644 --- a/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.types +++ b/tests/baselines/reference/duplicateOverloadInTypeAugmentation1.types @@ -4,7 +4,7 @@ interface Array { >T : T reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, ->reduce : { (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; (callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; (callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T; (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T; (callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; (callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; } >callbackfn : (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T >previousValue : T >T : T @@ -21,7 +21,7 @@ interface Array { >T : T reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, ->reduce : { (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; (callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; (callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T; (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T; (callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; (callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; (callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; } >U : U >callbackfn : (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U >previousValue : U @@ -45,9 +45,9 @@ var a: Array; var r5 = a.reduce((x, y) => x + y); >r5 : string >a.reduce((x, y) => x + y) : string ->a.reduce : { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue?: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue?: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; } +>a.reduce : { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string; (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue?: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; } >a : string[] ->reduce : { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue?: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue?: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string; (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue?: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; } >(x, y) => x + y : (x: string, y: string) => string >x : string >y : string diff --git a/tests/baselines/reference/genericContextualTypingSpecialization.symbols b/tests/baselines/reference/genericContextualTypingSpecialization.symbols index b244ab496be..0dcc8cb5899 100644 --- a/tests/baselines/reference/genericContextualTypingSpecialization.symbols +++ b/tests/baselines/reference/genericContextualTypingSpecialization.symbols @@ -3,9 +3,9 @@ var b: number[]; >b : Symbol(b, Decl(genericContextualTypingSpecialization.ts, 0, 3)) b.reduce((c, d) => c + d, 0); // should not error on '+' ->b.reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>b.reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >b : Symbol(b, Decl(genericContextualTypingSpecialization.ts, 0, 3)) ->reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >c : Symbol(c, Decl(genericContextualTypingSpecialization.ts, 1, 18)) >d : Symbol(d, Decl(genericContextualTypingSpecialization.ts, 1, 20)) >c : Symbol(c, Decl(genericContextualTypingSpecialization.ts, 1, 18)) diff --git a/tests/baselines/reference/genericContextualTypingSpecialization.types b/tests/baselines/reference/genericContextualTypingSpecialization.types index 82255020347..d7d61010507 100644 --- a/tests/baselines/reference/genericContextualTypingSpecialization.types +++ b/tests/baselines/reference/genericContextualTypingSpecialization.types @@ -4,9 +4,9 @@ var b: number[]; b.reduce((c, d) => c + d, 0); // should not error on '+' >b.reduce((c, d) => c + d, 0) : number ->b.reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>b.reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } >b : number[] ->reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } >(c, d) => c + d : (c: number, d: number) => number >c : number >d : number diff --git a/tests/baselines/reference/genericReduce.symbols b/tests/baselines/reference/genericReduce.symbols index f220972a350..a939c5cf92d 100644 --- a/tests/baselines/reference/genericReduce.symbols +++ b/tests/baselines/reference/genericReduce.symbols @@ -14,9 +14,9 @@ var b = a.map(s => s.length); var n1 = b.reduce((x, y) => x + y); >n1 : Symbol(n1, Decl(genericReduce.ts, 2, 3)) ->b.reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>b.reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >b : Symbol(b, Decl(genericReduce.ts, 1, 3)) ->reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(genericReduce.ts, 2, 19)) >y : Symbol(y, Decl(genericReduce.ts, 2, 21)) >x : Symbol(x, Decl(genericReduce.ts, 2, 19)) @@ -24,9 +24,9 @@ var n1 = b.reduce((x, y) => x + y); var n2 = b.reduceRight((x, y) => x + y); >n2 : Symbol(n2, Decl(genericReduce.ts, 3, 3)) ->b.reduceRight : Symbol(Array.reduceRight, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>b.reduceRight : Symbol(Array.reduceRight, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >b : Symbol(b, Decl(genericReduce.ts, 1, 3)) ->reduceRight : Symbol(Array.reduceRight, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>reduceRight : Symbol(Array.reduceRight, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(genericReduce.ts, 3, 24)) >y : Symbol(y, Decl(genericReduce.ts, 3, 26)) >x : Symbol(x, Decl(genericReduce.ts, 3, 24)) @@ -50,9 +50,9 @@ n2.toExponential(2); // should not error if 'n2' is correctly number. var n3 = b.reduce( (x, y) => x + y, ""); // Initial value is of type string >n3 : Symbol(n3, Decl(genericReduce.ts, 10, 3)) ->b.reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>b.reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >b : Symbol(b, Decl(genericReduce.ts, 1, 3)) ->reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >x : Symbol(x, Decl(genericReduce.ts, 10, 28)) >y : Symbol(y, Decl(genericReduce.ts, 10, 30)) >x : Symbol(x, Decl(genericReduce.ts, 10, 28)) diff --git a/tests/baselines/reference/genericReduce.types b/tests/baselines/reference/genericReduce.types index 628398f86fd..65a069426a7 100644 --- a/tests/baselines/reference/genericReduce.types +++ b/tests/baselines/reference/genericReduce.types @@ -22,9 +22,9 @@ var b = a.map(s => s.length); var n1 = b.reduce((x, y) => x + y); >n1 : number >b.reduce((x, y) => x + y) : number ->b.reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>b.reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } >b : number[] ->reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } >(x, y) => x + y : (x: number, y: number) => number >x : number >y : number @@ -35,9 +35,9 @@ var n1 = b.reduce((x, y) => x + y); var n2 = b.reduceRight((x, y) => x + y); >n2 : number >b.reduceRight((x, y) => x + y) : number ->b.reduceRight : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>b.reduceRight : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } >b : number[] ->reduceRight : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>reduceRight : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } >(x, y) => x + y : (x: number, y: number) => number >x : number >y : number @@ -76,9 +76,9 @@ n2.toExponential(2); // should not error if 'n2' is correctly number. var n3 = b.reduce( (x, y) => x + y, ""); // Initial value is of type string >n3 : string >b.reduce( (x, y) => x + y, "") : string ->b.reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>b.reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } >b : number[] ->reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } >(x, y) => x + y : (x: string, y: number) => string >x : string >y : number diff --git a/tests/baselines/reference/inferFromGenericFunctionReturnTypes1.symbols b/tests/baselines/reference/inferFromGenericFunctionReturnTypes1.symbols index e18c80afcde..3060f44009b 100644 --- a/tests/baselines/reference/inferFromGenericFunctionReturnTypes1.symbols +++ b/tests/baselines/reference/inferFromGenericFunctionReturnTypes1.symbols @@ -124,9 +124,9 @@ function compose(...fns: ((x: T) => T)[]): (x: T) => T { return (x: T) => fns.reduce((prev, fn) => fn(prev), x); >x : Symbol(x, Decl(inferFromGenericFunctionReturnTypes1.ts, 27, 10)) >T : Symbol(T, Decl(inferFromGenericFunctionReturnTypes1.ts, 26, 17)) ->fns.reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>fns.reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >fns : Symbol(fns, Decl(inferFromGenericFunctionReturnTypes1.ts, 26, 20)) ->reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prev : Symbol(prev, Decl(inferFromGenericFunctionReturnTypes1.ts, 27, 31)) >fn : Symbol(fn, Decl(inferFromGenericFunctionReturnTypes1.ts, 27, 36)) >fn : Symbol(fn, Decl(inferFromGenericFunctionReturnTypes1.ts, 27, 36)) diff --git a/tests/baselines/reference/inferFromGenericFunctionReturnTypes1.types b/tests/baselines/reference/inferFromGenericFunctionReturnTypes1.types index dfbe6c2f2b6..9484b3aaa19 100644 --- a/tests/baselines/reference/inferFromGenericFunctionReturnTypes1.types +++ b/tests/baselines/reference/inferFromGenericFunctionReturnTypes1.types @@ -131,9 +131,9 @@ function compose(...fns: ((x: T) => T)[]): (x: T) => T { >x : T >T : T >fns.reduce((prev, fn) => fn(prev), x) : T ->fns.reduce : { (callbackfn: (previousValue: (x: T) => T, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => (x: T) => T, initialValue?: (x: T) => T): (x: T) => T; (callbackfn: (previousValue: U, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => U, initialValue: U): U; } +>fns.reduce : { (callbackfn: (previousValue: (x: T) => T, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => (x: T) => T): (x: T) => T; (callbackfn: (previousValue: (x: T) => T, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => (x: T) => T, initialValue: (x: T) => T): (x: T) => T; (callbackfn: (previousValue: U, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => U, initialValue: U): U; } >fns : ((x: T) => T)[] ->reduce : { (callbackfn: (previousValue: (x: T) => T, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => (x: T) => T, initialValue?: (x: T) => T): (x: T) => T; (callbackfn: (previousValue: U, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: (x: T) => T, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => (x: T) => T): (x: T) => T; (callbackfn: (previousValue: (x: T) => T, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => (x: T) => T, initialValue: (x: T) => T): (x: T) => T; (callbackfn: (previousValue: U, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => U, initialValue: U): U; } >(prev, fn) => fn(prev) : (prev: T, fn: (x: T) => T) => T >prev : T >fn : (x: T) => T diff --git a/tests/baselines/reference/inferFromGenericFunctionReturnTypes2.symbols b/tests/baselines/reference/inferFromGenericFunctionReturnTypes2.symbols index 7e4fe043b93..f7189682273 100644 --- a/tests/baselines/reference/inferFromGenericFunctionReturnTypes2.symbols +++ b/tests/baselines/reference/inferFromGenericFunctionReturnTypes2.symbols @@ -292,9 +292,9 @@ function compose(...fns: ((x: T) => T)[]): (x: T) => T { return (x: T) => fns.reduce((prev, fn) => fn(prev), x); >x : Symbol(x, Decl(inferFromGenericFunctionReturnTypes2.ts, 49, 10)) >T : Symbol(T, Decl(inferFromGenericFunctionReturnTypes2.ts, 48, 17)) ->fns.reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>fns.reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >fns : Symbol(fns, Decl(inferFromGenericFunctionReturnTypes2.ts, 48, 20)) ->reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prev : Symbol(prev, Decl(inferFromGenericFunctionReturnTypes2.ts, 49, 31)) >fn : Symbol(fn, Decl(inferFromGenericFunctionReturnTypes2.ts, 49, 36)) >fn : Symbol(fn, Decl(inferFromGenericFunctionReturnTypes2.ts, 49, 36)) diff --git a/tests/baselines/reference/inferFromGenericFunctionReturnTypes2.types b/tests/baselines/reference/inferFromGenericFunctionReturnTypes2.types index cf7752e237e..a36b7ed35be 100644 --- a/tests/baselines/reference/inferFromGenericFunctionReturnTypes2.types +++ b/tests/baselines/reference/inferFromGenericFunctionReturnTypes2.types @@ -358,9 +358,9 @@ function compose(...fns: ((x: T) => T)[]): (x: T) => T { >x : T >T : T >fns.reduce((prev, fn) => fn(prev), x) : T ->fns.reduce : { (callbackfn: (previousValue: (x: T) => T, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => (x: T) => T, initialValue?: (x: T) => T): (x: T) => T; (callbackfn: (previousValue: U, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => U, initialValue: U): U; } +>fns.reduce : { (callbackfn: (previousValue: (x: T) => T, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => (x: T) => T): (x: T) => T; (callbackfn: (previousValue: (x: T) => T, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => (x: T) => T, initialValue: (x: T) => T): (x: T) => T; (callbackfn: (previousValue: U, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => U, initialValue: U): U; } >fns : ((x: T) => T)[] ->reduce : { (callbackfn: (previousValue: (x: T) => T, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => (x: T) => T, initialValue?: (x: T) => T): (x: T) => T; (callbackfn: (previousValue: U, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: (x: T) => T, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => (x: T) => T): (x: T) => T; (callbackfn: (previousValue: (x: T) => T, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => (x: T) => T, initialValue: (x: T) => T): (x: T) => T; (callbackfn: (previousValue: U, currentValue: (x: T) => T, currentIndex: number, array: ((x: T) => T)[]) => U, initialValue: U): U; } >(prev, fn) => fn(prev) : (prev: T, fn: (x: T) => T) => T >prev : T >fn : (x: T) => T diff --git a/tests/baselines/reference/parserharness.symbols b/tests/baselines/reference/parserharness.symbols index 94ae5c87901..8382d6ab41a 100644 --- a/tests/baselines/reference/parserharness.symbols +++ b/tests/baselines/reference/parserharness.symbols @@ -4692,7 +4692,7 @@ module Harness { var minDistFromStart = entries.map(x => x.editRange.minChar).reduce((prev, current) => Math.min(prev, current)); >minDistFromStart : Symbol(minDistFromStart, Decl(parserharness.ts, 1595, 15)) ->entries.map(x => x.editRange.minChar).reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>entries.map(x => x.editRange.minChar).reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >entries.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) >entries : Symbol(entries, Decl(parserharness.ts, 1593, 15)) >map : Symbol(Array.map, Decl(lib.d.ts, --, --)) @@ -4700,7 +4700,7 @@ module Harness { >x.editRange : Symbol(editRange, Decl(parserharness.ts, 1547, 44)) >x : Symbol(x, Decl(parserharness.ts, 1595, 47)) >editRange : Symbol(editRange, Decl(parserharness.ts, 1547, 44)) ->reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prev : Symbol(prev, Decl(parserharness.ts, 1595, 81)) >current : Symbol(current, Decl(parserharness.ts, 1595, 86)) >Math.min : Symbol(Math.min, Decl(lib.d.ts, --, --)) @@ -4711,7 +4711,7 @@ module Harness { var minDistFromEnd = entries.map(x => x.length - x.editRange.limChar).reduce((prev, current) => Math.min(prev, current)); >minDistFromEnd : Symbol(minDistFromEnd, Decl(parserharness.ts, 1596, 15)) ->entries.map(x => x.length - x.editRange.limChar).reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>entries.map(x => x.length - x.editRange.limChar).reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >entries.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) >entries : Symbol(entries, Decl(parserharness.ts, 1593, 15)) >map : Symbol(Array.map, Decl(lib.d.ts, --, --)) @@ -4722,7 +4722,7 @@ module Harness { >x.editRange : Symbol(editRange, Decl(parserharness.ts, 1547, 44)) >x : Symbol(x, Decl(parserharness.ts, 1596, 45)) >editRange : Symbol(editRange, Decl(parserharness.ts, 1547, 44)) ->reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prev : Symbol(prev, Decl(parserharness.ts, 1596, 90)) >current : Symbol(current, Decl(parserharness.ts, 1596, 95)) >Math.min : Symbol(Math.min, Decl(lib.d.ts, --, --)) @@ -4733,7 +4733,7 @@ module Harness { var aggDelta = entries.map(x => x.editRange.delta).reduce((prev, current) => prev + current); >aggDelta : Symbol(aggDelta, Decl(parserharness.ts, 1597, 15)) ->entries.map(x => x.editRange.delta).reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>entries.map(x => x.editRange.delta).reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >entries.map : Symbol(Array.map, Decl(lib.d.ts, --, --)) >entries : Symbol(entries, Decl(parserharness.ts, 1593, 15)) >map : Symbol(Array.map, Decl(lib.d.ts, --, --)) @@ -4741,7 +4741,7 @@ module Harness { >x.editRange : Symbol(editRange, Decl(parserharness.ts, 1547, 44)) >x : Symbol(x, Decl(parserharness.ts, 1597, 39)) >editRange : Symbol(editRange, Decl(parserharness.ts, 1547, 44)) ->reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prev : Symbol(prev, Decl(parserharness.ts, 1597, 71)) >current : Symbol(current, Decl(parserharness.ts, 1597, 76)) >prev : Symbol(prev, Decl(parserharness.ts, 1597, 71)) diff --git a/tests/baselines/reference/parserharness.types b/tests/baselines/reference/parserharness.types index 2fd260f5d2b..6ea78e22f2f 100644 --- a/tests/baselines/reference/parserharness.types +++ b/tests/baselines/reference/parserharness.types @@ -6604,7 +6604,7 @@ module Harness { var minDistFromStart = entries.map(x => x.editRange.minChar).reduce((prev, current) => Math.min(prev, current)); >minDistFromStart : any >entries.map(x => x.editRange.minChar).reduce((prev, current) => Math.min(prev, current)) : any ->entries.map(x => x.editRange.minChar).reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } +>entries.map(x => x.editRange.minChar).reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >entries.map(x => x.editRange.minChar) : any[] >entries.map : (callbackfn: (value: { length: number; editRange: any; }, index: number, array: { length: number; editRange: any; }[]) => U, thisArg?: any) => U[] >entries : { length: number; editRange: any; }[] @@ -6616,7 +6616,7 @@ module Harness { >x : { length: number; editRange: any; } >editRange : any >minChar : any ->reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >(prev, current) => Math.min(prev, current) : (prev: any, current: any) => number >prev : any >current : any @@ -6630,7 +6630,7 @@ module Harness { var minDistFromEnd = entries.map(x => x.length - x.editRange.limChar).reduce((prev, current) => Math.min(prev, current)); >minDistFromEnd : number >entries.map(x => x.length - x.editRange.limChar).reduce((prev, current) => Math.min(prev, current)) : number ->entries.map(x => x.length - x.editRange.limChar).reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>entries.map(x => x.length - x.editRange.limChar).reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } >entries.map(x => x.length - x.editRange.limChar) : number[] >entries.map : (callbackfn: (value: { length: number; editRange: any; }, index: number, array: { length: number; editRange: any; }[]) => U, thisArg?: any) => U[] >entries : { length: number; editRange: any; }[] @@ -6646,7 +6646,7 @@ module Harness { >x : { length: number; editRange: any; } >editRange : any >limChar : any ->reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue?: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number): number; (callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: number[]) => number, initialValue: number): number; (callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: number[]) => U, initialValue: U): U; } >(prev, current) => Math.min(prev, current) : (prev: number, current: number) => number >prev : number >current : number @@ -6660,7 +6660,7 @@ module Harness { var aggDelta = entries.map(x => x.editRange.delta).reduce((prev, current) => prev + current); >aggDelta : any >entries.map(x => x.editRange.delta).reduce((prev, current) => prev + current) : any ->entries.map(x => x.editRange.delta).reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } +>entries.map(x => x.editRange.delta).reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >entries.map(x => x.editRange.delta) : any[] >entries.map : (callbackfn: (value: { length: number; editRange: any; }, index: number, array: { length: number; editRange: any; }[]) => U, thisArg?: any) => U[] >entries : { length: number; editRange: any; }[] @@ -6672,7 +6672,7 @@ module Harness { >x : { length: number; editRange: any; } >editRange : any >delta : any ->reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >(prev, current) => prev + current : (prev: any, current: any) => any >prev : any >current : any diff --git a/tests/baselines/reference/recursiveTypeRelations.symbols b/tests/baselines/reference/recursiveTypeRelations.symbols index 9f656a789ed..2c940df2487 100644 --- a/tests/baselines/reference/recursiveTypeRelations.symbols +++ b/tests/baselines/reference/recursiveTypeRelations.symbols @@ -89,12 +89,12 @@ export function css(styles: S, ...classNam >arg : Symbol(arg, Decl(recursiveTypeRelations.ts, 18, 30)) return Object.keys(arg).reduce((obj: ClassNameObject, key: keyof S) => { ->Object.keys(arg).reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Object.keys(arg).reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Object.keys : Symbol(ObjectConstructor.keys, Decl(lib.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >keys : Symbol(ObjectConstructor.keys, Decl(lib.d.ts, --, --)) >arg : Symbol(arg, Decl(recursiveTypeRelations.ts, 18, 30)) ->reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >obj : Symbol(obj, Decl(recursiveTypeRelations.ts, 26, 55)) >key : Symbol(key, Decl(recursiveTypeRelations.ts, 26, 76)) >S : Symbol(S, Decl(recursiveTypeRelations.ts, 17, 20)) diff --git a/tests/baselines/reference/recursiveTypeRelations.types b/tests/baselines/reference/recursiveTypeRelations.types index 6def28d4461..110ff8175c4 100644 --- a/tests/baselines/reference/recursiveTypeRelations.types +++ b/tests/baselines/reference/recursiveTypeRelations.types @@ -102,13 +102,13 @@ export function css(styles: S, ...classNam return Object.keys(arg).reduce((obj: ClassNameObject, key: keyof S) => { >Object.keys(arg).reduce((obj: ClassNameObject, key: keyof S) => { const exportedClassName = styles[key]; obj[exportedClassName] = (arg as ClassNameMap)[key]; return obj; }, {}) : any ->Object.keys(arg).reduce : { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue?: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; } +>Object.keys(arg).reduce : { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string; (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; } >Object.keys(arg) : string[] >Object.keys : (o: {}) => string[] >Object : ObjectConstructor >keys : (o: {}) => string[] >arg : keyof S | (object & { [K in keyof S]?: boolean; }) ->reduce : { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue?: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string): string; (callbackfn: (previousValue: string, currentValue: string, currentIndex: number, array: string[]) => string, initialValue: string): string; (callbackfn: (previousValue: U, currentValue: string, currentIndex: number, array: string[]) => U, initialValue: U): U; } >ClassNameObject : No type information available! >(obj: ClassNameObject, key: keyof S) => { const exportedClassName = styles[key]; obj[exportedClassName] = (arg as ClassNameMap)[key]; return obj; } : (obj: any, key: keyof S) => any >obj : any diff --git a/tests/baselines/reference/restInvalidArgumentType.types b/tests/baselines/reference/restInvalidArgumentType.types index 28162bcc7cc..39495008877 100644 --- a/tests/baselines/reference/restInvalidArgumentType.types +++ b/tests/baselines/reference/restInvalidArgumentType.types @@ -87,7 +87,7 @@ function f(p1: T, p2: T[]) { >p1 : T var {...r2} = p2; // OK ->r2 : { [n: number]: T; length: number; toString(): string; toLocaleString(): string; push(...items: T[]): number; pop(): T; concat(...items: ReadonlyArray[]): T[]; concat(...items: (T | ReadonlyArray)[]): T[]; join(separator?: string): string; reverse(): T[]; shift(): T; slice(start?: number, end?: number): T[]; sort(compareFn?: (a: T, b: T) => number): T[]; splice(start: number, deleteCount?: number): T[]; splice(start: number, deleteCount: number, ...items: T[]): T[]; unshift(...items: T[]): number; indexOf(searchElement: T, fromIndex?: number): number; lastIndexOf(searchElement: T, fromIndex?: number): number; every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; filter(callbackfn: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[]; filter(callbackfn: (value: T, index: number, array: T[]) => any, thisArg?: any): T[]; reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; } +>r2 : { [n: number]: T; length: number; toString(): string; toLocaleString(): string; push(...items: T[]): number; pop(): T; concat(...items: ReadonlyArray[]): T[]; concat(...items: (T | ReadonlyArray)[]): T[]; join(separator?: string): string; reverse(): T[]; shift(): T; slice(start?: number, end?: number): T[]; sort(compareFn?: (a: T, b: T) => number): T[]; splice(start: number, deleteCount?: number): T[]; splice(start: number, deleteCount: number, ...items: T[]): T[]; unshift(...items: T[]): number; indexOf(searchElement: T, fromIndex?: number): number; lastIndexOf(searchElement: T, fromIndex?: number): number; every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; filter(callbackfn: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[]; filter(callbackfn: (value: T, index: number, array: T[]) => any, thisArg?: any): T[]; reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T; reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T; reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T; reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T; reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; } >p2 : T[] var {...r3} = t; // Error, generic type paramter diff --git a/tests/baselines/reference/returnTypeParameterWithModules.symbols b/tests/baselines/reference/returnTypeParameterWithModules.symbols index 7f8fab382a3..eb56940b604 100644 --- a/tests/baselines/reference/returnTypeParameterWithModules.symbols +++ b/tests/baselines/reference/returnTypeParameterWithModules.symbols @@ -13,11 +13,11 @@ module M1 { return Array.prototype.reduce.apply(ar, e ? [f, e] : [f]); >Array.prototype.reduce.apply : Symbol(Function.apply, Decl(lib.d.ts, --, --)) ->Array.prototype.reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>Array.prototype.reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >Array.prototype : Symbol(ArrayConstructor.prototype, Decl(lib.d.ts, --, --)) >Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >prototype : Symbol(ArrayConstructor.prototype, Decl(lib.d.ts, --, --)) ->reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >apply : Symbol(Function.apply, Decl(lib.d.ts, --, --)) >ar : Symbol(ar, Decl(returnTypeParameterWithModules.ts, 1, 30)) >e : Symbol(e, Decl(returnTypeParameterWithModules.ts, 1, 36)) diff --git a/tests/baselines/reference/returnTypeParameterWithModules.types b/tests/baselines/reference/returnTypeParameterWithModules.types index 584c962a170..3aec0f14fcf 100644 --- a/tests/baselines/reference/returnTypeParameterWithModules.types +++ b/tests/baselines/reference/returnTypeParameterWithModules.types @@ -14,11 +14,11 @@ module M1 { return Array.prototype.reduce.apply(ar, e ? [f, e] : [f]); >Array.prototype.reduce.apply(ar, e ? [f, e] : [f]) : any >Array.prototype.reduce.apply : (this: Function, thisArg: any, argArray?: any) => any ->Array.prototype.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } +>Array.prototype.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >Array.prototype : any[] >Array : ArrayConstructor >prototype : any[] ->reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >apply : (this: Function, thisArg: any, argArray?: any) => any >ar : any >e ? [f, e] : [f] : any[] diff --git a/tests/baselines/reference/spreadInvalidArgumentType.types b/tests/baselines/reference/spreadInvalidArgumentType.types index 1eebc00850f..244d8515893 100644 --- a/tests/baselines/reference/spreadInvalidArgumentType.types +++ b/tests/baselines/reference/spreadInvalidArgumentType.types @@ -89,8 +89,8 @@ function f(p1: T, p2: T[]) { >p1 : T var o2 = { ...p2 }; // OK ->o2 : { [n: number]: T; length: number; toString(): string; toLocaleString(): string; push(...items: T[]): number; pop(): T; concat(...items: ReadonlyArray[]): T[]; concat(...items: (T | ReadonlyArray)[]): T[]; join(separator?: string): string; reverse(): T[]; shift(): T; slice(start?: number, end?: number): T[]; sort(compareFn?: (a: T, b: T) => number): T[]; splice(start: number, deleteCount?: number): T[]; splice(start: number, deleteCount: number, ...items: T[]): T[]; unshift(...items: T[]): number; indexOf(searchElement: T, fromIndex?: number): number; lastIndexOf(searchElement: T, fromIndex?: number): number; every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; filter(callbackfn: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[]; filter(callbackfn: (value: T, index: number, array: T[]) => any, thisArg?: any): T[]; reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; } ->{ ...p2 } : { [n: number]: T; length: number; toString(): string; toLocaleString(): string; push(...items: T[]): number; pop(): T; concat(...items: ReadonlyArray[]): T[]; concat(...items: (T | ReadonlyArray)[]): T[]; join(separator?: string): string; reverse(): T[]; shift(): T; slice(start?: number, end?: number): T[]; sort(compareFn?: (a: T, b: T) => number): T[]; splice(start: number, deleteCount?: number): T[]; splice(start: number, deleteCount: number, ...items: T[]): T[]; unshift(...items: T[]): number; indexOf(searchElement: T, fromIndex?: number): number; lastIndexOf(searchElement: T, fromIndex?: number): number; every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; filter(callbackfn: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[]; filter(callbackfn: (value: T, index: number, array: T[]) => any, thisArg?: any): T[]; reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue?: T): T; reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; } +>o2 : { [n: number]: T; length: number; toString(): string; toLocaleString(): string; push(...items: T[]): number; pop(): T; concat(...items: ReadonlyArray[]): T[]; concat(...items: (T | ReadonlyArray)[]): T[]; join(separator?: string): string; reverse(): T[]; shift(): T; slice(start?: number, end?: number): T[]; sort(compareFn?: (a: T, b: T) => number): T[]; splice(start: number, deleteCount?: number): T[]; splice(start: number, deleteCount: number, ...items: T[]): T[]; unshift(...items: T[]): number; indexOf(searchElement: T, fromIndex?: number): number; lastIndexOf(searchElement: T, fromIndex?: number): number; every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; filter(callbackfn: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[]; filter(callbackfn: (value: T, index: number, array: T[]) => any, thisArg?: any): T[]; reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T; reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T; reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T; reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T; reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; } +>{ ...p2 } : { [n: number]: T; length: number; toString(): string; toLocaleString(): string; push(...items: T[]): number; pop(): T; concat(...items: ReadonlyArray[]): T[]; concat(...items: (T | ReadonlyArray)[]): T[]; join(separator?: string): string; reverse(): T[]; shift(): T; slice(start?: number, end?: number): T[]; sort(compareFn?: (a: T, b: T) => number): T[]; splice(start: number, deleteCount?: number): T[]; splice(start: number, deleteCount: number, ...items: T[]): T[]; unshift(...items: T[]): number; indexOf(searchElement: T, fromIndex?: number): number; lastIndexOf(searchElement: T, fromIndex?: number): number; every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean; forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void; map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[]; filter(callbackfn: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[]; filter(callbackfn: (value: T, index: number, array: T[]) => any, thisArg?: any): T[]; reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T; reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T; reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T; reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T; reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U; } >p2 : T[] var o3 = { ...t }; // Error, generic type paramter diff --git a/tests/baselines/reference/unknownSymbolOffContextualType1.symbols b/tests/baselines/reference/unknownSymbolOffContextualType1.symbols index 1e19afeb6a0..3acf34ec9bf 100644 --- a/tests/baselines/reference/unknownSymbolOffContextualType1.symbols +++ b/tests/baselines/reference/unknownSymbolOffContextualType1.symbols @@ -61,9 +61,9 @@ function getMaxWidth(elementNames: string[]) { }); var maxWidth = widths.reduce(function (a, b) { >maxWidth : Symbol(maxWidth, Decl(unknownSymbolOffContextualType1.ts, 17, 7)) ->widths.reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>widths.reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >widths : Symbol(widths, Decl(unknownSymbolOffContextualType1.ts, 14, 7)) ->reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) +>reduce : Symbol(Array.reduce, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --)) >a : Symbol(a, Decl(unknownSymbolOffContextualType1.ts, 17, 43)) >b : Symbol(b, Decl(unknownSymbolOffContextualType1.ts, 17, 45)) diff --git a/tests/baselines/reference/unknownSymbolOffContextualType1.types b/tests/baselines/reference/unknownSymbolOffContextualType1.types index c6f05b69b74..7df3bd52cc9 100644 --- a/tests/baselines/reference/unknownSymbolOffContextualType1.types +++ b/tests/baselines/reference/unknownSymbolOffContextualType1.types @@ -72,9 +72,9 @@ function getMaxWidth(elementNames: string[]) { var maxWidth = widths.reduce(function (a, b) { >maxWidth : any >widths.reduce(function (a, b) { return a > b ? a : b; }) : any ->widths.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } +>widths.reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >widths : any[] ->reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue?: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } +>reduce : { (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any): any; (callbackfn: (previousValue: any, currentValue: any, currentIndex: number, array: any[]) => any, initialValue: any): any; (callbackfn: (previousValue: U, currentValue: any, currentIndex: number, array: any[]) => U, initialValue: U): U; } >function (a, b) { return a > b ? a : b; } : (a: any, b: any) => any >a : any >b : any From dc607c29b4f281d8734a70264525ecf3fbe64c25 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Mon, 9 Oct 2017 17:15:13 -0700 Subject: [PATCH 070/137] Fix 'this' capturing for dynamic import --- src/compiler/binder.ts | 6 ++ src/compiler/transformers/module/module.ts | 89 ++++++++++++++----- .../dynamicImportWithNestedThis_es2015.js | 37 ++++++++ ...dynamicImportWithNestedThis_es2015.symbols | 27 ++++++ .../dynamicImportWithNestedThis_es2015.types | 31 +++++++ .../dynamicImportWithNestedThis_es5.js | 39 ++++++++ .../dynamicImportWithNestedThis_es5.symbols | 27 ++++++ .../dynamicImportWithNestedThis_es5.types | 31 +++++++ .../dynamicImportWithNestedThis_es2015.ts | 14 +++ .../dynamicImportWithNestedThis_es5.ts | 14 +++ 10 files changed, 292 insertions(+), 23 deletions(-) create mode 100644 tests/baselines/reference/dynamicImportWithNestedThis_es2015.js create mode 100644 tests/baselines/reference/dynamicImportWithNestedThis_es2015.symbols create mode 100644 tests/baselines/reference/dynamicImportWithNestedThis_es2015.types create mode 100644 tests/baselines/reference/dynamicImportWithNestedThis_es5.js create mode 100644 tests/baselines/reference/dynamicImportWithNestedThis_es5.symbols create mode 100644 tests/baselines/reference/dynamicImportWithNestedThis_es5.types create mode 100644 tests/cases/compiler/dynamicImportWithNestedThis_es2015.ts create mode 100644 tests/cases/compiler/dynamicImportWithNestedThis_es5.ts diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 9b977eb6bfc..48cace44841 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -2699,6 +2699,12 @@ namespace ts { if (expression.kind === SyntaxKind.ImportKeyword) { transformFlags |= TransformFlags.ContainsDynamicImport; + + // A dynamic 'import()' call that contains a lexical 'this' will + // require a captured 'this' when emitting down-level. + if (subtreeFlags & TransformFlags.ContainsLexicalThis) { + transformFlags |= TransformFlags.ContainsCapturedLexicalThis; + } } node.transformFlags = transformFlags | TransformFlags.HasComputedFlags; diff --git a/src/compiler/transformers/module/module.ts b/src/compiler/transformers/module/module.ts index ecbef685649..ba262bf2c59 100644 --- a/src/compiler/transformers/module/module.ts +++ b/src/compiler/transformers/module/module.ts @@ -561,46 +561,89 @@ namespace ts { // }); const resolve = createUniqueName("resolve"); const reject = createUniqueName("reject"); - return createNew( - createIdentifier("Promise"), - /*typeArguments*/ undefined, - [createFunctionExpression( + const parameters = [ + createParameter(/*decorator*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, /*name*/ resolve), + createParameter(/*decorator*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, /*name*/ reject) + ]; + const body = createBlock([ + createStatement( + createCall( + createIdentifier("require"), + /*typeArguments*/ undefined, + [createArrayLiteral([firstOrUndefined(node.arguments) || createOmittedExpression()]), resolve, reject] + ) + ) + ]); + + let func: FunctionExpression | ArrowFunction; + if (languageVersion >= ScriptTarget.ES2015) { + func = createArrowFunction( + /*modifiers*/ undefined, + /*typeParameters*/ undefined, + parameters, + /*type*/ undefined, + /*equalsGreaterThanToken*/ undefined, + body); + } + else { + func = createFunctionExpression( /*modifiers*/ undefined, /*asteriskToken*/ undefined, /*name*/ undefined, /*typeParameters*/ undefined, - [createParameter(/*decorator*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, /*name*/ resolve), - createParameter(/*decorator*/ undefined, /*modifiers*/ undefined, /*dotDotDotToken*/ undefined, /*name*/ reject)], + parameters, /*type*/ undefined, - createBlock([createStatement( - createCall( - createIdentifier("require"), - /*typeArguments*/ undefined, - [createArrayLiteral([firstOrUndefined(node.arguments) || createOmittedExpression()]), resolve, reject] - ))]) - )]); + body); + + // if there is a lexical 'this' in the import call arguments, ensure we indicate + // that this new function expression indicates it captures 'this' so that the + // es2015 transformer will properly substitute 'this' with '_this'. + if (node.transformFlags & TransformFlags.ContainsLexicalThis) { + setEmitFlags(func, EmitFlags.CapturesThis); + } + } + + return createNew(createIdentifier("Promise"), /*typeArguments*/ undefined, [func]); } - function transformImportCallExpressionCommonJS(node: ImportCall): Expression { + function transformImportCallExpressionCommonJS(node: ImportCall): Expression { // import("./blah") // emit as // Promise.resolve().then(function () { return require(x); }) /*CommonJs Require*/ // We have to wrap require in then callback so that require is done in asynchronously // if we simply do require in resolve callback in Promise constructor. We will execute the loading immediately - return createCall( - createPropertyAccess( - createCall(createPropertyAccess(createIdentifier("Promise"), "resolve"), /*typeArguments*/ undefined, /*argumentsArray*/ []), - "then"), - /*typeArguments*/ undefined, - [createFunctionExpression( + const promiseResolveCall = createCall(createPropertyAccess(createIdentifier("Promise"), "resolve"), /*typeArguments*/ undefined, /*argumentsArray*/ []); + const requireCall = createCall(createIdentifier("require"), /*typeArguments*/ undefined, node.arguments); + + let func: FunctionExpression | ArrowFunction; + if (languageVersion >= ScriptTarget.ES2015) { + func = createArrowFunction( + /*modifiers*/ undefined, + /*typeParameters*/ undefined, + /*parameters*/ [], + /*type*/ undefined, + /*equalsGreaterThanToken*/ undefined, + requireCall); + } + else { + func = createFunctionExpression( /*modifiers*/ undefined, /*asteriskToken*/ undefined, /*name*/ undefined, /*typeParameters*/ undefined, - /*parameters*/ undefined, + /*parameters*/ [], /*type*/ undefined, - createBlock([createReturn(createCall(createIdentifier("require"), /*typeArguments*/ undefined, node.arguments))]) - )]); + createBlock([createReturn(requireCall)])); + + // if there is a lexical 'this' in the import call arguments, ensure we indicate + // that this new function expression indicates it captures 'this' so that the + // es2015 transformer will properly substitute 'this' with '_this'. + if (node.transformFlags & TransformFlags.ContainsLexicalThis) { + setEmitFlags(func, EmitFlags.CapturesThis); + } + } + + return createCall(createPropertyAccess(promiseResolveCall, "then"), /*typeArguments*/ undefined, [func]); } /** diff --git a/tests/baselines/reference/dynamicImportWithNestedThis_es2015.js b/tests/baselines/reference/dynamicImportWithNestedThis_es2015.js new file mode 100644 index 00000000000..86fba0c0b5d --- /dev/null +++ b/tests/baselines/reference/dynamicImportWithNestedThis_es2015.js @@ -0,0 +1,37 @@ +//// [dynamicImportWithNestedThis_es2015.ts] +// https://github.com/Microsoft/TypeScript/issues/17564 +class C { + private _path = './other'; + + dynamic() { + return import(this._path); + } +} + +const c = new C(); +c.dynamic(); + +//// [dynamicImportWithNestedThis_es2015.js] +(function (factory) { + if (typeof module === "object" && typeof module.exports === "object") { + var v = factory(require, exports); + if (v !== undefined) module.exports = v; + } + else if (typeof define === "function" && define.amd) { + define(["require", "exports"], factory); + } +})(function (require, exports) { + "use strict"; + var __syncRequire = typeof module === "object" && typeof module.exports === "object"; + // https://github.com/Microsoft/TypeScript/issues/17564 + class C { + constructor() { + this._path = './other'; + } + dynamic() { + return __syncRequire ? Promise.resolve().then(() => require(this._path)) : new Promise((resolve_1, reject_1) => { require([this._path], resolve_1, reject_1); }); + } + } + const c = new C(); + c.dynamic(); +}); diff --git a/tests/baselines/reference/dynamicImportWithNestedThis_es2015.symbols b/tests/baselines/reference/dynamicImportWithNestedThis_es2015.symbols new file mode 100644 index 00000000000..7043a071124 --- /dev/null +++ b/tests/baselines/reference/dynamicImportWithNestedThis_es2015.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/dynamicImportWithNestedThis_es2015.ts === +// https://github.com/Microsoft/TypeScript/issues/17564 +class C { +>C : Symbol(C, Decl(dynamicImportWithNestedThis_es2015.ts, 0, 0)) + + private _path = './other'; +>_path : Symbol(C._path, Decl(dynamicImportWithNestedThis_es2015.ts, 1, 9)) + + dynamic() { +>dynamic : Symbol(C.dynamic, Decl(dynamicImportWithNestedThis_es2015.ts, 2, 27)) + + return import(this._path); +>this._path : Symbol(C._path, Decl(dynamicImportWithNestedThis_es2015.ts, 1, 9)) +>this : Symbol(C, Decl(dynamicImportWithNestedThis_es2015.ts, 0, 0)) +>_path : Symbol(C._path, Decl(dynamicImportWithNestedThis_es2015.ts, 1, 9)) + } +} + +const c = new C(); +>c : Symbol(c, Decl(dynamicImportWithNestedThis_es2015.ts, 9, 5)) +>C : Symbol(C, Decl(dynamicImportWithNestedThis_es2015.ts, 0, 0)) + +c.dynamic(); +>c.dynamic : Symbol(C.dynamic, Decl(dynamicImportWithNestedThis_es2015.ts, 2, 27)) +>c : Symbol(c, Decl(dynamicImportWithNestedThis_es2015.ts, 9, 5)) +>dynamic : Symbol(C.dynamic, Decl(dynamicImportWithNestedThis_es2015.ts, 2, 27)) + diff --git a/tests/baselines/reference/dynamicImportWithNestedThis_es2015.types b/tests/baselines/reference/dynamicImportWithNestedThis_es2015.types new file mode 100644 index 00000000000..165929a43cf --- /dev/null +++ b/tests/baselines/reference/dynamicImportWithNestedThis_es2015.types @@ -0,0 +1,31 @@ +=== tests/cases/compiler/dynamicImportWithNestedThis_es2015.ts === +// https://github.com/Microsoft/TypeScript/issues/17564 +class C { +>C : C + + private _path = './other'; +>_path : string +>'./other' : "./other" + + dynamic() { +>dynamic : () => Promise + + return import(this._path); +>import(this._path) : Promise +>this._path : string +>this : this +>_path : string + } +} + +const c = new C(); +>c : C +>new C() : C +>C : typeof C + +c.dynamic(); +>c.dynamic() : Promise +>c.dynamic : () => Promise +>c : C +>dynamic : () => Promise + diff --git a/tests/baselines/reference/dynamicImportWithNestedThis_es5.js b/tests/baselines/reference/dynamicImportWithNestedThis_es5.js new file mode 100644 index 00000000000..cde1979b25b --- /dev/null +++ b/tests/baselines/reference/dynamicImportWithNestedThis_es5.js @@ -0,0 +1,39 @@ +//// [dynamicImportWithNestedThis_es5.ts] +// https://github.com/Microsoft/TypeScript/issues/17564 +class C { + private _path = './other'; + + dynamic() { + return import(this._path); + } +} + +const c = new C(); +c.dynamic(); + +//// [dynamicImportWithNestedThis_es5.js] +(function (factory) { + if (typeof module === "object" && typeof module.exports === "object") { + var v = factory(require, exports); + if (v !== undefined) module.exports = v; + } + else if (typeof define === "function" && define.amd) { + define(["require", "exports"], factory); + } +})(function (require, exports) { + "use strict"; + var __syncRequire = typeof module === "object" && typeof module.exports === "object"; + // https://github.com/Microsoft/TypeScript/issues/17564 + var C = /** @class */ (function () { + function C() { + this._path = './other'; + } + C.prototype.dynamic = function () { + var _this = this; + return __syncRequire ? Promise.resolve().then(function () { return require(_this._path); }) : new Promise(function (resolve_1, reject_1) { require([_this._path], resolve_1, reject_1); }); + }; + return C; + }()); + var c = new C(); + c.dynamic(); +}); diff --git a/tests/baselines/reference/dynamicImportWithNestedThis_es5.symbols b/tests/baselines/reference/dynamicImportWithNestedThis_es5.symbols new file mode 100644 index 00000000000..6a127548030 --- /dev/null +++ b/tests/baselines/reference/dynamicImportWithNestedThis_es5.symbols @@ -0,0 +1,27 @@ +=== tests/cases/compiler/dynamicImportWithNestedThis_es5.ts === +// https://github.com/Microsoft/TypeScript/issues/17564 +class C { +>C : Symbol(C, Decl(dynamicImportWithNestedThis_es5.ts, 0, 0)) + + private _path = './other'; +>_path : Symbol(C._path, Decl(dynamicImportWithNestedThis_es5.ts, 1, 9)) + + dynamic() { +>dynamic : Symbol(C.dynamic, Decl(dynamicImportWithNestedThis_es5.ts, 2, 27)) + + return import(this._path); +>this._path : Symbol(C._path, Decl(dynamicImportWithNestedThis_es5.ts, 1, 9)) +>this : Symbol(C, Decl(dynamicImportWithNestedThis_es5.ts, 0, 0)) +>_path : Symbol(C._path, Decl(dynamicImportWithNestedThis_es5.ts, 1, 9)) + } +} + +const c = new C(); +>c : Symbol(c, Decl(dynamicImportWithNestedThis_es5.ts, 9, 5)) +>C : Symbol(C, Decl(dynamicImportWithNestedThis_es5.ts, 0, 0)) + +c.dynamic(); +>c.dynamic : Symbol(C.dynamic, Decl(dynamicImportWithNestedThis_es5.ts, 2, 27)) +>c : Symbol(c, Decl(dynamicImportWithNestedThis_es5.ts, 9, 5)) +>dynamic : Symbol(C.dynamic, Decl(dynamicImportWithNestedThis_es5.ts, 2, 27)) + diff --git a/tests/baselines/reference/dynamicImportWithNestedThis_es5.types b/tests/baselines/reference/dynamicImportWithNestedThis_es5.types new file mode 100644 index 00000000000..78b0f472971 --- /dev/null +++ b/tests/baselines/reference/dynamicImportWithNestedThis_es5.types @@ -0,0 +1,31 @@ +=== tests/cases/compiler/dynamicImportWithNestedThis_es5.ts === +// https://github.com/Microsoft/TypeScript/issues/17564 +class C { +>C : C + + private _path = './other'; +>_path : string +>'./other' : "./other" + + dynamic() { +>dynamic : () => Promise + + return import(this._path); +>import(this._path) : Promise +>this._path : string +>this : this +>_path : string + } +} + +const c = new C(); +>c : C +>new C() : C +>C : typeof C + +c.dynamic(); +>c.dynamic() : Promise +>c.dynamic : () => Promise +>c : C +>dynamic : () => Promise + diff --git a/tests/cases/compiler/dynamicImportWithNestedThis_es2015.ts b/tests/cases/compiler/dynamicImportWithNestedThis_es2015.ts new file mode 100644 index 00000000000..3c7f2936931 --- /dev/null +++ b/tests/cases/compiler/dynamicImportWithNestedThis_es2015.ts @@ -0,0 +1,14 @@ +// @lib: es2015 +// @target: es2015 +// @module: umd +// https://github.com/Microsoft/TypeScript/issues/17564 +class C { + private _path = './other'; + + dynamic() { + return import(this._path); + } +} + +const c = new C(); +c.dynamic(); \ No newline at end of file diff --git a/tests/cases/compiler/dynamicImportWithNestedThis_es5.ts b/tests/cases/compiler/dynamicImportWithNestedThis_es5.ts new file mode 100644 index 00000000000..5740c3f6694 --- /dev/null +++ b/tests/cases/compiler/dynamicImportWithNestedThis_es5.ts @@ -0,0 +1,14 @@ +// @lib: es2015 +// @target: es5 +// @module: umd +// https://github.com/Microsoft/TypeScript/issues/17564 +class C { + private _path = './other'; + + dynamic() { + return import(this._path); + } +} + +const c = new C(); +c.dynamic(); \ No newline at end of file From aa22c56282021e19fe546d2f65f650836f826e3b Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Mon, 9 Oct 2017 18:03:05 -0700 Subject: [PATCH 071/137] Swallow the directory watcher exceptions --- src/server/server.ts | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/server/server.ts b/src/server/server.ts index 6fab1a3d08a..7917f6fb544 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -753,10 +753,21 @@ namespace ts.server { const sys = ts.sys; // use watchGuard process on Windows when node version is 4 or later const useWatchGuard = process.platform === "win32" && getNodeMajorVersion() >= 4; + const originalWatchDirectory = sys.watchDirectory; + const noopWatcher: FileWatcher = { close: noop }; + function watchDirectorySwallowingException(path: string, callback: DirectoryWatcherCallback, recursive?: boolean): FileWatcher { + try { + return originalWatchDirectory.call(sys, path, callback, recursive); + } + catch (e) { + logger.info(`Exception when creating directory watcher: ${e.message}`); + return noopWatcher; + } + } + if (useWatchGuard) { const currentDrive = extractWatchDirectoryCacheKey(sys.resolvePath(sys.getCurrentDirectory()), /*currentDriveKey*/ undefined); const statusCache = createMap(); - const originalWatchDirectory = sys.watchDirectory; sys.watchDirectory = function (path: string, callback: DirectoryWatcherCallback, recursive?: boolean): FileWatcher { const cacheKey = extractWatchDirectoryCacheKey(path, currentDrive); let status = cacheKey && statusCache.get(cacheKey); @@ -790,14 +801,17 @@ namespace ts.server { } if (status) { // this drive is safe to use - call real 'watchDirectory' - return originalWatchDirectory.call(sys, path, callback, recursive); + return watchDirectorySwallowingException(path, callback, recursive); } else { // this drive is unsafe - return no-op watcher - return { close() { } }; + return noopWatcher; } }; } + else { + sys.watchDirectory = watchDirectorySwallowingException; + } // Override sys.write because fs.writeSync is not reliable on Node 4 sys.write = (s: string) => writeMessage(new Buffer(s, "utf8")); From 98d58d651747702f2f9252ad93125026a770c565 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Mon, 9 Oct 2017 20:12:53 -0700 Subject: [PATCH 072/137] Handle project close to release all the script infos held by the project --- src/server/project.ts | 24 +++++++++---------- .../reference/api/tsserverlibrary.d.ts | 1 + 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/server/project.ts b/src/server/project.ts index e8bfd7c1b75..db540ccfac2 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -495,25 +495,25 @@ namespace ts.server { close() { if (this.program) { - // if we have a program - release all files that are enlisted in program + // if we have a program - release all files that are enlisted in program but arent root + // The releasing of the roots happens later + // The project could have pending update remaining and hence the info could be in the files but not in program graph for (const f of this.program.getSourceFiles()) { - this.detachScriptInfo(f.fileName); + this.detachScriptInfoIfNotRoot(f.fileName); } } - if (!this.program || !this.languageServiceEnabled) { - // release all root files either if there is no program or language service is disabled. - // in the latter case set of root files can be larger than the set of files in program. - for (const root of this.rootFiles) { - root.detachFromProject(this); - } + // Release external files + forEach(this.externalFiles, externalFile => this.detachScriptInfoIfNotRoot(externalFile)); + // Always remove root files from the project + for (const root of this.rootFiles) { + root.detachFromProject(this); } this.rootFiles = undefined; this.rootFilesMap = undefined; + this.externalFiles = undefined; this.program = undefined; this.builder = undefined; - forEach(this.externalFiles, externalFile => this.detachScriptInfo(externalFile)); - this.externalFiles = undefined; this.resolutionCache.clear(); this.resolutionCache = undefined; this.cachedUnresolvedImportsPerFile = undefined; @@ -530,11 +530,11 @@ namespace ts.server { this.languageService = undefined; } - private detachScriptInfo(uncheckedFilename: string) { + private detachScriptInfoIfNotRoot(uncheckedFilename: string) { const info = this.projectService.getScriptInfo(uncheckedFilename); // We might not find the script info in case its not associated with the project any more // and project graph was not updated (eg delayed update graph in case of files changed/deleted on the disk) - if (info) { + if (info && !this.isRoot(info)) { info.detachFromProject(this); } } diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 7fe07813adc..0097ba24942 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -7136,6 +7136,7 @@ declare namespace ts.server { getExternalFiles(): SortedReadonlyArray; getSourceFile(path: Path): SourceFile; close(): void; + private detachScriptInfoIfNotRoot(uncheckedFilename); isClosed(): boolean; hasRoots(): boolean; getRootFiles(): NormalizedPath[]; From dca6e33ac7ba655af0d27a9d2e9555424c9cc67e Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Tue, 10 Oct 2017 10:03:18 -0700 Subject: [PATCH 073/137] baseline updates --- .../reference/importCallExpressionAsyncES6AMD.js | 10 +++++----- .../reference/importCallExpressionAsyncES6CJS.js | 10 +++++----- .../reference/importCallExpressionAsyncES6UMD.js | 10 +++++----- .../importCallExpressionCheckReturntype1.js | 6 +++--- .../importCallExpressionDeclarationEmit1.js | 10 +++++----- .../reference/importCallExpressionES6AMD.js | 12 ++++++------ .../reference/importCallExpressionES6CJS.js | 12 ++++++------ .../reference/importCallExpressionES6UMD.js | 12 ++++++------ .../importCallExpressionGrammarError.js | 10 +++++----- .../reference/importCallExpressionInAMD1.js | 8 ++++---- .../reference/importCallExpressionInAMD2.js | 2 +- .../reference/importCallExpressionInAMD3.js | 2 +- .../reference/importCallExpressionInAMD4.js | 12 ++++++------ .../reference/importCallExpressionInCJS1.js | 8 ++++---- .../reference/importCallExpressionInCJS2.js | 4 ++-- .../reference/importCallExpressionInCJS3.js | 2 +- .../reference/importCallExpressionInCJS4.js | 2 +- .../reference/importCallExpressionInCJS5.js | 12 ++++++------ .../importCallExpressionInExportEqualsAMD.js | 2 +- .../importCallExpressionInExportEqualsCJS.js | 2 +- .../importCallExpressionInExportEqualsUMD.js | 2 +- .../importCallExpressionInScriptContext1.js | 2 +- .../importCallExpressionInScriptContext2.js | 2 +- .../reference/importCallExpressionInUMD1.js | 8 ++++---- .../reference/importCallExpressionInUMD2.js | 2 +- .../reference/importCallExpressionInUMD3.js | 2 +- .../reference/importCallExpressionInUMD4.js | 12 ++++++------ .../importCallExpressionReturnPromiseOfAny.js | 16 ++++++++-------- ...tCallExpressionSpecifierNotStringTypeError.js | 10 +++++----- .../importCallExpressionWithTypeArgument.js | 4 ++-- 30 files changed, 104 insertions(+), 104 deletions(-) diff --git a/tests/baselines/reference/importCallExpressionAsyncES6AMD.js b/tests/baselines/reference/importCallExpressionAsyncES6AMD.js index 9819da8369b..7f86625bbfc 100644 --- a/tests/baselines/reference/importCallExpressionAsyncES6AMD.js +++ b/tests/baselines/reference/importCallExpressionAsyncES6AMD.js @@ -42,34 +42,34 @@ define(["require", "exports"], function (require, exports) { Object.defineProperty(exports, "__esModule", { value: true }); function fn() { return __awaiter(this, void 0, void 0, function* () { - const req = yield new Promise(function (resolve_1, reject_1) { require(['./test'], resolve_1, reject_1); }); // ONE + const req = yield new Promise((resolve_1, reject_1) => { require(['./test'], resolve_1, reject_1); }); // ONE }); } exports.fn = fn; class cl1 { m() { return __awaiter(this, void 0, void 0, function* () { - const req = yield new Promise(function (resolve_2, reject_2) { require(['./test'], resolve_2, reject_2); }); // TWO + const req = yield new Promise((resolve_2, reject_2) => { require(['./test'], resolve_2, reject_2); }); // TWO }); } } exports.cl1 = cl1; exports.obj = { m: () => __awaiter(this, void 0, void 0, function* () { - const req = yield new Promise(function (resolve_3, reject_3) { require(['./test'], resolve_3, reject_3); }); // THREE + const req = yield new Promise((resolve_3, reject_3) => { require(['./test'], resolve_3, reject_3); }); // THREE }) }; class cl2 { constructor() { this.p = { m: () => __awaiter(this, void 0, void 0, function* () { - const req = yield new Promise(function (resolve_4, reject_4) { require(['./test'], resolve_4, reject_4); }); // FOUR + const req = yield new Promise((resolve_4, reject_4) => { require(['./test'], resolve_4, reject_4); }); // FOUR }) }; } } exports.cl2 = cl2; exports.l = () => __awaiter(this, void 0, void 0, function* () { - const req = yield new Promise(function (resolve_5, reject_5) { require(['./test'], resolve_5, reject_5); }); // FIVE + const req = yield new Promise((resolve_5, reject_5) => { require(['./test'], resolve_5, reject_5); }); // FIVE }); }); diff --git a/tests/baselines/reference/importCallExpressionAsyncES6CJS.js b/tests/baselines/reference/importCallExpressionAsyncES6CJS.js index b512ae94b48..20961f96330 100644 --- a/tests/baselines/reference/importCallExpressionAsyncES6CJS.js +++ b/tests/baselines/reference/importCallExpressionAsyncES6CJS.js @@ -41,33 +41,33 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge Object.defineProperty(exports, "__esModule", { value: true }); function fn() { return __awaiter(this, void 0, void 0, function* () { - const req = yield Promise.resolve().then(function () { return require('./test'); }); // ONE + const req = yield Promise.resolve().then(() => require('./test')); // ONE }); } exports.fn = fn; class cl1 { m() { return __awaiter(this, void 0, void 0, function* () { - const req = yield Promise.resolve().then(function () { return require('./test'); }); // TWO + const req = yield Promise.resolve().then(() => require('./test')); // TWO }); } } exports.cl1 = cl1; exports.obj = { m: () => __awaiter(this, void 0, void 0, function* () { - const req = yield Promise.resolve().then(function () { return require('./test'); }); // THREE + const req = yield Promise.resolve().then(() => require('./test')); // THREE }) }; class cl2 { constructor() { this.p = { m: () => __awaiter(this, void 0, void 0, function* () { - const req = yield Promise.resolve().then(function () { return require('./test'); }); // FOUR + const req = yield Promise.resolve().then(() => require('./test')); // FOUR }) }; } } exports.cl2 = cl2; exports.l = () => __awaiter(this, void 0, void 0, function* () { - const req = yield Promise.resolve().then(function () { return require('./test'); }); // FIVE + const req = yield Promise.resolve().then(() => require('./test')); // FIVE }); diff --git a/tests/baselines/reference/importCallExpressionAsyncES6UMD.js b/tests/baselines/reference/importCallExpressionAsyncES6UMD.js index f77d5150118..1d4aff02670 100644 --- a/tests/baselines/reference/importCallExpressionAsyncES6UMD.js +++ b/tests/baselines/reference/importCallExpressionAsyncES6UMD.js @@ -51,34 +51,34 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge Object.defineProperty(exports, "__esModule", { value: true }); function fn() { return __awaiter(this, void 0, void 0, function* () { - const req = yield __syncRequire ? Promise.resolve().then(function () { return require('./test'); }) : new Promise(function (resolve_1, reject_1) { require(['./test'], resolve_1, reject_1); }); // ONE + const req = yield __syncRequire ? Promise.resolve().then(() => require('./test')) : new Promise((resolve_1, reject_1) => { require(['./test'], resolve_1, reject_1); }); // ONE }); } exports.fn = fn; class cl1 { m() { return __awaiter(this, void 0, void 0, function* () { - const req = yield __syncRequire ? Promise.resolve().then(function () { return require('./test'); }) : new Promise(function (resolve_2, reject_2) { require(['./test'], resolve_2, reject_2); }); // TWO + const req = yield __syncRequire ? Promise.resolve().then(() => require('./test')) : new Promise((resolve_2, reject_2) => { require(['./test'], resolve_2, reject_2); }); // TWO }); } } exports.cl1 = cl1; exports.obj = { m: () => __awaiter(this, void 0, void 0, function* () { - const req = yield __syncRequire ? Promise.resolve().then(function () { return require('./test'); }) : new Promise(function (resolve_3, reject_3) { require(['./test'], resolve_3, reject_3); }); // THREE + const req = yield __syncRequire ? Promise.resolve().then(() => require('./test')) : new Promise((resolve_3, reject_3) => { require(['./test'], resolve_3, reject_3); }); // THREE }) }; class cl2 { constructor() { this.p = { m: () => __awaiter(this, void 0, void 0, function* () { - const req = yield __syncRequire ? Promise.resolve().then(function () { return require('./test'); }) : new Promise(function (resolve_4, reject_4) { require(['./test'], resolve_4, reject_4); }); // FOUR + const req = yield __syncRequire ? Promise.resolve().then(() => require('./test')) : new Promise((resolve_4, reject_4) => { require(['./test'], resolve_4, reject_4); }); // FOUR }) }; } } exports.cl2 = cl2; exports.l = () => __awaiter(this, void 0, void 0, function* () { - const req = yield __syncRequire ? Promise.resolve().then(function () { return require('./test'); }) : new Promise(function (resolve_5, reject_5) { require(['./test'], resolve_5, reject_5); }); // FIVE + const req = yield __syncRequire ? Promise.resolve().then(() => require('./test')) : new Promise((resolve_5, reject_5) => { require(['./test'], resolve_5, reject_5); }); // FIVE }); }); diff --git a/tests/baselines/reference/importCallExpressionCheckReturntype1.js b/tests/baselines/reference/importCallExpressionCheckReturntype1.js index facb6913388..3cc4893ff67 100644 --- a/tests/baselines/reference/importCallExpressionCheckReturntype1.js +++ b/tests/baselines/reference/importCallExpressionCheckReturntype1.js @@ -30,6 +30,6 @@ exports.C = C; //// [1.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -let p1 = Promise.resolve().then(function () { return require("./defaultPath"); }); -let p2 = Promise.resolve().then(function () { return require("./defaultPath"); }); -let p3 = Promise.resolve().then(function () { return require("./defaultPath"); }); +let p1 = Promise.resolve().then(() => require("./defaultPath")); +let p2 = Promise.resolve().then(() => require("./defaultPath")); +let p3 = Promise.resolve().then(() => require("./defaultPath")); diff --git a/tests/baselines/reference/importCallExpressionDeclarationEmit1.js b/tests/baselines/reference/importCallExpressionDeclarationEmit1.js index 07f95d3b3b2..721d85abe71 100644 --- a/tests/baselines/reference/importCallExpressionDeclarationEmit1.js +++ b/tests/baselines/reference/importCallExpressionDeclarationEmit1.js @@ -15,12 +15,12 @@ function returnDynamicLoad(path: string) { } //// [importCallExpressionDeclarationEmit1.js] -Promise.resolve().then(function () { return require(getSpecifier()); }); -var p0 = Promise.resolve().then(function () { return require(`${directory}\${moduleFile}`); }); -var p1 = Promise.resolve().then(function () { return require(getSpecifier()); }); -const p2 = Promise.resolve().then(function () { return require(whatToLoad ? getSpecifier() : "defaulPath"); }); +Promise.resolve().then(() => require(getSpecifier())); +var p0 = Promise.resolve().then(() => require(`${directory}\${moduleFile}`)); +var p1 = Promise.resolve().then(() => require(getSpecifier())); +const p2 = Promise.resolve().then(() => require(whatToLoad ? getSpecifier() : "defaulPath")); function returnDynamicLoad(path) { - return Promise.resolve().then(function () { return require(path); }); + return Promise.resolve().then(() => require(path)); } diff --git a/tests/baselines/reference/importCallExpressionES6AMD.js b/tests/baselines/reference/importCallExpressionES6AMD.js index 08fec3b27fd..1c5430c9f04 100644 --- a/tests/baselines/reference/importCallExpressionES6AMD.js +++ b/tests/baselines/reference/importCallExpressionES6AMD.js @@ -39,23 +39,23 @@ define(["require", "exports"], function (require, exports) { define(["require", "exports"], function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - new Promise(function (resolve_1, reject_1) { require(["./0"], resolve_1, reject_1); }); - var p1 = new Promise(function (resolve_2, reject_2) { require(["./0"], resolve_2, reject_2); }); + new Promise((resolve_1, reject_1) => { require(["./0"], resolve_1, reject_1); }); + var p1 = new Promise((resolve_2, reject_2) => { require(["./0"], resolve_2, reject_2); }); p1.then(zero => { return zero.foo(); }); - exports.p2 = new Promise(function (resolve_3, reject_3) { require(["./0"], resolve_3, reject_3); }); + exports.p2 = new Promise((resolve_3, reject_3) => { require(["./0"], resolve_3, reject_3); }); function foo() { - const p2 = new Promise(function (resolve_4, reject_4) { require(["./0"], resolve_4, reject_4); }); + const p2 = new Promise((resolve_4, reject_4) => { require(["./0"], resolve_4, reject_4); }); } class C { method() { - const loadAsync = new Promise(function (resolve_5, reject_5) { require(["./0"], resolve_5, reject_5); }); + const loadAsync = new Promise((resolve_5, reject_5) => { require(["./0"], resolve_5, reject_5); }); } } class D { method() { - const loadAsync = new Promise(function (resolve_6, reject_6) { require(["./0"], resolve_6, reject_6); }); + const loadAsync = new Promise((resolve_6, reject_6) => { require(["./0"], resolve_6, reject_6); }); } } exports.D = D; diff --git a/tests/baselines/reference/importCallExpressionES6CJS.js b/tests/baselines/reference/importCallExpressionES6CJS.js index 28833e17479..a1d8108bdea 100644 --- a/tests/baselines/reference/importCallExpressionES6CJS.js +++ b/tests/baselines/reference/importCallExpressionES6CJS.js @@ -36,23 +36,23 @@ exports.foo = foo; //// [1.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -Promise.resolve().then(function () { return require("./0"); }); -var p1 = Promise.resolve().then(function () { return require("./0"); }); +Promise.resolve().then(() => require("./0")); +var p1 = Promise.resolve().then(() => require("./0")); p1.then(zero => { return zero.foo(); }); -exports.p2 = Promise.resolve().then(function () { return require("./0"); }); +exports.p2 = Promise.resolve().then(() => require("./0")); function foo() { - const p2 = Promise.resolve().then(function () { return require("./0"); }); + const p2 = Promise.resolve().then(() => require("./0")); } class C { method() { - const loadAsync = Promise.resolve().then(function () { return require("./0"); }); + const loadAsync = Promise.resolve().then(() => require("./0")); } } class D { method() { - const loadAsync = Promise.resolve().then(function () { return require("./0"); }); + const loadAsync = Promise.resolve().then(() => require("./0")); } } exports.D = D; diff --git a/tests/baselines/reference/importCallExpressionES6UMD.js b/tests/baselines/reference/importCallExpressionES6UMD.js index cc7dfef0074..750a1a7cc0c 100644 --- a/tests/baselines/reference/importCallExpressionES6UMD.js +++ b/tests/baselines/reference/importCallExpressionES6UMD.js @@ -56,23 +56,23 @@ export class D { "use strict"; var __syncRequire = typeof module === "object" && typeof module.exports === "object"; Object.defineProperty(exports, "__esModule", { value: true }); - __syncRequire ? Promise.resolve().then(function () { return require("./0"); }) : new Promise(function (resolve_1, reject_1) { require(["./0"], resolve_1, reject_1); }); - var p1 = __syncRequire ? Promise.resolve().then(function () { return require("./0"); }) : new Promise(function (resolve_2, reject_2) { require(["./0"], resolve_2, reject_2); }); + __syncRequire ? Promise.resolve().then(() => require("./0")) : new Promise((resolve_1, reject_1) => { require(["./0"], resolve_1, reject_1); }); + var p1 = __syncRequire ? Promise.resolve().then(() => require("./0")) : new Promise((resolve_2, reject_2) => { require(["./0"], resolve_2, reject_2); }); p1.then(zero => { return zero.foo(); }); - exports.p2 = __syncRequire ? Promise.resolve().then(function () { return require("./0"); }) : new Promise(function (resolve_3, reject_3) { require(["./0"], resolve_3, reject_3); }); + exports.p2 = __syncRequire ? Promise.resolve().then(() => require("./0")) : new Promise((resolve_3, reject_3) => { require(["./0"], resolve_3, reject_3); }); function foo() { - const p2 = __syncRequire ? Promise.resolve().then(function () { return require("./0"); }) : new Promise(function (resolve_4, reject_4) { require(["./0"], resolve_4, reject_4); }); + const p2 = __syncRequire ? Promise.resolve().then(() => require("./0")) : new Promise((resolve_4, reject_4) => { require(["./0"], resolve_4, reject_4); }); } class C { method() { - const loadAsync = __syncRequire ? Promise.resolve().then(function () { return require("./0"); }) : new Promise(function (resolve_5, reject_5) { require(["./0"], resolve_5, reject_5); }); + const loadAsync = __syncRequire ? Promise.resolve().then(() => require("./0")) : new Promise((resolve_5, reject_5) => { require(["./0"], resolve_5, reject_5); }); } } class D { method() { - const loadAsync = __syncRequire ? Promise.resolve().then(function () { return require("./0"); }) : new Promise(function (resolve_6, reject_6) { require(["./0"], resolve_6, reject_6); }); + const loadAsync = __syncRequire ? Promise.resolve().then(() => require("./0")) : new Promise((resolve_6, reject_6) => { require(["./0"], resolve_6, reject_6); }); } } exports.D = D; diff --git a/tests/baselines/reference/importCallExpressionGrammarError.js b/tests/baselines/reference/importCallExpressionGrammarError.js index b30b0c9ddd5..e2ffc55577d 100644 --- a/tests/baselines/reference/importCallExpressionGrammarError.js +++ b/tests/baselines/reference/importCallExpressionGrammarError.js @@ -12,8 +12,8 @@ const p4 = import("pathToModule", "secondModule"); //// [importCallExpressionGrammarError.js] var a = ["./0"]; -Promise.resolve().then(function () { return require(...["PathModule"]); }); -var p1 = Promise.resolve().then(function () { return require(...a); }); -const p2 = Promise.resolve().then(function () { return require(); }); -const p3 = Promise.resolve().then(function () { return require(); }); -const p4 = Promise.resolve().then(function () { return require("pathToModule", "secondModule"); }); +Promise.resolve().then(() => require(...["PathModule"])); +var p1 = Promise.resolve().then(() => require(...a)); +const p2 = Promise.resolve().then(() => require()); +const p3 = Promise.resolve().then(() => require()); +const p4 = Promise.resolve().then(() => require("pathToModule", "secondModule")); diff --git a/tests/baselines/reference/importCallExpressionInAMD1.js b/tests/baselines/reference/importCallExpressionInAMD1.js index 5c858160353..64e5aee2dda 100644 --- a/tests/baselines/reference/importCallExpressionInAMD1.js +++ b/tests/baselines/reference/importCallExpressionInAMD1.js @@ -27,13 +27,13 @@ define(["require", "exports"], function (require, exports) { define(["require", "exports"], function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); - new Promise(function (resolve_1, reject_1) { require(["./0"], resolve_1, reject_1); }); - var p1 = new Promise(function (resolve_2, reject_2) { require(["./0"], resolve_2, reject_2); }); + new Promise((resolve_1, reject_1) => { require(["./0"], resolve_1, reject_1); }); + var p1 = new Promise((resolve_2, reject_2) => { require(["./0"], resolve_2, reject_2); }); p1.then(zero => { return zero.foo(); }); - exports.p2 = new Promise(function (resolve_3, reject_3) { require(["./0"], resolve_3, reject_3); }); + exports.p2 = new Promise((resolve_3, reject_3) => { require(["./0"], resolve_3, reject_3); }); function foo() { - const p2 = new Promise(function (resolve_4, reject_4) { require(["./0"], resolve_4, reject_4); }); + const p2 = new Promise((resolve_4, reject_4) => { require(["./0"], resolve_4, reject_4); }); } }); diff --git a/tests/baselines/reference/importCallExpressionInAMD2.js b/tests/baselines/reference/importCallExpressionInAMD2.js index 7347e2f8105..0d3f0e08d21 100644 --- a/tests/baselines/reference/importCallExpressionInAMD2.js +++ b/tests/baselines/reference/importCallExpressionInAMD2.js @@ -35,5 +35,5 @@ define(["require", "exports"], function (require, exports) { b.print(); }); } - foo(new Promise(function (resolve_1, reject_1) { require(["./0"], resolve_1, reject_1); })); + foo(new Promise((resolve_1, reject_1) => { require(["./0"], resolve_1, reject_1); })); }); diff --git a/tests/baselines/reference/importCallExpressionInAMD3.js b/tests/baselines/reference/importCallExpressionInAMD3.js index 471f35a6415..07e7e922541 100644 --- a/tests/baselines/reference/importCallExpressionInAMD3.js +++ b/tests/baselines/reference/importCallExpressionInAMD3.js @@ -26,7 +26,7 @@ define(["require", "exports"], function (require, exports) { define(["require", "exports"], function (require, exports) { "use strict"; async function foo() { - class C extends (await new Promise(function (resolve_1, reject_1) { require(["./0"], resolve_1, reject_1); })).B { + class C extends (await new Promise((resolve_1, reject_1) => { require(["./0"], resolve_1, reject_1); })).B { } var c = new C(); c.print(); diff --git a/tests/baselines/reference/importCallExpressionInAMD4.js b/tests/baselines/reference/importCallExpressionInAMD4.js index 43ba5afcd30..2fe29e5ae06 100644 --- a/tests/baselines/reference/importCallExpressionInAMD4.js +++ b/tests/baselines/reference/importCallExpressionInAMD4.js @@ -64,30 +64,30 @@ define(["require", "exports"], function (require, exports) { Object.defineProperty(exports, "__esModule", { value: true }); class C { constructor() { - this.myModule = new Promise(function (resolve_1, reject_1) { require(["./0"], resolve_1, reject_1); }); + this.myModule = new Promise((resolve_1, reject_1) => { require(["./0"], resolve_1, reject_1); }); } method() { - const loadAsync = new Promise(function (resolve_2, reject_2) { require(["./0"], resolve_2, reject_2); }); + const loadAsync = new Promise((resolve_2, reject_2) => { require(["./0"], resolve_2, reject_2); }); this.myModule.then(Zero => { console.log(Zero.foo()); }, async (err) => { console.log(err); - let one = await new Promise(function (resolve_3, reject_3) { require(["./1"], resolve_3, reject_3); }); + let one = await new Promise((resolve_3, reject_3) => { require(["./1"], resolve_3, reject_3); }); console.log(one.backup()); }); } } class D { constructor() { - this.myModule = new Promise(function (resolve_4, reject_4) { require(["./0"], resolve_4, reject_4); }); + this.myModule = new Promise((resolve_4, reject_4) => { require(["./0"], resolve_4, reject_4); }); } method() { - const loadAsync = new Promise(function (resolve_5, reject_5) { require(["./0"], resolve_5, reject_5); }); + const loadAsync = new Promise((resolve_5, reject_5) => { require(["./0"], resolve_5, reject_5); }); this.myModule.then(Zero => { console.log(Zero.foo()); }, async (err) => { console.log(err); - let one = await new Promise(function (resolve_6, reject_6) { require(["./1"], resolve_6, reject_6); }); + let one = await new Promise((resolve_6, reject_6) => { require(["./1"], resolve_6, reject_6); }); console.log(one.backup()); }); } diff --git a/tests/baselines/reference/importCallExpressionInCJS1.js b/tests/baselines/reference/importCallExpressionInCJS1.js index 359e743144b..c814f5e5671 100644 --- a/tests/baselines/reference/importCallExpressionInCJS1.js +++ b/tests/baselines/reference/importCallExpressionInCJS1.js @@ -24,12 +24,12 @@ exports.foo = foo; //// [1.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -Promise.resolve().then(function () { return require("./0"); }); -var p1 = Promise.resolve().then(function () { return require("./0"); }); +Promise.resolve().then(() => require("./0")); +var p1 = Promise.resolve().then(() => require("./0")); p1.then(zero => { return zero.foo(); }); -exports.p2 = Promise.resolve().then(function () { return require("./0"); }); +exports.p2 = Promise.resolve().then(() => require("./0")); function foo() { - const p2 = Promise.resolve().then(function () { return require("./0"); }); + const p2 = Promise.resolve().then(() => require("./0")); } diff --git a/tests/baselines/reference/importCallExpressionInCJS2.js b/tests/baselines/reference/importCallExpressionInCJS2.js index aa983a7a2fe..fb559cb1193 100644 --- a/tests/baselines/reference/importCallExpressionInCJS2.js +++ b/tests/baselines/reference/importCallExpressionInCJS2.js @@ -32,9 +32,9 @@ exports.backup = backup; async function compute(promise) { let j = await promise; if (!j) { - j = await Promise.resolve().then(function () { return require("./1"); }); + j = await Promise.resolve().then(() => require("./1")); return j.backup(); } return j.foo(); } -compute(Promise.resolve().then(function () { return require("./0"); })); +compute(Promise.resolve().then(() => require("./0"))); diff --git a/tests/baselines/reference/importCallExpressionInCJS3.js b/tests/baselines/reference/importCallExpressionInCJS3.js index 2f956d9ac3a..616fbc9c3f9 100644 --- a/tests/baselines/reference/importCallExpressionInCJS3.js +++ b/tests/baselines/reference/importCallExpressionInCJS3.js @@ -31,4 +31,4 @@ function foo(x) { b.print(); }); } -foo(Promise.resolve().then(function () { return require("./0"); })); +foo(Promise.resolve().then(() => require("./0"))); diff --git a/tests/baselines/reference/importCallExpressionInCJS4.js b/tests/baselines/reference/importCallExpressionInCJS4.js index 554a0b222ab..b88295110b8 100644 --- a/tests/baselines/reference/importCallExpressionInCJS4.js +++ b/tests/baselines/reference/importCallExpressionInCJS4.js @@ -22,7 +22,7 @@ class B { exports.B = B; //// [2.js] async function foo() { - class C extends (await Promise.resolve().then(function () { return require("./0"); })).B { + class C extends (await Promise.resolve().then(() => require("./0"))).B { } var c = new C(); c.print(); diff --git a/tests/baselines/reference/importCallExpressionInCJS5.js b/tests/baselines/reference/importCallExpressionInCJS5.js index eeb4db275fa..b32b0e52c50 100644 --- a/tests/baselines/reference/importCallExpressionInCJS5.js +++ b/tests/baselines/reference/importCallExpressionInCJS5.js @@ -59,30 +59,30 @@ exports.backup = backup; Object.defineProperty(exports, "__esModule", { value: true }); class C { constructor() { - this.myModule = Promise.resolve().then(function () { return require("./0"); }); + this.myModule = Promise.resolve().then(() => require("./0")); } method() { - const loadAsync = Promise.resolve().then(function () { return require("./0"); }); + const loadAsync = Promise.resolve().then(() => require("./0")); this.myModule.then(Zero => { console.log(Zero.foo()); }, async (err) => { console.log(err); - let one = await Promise.resolve().then(function () { return require("./1"); }); + let one = await Promise.resolve().then(() => require("./1")); console.log(one.backup()); }); } } class D { constructor() { - this.myModule = Promise.resolve().then(function () { return require("./0"); }); + this.myModule = Promise.resolve().then(() => require("./0")); } method() { - const loadAsync = Promise.resolve().then(function () { return require("./0"); }); + const loadAsync = Promise.resolve().then(() => require("./0")); this.myModule.then(Zero => { console.log(Zero.foo()); }, async (err) => { console.log(err); - let one = await Promise.resolve().then(function () { return require("./1"); }); + let one = await Promise.resolve().then(() => require("./1")); console.log(one.backup()); }); } diff --git a/tests/baselines/reference/importCallExpressionInExportEqualsAMD.js b/tests/baselines/reference/importCallExpressionInExportEqualsAMD.js index f2fda1fadd7..1fcef2bde39 100644 --- a/tests/baselines/reference/importCallExpressionInExportEqualsAMD.js +++ b/tests/baselines/reference/importCallExpressionInExportEqualsAMD.js @@ -17,6 +17,6 @@ define(["require", "exports"], function (require, exports) { define(["require", "exports"], function (require, exports) { "use strict"; return async function () { - const something = await new Promise(function (resolve_1, reject_1) { require(["./something"], resolve_1, reject_1); }); + const something = await new Promise((resolve_1, reject_1) => { require(["./something"], resolve_1, reject_1); }); }; }); diff --git a/tests/baselines/reference/importCallExpressionInExportEqualsCJS.js b/tests/baselines/reference/importCallExpressionInExportEqualsCJS.js index 5d7e2816116..72e3a0ec0af 100644 --- a/tests/baselines/reference/importCallExpressionInExportEqualsCJS.js +++ b/tests/baselines/reference/importCallExpressionInExportEqualsCJS.js @@ -14,5 +14,5 @@ module.exports = 42; //// [index.js] "use strict"; module.exports = async function () { - const something = await Promise.resolve().then(function () { return require("./something"); }); + const something = await Promise.resolve().then(() => require("./something")); }; diff --git a/tests/baselines/reference/importCallExpressionInExportEqualsUMD.js b/tests/baselines/reference/importCallExpressionInExportEqualsUMD.js index e0c6e2a925f..5f70891b09e 100644 --- a/tests/baselines/reference/importCallExpressionInExportEqualsUMD.js +++ b/tests/baselines/reference/importCallExpressionInExportEqualsUMD.js @@ -34,6 +34,6 @@ export = async function() { "use strict"; var __syncRequire = typeof module === "object" && typeof module.exports === "object"; return async function () { - const something = await (__syncRequire ? Promise.resolve().then(function () { return require("./something"); }) : new Promise(function (resolve_1, reject_1) { require(["./something"], resolve_1, reject_1); })); + const something = await (__syncRequire ? Promise.resolve().then(() => require("./something")) : new Promise((resolve_1, reject_1) => { require(["./something"], resolve_1, reject_1); })); }; }); diff --git a/tests/baselines/reference/importCallExpressionInScriptContext1.js b/tests/baselines/reference/importCallExpressionInScriptContext1.js index 2c2d2f904d5..53c6118f61b 100644 --- a/tests/baselines/reference/importCallExpressionInScriptContext1.js +++ b/tests/baselines/reference/importCallExpressionInScriptContext1.js @@ -13,5 +13,5 @@ Object.defineProperty(exports, "__esModule", { value: true }); function foo() { return "foo"; } exports.foo = foo; //// [1.js] -var p1 = Promise.resolve().then(function () { return require("./0"); }); +var p1 = Promise.resolve().then(() => require("./0")); function arguments() { } // this is allow as the file doesn't have implicit "use strict" diff --git a/tests/baselines/reference/importCallExpressionInScriptContext2.js b/tests/baselines/reference/importCallExpressionInScriptContext2.js index 6b6e0109fda..4a0d4a1bf5a 100644 --- a/tests/baselines/reference/importCallExpressionInScriptContext2.js +++ b/tests/baselines/reference/importCallExpressionInScriptContext2.js @@ -15,5 +15,5 @@ function foo() { return "foo"; } exports.foo = foo; //// [1.js] "use strict"; -var p1 = Promise.resolve().then(function () { return require("./0"); }); +var p1 = Promise.resolve().then(() => require("./0")); function arguments() { } diff --git a/tests/baselines/reference/importCallExpressionInUMD1.js b/tests/baselines/reference/importCallExpressionInUMD1.js index ee99468f7f3..597e68e2d6f 100644 --- a/tests/baselines/reference/importCallExpressionInUMD1.js +++ b/tests/baselines/reference/importCallExpressionInUMD1.js @@ -44,13 +44,13 @@ function foo() { "use strict"; var __syncRequire = typeof module === "object" && typeof module.exports === "object"; Object.defineProperty(exports, "__esModule", { value: true }); - __syncRequire ? Promise.resolve().then(function () { return require("./0"); }) : new Promise(function (resolve_1, reject_1) { require(["./0"], resolve_1, reject_1); }); - var p1 = __syncRequire ? Promise.resolve().then(function () { return require("./0"); }) : new Promise(function (resolve_2, reject_2) { require(["./0"], resolve_2, reject_2); }); + __syncRequire ? Promise.resolve().then(() => require("./0")) : new Promise((resolve_1, reject_1) => { require(["./0"], resolve_1, reject_1); }); + var p1 = __syncRequire ? Promise.resolve().then(() => require("./0")) : new Promise((resolve_2, reject_2) => { require(["./0"], resolve_2, reject_2); }); p1.then(zero => { return zero.foo(); }); - exports.p2 = __syncRequire ? Promise.resolve().then(function () { return require("./0"); }) : new Promise(function (resolve_3, reject_3) { require(["./0"], resolve_3, reject_3); }); + exports.p2 = __syncRequire ? Promise.resolve().then(() => require("./0")) : new Promise((resolve_3, reject_3) => { require(["./0"], resolve_3, reject_3); }); function foo() { - const p2 = __syncRequire ? Promise.resolve().then(function () { return require("./0"); }) : new Promise(function (resolve_4, reject_4) { require(["./0"], resolve_4, reject_4); }); + const p2 = __syncRequire ? Promise.resolve().then(() => require("./0")) : new Promise((resolve_4, reject_4) => { require(["./0"], resolve_4, reject_4); }); } }); diff --git a/tests/baselines/reference/importCallExpressionInUMD2.js b/tests/baselines/reference/importCallExpressionInUMD2.js index db8b87a2f79..516800968c1 100644 --- a/tests/baselines/reference/importCallExpressionInUMD2.js +++ b/tests/baselines/reference/importCallExpressionInUMD2.js @@ -52,5 +52,5 @@ foo(import("./0")); b.print(); }); } - foo(__syncRequire ? Promise.resolve().then(function () { return require("./0"); }) : new Promise(function (resolve_1, reject_1) { require(["./0"], resolve_1, reject_1); })); + foo(__syncRequire ? Promise.resolve().then(() => require("./0")) : new Promise((resolve_1, reject_1) => { require(["./0"], resolve_1, reject_1); })); }); diff --git a/tests/baselines/reference/importCallExpressionInUMD3.js b/tests/baselines/reference/importCallExpressionInUMD3.js index 41106e3ab78..57d200ca70c 100644 --- a/tests/baselines/reference/importCallExpressionInUMD3.js +++ b/tests/baselines/reference/importCallExpressionInUMD3.js @@ -43,7 +43,7 @@ foo(); "use strict"; var __syncRequire = typeof module === "object" && typeof module.exports === "object"; async function foo() { - class C extends (await (__syncRequire ? Promise.resolve().then(function () { return require("./0"); }) : new Promise(function (resolve_1, reject_1) { require(["./0"], resolve_1, reject_1); }))).B { + class C extends (await (__syncRequire ? Promise.resolve().then(() => require("./0")) : new Promise((resolve_1, reject_1) => { require(["./0"], resolve_1, reject_1); }))).B { } var c = new C(); c.print(); diff --git a/tests/baselines/reference/importCallExpressionInUMD4.js b/tests/baselines/reference/importCallExpressionInUMD4.js index 477a7826bc0..70a574f0302 100644 --- a/tests/baselines/reference/importCallExpressionInUMD4.js +++ b/tests/baselines/reference/importCallExpressionInUMD4.js @@ -89,30 +89,30 @@ export class D { Object.defineProperty(exports, "__esModule", { value: true }); class C { constructor() { - this.myModule = __syncRequire ? Promise.resolve().then(function () { return require("./0"); }) : new Promise(function (resolve_1, reject_1) { require(["./0"], resolve_1, reject_1); }); + this.myModule = __syncRequire ? Promise.resolve().then(() => require("./0")) : new Promise((resolve_1, reject_1) => { require(["./0"], resolve_1, reject_1); }); } method() { - const loadAsync = __syncRequire ? Promise.resolve().then(function () { return require("./0"); }) : new Promise(function (resolve_2, reject_2) { require(["./0"], resolve_2, reject_2); }); + const loadAsync = __syncRequire ? Promise.resolve().then(() => require("./0")) : new Promise((resolve_2, reject_2) => { require(["./0"], resolve_2, reject_2); }); this.myModule.then(Zero => { console.log(Zero.foo()); }, async (err) => { console.log(err); - let one = await (__syncRequire ? Promise.resolve().then(function () { return require("./1"); }) : new Promise(function (resolve_3, reject_3) { require(["./1"], resolve_3, reject_3); })); + let one = await (__syncRequire ? Promise.resolve().then(() => require("./1")) : new Promise((resolve_3, reject_3) => { require(["./1"], resolve_3, reject_3); })); console.log(one.backup()); }); } } class D { constructor() { - this.myModule = __syncRequire ? Promise.resolve().then(function () { return require("./0"); }) : new Promise(function (resolve_4, reject_4) { require(["./0"], resolve_4, reject_4); }); + this.myModule = __syncRequire ? Promise.resolve().then(() => require("./0")) : new Promise((resolve_4, reject_4) => { require(["./0"], resolve_4, reject_4); }); } method() { - const loadAsync = __syncRequire ? Promise.resolve().then(function () { return require("./0"); }) : new Promise(function (resolve_5, reject_5) { require(["./0"], resolve_5, reject_5); }); + const loadAsync = __syncRequire ? Promise.resolve().then(() => require("./0")) : new Promise((resolve_5, reject_5) => { require(["./0"], resolve_5, reject_5); }); this.myModule.then(Zero => { console.log(Zero.foo()); }, async (err) => { console.log(err); - let one = await (__syncRequire ? Promise.resolve().then(function () { return require("./1"); }) : new Promise(function (resolve_6, reject_6) { require(["./1"], resolve_6, reject_6); })); + let one = await (__syncRequire ? Promise.resolve().then(() => require("./1")) : new Promise((resolve_6, reject_6) => { require(["./1"], resolve_6, reject_6); })); console.log(one.backup()); }); } diff --git a/tests/baselines/reference/importCallExpressionReturnPromiseOfAny.js b/tests/baselines/reference/importCallExpressionReturnPromiseOfAny.js index 728d6636953..8c94510b609 100644 --- a/tests/baselines/reference/importCallExpressionReturnPromiseOfAny.js +++ b/tests/baselines/reference/importCallExpressionReturnPromiseOfAny.js @@ -42,20 +42,20 @@ exports.C = C; //// [1.js] "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -Promise.resolve().then(function () { return require(`${directory}\${moduleFile}`); }); -Promise.resolve().then(function () { return require(getSpecifier()); }); -var p1 = Promise.resolve().then(function () { return require(ValidSomeCondition() ? "./0" : "externalModule"); }); -var p1 = Promise.resolve().then(function () { return require(getSpecifier()); }); -var p11 = Promise.resolve().then(function () { return require(getSpecifier()); }); -const p2 = Promise.resolve().then(function () { return require(whatToLoad ? getSpecifier() : "defaulPath"); }); +Promise.resolve().then(() => require(`${directory}\${moduleFile}`)); +Promise.resolve().then(() => require(getSpecifier())); +var p1 = Promise.resolve().then(() => require(ValidSomeCondition() ? "./0" : "externalModule")); +var p1 = Promise.resolve().then(() => require(getSpecifier())); +var p11 = Promise.resolve().then(() => require(getSpecifier())); +const p2 = Promise.resolve().then(() => require(whatToLoad ? getSpecifier() : "defaulPath")); p1.then(zero => { return zero.foo(); // ok, zero is any }); let j; -var p3 = Promise.resolve().then(function () { return require(j = getSpecifier()); }); +var p3 = Promise.resolve().then(() => require(j = getSpecifier())); function* loadModule(directories) { for (const directory of directories) { const path = `${directory}\moduleFile`; - Promise.resolve().then(function () { return require(yield path); }); + Promise.resolve().then(() => require(yield path)); } } diff --git a/tests/baselines/reference/importCallExpressionSpecifierNotStringTypeError.js b/tests/baselines/reference/importCallExpressionSpecifierNotStringTypeError.js index dde35d8048b..5e2ace1c401 100644 --- a/tests/baselines/reference/importCallExpressionSpecifierNotStringTypeError.js +++ b/tests/baselines/reference/importCallExpressionSpecifierNotStringTypeError.js @@ -15,11 +15,11 @@ var p4 = import(()=>"PathToModule"); //// [importCallExpressionSpecifierNotStringTypeError.js] // Error specifier is not assignable to string -Promise.resolve().then(function () { return require(getSpecifier()); }); -var p1 = Promise.resolve().then(function () { return require(getSpecifier()); }); -const p2 = Promise.resolve().then(function () { return require(whatToLoad ? getSpecifier() : "defaulPath"); }); +Promise.resolve().then(() => require(getSpecifier())); +var p1 = Promise.resolve().then(() => require(getSpecifier())); +const p2 = Promise.resolve().then(() => require(whatToLoad ? getSpecifier() : "defaulPath")); p1.then(zero => { return zero.foo(); // ok, zero is any }); -var p3 = Promise.resolve().then(function () { return require(["path1", "path2"]); }); -var p4 = Promise.resolve().then(function () { return require(() => "PathToModule"); }); +var p3 = Promise.resolve().then(() => require(["path1", "path2"])); +var p4 = Promise.resolve().then(() => require(() => "PathToModule")); diff --git a/tests/baselines/reference/importCallExpressionWithTypeArgument.js b/tests/baselines/reference/importCallExpressionWithTypeArgument.js index 2915669eae5..885992a798b 100644 --- a/tests/baselines/reference/importCallExpressionWithTypeArgument.js +++ b/tests/baselines/reference/importCallExpressionWithTypeArgument.js @@ -15,5 +15,5 @@ function foo() { return "foo"; } exports.foo = foo; //// [1.js] "use strict"; -var p1 = Promise.resolve().then(function () { return require("./0"); }); // error -var p2 = Promise.resolve().then(function () { return require("./0"); }); // error +var p1 = Promise.resolve().then(() => require("./0")); // error +var p2 = Promise.resolve().then(() => require("./0")); // error From 3eeb54861d310a37518e81642bee77120c097e00 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 10 Oct 2017 10:53:43 -0700 Subject: [PATCH 074/137] Fix invalid cast (#18821) --- src/compiler/binder.ts | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 48cace44841..4cacb5765db 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -2271,16 +2271,13 @@ namespace ts { function isExportsOrModuleExportsOrAlias(node: Node): boolean { return isExportsIdentifier(node) || isModuleExportsPropertyAccessExpression(node) || - isNameOfExportsOrModuleExportsAliasDeclaration(node); + isIdentifier(node) && isNameOfExportsOrModuleExportsAliasDeclaration(node); } - function isNameOfExportsOrModuleExportsAliasDeclaration(node: Node) { - if (isIdentifier(node)) { - const symbol = lookupSymbolForName(node.escapedText); - return symbol && symbol.valueDeclaration && isVariableDeclaration(symbol.valueDeclaration) && - symbol.valueDeclaration.initializer && isExportsOrModuleExportsOrAliasOrAssignment(symbol.valueDeclaration.initializer); - } - return false; + function isNameOfExportsOrModuleExportsAliasDeclaration(node: Identifier): boolean { + const symbol = lookupSymbolForName(node.escapedText); + return symbol && symbol.valueDeclaration && isVariableDeclaration(symbol.valueDeclaration) && + symbol.valueDeclaration.initializer && isExportsOrModuleExportsOrAliasOrAssignment(symbol.valueDeclaration.initializer); } function isExportsOrModuleExportsOrAliasOrAssignment(node: Node): boolean { @@ -2354,20 +2351,22 @@ namespace ts { // Look up the function in the local scope, since prototype assignments should // follow the function declaration const leftSideOfAssignment = node.left as PropertyAccessExpression; - const target = leftSideOfAssignment.expression as Identifier; + const target = leftSideOfAssignment.expression; - // Fix up parent pointers since we're going to use these nodes before we bind into them - leftSideOfAssignment.parent = node; - target.parent = leftSideOfAssignment; + if (isIdentifier(target)) { + // Fix up parent pointers since we're going to use these nodes before we bind into them + leftSideOfAssignment.parent = node; + target.parent = leftSideOfAssignment; - if (isNameOfExportsOrModuleExportsAliasDeclaration(target)) { - // This can be an alias for the 'exports' or 'module.exports' names, e.g. - // var util = module.exports; - // util.property = function ... - bindExportsPropertyAssignment(node); - } - else { - bindPropertyAssignment(target.escapedText, leftSideOfAssignment, /*isPrototypeProperty*/ false); + if (isNameOfExportsOrModuleExportsAliasDeclaration(target)) { + // This can be an alias for the 'exports' or 'module.exports' names, e.g. + // var util = module.exports; + // util.property = function ... + bindExportsPropertyAssignment(node); + } + else { + bindPropertyAssignment(target.escapedText, leftSideOfAssignment, /*isPrototypeProperty*/ false); + } } } From 9ccc1b48873bb2cd1e1a0cf9eabc0232c26c200d Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 10 Oct 2017 10:54:29 -0700 Subject: [PATCH 075/137] Remove unnecessary uses of `any` in shims.ts (#19038) --- src/services/shims.ts | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/services/shims.ts b/src/services/shims.ts index 737db44b83f..9d4baccc3c4 100644 --- a/src/services/shims.ts +++ b/src/services/shims.ts @@ -16,7 +16,7 @@ /// /* @internal */ -let debugObjectHost = (function (this: any) { return this; })(); +let debugObjectHost: { CollectGarbage(): void } = (function (this: any) { return this; })(); // We need to use 'null' to interface with the managed side. /* tslint:disable:no-null-keyword */ @@ -119,13 +119,13 @@ namespace ts { } export interface Shim { - dispose(_dummy: any): void; + dispose(_dummy: {}): void; } export interface LanguageServiceShim extends Shim { languageService: LanguageService; - dispose(_dummy: any): void; + dispose(_dummy: {}): void; refresh(throwOnError: boolean): void; @@ -417,7 +417,7 @@ namespace ts { return this.shimHost.getScriptVersion(fileName); } - public getLocalizedDiagnosticMessages(): any { + public getLocalizedDiagnosticMessages() { const diagnosticMessagesJson = this.shimHost.getLocalizedDiagnosticMessages(); if (diagnosticMessagesJson === null || diagnosticMessagesJson === "") { return null; @@ -515,7 +515,7 @@ namespace ts { } } - function simpleForwardCall(logger: Logger, actionDescription: string, action: () => any, logPerformance: boolean): any { + function simpleForwardCall(logger: Logger, actionDescription: string, action: () => {}, logPerformance: boolean): {} { let start: number; if (logPerformance) { logger.log(actionDescription); @@ -539,14 +539,14 @@ namespace ts { return result; } - function forwardJSONCall(logger: Logger, actionDescription: string, action: () => any, logPerformance: boolean): string { + function forwardJSONCall(logger: Logger, actionDescription: string, action: () => {}, logPerformance: boolean): string { return forwardCall(logger, actionDescription, /*returnJson*/ true, action, logPerformance); } function forwardCall(logger: Logger, actionDescription: string, returnJson: boolean, action: () => T, logPerformance: boolean): T | string { try { const result = simpleForwardCall(logger, actionDescription, action, logPerformance); - return returnJson ? JSON.stringify({ result }) : result; + return returnJson ? JSON.stringify({ result }) : result as T; } catch (err) { if (err instanceof OperationCanceledException) { @@ -563,7 +563,7 @@ namespace ts { constructor(private factory: ShimFactory) { factory.registerShim(this); } - public dispose(_dummy: any): void { + public dispose(_dummy: {}): void { this.factory.unregisterShim(this); } } @@ -601,7 +601,7 @@ namespace ts { this.logger = this.host; } - public forwardJSONCall(actionDescription: string, action: () => any): string { + public forwardJSONCall(actionDescription: string, action: () => {}): string { return forwardJSONCall(this.logger, actionDescription, action, this.logPerformance); } @@ -611,7 +611,7 @@ namespace ts { * Ensure (almost) deterministic release of internal Javascript resources when * some external native objects holds onto us (e.g. Com/Interop). */ - public dispose(dummy: any): void { + public dispose(dummy: {}): void { this.logger.log("dispose()"); this.languageService.dispose(); this.languageService = null; @@ -635,7 +635,7 @@ namespace ts { public refresh(throwOnError: boolean): void { this.forwardJSONCall( `refresh(${throwOnError})`, - () => null + () => null ); } @@ -644,7 +644,7 @@ namespace ts { "cleanupSemanticCache()", () => { this.languageService.cleanupSemanticCache(); - return null; + return null; }); } @@ -980,13 +980,13 @@ namespace ts { ); } - public getEmitOutputObject(fileName: string): any { + public getEmitOutputObject(fileName: string): EmitOutput { return forwardCall( this.logger, `getEmitOutput('${fileName}')`, /*returnJson*/ false, () => this.languageService.getEmitOutput(fileName), - this.logPerformance); + this.logPerformance) as EmitOutput; } } @@ -1030,7 +1030,7 @@ namespace ts { super(factory); } - private forwardJSONCall(actionDescription: string, action: () => any): any { + private forwardJSONCall(actionDescription: string, action: () => {}): string { return forwardJSONCall(this.logger, actionDescription, action, this.logPerformance); } @@ -1221,7 +1221,7 @@ namespace ts { // Here we expose the TypeScript services as an external module // so that it may be consumed easily like a node module. - declare const module: any; + declare const module: { exports: {} }; if (typeof module !== "undefined" && module.exports) { module.exports = ts; } From 3171d082a6c126a0930e3b94cb2f791e2d059069 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 10 Oct 2017 10:52:29 -0700 Subject: [PATCH 076/137] Handle the case of completion of class member when member name is being edited Fixes #17977 --- src/services/completions.ts | 5 +++ .../completionEntryForClassMembers3.ts | 32 +++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 tests/cases/fourslash/completionEntryForClassMembers3.ts diff --git a/src/services/completions.ts b/src/services/completions.ts index 44ad611de79..c2224256937 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -1195,6 +1195,11 @@ namespace ts.Completions { if (isClassLike(location)) { return location; } + // class c { method() { } b| } + if (isFromClassElementDeclaration(location) && + (location.parent as ClassElement).name === location) { + return location.parent.parent as ClassLikeDeclaration; + } break; default: diff --git a/tests/cases/fourslash/completionEntryForClassMembers3.ts b/tests/cases/fourslash/completionEntryForClassMembers3.ts new file mode 100644 index 00000000000..a27c5959e6d --- /dev/null +++ b/tests/cases/fourslash/completionEntryForClassMembers3.ts @@ -0,0 +1,32 @@ +/// + +////interface IFoo { +//// bar(): void; +////} +////class Foo1 implements IFoo { +//// zap() { } +//// /*1*/ +////} +////class Foo2 implements IFoo { +//// zap() { } +//// b/*2*/() { } +////} +////class Foo3 implements IFoo { +//// zap() { } +//// b/*3*/: any; +////} +const allowedKeywordCount = verify.allowedClassElementKeywords.length; +function verifyHasBar() { + verify.completionListContains("bar", "(method) IFoo.bar(): void", /*documentation*/ undefined, "method"); + verify.completionListContainsClassElementKeywords(); + verify.completionListCount(allowedKeywordCount + 1); +} + +goTo.marker("1"); +verifyHasBar(); +edit.insert("b"); +verifyHasBar(); +goTo.marker("2"); +verifyHasBar(); +goTo.marker("3"); +verifyHasBar(); \ No newline at end of file From b839e17e178d27e4ffbc97121246c14d1f07149a Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 10 Oct 2017 11:27:53 -0700 Subject: [PATCH 077/137] Improve JSDoc @augments diagnostics (#19011) --- src/compiler/checker.ts | 4 ++-- src/compiler/diagnosticMessages.json | 4 ++-- tests/baselines/reference/jsdocAugments_notAClass.errors.txt | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d47a77a7440..2cad5dbf652 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -20034,7 +20034,7 @@ namespace ts { function checkJSDocAugmentsTag(node: JSDocAugmentsTag): void { const classLike = getJSDocHost(node); if (!isClassDeclaration(classLike) && !isClassExpression(classLike)) { - error(classLike, Diagnostics.JSDoc_augments_is_not_attached_to_a_class_declaration); + error(classLike, Diagnostics.JSDoc_0_is_not_attached_to_a_class, idText(node.tagName)); return; } @@ -20049,7 +20049,7 @@ namespace ts { if (extend) { const className = getIdentifierFromEntityNameExpression(extend.expression); if (className && name.escapedText !== className.escapedText) { - error(name, Diagnostics.JSDoc_augments_0_does_not_match_the_extends_1_clause, idText(name), idText(className)); + error(name, Diagnostics.JSDoc_0_1_does_not_match_the_extends_2_clause, idText(node.tagName), idText(name), idText(className)); } } } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 91ad9e52bfd..e5e7b774884 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3519,11 +3519,11 @@ "category": "Error", "code": 8021 }, - "JSDoc '@augments' is not attached to a class declaration.": { + "JSDoc '@{0}' is not attached to a class.": { "category": "Error", "code": 8022 }, - "JSDoc '@augments {0}' does not match the 'extends {1}' clause.": { + "JSDoc '@{0} {1}' does not match the 'extends {2}' clause.": { "category": "Error", "code": 8023 }, diff --git a/tests/baselines/reference/jsdocAugments_notAClass.errors.txt b/tests/baselines/reference/jsdocAugments_notAClass.errors.txt index 9f8528f0cd8..daf20aaf884 100644 --- a/tests/baselines/reference/jsdocAugments_notAClass.errors.txt +++ b/tests/baselines/reference/jsdocAugments_notAClass.errors.txt @@ -1,4 +1,4 @@ -/b.js(3,10): error TS8022: JSDoc '@augments' is not attached to a class declaration. +/b.js(3,10): error TS8022: JSDoc '@augments' is not attached to a class. ==== /b.js (1 errors) ==== @@ -6,5 +6,5 @@ /** @augments A */ function b() {} ~ -!!! error TS8022: JSDoc '@augments' is not attached to a class declaration. +!!! error TS8022: JSDoc '@augments' is not attached to a class. \ No newline at end of file From 927ffefcf43727bf3168ee2e10fe7ed30e731a9f Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 10 Oct 2017 11:28:05 -0700 Subject: [PATCH 078/137] Replace more 'verify.rangeAfterCodeFix' with 'verify.codeFix' (#18800) --- src/compiler/diagnosticMessages.json | 2 +- src/harness/fourslash.ts | 2 +- .../codeFixChangeExtendsToImplements.ts | 5 +- ...angeExtendsToImplementsAbstractModifier.ts | 6 ++- ...eFixChangeExtendsToImplementsTypeParams.ts | 5 +- ...xChangeExtendsToImplementsWithDecorator.ts | 6 ++- .../fourslash/codeFixChangeJSDocSyntax1.ts | 5 +- .../fourslash/codeFixChangeJSDocSyntax10.ts | 8 ++- .../fourslash/codeFixChangeJSDocSyntax11.ts | 8 ++- .../fourslash/codeFixChangeJSDocSyntax12.ts | 8 ++- .../fourslash/codeFixChangeJSDocSyntax13.ts | 8 ++- .../fourslash/codeFixChangeJSDocSyntax14.ts | 7 ++- .../fourslash/codeFixChangeJSDocSyntax15.ts | 7 ++- .../fourslash/codeFixChangeJSDocSyntax16.ts | 5 +- .../fourslash/codeFixChangeJSDocSyntax17.ts | 6 ++- .../fourslash/codeFixChangeJSDocSyntax18.ts | 6 ++- .../fourslash/codeFixChangeJSDocSyntax19.ts | 6 ++- .../fourslash/codeFixChangeJSDocSyntax2.ts | 5 +- .../fourslash/codeFixChangeJSDocSyntax20.ts | 6 ++- .../fourslash/codeFixChangeJSDocSyntax21.ts | 6 ++- .../fourslash/codeFixChangeJSDocSyntax22.ts | 6 ++- .../fourslash/codeFixChangeJSDocSyntax23.ts | 6 ++- .../fourslash/codeFixChangeJSDocSyntax24.ts | 6 ++- .../fourslash/codeFixChangeJSDocSyntax25.ts | 6 ++- .../fourslash/codeFixChangeJSDocSyntax26.ts | 6 ++- .../fourslash/codeFixChangeJSDocSyntax27.ts | 8 ++- .../fourslash/codeFixChangeJSDocSyntax3.ts | 5 +- .../fourslash/codeFixChangeJSDocSyntax4.ts | 5 +- .../fourslash/codeFixChangeJSDocSyntax5.ts | 7 ++- .../fourslash/codeFixChangeJSDocSyntax6.ts | 6 ++- .../fourslash/codeFixChangeJSDocSyntax7.ts | 5 +- .../fourslash/codeFixChangeJSDocSyntax8.ts | 5 +- .../fourslash/codeFixChangeJSDocSyntax9.ts | 5 +- ...ClassImplementClassFunctionVoidInferred.ts | 21 ++++---- ...prExtendsAbstractExpressionWithTypeArgs.ts | 23 ++++---- ...assExtendAbstractExpressionWithTypeArgs.ts | 23 ++++---- .../codeFixClassExtendAbstractGetterSetter.ts | 53 ++++++++++--------- .../codeFixClassExtendAbstractMethod.ts | 33 ++++++------ .../codeFixClassExtendAbstractMethodThis.ts | 19 ++++--- ...stractMethodTypeParamsInstantiateNumber.ts | 18 ++++--- ...endAbstractMethodTypeParamsInstantiateU.ts | 18 ++++--- .../codeFixClassExtendAbstractProperty.ts | 19 ++++--- tests/cases/fourslash/unusedMethodInClass1.ts | 11 ++-- tests/cases/fourslash/unusedMethodInClass2.ts | 12 +++-- tests/cases/fourslash/unusedMethodInClass3.ts | 11 ++-- tests/cases/fourslash/unusedMethodInClass4.ts | 8 ++- tests/cases/fourslash/unusedMethodInClass5.ts | 11 ++-- tests/cases/fourslash/unusedMethodInClass6.ts | 11 ++-- .../fourslash/unusedNamespaceInNamespace.ts | 16 +++--- .../unusedParameterInConstructor1.ts | 6 ++- ...sedParameterInConstructor1AddUnderscore.ts | 6 ++- .../unusedParameterInConstructor2.ts | 6 ++- .../unusedParameterInConstructor3.ts | 6 ++- .../unusedParameterInConstructor4.ts | 6 ++- .../fourslash/unusedParameterInFunction1.ts | 6 ++- ...unusedParameterInFunction1AddUnderscore.ts | 6 ++- .../fourslash/unusedParameterInFunction2.ts | 6 ++- .../fourslash/unusedParameterInFunction3.ts | 6 ++- .../fourslash/unusedParameterInFunction4.ts | 6 ++- .../fourslash/unusedParameterInLambda1.ts | 6 ++- .../unusedParameterInLambda1AddUnderscore.ts | 6 ++- .../fourslash/unusedTypeAliasInNamespace1.ts | 15 +++--- .../fourslash/unusedTypeParametersInClass1.ts | 5 +- .../fourslash/unusedTypeParametersInClass2.ts | 5 +- .../fourslash/unusedTypeParametersInClass3.ts | 5 +- .../unusedTypeParametersInFunction1.ts | 5 +- .../unusedTypeParametersInFunction2.ts | 5 +- .../unusedTypeParametersInFunction3.ts | 5 +- .../unusedTypeParametersInInterface1.ts | 5 +- .../unusedTypeParametersInLambda1.ts | 5 +- .../unusedTypeParametersInLambda2.ts | 5 +- .../unusedTypeParametersInLambda3.ts | 5 +- .../unusedTypeParametersInLambda4.ts | 5 +- .../unusedTypeParametersInMethod1.ts | 5 +- .../unusedTypeParametersInMethod2.ts | 5 +- .../unusedTypeParametersInMethods1.ts | 5 +- .../cases/fourslash/unusedVariableInBlocks.ts | 15 +++--- .../cases/fourslash/unusedVariableInClass1.ts | 5 +- .../cases/fourslash/unusedVariableInClass2.ts | 5 +- .../cases/fourslash/unusedVariableInClass3.ts | 5 +- .../fourslash/unusedVariableInForLoop1FS.ts | 6 ++- .../fourslash/unusedVariableInForLoop2FS.ts | 5 +- .../fourslash/unusedVariableInForLoop3FS.ts | 5 +- .../fourslash/unusedVariableInForLoop4FS.ts | 5 +- ...unusedVariableInForLoop5FSAddUnderscore.ts | 5 +- .../fourslash/unusedVariableInForLoop6FS.ts | 7 ++- ...unusedVariableInForLoop6FSAddUnderscore.ts | 6 ++- .../fourslash/unusedVariableInForLoop7FS.ts | 7 ++- .../fourslash/unusedVariableInModule1.ts | 5 +- .../fourslash/unusedVariableInModule2.ts | 5 +- .../fourslash/unusedVariableInModule3.ts | 5 +- .../fourslash/unusedVariableInModule4.ts | 6 ++- .../fourslash/unusedVariableInNamespace1.ts | 5 +- .../fourslash/unusedVariableInNamespace2.ts | 5 +- .../fourslash/unusedVariableInNamespace3.ts | 5 +- 95 files changed, 545 insertions(+), 224 deletions(-) diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index e5e7b774884..251e84ca8f4 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3661,7 +3661,7 @@ "category": "Message", "code": 90013 }, - "Change {0} to {1}.": { + "Change '{0}' to '{1}'.": { "category": "Message", "code": 90014 }, diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index debb7290678..de6d92eda05 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -2381,7 +2381,7 @@ Actual: ${stringify(fullActual)}`); })); return ts.flatMap(ts.deduplicate(diagnosticsForCodeFix, ts.equalOwnProperties), diagnostic => { - if (errorCode && errorCode !== diagnostic.code) { + if (errorCode !== undefined && errorCode !== diagnostic.code) { return; } diff --git a/tests/cases/fourslash/codeFixChangeExtendsToImplements.ts b/tests/cases/fourslash/codeFixChangeExtendsToImplements.ts index bfaedf2818a..bf3b8b7b8a4 100644 --- a/tests/cases/fourslash/codeFixChangeExtendsToImplements.ts +++ b/tests/cases/fourslash/codeFixChangeExtendsToImplements.ts @@ -3,4 +3,7 @@ //// interface I {} //// [|/* */ class /* */ C /* */ extends /* */ I|]{} -verify.rangeAfterCodeFix("/* */ class /* */ C /* */ implements /* */ I"); \ No newline at end of file +verify.codeFix({ + description: "Change 'extends' to 'implements'.", + newRangeContent: "/* */ class /* */ C /* */ implements /* */ I", +}); diff --git a/tests/cases/fourslash/codeFixChangeExtendsToImplementsAbstractModifier.ts b/tests/cases/fourslash/codeFixChangeExtendsToImplementsAbstractModifier.ts index 5f5ca93c28f..7f309a22965 100644 --- a/tests/cases/fourslash/codeFixChangeExtendsToImplementsAbstractModifier.ts +++ b/tests/cases/fourslash/codeFixChangeExtendsToImplementsAbstractModifier.ts @@ -5,4 +5,8 @@ //// [|abstract class A extends I1 implements I2|] { } -verify.rangeAfterCodeFix("abstract class A implements I1, I2"); \ No newline at end of file +verify.codeFix({ + description: "Change 'extends' to 'implements'.", + // TODO: GH#18794 + newRangeContent: "abstract class A implements I1 , I2", +}); diff --git a/tests/cases/fourslash/codeFixChangeExtendsToImplementsTypeParams.ts b/tests/cases/fourslash/codeFixChangeExtendsToImplementsTypeParams.ts index 869bd1a5dc0..2cca0b277fd 100644 --- a/tests/cases/fourslash/codeFixChangeExtendsToImplementsTypeParams.ts +++ b/tests/cases/fourslash/codeFixChangeExtendsToImplementsTypeParams.ts @@ -3,4 +3,7 @@ ////interface I { x: X} ////[|class C extends I|]{} -verify.rangeAfterCodeFix("class C implements I"); \ No newline at end of file +verify.codeFix({ + description: "Change 'extends' to 'implements'.", + newRangeContent: "class C implements I", +}); diff --git a/tests/cases/fourslash/codeFixChangeExtendsToImplementsWithDecorator.ts b/tests/cases/fourslash/codeFixChangeExtendsToImplementsWithDecorator.ts index 9671f41def3..e031251ac1b 100644 --- a/tests/cases/fourslash/codeFixChangeExtendsToImplementsWithDecorator.ts +++ b/tests/cases/fourslash/codeFixChangeExtendsToImplementsWithDecorator.ts @@ -10,4 +10,8 @@ //// @sealed //// [|class A extends I1 implements I2 { }|] -verify.rangeAfterCodeFix("class A implements I1, I2 { }"); \ No newline at end of file +verify.codeFix({ + description: "Change 'extends' to 'implements'.", + // TODO: GH#18794 + newRangeContent: "class A implements I1 , I2 { }", +}); diff --git a/tests/cases/fourslash/codeFixChangeJSDocSyntax1.ts b/tests/cases/fourslash/codeFixChangeJSDocSyntax1.ts index 93107ef669b..1a4e967df45 100644 --- a/tests/cases/fourslash/codeFixChangeJSDocSyntax1.ts +++ b/tests/cases/fourslash/codeFixChangeJSDocSyntax1.ts @@ -1,4 +1,7 @@ /// //// var x: [|?|] = 12; -verify.rangeAfterCodeFix("any"); +verify.codeFix({ + description: "Change '?' to 'any'.", + newRangeContent: "any", +}); diff --git a/tests/cases/fourslash/codeFixChangeJSDocSyntax10.ts b/tests/cases/fourslash/codeFixChangeJSDocSyntax10.ts index 3e6754588fd..12ddb66c6fd 100644 --- a/tests/cases/fourslash/codeFixChangeJSDocSyntax10.ts +++ b/tests/cases/fourslash/codeFixChangeJSDocSyntax10.ts @@ -2,4 +2,10 @@ /// //// function f(x: [|number?|]) { //// } -verify.rangeAfterCodeFix("number | null", /*includeWhiteSpace*/ false, /*errorCode*/ 8020, 0); + +verify.codeFix({ + description: "Change 'number?' to 'number | null'.", + errorCode: 8020, + index: 0, + newRangeContent: "number | null", +}); diff --git a/tests/cases/fourslash/codeFixChangeJSDocSyntax11.ts b/tests/cases/fourslash/codeFixChangeJSDocSyntax11.ts index 7ac80125775..8edcbb35da2 100644 --- a/tests/cases/fourslash/codeFixChangeJSDocSyntax11.ts +++ b/tests/cases/fourslash/codeFixChangeJSDocSyntax11.ts @@ -2,4 +2,10 @@ /// //// var f = function f(x: [|string?|]) { //// } -verify.rangeAfterCodeFix("string | null | undefined", /*includeWhiteSpace*/ false, /*errorCode*/ 8020, 1); + +verify.codeFix({ + description: "Change 'string?' to 'string | null | undefined'.", + errorCode: 8020, + index: 1, + newRangeContent: "string | null | undefined", +}); diff --git a/tests/cases/fourslash/codeFixChangeJSDocSyntax12.ts b/tests/cases/fourslash/codeFixChangeJSDocSyntax12.ts index 37eb5df41ee..a2221897aa8 100644 --- a/tests/cases/fourslash/codeFixChangeJSDocSyntax12.ts +++ b/tests/cases/fourslash/codeFixChangeJSDocSyntax12.ts @@ -3,4 +3,10 @@ ////class C { //// p: [|*|] ////} -verify.rangeAfterCodeFix("any", /*includeWhiteSpace*/ false, /*errorCode*/ 8020, 0); + +verify.codeFix({ + description: "Change '*' to 'any'.", + errorCode: 8020, + index: 0, + newRangeContent: "any", +}); diff --git a/tests/cases/fourslash/codeFixChangeJSDocSyntax13.ts b/tests/cases/fourslash/codeFixChangeJSDocSyntax13.ts index 5b374b508f1..65fef47feda 100644 --- a/tests/cases/fourslash/codeFixChangeJSDocSyntax13.ts +++ b/tests/cases/fourslash/codeFixChangeJSDocSyntax13.ts @@ -3,4 +3,10 @@ ////class C { //// p: [|*|] = 12 ////} -verify.rangeAfterCodeFix("any", /*includeWhiteSpace*/ false, /*errorCode*/ 8020, 0); + +verify.codeFix({ + description: "Change '*' to 'any'.", + errorCode: 8020, + index: 0, + newRangeContent: "any", +}); diff --git a/tests/cases/fourslash/codeFixChangeJSDocSyntax14.ts b/tests/cases/fourslash/codeFixChangeJSDocSyntax14.ts index 69478fc3abc..71f21dd8301 100644 --- a/tests/cases/fourslash/codeFixChangeJSDocSyntax14.ts +++ b/tests/cases/fourslash/codeFixChangeJSDocSyntax14.ts @@ -2,4 +2,9 @@ /// //// var x = 12 as [|number?|]; -verify.rangeAfterCodeFix("number | null", /*includeWhiteSpace*/ false, /*errorCode*/ 8020, 0); +verify.codeFix({ + description: "Change 'number?' to 'number | null'.", + errorCode: 8020, + index: 0, + newRangeContent: "number | null", +}); diff --git a/tests/cases/fourslash/codeFixChangeJSDocSyntax15.ts b/tests/cases/fourslash/codeFixChangeJSDocSyntax15.ts index 9482830c19d..b0e8c069e1e 100644 --- a/tests/cases/fourslash/codeFixChangeJSDocSyntax15.ts +++ b/tests/cases/fourslash/codeFixChangeJSDocSyntax15.ts @@ -2,4 +2,9 @@ //// var f = <[|function(number?): number|]>(x => x); // note: without --strict, number? --> number, not number | null -verify.rangeAfterCodeFix("(arg0: number) => number", /*includeWhiteSpace*/ false, /*errorCode*/ 8020, 0); +verify.codeFix({ + description: "Change 'function(number?): number' to '(arg0: number) => number'.", + errorCode: 8020, + index: 0, + newRangeContent: "(arg0: number) => number", +}); diff --git a/tests/cases/fourslash/codeFixChangeJSDocSyntax16.ts b/tests/cases/fourslash/codeFixChangeJSDocSyntax16.ts index 111aec1dce7..264e490d961 100644 --- a/tests/cases/fourslash/codeFixChangeJSDocSyntax16.ts +++ b/tests/cases/fourslash/codeFixChangeJSDocSyntax16.ts @@ -1,4 +1,7 @@ /// //// var f: { [K in keyof number]: [|*|] }; -verify.rangeAfterCodeFix("any"); +verify.codeFix({ + description: "Change '*' to 'any'.", + newRangeContent: "any", +}); diff --git a/tests/cases/fourslash/codeFixChangeJSDocSyntax17.ts b/tests/cases/fourslash/codeFixChangeJSDocSyntax17.ts index 6a3ce2ed3df..63973222a8a 100644 --- a/tests/cases/fourslash/codeFixChangeJSDocSyntax17.ts +++ b/tests/cases/fourslash/codeFixChangeJSDocSyntax17.ts @@ -1,3 +1,7 @@ /// //// declare function index(ix: number): [|*|]; -verify.rangeAfterCodeFix("any"); + +verify.codeFix({ + description: "Change '*' to 'any'.", + newRangeContent: "any", +}); diff --git a/tests/cases/fourslash/codeFixChangeJSDocSyntax18.ts b/tests/cases/fourslash/codeFixChangeJSDocSyntax18.ts index 30a3815516a..31b04bef0f6 100644 --- a/tests/cases/fourslash/codeFixChangeJSDocSyntax18.ts +++ b/tests/cases/fourslash/codeFixChangeJSDocSyntax18.ts @@ -1,3 +1,7 @@ /// //// var index: { (ix: number): [|?|] }; -verify.rangeAfterCodeFix("any"); + +verify.codeFix({ + description: "Change '?' to 'any'.", + newRangeContent: "any", +}); diff --git a/tests/cases/fourslash/codeFixChangeJSDocSyntax19.ts b/tests/cases/fourslash/codeFixChangeJSDocSyntax19.ts index e6344881227..d254cf6d8dd 100644 --- a/tests/cases/fourslash/codeFixChangeJSDocSyntax19.ts +++ b/tests/cases/fourslash/codeFixChangeJSDocSyntax19.ts @@ -1,3 +1,7 @@ /// //// var index: { new (ix: number): [|?|] }; -verify.rangeAfterCodeFix("any"); + +verify.codeFix({ + description: "Change '?' to 'any'.", + newRangeContent: "any", +}); diff --git a/tests/cases/fourslash/codeFixChangeJSDocSyntax2.ts b/tests/cases/fourslash/codeFixChangeJSDocSyntax2.ts index 333b108538f..d2dc0986a59 100644 --- a/tests/cases/fourslash/codeFixChangeJSDocSyntax2.ts +++ b/tests/cases/fourslash/codeFixChangeJSDocSyntax2.ts @@ -1,4 +1,7 @@ /// //// var x: [|*|] = 12; -verify.rangeAfterCodeFix("any"); +verify.codeFix({ + description: "Change '*' to 'any'.", + newRangeContent: "any", +}); diff --git a/tests/cases/fourslash/codeFixChangeJSDocSyntax20.ts b/tests/cases/fourslash/codeFixChangeJSDocSyntax20.ts index dc153730841..32cfe73fd4a 100644 --- a/tests/cases/fourslash/codeFixChangeJSDocSyntax20.ts +++ b/tests/cases/fourslash/codeFixChangeJSDocSyntax20.ts @@ -1,3 +1,7 @@ /// //// var index = { get p(): [|*|] { return 12 } }; -verify.rangeAfterCodeFix("any"); + +verify.codeFix({ + description: "Change '*' to 'any'.", + newRangeContent: "any", +}); diff --git a/tests/cases/fourslash/codeFixChangeJSDocSyntax21.ts b/tests/cases/fourslash/codeFixChangeJSDocSyntax21.ts index 442414e4577..efb53d53009 100644 --- a/tests/cases/fourslash/codeFixChangeJSDocSyntax21.ts +++ b/tests/cases/fourslash/codeFixChangeJSDocSyntax21.ts @@ -1,3 +1,7 @@ /// //// var index = { set p(x: [|*|]) { } }; -verify.rangeAfterCodeFix("any"); + +verify.codeFix({ + description: "Change '*' to 'any'.", + newRangeContent: "any", +}); diff --git a/tests/cases/fourslash/codeFixChangeJSDocSyntax22.ts b/tests/cases/fourslash/codeFixChangeJSDocSyntax22.ts index c575f1ca7ce..06ff23c3cf5 100644 --- a/tests/cases/fourslash/codeFixChangeJSDocSyntax22.ts +++ b/tests/cases/fourslash/codeFixChangeJSDocSyntax22.ts @@ -1,3 +1,7 @@ /// //// var index: { [s: string]: [|*|] }; -verify.rangeAfterCodeFix("any"); + +verify.codeFix({ + description: "Change '*' to 'any'.", + newRangeContent: "any", +}); diff --git a/tests/cases/fourslash/codeFixChangeJSDocSyntax23.ts b/tests/cases/fourslash/codeFixChangeJSDocSyntax23.ts index 7ab70e18ee7..29a49ff641c 100644 --- a/tests/cases/fourslash/codeFixChangeJSDocSyntax23.ts +++ b/tests/cases/fourslash/codeFixChangeJSDocSyntax23.ts @@ -3,4 +3,8 @@ //// m(): [|*|] { //// } ////} -verify.rangeAfterCodeFix("any"); + +verify.codeFix({ + description: "Change '*' to 'any'.", + newRangeContent: "any", +}); diff --git a/tests/cases/fourslash/codeFixChangeJSDocSyntax24.ts b/tests/cases/fourslash/codeFixChangeJSDocSyntax24.ts index 7ea2d1f6faf..6c9a840a373 100644 --- a/tests/cases/fourslash/codeFixChangeJSDocSyntax24.ts +++ b/tests/cases/fourslash/codeFixChangeJSDocSyntax24.ts @@ -2,4 +2,8 @@ ////declare class C { //// m(): [|*|]; ////} -verify.rangeAfterCodeFix("any"); + +verify.codeFix({ + description: "Change '*' to 'any'.", + newRangeContent: "any", +}); diff --git a/tests/cases/fourslash/codeFixChangeJSDocSyntax25.ts b/tests/cases/fourslash/codeFixChangeJSDocSyntax25.ts index 6486a70417e..74a7ea9fa18 100644 --- a/tests/cases/fourslash/codeFixChangeJSDocSyntax25.ts +++ b/tests/cases/fourslash/codeFixChangeJSDocSyntax25.ts @@ -2,4 +2,8 @@ ////declare class C { //// p: [|*|]; ////} -verify.rangeAfterCodeFix("any"); + +verify.codeFix({ + description: "Change '*' to 'any'.", + newRangeContent: "any", +}); diff --git a/tests/cases/fourslash/codeFixChangeJSDocSyntax26.ts b/tests/cases/fourslash/codeFixChangeJSDocSyntax26.ts index dc31f1dfffd..4287539173a 100644 --- a/tests/cases/fourslash/codeFixChangeJSDocSyntax26.ts +++ b/tests/cases/fourslash/codeFixChangeJSDocSyntax26.ts @@ -2,4 +2,8 @@ ////class C { //// p: [|*|] = 12; ////} -verify.rangeAfterCodeFix("any"); + +verify.codeFix({ + description: "Change '*' to 'any'.", + newRangeContent: "any", +}); diff --git a/tests/cases/fourslash/codeFixChangeJSDocSyntax27.ts b/tests/cases/fourslash/codeFixChangeJSDocSyntax27.ts index a259b2dd719..998a9ebd28a 100644 --- a/tests/cases/fourslash/codeFixChangeJSDocSyntax27.ts +++ b/tests/cases/fourslash/codeFixChangeJSDocSyntax27.ts @@ -1,4 +1,10 @@ // @strict: true /// ////type T = [|...number?|]; -verify.rangeAfterCodeFix("number[] | null", /*includeWhiteSpace*/ false, /*errorCode*/ 8020, 0); + +verify.codeFix({ + description: "Change '...number?' to 'number[] | null'.", + errorCode: 8020, + index: 0, + newRangeContent: "number[] | null", +}); diff --git a/tests/cases/fourslash/codeFixChangeJSDocSyntax3.ts b/tests/cases/fourslash/codeFixChangeJSDocSyntax3.ts index f3b02cb84f1..2c804edb615 100644 --- a/tests/cases/fourslash/codeFixChangeJSDocSyntax3.ts +++ b/tests/cases/fourslash/codeFixChangeJSDocSyntax3.ts @@ -1,4 +1,7 @@ /// //// var x: [|......number[][]|] = 12; -verify.rangeAfterCodeFix("number[][][][]"); +verify.codeFix({ + description: "Change '......number[][]' to 'number[][][][]'.", + newRangeContent: "number[][][][]", +}); diff --git a/tests/cases/fourslash/codeFixChangeJSDocSyntax4.ts b/tests/cases/fourslash/codeFixChangeJSDocSyntax4.ts index e9522331d38..f2df4abfd33 100644 --- a/tests/cases/fourslash/codeFixChangeJSDocSyntax4.ts +++ b/tests/cases/fourslash/codeFixChangeJSDocSyntax4.ts @@ -1,4 +1,7 @@ /// //// var x: [|Array.|] = 12; -verify.rangeAfterCodeFix("number[]"); +verify.codeFix({ + description: "Change 'Array.' to 'number[]'.", + newRangeContent: "number[]", +}); diff --git a/tests/cases/fourslash/codeFixChangeJSDocSyntax5.ts b/tests/cases/fourslash/codeFixChangeJSDocSyntax5.ts index 6f46f3082e1..39cca325a4c 100644 --- a/tests/cases/fourslash/codeFixChangeJSDocSyntax5.ts +++ b/tests/cases/fourslash/codeFixChangeJSDocSyntax5.ts @@ -2,4 +2,9 @@ /// //// var x: [|?number|] = 12; -verify.rangeAfterCodeFix("number | null", /*includeWhiteSpace*/ false, /*errorCode*/ 8020, 0); +verify.codeFix({ + description: "Change '?number' to 'number | null'.", + errorCode: 8020, + index: 0, + newRangeContent: "number | null", +}); diff --git a/tests/cases/fourslash/codeFixChangeJSDocSyntax6.ts b/tests/cases/fourslash/codeFixChangeJSDocSyntax6.ts index 8af9f09d99d..da692d723bb 100644 --- a/tests/cases/fourslash/codeFixChangeJSDocSyntax6.ts +++ b/tests/cases/fourslash/codeFixChangeJSDocSyntax6.ts @@ -2,4 +2,8 @@ /// //// var x: [|number?|] = 12; -verify.rangeAfterCodeFix("number | null | undefined", /*includeWhiteSpace*/ undefined, /*errorCode*/ undefined, 1); +verify.codeFix({ + description: "Change 'number?' to 'number | null | undefined'.", + index: 1, + newRangeContent: "number | null | undefined", +}); diff --git a/tests/cases/fourslash/codeFixChangeJSDocSyntax7.ts b/tests/cases/fourslash/codeFixChangeJSDocSyntax7.ts index c80d08b3bac..1d557896fe9 100644 --- a/tests/cases/fourslash/codeFixChangeJSDocSyntax7.ts +++ b/tests/cases/fourslash/codeFixChangeJSDocSyntax7.ts @@ -1,4 +1,7 @@ /// //// var x: [|!number|] = 12; -verify.rangeAfterCodeFix("number"); +verify.codeFix({ + description: "Change '!number' to 'number'.", + newRangeContent: "number", +}); diff --git a/tests/cases/fourslash/codeFixChangeJSDocSyntax8.ts b/tests/cases/fourslash/codeFixChangeJSDocSyntax8.ts index 0fa7ddf229c..c35badc88cf 100644 --- a/tests/cases/fourslash/codeFixChangeJSDocSyntax8.ts +++ b/tests/cases/fourslash/codeFixChangeJSDocSyntax8.ts @@ -1,4 +1,7 @@ /// //// var x: [|function(this: number, number): string|] = 12; -verify.rangeAfterCodeFix("(this: number, arg1: number) => string"); +verify.codeFix({ + description: "Change 'function(this: number, number): string' to '(this: number, arg1: number) => string'.", + newRangeContent: "(this: number, arg1: number) => string", +}); diff --git a/tests/cases/fourslash/codeFixChangeJSDocSyntax9.ts b/tests/cases/fourslash/codeFixChangeJSDocSyntax9.ts index 061ded158ea..6ce049b6a42 100644 --- a/tests/cases/fourslash/codeFixChangeJSDocSyntax9.ts +++ b/tests/cases/fourslash/codeFixChangeJSDocSyntax9.ts @@ -1,4 +1,7 @@ /// //// var x: [|function(new: number)|] = 12; -verify.rangeAfterCodeFix("new () => number"); +verify.codeFix({ + description: "Change 'function(new: number)' to 'new () => number'.", + newRangeContent: "new () => number", +}); diff --git a/tests/cases/fourslash/codeFixClassExprClassImplementClassFunctionVoidInferred.ts b/tests/cases/fourslash/codeFixClassExprClassImplementClassFunctionVoidInferred.ts index 2568111fb90..b582c5e8960 100644 --- a/tests/cases/fourslash/codeFixClassExprClassImplementClassFunctionVoidInferred.ts +++ b/tests/cases/fourslash/codeFixClassExprClassImplementClassFunctionVoidInferred.ts @@ -1,13 +1,16 @@ /// -//// class A { -//// f() {} -//// } +////class A { +//// f() {} +////} //// -//// let B = class implements A {[| |]} +////let B = class implements A {[| |]} -verify.rangeAfterCodeFix(` -f(): void{ - throw new Error("Method not implemented."); -} -`); +verify.codeFix({ + description: "Implement interface 'A'.", + // TODO: GH#18795 + newRangeContent: `f(): void {\r + throw new Error("Method not implemented.");\r +}\r + ` +}); diff --git a/tests/cases/fourslash/codeFixClassExprExtendsAbstractExpressionWithTypeArgs.ts b/tests/cases/fourslash/codeFixClassExprExtendsAbstractExpressionWithTypeArgs.ts index a7690b4f5bf..198cb9ea673 100644 --- a/tests/cases/fourslash/codeFixClassExprExtendsAbstractExpressionWithTypeArgs.ts +++ b/tests/cases/fourslash/codeFixClassExprExtendsAbstractExpressionWithTypeArgs.ts @@ -1,14 +1,17 @@ /// -//// function foo(a: T) { -//// abstract class C { -//// abstract a: T | U; -//// } -//// return C; -//// } +////function foo(a: T) { +//// abstract class C { +//// abstract a: T | U; +//// } +//// return C; +////} //// -//// let B = class extends foo("s") {[| |]} +////let B = class extends foo("s") {[| |]} -verify.rangeAfterCodeFix(` -a: string | number; -`); +verify.codeFix({ + description: "Implement inherited abstract class.", + // TODO: GH#18795 + newRangeContent: `a: string | number;\r + ` +}); diff --git a/tests/cases/fourslash/codeFixClassExtendAbstractExpressionWithTypeArgs.ts b/tests/cases/fourslash/codeFixClassExtendAbstractExpressionWithTypeArgs.ts index 5796bea6fb4..ed574348b9f 100644 --- a/tests/cases/fourslash/codeFixClassExtendAbstractExpressionWithTypeArgs.ts +++ b/tests/cases/fourslash/codeFixClassExtendAbstractExpressionWithTypeArgs.ts @@ -1,14 +1,17 @@ /// -//// function foo(a: T) { -//// abstract class C { -//// abstract a: T | U; -//// } -//// return C; -//// } +////function foo(a: T) { +//// abstract class C { +//// abstract a: T | U; +//// } +//// return C; +////} //// -//// class B extends foo("s") {[| |]} +////class B extends foo("s") {[| |]} -verify.rangeAfterCodeFix(` -a: string | number; -`); \ No newline at end of file +verify.codeFix({ + description: "Implement inherited abstract class.", + // TODO: GH#18795 + newRangeContent: `a: string | number;\r + ` +}); diff --git a/tests/cases/fourslash/codeFixClassExtendAbstractGetterSetter.ts b/tests/cases/fourslash/codeFixClassExtendAbstractGetterSetter.ts index bc437c93bcd..3522b1d39da 100644 --- a/tests/cases/fourslash/codeFixClassExtendAbstractGetterSetter.ts +++ b/tests/cases/fourslash/codeFixClassExtendAbstractGetterSetter.ts @@ -1,31 +1,34 @@ /// -//// abstract class A { -//// private _a: string; +////abstract class A { +//// private _a: string; //// -//// abstract get a(): number | string; -//// abstract get b(): this; -//// abstract get c(): A; +//// abstract get a(): number | string; +//// abstract get b(): this; +//// abstract get c(): A; //// -//// abstract set d(arg: number | string); -//// abstract set e(arg: this); -//// abstract set f(arg: A); +//// abstract set d(arg: number | string); +//// abstract set e(arg: this); +//// abstract set f(arg: A); //// -//// abstract get g(): string; -//// abstract set g(newName: string); -//// } -//// -//// // Don't need to add anything in this case. -//// abstract class B extends A {} -//// -//// class C extends A {[| |]} +//// abstract get g(): string; +//// abstract set g(newName: string); +////} +//// +////// Don't need to add anything in this case. +////abstract class B extends A {} +//// +////class C extends A {[| |]} -verify.rangeAfterCodeFix(` - a: string | number; - b: this; - c: A; - d: string | number; - e: this; - f: A; - g: string; -`); +verify.codeFix({ + description: "Implement inherited abstract class.", + // TODO: GH#18795 + newRangeContent: `a: string | number;\r +b: this;\r +c: A;\r +d: string | number;\r +e: this;\r +f: A;\r +g: string;\r + ` +}); diff --git a/tests/cases/fourslash/codeFixClassExtendAbstractMethod.ts b/tests/cases/fourslash/codeFixClassExtendAbstractMethod.ts index 7e51e2216dc..de9500552ab 100644 --- a/tests/cases/fourslash/codeFixClassExtendAbstractMethod.ts +++ b/tests/cases/fourslash/codeFixClassExtendAbstractMethod.ts @@ -1,24 +1,27 @@ /// -//// abstract class A { +////abstract class A { //// abstract f(a: number, b: string): boolean; //// abstract f(a: number, b: string): this; //// abstract f(a: string, b: number): Function; //// abstract f(a: string): Function; //// abstract foo(): number; -//// } +////} //// -//// class C extends A {[| |]} +////class C extends A {[| |]} -verify.rangeAfterCodeFix(` - f(a: number, b: string): boolean; - f(a: number, b: string): this; - f(a: string, b: number): Function; - f(a: string): Function; - f(a: any, b?: any) { - throw new Error("Method not implemented."); - } - foo(): number { - throw new Error("Method not implemented."); - } -`); +verify.codeFix({ + description: "Implement inherited abstract class.", + // TODO: GH#18795 + newRangeContent: `f(a: number, b: string): boolean;\r +f(a: number, b: string): this;\r +f(a: string, b: number): Function;\r +f(a: string): Function;\r +f(a: any, b?: any) {\r + throw new Error("Method not implemented.");\r +}\r +foo(): number {\r + throw new Error("Method not implemented.");\r +}\r + ` +}); diff --git a/tests/cases/fourslash/codeFixClassExtendAbstractMethodThis.ts b/tests/cases/fourslash/codeFixClassExtendAbstractMethodThis.ts index a462ac98121..e33338b45a9 100644 --- a/tests/cases/fourslash/codeFixClassExtendAbstractMethodThis.ts +++ b/tests/cases/fourslash/codeFixClassExtendAbstractMethodThis.ts @@ -1,13 +1,16 @@ /// -//// abstract class A { +////abstract class A { //// abstract f(): this; -//// } +////} //// -//// class C extends A {[| |]} +////class C extends A {[| |]} -verify.rangeAfterCodeFix(` - f(): this { - throw new Error("Method not implemented."); - } -`); +verify.codeFix({ + description: "Implement inherited abstract class.", + // TODO: GH#18795 + newRangeContent: `f(): this {\r + throw new Error("Method not implemented.");\r +}\r + ` +}); diff --git a/tests/cases/fourslash/codeFixClassExtendAbstractMethodTypeParamsInstantiateNumber.ts b/tests/cases/fourslash/codeFixClassExtendAbstractMethodTypeParamsInstantiateNumber.ts index c1a55e88034..395d9348b79 100644 --- a/tests/cases/fourslash/codeFixClassExtendAbstractMethodTypeParamsInstantiateNumber.ts +++ b/tests/cases/fourslash/codeFixClassExtendAbstractMethodTypeParamsInstantiateNumber.ts @@ -1,12 +1,16 @@ /// -//// abstract class A { +////abstract class A { //// abstract f(x: T): T; -//// } +////} //// -//// class C extends A {[| |]} +////class C extends A {[| |]} -verify.rangeAfterCodeFix(`f(x: number): number{ - throw new Error("Method not implemented."); -} -`); \ No newline at end of file +verify.codeFix({ + description: "Implement inherited abstract class.", + // TODO: GH#18795 + newRangeContent: `f(x: number): number {\r + throw new Error("Method not implemented.");\r +}\r + ` +}); diff --git a/tests/cases/fourslash/codeFixClassExtendAbstractMethodTypeParamsInstantiateU.ts b/tests/cases/fourslash/codeFixClassExtendAbstractMethodTypeParamsInstantiateU.ts index c2ec5ff8035..408406a9efe 100644 --- a/tests/cases/fourslash/codeFixClassExtendAbstractMethodTypeParamsInstantiateU.ts +++ b/tests/cases/fourslash/codeFixClassExtendAbstractMethodTypeParamsInstantiateU.ts @@ -1,12 +1,16 @@ /// -//// abstract class A { +////abstract class A { //// abstract f(x: T): T; -//// } +////} //// -//// class C extends A {[| |]} +////class C extends A {[| |]} -verify.rangeAfterCodeFix(`f(x: U): U{ - throw new Error("Method not implemented."); -} -`); \ No newline at end of file +verify.codeFix({ + description: "Implement inherited abstract class.", + // TODO: GH#18795 + newRangeContent: `f(x: U): U {\r + throw new Error("Method not implemented.");\r +}\r + ` +}); diff --git a/tests/cases/fourslash/codeFixClassExtendAbstractProperty.ts b/tests/cases/fourslash/codeFixClassExtendAbstractProperty.ts index 701903d6770..fbdb13f4f2c 100644 --- a/tests/cases/fourslash/codeFixClassExtendAbstractProperty.ts +++ b/tests/cases/fourslash/codeFixClassExtendAbstractProperty.ts @@ -1,15 +1,18 @@ /// -//// abstract class A { +////abstract class A { //// abstract x: number; //// abstract y: this; //// abstract z: A; -//// } +////} //// -//// class C extends A {[| |]} +////class C extends A {[| |]} -verify.rangeAfterCodeFix(` - x: number; - y: this; - z: A; -`); +verify.codeFix({ + description: "Implement inherited abstract class.", + // TODO: GH#18795 + newRangeContent: `x: number;\r +y: this;\r +z: A;\r + ` +}); diff --git a/tests/cases/fourslash/unusedMethodInClass1.ts b/tests/cases/fourslash/unusedMethodInClass1.ts index a5e3789c8af..175d95e2490 100644 --- a/tests/cases/fourslash/unusedMethodInClass1.ts +++ b/tests/cases/fourslash/unusedMethodInClass1.ts @@ -1,11 +1,12 @@ /// // @noUnusedLocals: true -////[| class greeter { +////class greeter { //// private function1() { //// } -////} |] +////} -verify.rangeAfterCodeFix(` -class greeter { -}`); +verify.codeFix({ + description: `Remove declaration for: 'function1'.`, + newFileContent: "class greeter {\n}", +}); diff --git a/tests/cases/fourslash/unusedMethodInClass2.ts b/tests/cases/fourslash/unusedMethodInClass2.ts index cce621236d4..884f7ecce4e 100644 --- a/tests/cases/fourslash/unusedMethodInClass2.ts +++ b/tests/cases/fourslash/unusedMethodInClass2.ts @@ -1,15 +1,17 @@ /// // @noUnusedLocals: true -//// [| class greeter { +////class greeter { //// public function2() { //// } //// private function1() { //// } -////} |] +////} -verify.rangeAfterCodeFix(` -class greeter { +verify.codeFix({ + description: `Remove declaration for: 'function1'.`, + newFileContent: `class greeter { public function2() { } -}`); +}`, +}); diff --git a/tests/cases/fourslash/unusedMethodInClass3.ts b/tests/cases/fourslash/unusedMethodInClass3.ts index ccf98c4bbc5..f76a1acde09 100644 --- a/tests/cases/fourslash/unusedMethodInClass3.ts +++ b/tests/cases/fourslash/unusedMethodInClass3.ts @@ -1,11 +1,12 @@ /// // @noUnusedLocals: true -////[|class greeter { +////class greeter { //// private function1 = function() { //// } -////} |] +////} -verify.rangeAfterCodeFix(` -class greeter { -}`); +verify.codeFix({ + description: `Remove declaration for: 'function1'.`, + newFileContent: "class greeter {\n}", +}); diff --git a/tests/cases/fourslash/unusedMethodInClass4.ts b/tests/cases/fourslash/unusedMethodInClass4.ts index 962b80f5bc1..9f882a3b76e 100644 --- a/tests/cases/fourslash/unusedMethodInClass4.ts +++ b/tests/cases/fourslash/unusedMethodInClass4.ts @@ -8,5 +8,9 @@ //// } |] ////} -verify.rangeAfterCodeFix(`public function2(){ -}`); +verify.codeFix({ + description: `Remove declaration for: 'function1'.`, + newRangeContent: `public function2(){ + } +`, +}); diff --git a/tests/cases/fourslash/unusedMethodInClass5.ts b/tests/cases/fourslash/unusedMethodInClass5.ts index 806e619817f..c53a31b5d36 100644 --- a/tests/cases/fourslash/unusedMethodInClass5.ts +++ b/tests/cases/fourslash/unusedMethodInClass5.ts @@ -1,8 +1,11 @@ /// // @noUnusedLocals: true -//// [|class C { -//// private ["string"] (){} -//// }|] +////class C { +//// private ["string"] (){} +////} -verify.rangeAfterCodeFix("class C { }"); \ No newline at end of file +verify.codeFix({ + description: `Remove declaration for: '"string"'.`, + newFileContent: "class C {\n}", +}); diff --git a/tests/cases/fourslash/unusedMethodInClass6.ts b/tests/cases/fourslash/unusedMethodInClass6.ts index d223b3d6857..eef00d1cdd0 100644 --- a/tests/cases/fourslash/unusedMethodInClass6.ts +++ b/tests/cases/fourslash/unusedMethodInClass6.ts @@ -1,8 +1,11 @@ /// // @noUnusedLocals: true -//// [|class C { -//// private "string" (){} -//// }|] +////class C { +//// private "string" (){} +////} -verify.rangeAfterCodeFix("class C { }"); \ No newline at end of file +verify.codeFix({ + description: `Remove declaration for: '"string"'.`, + newFileContent: "class C {\n}", +}); diff --git a/tests/cases/fourslash/unusedNamespaceInNamespace.ts b/tests/cases/fourslash/unusedNamespaceInNamespace.ts index 802336454c6..4391a6a158c 100644 --- a/tests/cases/fourslash/unusedNamespaceInNamespace.ts +++ b/tests/cases/fourslash/unusedNamespaceInNamespace.ts @@ -1,13 +1,13 @@ /// // @noUnusedLocals: true -//// [|namespace A { +////namespace A { //// namespace B { -//// } -//// }|] - -verify.rangeAfterCodeFix(` -namespace A { -} -`); +//// } +////} +verify.codeFix({ + description: "Remove declaration for: 'B'.", + newFileContent: `namespace A { +}`, +}); diff --git a/tests/cases/fourslash/unusedParameterInConstructor1.ts b/tests/cases/fourslash/unusedParameterInConstructor1.ts index 33fe34c7e61..46a8c1f3b52 100644 --- a/tests/cases/fourslash/unusedParameterInConstructor1.ts +++ b/tests/cases/fourslash/unusedParameterInConstructor1.ts @@ -5,4 +5,8 @@ //// [|constructor(private p1: string, public p2: boolean, public p3: any, p5)|] { p5; } //// } -verify.rangeAfterCodeFix("constructor(public p2: boolean, public p3: any, p5)", /*includeWhiteSpace*/ false, /*errorCode*/ undefined, /*index*/ 0); \ No newline at end of file +verify.codeFix({ + description: "Remove declaration for: 'p1'.", + index: 0, + newRangeContent: "constructor(public p2: boolean, public p3: any, p5)", +}); diff --git a/tests/cases/fourslash/unusedParameterInConstructor1AddUnderscore.ts b/tests/cases/fourslash/unusedParameterInConstructor1AddUnderscore.ts index 31882978951..634561a5c65 100644 --- a/tests/cases/fourslash/unusedParameterInConstructor1AddUnderscore.ts +++ b/tests/cases/fourslash/unusedParameterInConstructor1AddUnderscore.ts @@ -5,4 +5,8 @@ //// [|constructor(private p1: string, public p2: boolean, public p3: any, p5) |] { p5; } //// } -verify.rangeAfterCodeFix("constructor(private _p1: string, public p2: boolean, public p3: any, p5)", /*includeWhiteSpace*/ false, /*errorCode*/ undefined, /*index*/ 1); \ No newline at end of file +verify.codeFix({ + description: "Prefix 'p1' with an underscore.", + index: 1, + newRangeContent: "constructor(private _p1: string, public p2: boolean, public p3: any, p5)", +}); diff --git a/tests/cases/fourslash/unusedParameterInConstructor2.ts b/tests/cases/fourslash/unusedParameterInConstructor2.ts index 71595a9c81c..b8208bb5359 100644 --- a/tests/cases/fourslash/unusedParameterInConstructor2.ts +++ b/tests/cases/fourslash/unusedParameterInConstructor2.ts @@ -5,4 +5,8 @@ //// [|constructor(public p1: string, private p2: boolean, public p3: any, p5)|] { p5; } //// } -verify.rangeAfterCodeFix("constructor(public p1: string, public p3: any, p5)", /*includeWhiteSpace*/ false, /*errorCode*/ undefined, /*index*/ 0); \ No newline at end of file +verify.codeFix({ + description: "Remove declaration for: 'p2'.", + index: 0, + newRangeContent: "constructor(public p1: string, public p3: any, p5)", +}); diff --git a/tests/cases/fourslash/unusedParameterInConstructor3.ts b/tests/cases/fourslash/unusedParameterInConstructor3.ts index 3da0e85407f..c36f24595a7 100644 --- a/tests/cases/fourslash/unusedParameterInConstructor3.ts +++ b/tests/cases/fourslash/unusedParameterInConstructor3.ts @@ -5,4 +5,8 @@ //// [|constructor(public p1: string, public p2: boolean, private p3: any, p5)|] { p5; } //// } -verify.rangeAfterCodeFix("constructor(public p1: string, public p2: boolean, p5)", /*includeWhiteSpace*/ false, /*errorCode*/ undefined, /*index*/ 0); \ No newline at end of file +verify.codeFix({ + description: "Remove declaration for: 'p3'.", + index: 0, + newRangeContent: "constructor(public p1: string, public p2: boolean, p5)", +}); diff --git a/tests/cases/fourslash/unusedParameterInConstructor4.ts b/tests/cases/fourslash/unusedParameterInConstructor4.ts index 860a7befa9b..99e98d64cda 100644 --- a/tests/cases/fourslash/unusedParameterInConstructor4.ts +++ b/tests/cases/fourslash/unusedParameterInConstructor4.ts @@ -5,4 +5,8 @@ //// [|constructor(private readonly p2: boolean, p5)|] { p5; } //// } -verify.rangeAfterCodeFix("constructor(p5)", /*includeWhiteSpace*/ false, /*errorCode*/ undefined, /*index*/ 0); \ No newline at end of file +verify.codeFix({ + description: "Remove declaration for: 'p2'.", + index: 0, + newRangeContent: "constructor(p5)", +}); diff --git a/tests/cases/fourslash/unusedParameterInFunction1.ts b/tests/cases/fourslash/unusedParameterInFunction1.ts index bc6f081ecaa..3f979f78766 100644 --- a/tests/cases/fourslash/unusedParameterInFunction1.ts +++ b/tests/cases/fourslash/unusedParameterInFunction1.ts @@ -4,4 +4,8 @@ ////function [|greeter( x)|] { ////} -verify.rangeAfterCodeFix("greeter()", /*includeWhiteSpace*/ false, /*errorCode*/ undefined, /*index*/ 0); +verify.codeFix({ + description: "Remove declaration for: 'x'.", + index: 0, + newRangeContent: "greeter()", +}); diff --git a/tests/cases/fourslash/unusedParameterInFunction1AddUnderscore.ts b/tests/cases/fourslash/unusedParameterInFunction1AddUnderscore.ts index 137625869c8..c248c5e1a94 100644 --- a/tests/cases/fourslash/unusedParameterInFunction1AddUnderscore.ts +++ b/tests/cases/fourslash/unusedParameterInFunction1AddUnderscore.ts @@ -4,4 +4,8 @@ ////function [|greeter( x) |] { ////} -verify.rangeAfterCodeFix("greeter( _x)", /*includeWhiteSpace*/ false, /*errorCode*/ undefined, /*index*/ 1); +verify.codeFix({ + description: "Prefix 'x' with an underscore.", + index: 1, + newRangeContent: "greeter( _x)", +}); diff --git a/tests/cases/fourslash/unusedParameterInFunction2.ts b/tests/cases/fourslash/unusedParameterInFunction2.ts index 6d1a772b0a8..74d95c99221 100644 --- a/tests/cases/fourslash/unusedParameterInFunction2.ts +++ b/tests/cases/fourslash/unusedParameterInFunction2.ts @@ -5,4 +5,8 @@ //// use(x); ////} -verify.rangeAfterCodeFix("greeter(x)", /*includeWhiteSpace*/ false, /*errorCode*/ undefined, /*index*/ 0); \ No newline at end of file +verify.codeFix({ + description: "Remove declaration for: 'y'.", + index: 0, + newRangeContent: "greeter(x)", +}); diff --git a/tests/cases/fourslash/unusedParameterInFunction3.ts b/tests/cases/fourslash/unusedParameterInFunction3.ts index dcbe53163db..30dc2a94060 100644 --- a/tests/cases/fourslash/unusedParameterInFunction3.ts +++ b/tests/cases/fourslash/unusedParameterInFunction3.ts @@ -5,4 +5,8 @@ //// y++; ////} -verify.rangeAfterCodeFix("greeter(y)", /*includeWhiteSpace*/ false, /*errorCode*/ undefined, /*index*/ 0); \ No newline at end of file +verify.codeFix({ + description: "Remove declaration for: 'x'.", + index: 0, + newRangeContent: "greeter(y)", +}); diff --git a/tests/cases/fourslash/unusedParameterInFunction4.ts b/tests/cases/fourslash/unusedParameterInFunction4.ts index e3ee2585384..87b5880ba70 100644 --- a/tests/cases/fourslash/unusedParameterInFunction4.ts +++ b/tests/cases/fourslash/unusedParameterInFunction4.ts @@ -5,4 +5,8 @@ //// use(x, z); ////} -verify.rangeAfterCodeFix("function greeter(x,z)", /*includeWhiteSpace*/ false, /*errorCode*/ undefined, /*index*/ 0); \ No newline at end of file +verify.codeFix({ + description: "Remove declaration for: 'y'.", + index: 0, + newRangeContent: "function greeter(x,z) ", +}); diff --git a/tests/cases/fourslash/unusedParameterInLambda1.ts b/tests/cases/fourslash/unusedParameterInLambda1.ts index a5f735c7016..325502ebb6d 100644 --- a/tests/cases/fourslash/unusedParameterInLambda1.ts +++ b/tests/cases/fourslash/unusedParameterInLambda1.ts @@ -6,4 +6,8 @@ //// [|return (x:number) => {}|] //// } -verify.rangeAfterCodeFix("return () => {}", /*includeWhiteSpace*/ false, /*errorCode*/ undefined, /*index*/ 0); +verify.codeFix({ + description: "Remove declaration for: 'x'.", + index: 0, + newRangeContent: "return () => {}", +}); diff --git a/tests/cases/fourslash/unusedParameterInLambda1AddUnderscore.ts b/tests/cases/fourslash/unusedParameterInLambda1AddUnderscore.ts index 916c32d82eb..1b05c66dd2f 100644 --- a/tests/cases/fourslash/unusedParameterInLambda1AddUnderscore.ts +++ b/tests/cases/fourslash/unusedParameterInLambda1AddUnderscore.ts @@ -6,4 +6,8 @@ //// [|return (x:number) => {} |] //// } -verify.rangeAfterCodeFix("return (_x:number) => {}", /*includeWhiteSpace*/ false, /*errorCode*/ undefined, /*index*/ 1); +verify.codeFix({ + description: "Prefix 'x' with an underscore.", + index: 1, + newRangeContent: "return (_x:number) => {}", +}); diff --git a/tests/cases/fourslash/unusedTypeAliasInNamespace1.ts b/tests/cases/fourslash/unusedTypeAliasInNamespace1.ts index 2314ebbe447..13c87f6afd6 100644 --- a/tests/cases/fourslash/unusedTypeAliasInNamespace1.ts +++ b/tests/cases/fourslash/unusedTypeAliasInNamespace1.ts @@ -1,11 +1,14 @@ /// // @noUnusedLocals: true -//// [| namespace greeter { -//// type hw = "Hello" |"world"; -//// export type nw = "No" | "Way"; -//// } |] +////namespace greeter { +//// type hw = "Hello" |"world"; +//// export type nw = "No" | "Way"; +////} -verify.rangeAfterCodeFix(`namespace greeter { +verify.codeFix({ + description: "Remove declaration for: 'hw'.", + newFileContent: `namespace greeter { export type nw = "No" | "Way"; -}`); +}`, +}); diff --git a/tests/cases/fourslash/unusedTypeParametersInClass1.ts b/tests/cases/fourslash/unusedTypeParametersInClass1.ts index 322921ab471..6574362511f 100644 --- a/tests/cases/fourslash/unusedTypeParametersInClass1.ts +++ b/tests/cases/fourslash/unusedTypeParametersInClass1.ts @@ -4,4 +4,7 @@ ////[|class greeter |] { ////} -verify.rangeAfterCodeFix("class greeter"); \ No newline at end of file +verify.codeFix({ + description: "Remove declaration for: 'T'.", + newRangeContent: "class greeter ", +}); diff --git a/tests/cases/fourslash/unusedTypeParametersInClass2.ts b/tests/cases/fourslash/unusedTypeParametersInClass2.ts index feaf9d3a14b..3cb984a11ec 100644 --- a/tests/cases/fourslash/unusedTypeParametersInClass2.ts +++ b/tests/cases/fourslash/unusedTypeParametersInClass2.ts @@ -5,4 +5,7 @@ //// public a: X; ////} -verify.rangeAfterCodeFix("class greeter"); \ No newline at end of file +verify.codeFix({ + description: "Remove declaration for: 'Y'.", + newRangeContent: "class greeter ", +}); diff --git a/tests/cases/fourslash/unusedTypeParametersInClass3.ts b/tests/cases/fourslash/unusedTypeParametersInClass3.ts index b1151265fe3..13ebc352cb0 100644 --- a/tests/cases/fourslash/unusedTypeParametersInClass3.ts +++ b/tests/cases/fourslash/unusedTypeParametersInClass3.ts @@ -6,4 +6,7 @@ //// public b: Z; ////} -verify.rangeAfterCodeFix("class greeter"); +verify.codeFix({ + description: "Remove declaration for: 'Y'.", + newRangeContent: "class greeter ", +}); diff --git a/tests/cases/fourslash/unusedTypeParametersInFunction1.ts b/tests/cases/fourslash/unusedTypeParametersInFunction1.ts index a11156badaa..b7289fc1e0a 100644 --- a/tests/cases/fourslash/unusedTypeParametersInFunction1.ts +++ b/tests/cases/fourslash/unusedTypeParametersInFunction1.ts @@ -3,4 +3,7 @@ // @noUnusedLocals: true //// [|function f1() {}|] -verify.rangeAfterCodeFix("function f1() {}"); +verify.codeFix({ + description: "Remove declaration for: 'T'.", + newRangeContent: "function f1() {}", +}); diff --git a/tests/cases/fourslash/unusedTypeParametersInFunction2.ts b/tests/cases/fourslash/unusedTypeParametersInFunction2.ts index a011f093dab..e2851b34605 100644 --- a/tests/cases/fourslash/unusedTypeParametersInFunction2.ts +++ b/tests/cases/fourslash/unusedTypeParametersInFunction2.ts @@ -3,4 +3,7 @@ // @noUnusedLocals: true //// [|function f1(a: X) {a}|] -verify.rangeAfterCodeFix("function f1(a: X) {a}"); +verify.codeFix({ + description: "Remove declaration for: 'Y'.", + newRangeContent: "function f1(a: X) {a}", +}); diff --git a/tests/cases/fourslash/unusedTypeParametersInFunction3.ts b/tests/cases/fourslash/unusedTypeParametersInFunction3.ts index 6dc56ccc7cb..4be2dc5feb3 100644 --- a/tests/cases/fourslash/unusedTypeParametersInFunction3.ts +++ b/tests/cases/fourslash/unusedTypeParametersInFunction3.ts @@ -3,4 +3,7 @@ // @noUnusedLocals: true //// [|function f1(a: X) {a;var b:Z;b}|] -verify.rangeAfterCodeFix("function f1(a: X) {a;var b:Z;b}"); +verify.codeFix({ + description: "Remove declaration for: 'Y'.", + newRangeContent: "function f1(a: X) {a;var b:Z;b}", +}); diff --git a/tests/cases/fourslash/unusedTypeParametersInInterface1.ts b/tests/cases/fourslash/unusedTypeParametersInInterface1.ts index b5363b369be..bc3a95d63b6 100644 --- a/tests/cases/fourslash/unusedTypeParametersInInterface1.ts +++ b/tests/cases/fourslash/unusedTypeParametersInInterface1.ts @@ -4,4 +4,7 @@ // @noUnusedParameters: true //// [|interface I {}|] -verify.rangeAfterCodeFix("interface I {}"); \ No newline at end of file +verify.codeFix({ + description: "Remove declaration for: 'T'.", + newRangeContent: "interface I {}", +}); diff --git a/tests/cases/fourslash/unusedTypeParametersInLambda1.ts b/tests/cases/fourslash/unusedTypeParametersInLambda1.ts index 01c1ebd24f5..3d7310d6ae6 100644 --- a/tests/cases/fourslash/unusedTypeParametersInLambda1.ts +++ b/tests/cases/fourslash/unusedTypeParametersInLambda1.ts @@ -6,4 +6,7 @@ //// [|return (x:number) => {x}|] //// } -verify.rangeAfterCodeFix("return (x:number) => {x}"); +verify.codeFix({ + description: "Remove declaration for: 'T'.", + newRangeContent: "return(x:number) => {x}", +}); diff --git a/tests/cases/fourslash/unusedTypeParametersInLambda2.ts b/tests/cases/fourslash/unusedTypeParametersInLambda2.ts index e5a4acc31c5..b2b89d3373e 100644 --- a/tests/cases/fourslash/unusedTypeParametersInLambda2.ts +++ b/tests/cases/fourslash/unusedTypeParametersInLambda2.ts @@ -6,4 +6,7 @@ //// [|new (a: T): void;|] //// } -verify.rangeAfterCodeFix("new (a: T): void;"); +verify.codeFix({ + description: "Remove declaration for: 'U'.", + newRangeContent: "new (a: T): void;", +}); diff --git a/tests/cases/fourslash/unusedTypeParametersInLambda3.ts b/tests/cases/fourslash/unusedTypeParametersInLambda3.ts index e6d866dcb6a..1f994c45905 100644 --- a/tests/cases/fourslash/unusedTypeParametersInLambda3.ts +++ b/tests/cases/fourslash/unusedTypeParametersInLambda3.ts @@ -7,4 +7,7 @@ //// [|new (a: T): A;|] //// } -verify.rangeAfterCodeFix("new (a: T): A;"); +verify.codeFix({ + description: "Remove declaration for: 'K'.", + newRangeContent: "new (a: T): A;", +}); diff --git a/tests/cases/fourslash/unusedTypeParametersInLambda4.ts b/tests/cases/fourslash/unusedTypeParametersInLambda4.ts index 04bd7c7e9be..d5c01202d26 100644 --- a/tests/cases/fourslash/unusedTypeParametersInLambda4.ts +++ b/tests/cases/fourslash/unusedTypeParametersInLambda4.ts @@ -6,4 +6,7 @@ //// } //// [|var y: new (a:T)=>void;|] -verify.rangeAfterCodeFix("var y: new (a:T)=>void;"); \ No newline at end of file +verify.codeFix({ + description: "Remove declaration for: 'U'.", + newRangeContent: "var y: new (a:T)=>void;", +}); diff --git a/tests/cases/fourslash/unusedTypeParametersInMethod1.ts b/tests/cases/fourslash/unusedTypeParametersInMethod1.ts index bc14952eca9..f4d036f54f4 100644 --- a/tests/cases/fourslash/unusedTypeParametersInMethod1.ts +++ b/tests/cases/fourslash/unusedTypeParametersInMethod1.ts @@ -5,4 +5,7 @@ //// [|f1()|] {} //// } -verify.rangeAfterCodeFix("f1()"); \ No newline at end of file +verify.codeFix({ + description: "Remove declaration for: 'T'.", + newRangeContent: "f1()", +}); diff --git a/tests/cases/fourslash/unusedTypeParametersInMethod2.ts b/tests/cases/fourslash/unusedTypeParametersInMethod2.ts index c12fd53f66b..25556ebc57d 100644 --- a/tests/cases/fourslash/unusedTypeParametersInMethod2.ts +++ b/tests/cases/fourslash/unusedTypeParametersInMethod2.ts @@ -5,4 +5,7 @@ //// [|f1(a: U)|] {a;} //// } -verify.rangeAfterCodeFix("f1(a: U)"); \ No newline at end of file +verify.codeFix({ + description: "Remove declaration for: 'T'.", + newRangeContent: "f1(a: U)", +}); diff --git a/tests/cases/fourslash/unusedTypeParametersInMethods1.ts b/tests/cases/fourslash/unusedTypeParametersInMethods1.ts index d0b170491f5..62f22246431 100644 --- a/tests/cases/fourslash/unusedTypeParametersInMethods1.ts +++ b/tests/cases/fourslash/unusedTypeParametersInMethods1.ts @@ -5,4 +5,7 @@ //// [|public f1(a: X)|] { a; var b: Z; b } //// } -verify.rangeAfterCodeFix("public f1(a: X)"); +verify.codeFix({ + description: "Remove declaration for: 'Y'.", + newRangeContent: "public f1(a: X)", +}); diff --git a/tests/cases/fourslash/unusedVariableInBlocks.ts b/tests/cases/fourslash/unusedVariableInBlocks.ts index 2a33d0c4cf5..fe3c002916b 100644 --- a/tests/cases/fourslash/unusedVariableInBlocks.ts +++ b/tests/cases/fourslash/unusedVariableInBlocks.ts @@ -1,15 +1,18 @@ /// // @noUnusedLocals: true -//// function f1 () { +////function f1 () { //// [|let x = 10; //// { //// let x = 11; //// } //// x;|] -//// } +////} -verify.rangeAfterCodeFix(`let x = 10; - { - } - x;`); +verify.codeFix({ + description: "Remove declaration for: 'x'.", + newRangeContent: `let x = 10; + { + } + x;`, +}); diff --git a/tests/cases/fourslash/unusedVariableInClass1.ts b/tests/cases/fourslash/unusedVariableInClass1.ts index 8b0ca0db727..e4cec171e8e 100644 --- a/tests/cases/fourslash/unusedVariableInClass1.ts +++ b/tests/cases/fourslash/unusedVariableInClass1.ts @@ -5,4 +5,7 @@ //// [|private greeting: string;|] ////} -verify.rangeAfterCodeFix(""); +verify.codeFix({ + description: "Remove declaration for: 'greeting'.", + newRangeContent: "", +}); diff --git a/tests/cases/fourslash/unusedVariableInClass2.ts b/tests/cases/fourslash/unusedVariableInClass2.ts index 6503dd02872..1f632a43ce8 100644 --- a/tests/cases/fourslash/unusedVariableInClass2.ts +++ b/tests/cases/fourslash/unusedVariableInClass2.ts @@ -6,4 +6,7 @@ //// private greeting: string;|] ////} -verify.rangeAfterCodeFix("public greeting1;"); +verify.codeFix({ + description: "Remove declaration for: 'greeting'.", + newRangeContent: "public greeting1;\n", +}); diff --git a/tests/cases/fourslash/unusedVariableInClass3.ts b/tests/cases/fourslash/unusedVariableInClass3.ts index 3ac306170a2..eec4e6bbe8f 100644 --- a/tests/cases/fourslash/unusedVariableInClass3.ts +++ b/tests/cases/fourslash/unusedVariableInClass3.ts @@ -5,4 +5,7 @@ //// private X = function() {}; ////|]} -verify.rangeAfterCodeFix(""); +verify.codeFix({ + description: "Remove declaration for: 'X'.", + newRangeContent: "\n", +}); diff --git a/tests/cases/fourslash/unusedVariableInForLoop1FS.ts b/tests/cases/fourslash/unusedVariableInForLoop1FS.ts index 760d8487b34..2a4feffd474 100644 --- a/tests/cases/fourslash/unusedVariableInForLoop1FS.ts +++ b/tests/cases/fourslash/unusedVariableInForLoop1FS.ts @@ -7,5 +7,7 @@ //// } //// } -verify.rangeAfterCodeFix("for(; ;)"); - +verify.codeFix({ + description: "Remove declaration for: 'i'.", + newRangeContent: "for(; ;) ", +}); diff --git a/tests/cases/fourslash/unusedVariableInForLoop2FS.ts b/tests/cases/fourslash/unusedVariableInForLoop2FS.ts index a16f21e8417..d913ae5ce94 100644 --- a/tests/cases/fourslash/unusedVariableInForLoop2FS.ts +++ b/tests/cases/fourslash/unusedVariableInForLoop2FS.ts @@ -7,4 +7,7 @@ //// } //// } -verify.rangeAfterCodeFix("for(var i = 0; ;i++)"); +verify.codeFix({ + description: "Remove declaration for: 'j'.", + newRangeContent: "for(var i = 0; ;i++)", +}); diff --git a/tests/cases/fourslash/unusedVariableInForLoop3FS.ts b/tests/cases/fourslash/unusedVariableInForLoop3FS.ts index 07d13307ca7..6f3beae5c74 100644 --- a/tests/cases/fourslash/unusedVariableInForLoop3FS.ts +++ b/tests/cases/fourslash/unusedVariableInForLoop3FS.ts @@ -7,4 +7,7 @@ //// } //// } -verify.rangeAfterCodeFix("for(var i = 0, k=0; ;i++,k++)"); \ No newline at end of file +verify.codeFix({ + description: "Remove declaration for: 'j'.", + newRangeContent: "for(var i = 0, k=0; ;i++, k++)", +}); diff --git a/tests/cases/fourslash/unusedVariableInForLoop4FS.ts b/tests/cases/fourslash/unusedVariableInForLoop4FS.ts index d54f8baaa3d..661012958d4 100644 --- a/tests/cases/fourslash/unusedVariableInForLoop4FS.ts +++ b/tests/cases/fourslash/unusedVariableInForLoop4FS.ts @@ -7,4 +7,7 @@ //// } //// } -verify.rangeAfterCodeFix("for(var j = 0, k=0; ;j++,k++)"); +verify.codeFix({ + description: "Remove declaration for: 'i'.", + newRangeContent: "for(var j= 0, k=0; ;j++, k++) ", +}); diff --git a/tests/cases/fourslash/unusedVariableInForLoop5FSAddUnderscore.ts b/tests/cases/fourslash/unusedVariableInForLoop5FSAddUnderscore.ts index 2948bfab207..87783ff67fc 100644 --- a/tests/cases/fourslash/unusedVariableInForLoop5FSAddUnderscore.ts +++ b/tests/cases/fourslash/unusedVariableInForLoop5FSAddUnderscore.ts @@ -7,4 +7,7 @@ //// } //// } -verify.rangeAfterCodeFix(`for (const _elem in ["a", "b", "c"])`, /*includeWhiteSpace*/ true, /*errorCode*/ 0); +verify.codeFix({ + description: "Prefix 'elem' with an underscore.", + newRangeContent: 'for (const _elem in ["a", "b", "c"])' +}); diff --git a/tests/cases/fourslash/unusedVariableInForLoop6FS.ts b/tests/cases/fourslash/unusedVariableInForLoop6FS.ts index fa1948438bc..9661514d431 100644 --- a/tests/cases/fourslash/unusedVariableInForLoop6FS.ts +++ b/tests/cases/fourslash/unusedVariableInForLoop6FS.ts @@ -7,5 +7,8 @@ //// } //// } -verify.rangeAfterCodeFix("const {} of ", /*includeWhiteSpace*/ false, /*errorCode*/ undefined, /*index*/ 0); - +verify.codeFix({ + description: "Remove declaration for: 'elem'.", + index: 0, + newRangeContent: "const {} of", +}); diff --git a/tests/cases/fourslash/unusedVariableInForLoop6FSAddUnderscore.ts b/tests/cases/fourslash/unusedVariableInForLoop6FSAddUnderscore.ts index 4faa6893b7f..9f8c7b19f99 100644 --- a/tests/cases/fourslash/unusedVariableInForLoop6FSAddUnderscore.ts +++ b/tests/cases/fourslash/unusedVariableInForLoop6FSAddUnderscore.ts @@ -7,5 +7,9 @@ //// } //// } -verify.rangeAfterCodeFix("const _elem of", /*includeWhiteSpace*/ false, /*errorCode*/ undefined, /*index*/ 1); +verify.codeFix({ + description: "Prefix 'elem' with an underscore.", + index: 1, + newRangeContent: "const _elem of" +}); diff --git a/tests/cases/fourslash/unusedVariableInForLoop7FS.ts b/tests/cases/fourslash/unusedVariableInForLoop7FS.ts index 7f99863ba46..c42bf8bc97a 100644 --- a/tests/cases/fourslash/unusedVariableInForLoop7FS.ts +++ b/tests/cases/fourslash/unusedVariableInForLoop7FS.ts @@ -9,8 +9,11 @@ ////}|] //// -verify.rangeAfterCodeFix(`{ +verify.codeFix({ + description: "Remove declaration for: 'x'.", + newRangeContent: `{ for (const elem of ["a", "b", "c"]) { elem; } -}`, /*includeWhiteSpace*/ true); +}` +}); diff --git a/tests/cases/fourslash/unusedVariableInModule1.ts b/tests/cases/fourslash/unusedVariableInModule1.ts index e9fe9515e6d..7a0a3ad8601 100644 --- a/tests/cases/fourslash/unusedVariableInModule1.ts +++ b/tests/cases/fourslash/unusedVariableInModule1.ts @@ -6,4 +6,7 @@ //// [|var x: string; //// export var y: string;|] -verify.rangeAfterCodeFix("export var y: string;"); +verify.codeFix({ + description: "Remove declaration for: 'x'.", + newRangeContent: "export var y: string;", +}); diff --git a/tests/cases/fourslash/unusedVariableInModule2.ts b/tests/cases/fourslash/unusedVariableInModule2.ts index ac6e7120d8b..e8a1ae762d4 100644 --- a/tests/cases/fourslash/unusedVariableInModule2.ts +++ b/tests/cases/fourslash/unusedVariableInModule2.ts @@ -7,4 +7,7 @@ //// z; //// export var y: string; -verify.rangeAfterCodeFix("var z: number;"); +verify.codeFix({ + description: "Remove declaration for: 'x'.", + newRangeContent: "var z: number;", +}); diff --git a/tests/cases/fourslash/unusedVariableInModule3.ts b/tests/cases/fourslash/unusedVariableInModule3.ts index 0185b89e3a6..56b08f5499e 100644 --- a/tests/cases/fourslash/unusedVariableInModule3.ts +++ b/tests/cases/fourslash/unusedVariableInModule3.ts @@ -6,4 +6,7 @@ //// [|var x = function f1() {} //// export var y: string;|] -verify.rangeAfterCodeFix("export var y: string;"); +verify.codeFix({ + description: "Remove declaration for: 'x'.", + newRangeContent: "export var y: string;", +}); diff --git a/tests/cases/fourslash/unusedVariableInModule4.ts b/tests/cases/fourslash/unusedVariableInModule4.ts index 6d80d59c2ce..71890893b9e 100644 --- a/tests/cases/fourslash/unusedVariableInModule4.ts +++ b/tests/cases/fourslash/unusedVariableInModule4.ts @@ -7,4 +7,8 @@ //// x; //// export var y: string; -verify.rangeAfterCodeFix(`var x = function f1() {}`, /*includeWhiteSpace*/ false, /*errorCode*/ undefined, /*index*/ 0); +verify.codeFix({ + description: "Remove declaration for: 'm'.", + index: 0, + newRangeContent: `var x = function f1() {}`, +}); diff --git a/tests/cases/fourslash/unusedVariableInNamespace1.ts b/tests/cases/fourslash/unusedVariableInNamespace1.ts index c9f38473a51..6dd14233683 100644 --- a/tests/cases/fourslash/unusedVariableInNamespace1.ts +++ b/tests/cases/fourslash/unusedVariableInNamespace1.ts @@ -5,4 +5,7 @@ //// [|let a = "dummy entry";|] ////} -verify.rangeAfterCodeFix(""); +verify.codeFix({ + description: "Remove declaration for: 'a'.", + newRangeContent: "", +}); diff --git a/tests/cases/fourslash/unusedVariableInNamespace2.ts b/tests/cases/fourslash/unusedVariableInNamespace2.ts index 61fc3ec137c..9bf546f6f53 100644 --- a/tests/cases/fourslash/unusedVariableInNamespace2.ts +++ b/tests/cases/fourslash/unusedVariableInNamespace2.ts @@ -8,4 +8,7 @@ //// } ////} -verify.rangeAfterCodeFix(`let a = "dummy entry", c = 0;`); +verify.codeFix({ + description: "Remove declaration for: 'b'.", + newRangeContent: 'let a = "dummy entry", c = 0;', +}); diff --git a/tests/cases/fourslash/unusedVariableInNamespace3.ts b/tests/cases/fourslash/unusedVariableInNamespace3.ts index 7d2f3d251f3..85e1889c3e1 100644 --- a/tests/cases/fourslash/unusedVariableInNamespace3.ts +++ b/tests/cases/fourslash/unusedVariableInNamespace3.ts @@ -8,4 +8,7 @@ //// } ////} -verify.rangeAfterCodeFix(`let a = "dummy entry", b;`); +verify.codeFix({ + description: "Remove declaration for: 'c'.", + newRangeContent: 'let a = "dummy entry", b;', +}); From 9ece0cc956215ca1d82bf3f531a98ca44cdf5d66 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Tue, 10 Oct 2017 13:01:06 -0700 Subject: [PATCH 079/137] Move getSynthesizedDeepClone to services/utilities.ts --- src/compiler/factory.ts | 10 ---------- src/services/utilities.ts | 12 ++++++++++++ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index 7d703ffe062..fe183c5e806 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -71,16 +71,6 @@ namespace ts { return clone; } - /** - * Creates a deep, memberwise clone of a node with no source map location. - */ - /* @internal */ - export function getSynthesizedDeepClone(node: T | undefined): T | undefined { - return node - ? getSynthesizedClone(visitEachChild(node, child => getSynthesizedDeepClone(child), nullTransformationContext)) - : undefined; - } - // Literals export function createLiteral(value: string): StringLiteral; diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 6166ceea28c..c22b981b4ff 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -1334,4 +1334,16 @@ namespace ts { } return position; } + + /** + * Creates a deep, memberwise clone of a node with no source map location. + * + * WARNING: This is an expensive operation and is only intended to be used in refactorings + * and code fixes (because those are triggered by explicit user actions). + */ + export function getSynthesizedDeepClone(node: T | undefined): T | undefined { + return node + ? getSynthesizedClone(visitEachChild(node, child => getSynthesizedDeepClone(child), nullTransformationContext)) + : undefined; + } } From 18afd8a50d9d3430062b126c7404501c190376af Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Tue, 10 Oct 2017 13:08:57 -0700 Subject: [PATCH 080/137] Optimize getSynthesizedDeepClone --- src/services/utilities.ts | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/src/services/utilities.ts b/src/services/utilities.ts index c22b981b4ff..5affb8a8887 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -1342,8 +1342,24 @@ namespace ts { * and code fixes (because those are triggered by explicit user actions). */ export function getSynthesizedDeepClone(node: T | undefined): T | undefined { - return node - ? getSynthesizedClone(visitEachChild(node, child => getSynthesizedDeepClone(child), nullTransformationContext)) - : undefined; + if (node === undefined) { + return undefined; + } + + const visited = visitEachChild(node, getSynthesizedDeepClone, nullTransformationContext); + if (visited === node) { + // This only happens for leaf nodes - internal nodes always see their children change. + return getSynthesizedClone(node); + } + + // PERF: As an optimization, rather than calling getSynthesizedClone, we'll update + // the new node created by visitEachChild with the extra changes getSynthesizedClone + // would have made. + + visited.pos = -1; + visited.end = -1; + visited.parent = undefined; + + return visited; } } From 75fea4f5c401c808a77744923b3ae712a0f540a9 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Tue, 10 Oct 2017 15:27:43 -0700 Subject: [PATCH 081/137] Update Authors for TS 2.6 --- .mailmap | 13 ++++++++++++- AUTHORS.md | 11 +++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.mailmap b/.mailmap index 7ae5cb19818..98f004c58dc 100644 --- a/.mailmap +++ b/.mailmap @@ -276,4 +276,15 @@ Francois Wouts Jan Melcher Jan Melcher Matt Mitchell Maxwell Paul Brickner -Tycho Grouwstra \ No newline at end of file +Tycho Grouwstra +Adrian Leonhard +Alex Chugaev +Henry Mercer +Ivan Enderlin +Joe Calzaretta +Magnus Kulke +Stas Vilchik +Taras Mankovski +Thomas den Hollander +Vakhurin Sergey +Zeeshan Ahmed \ No newline at end of file diff --git a/AUTHORS.md b/AUTHORS.md index 4f94a67f7dd..c554a588715 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -3,8 +3,10 @@ TypeScript is authored by: * Abubaker Bashir * Adam Freidin * Adi Dahiya +* Adrian Leonhard * Ahmad Farid * Akshar Patel +* Alex Chugaev * Alex Eagle * Alexander Kuvaev * Alexander Rusakov @@ -105,6 +107,7 @@ TypeScript is authored by: * Halasi Tamás * Harald Niesche * Hendrik Liebau +* Henry Mercer * Herrington Darkholme * Homa Wong * Iain Monro @@ -112,6 +115,7 @@ TypeScript is authored by: * Ika * Ingvar Stepanyan * Isiah Meadows +* Ivan Enderlin * Ivo Gabe de Wolff * Iwata Hidetaka * Jakub Młokosiewicz @@ -127,6 +131,7 @@ TypeScript is authored by: * Jeffrey Morlan * Jesse Schalken * Jiri Tobisek +* Joe Calzaretta * Joe Chung * Joel Day * Joey Wilson @@ -161,6 +166,7 @@ TypeScript is authored by: * Lucien Greathouse * Lukas Elmer * Magnus Hiie +* Magnus Kulke * Manish Giri * Marin Marinov * Marius Schulz @@ -232,13 +238,16 @@ TypeScript is authored by: * Soo Jae Hwang * Stan Thomas * Stanislav Sysoev +* Stas Vilchik * Steve Lucco * Sudheesh Singanamalla * Sébastien Arod * @T18970237136 * @t_ +* Taras Mankovski * Tarik Ozket * Tetsuharu Ohzeki +* Thomas den Hollander * Thomas Loubiou * Tien Hoanhtien * Tim Lancina @@ -253,6 +262,7 @@ TypeScript is authored by: * TruongSinh Tran-Nguyen * Tycho Grouwstra * Vadi Taslim +* Vakhurin Sergey * Vidar Tonaas Fauske * Viktor Zozulyak * Vilic Vane @@ -263,5 +273,6 @@ TypeScript is authored by: * York Yao * @yortus * Yuichi Nukiyama +* Zeeshan Ahmed * Zev Spitz * Zhengbo Li \ No newline at end of file From 611e0f7b4a86de98e96618296a1789a9c47e0223 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 10 Oct 2017 15:37:05 -0700 Subject: [PATCH 082/137] Do not rely on parent pointers in the binder (#19083) --- src/compiler/binder.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 4cacb5765db..35a62a644d8 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -143,6 +143,15 @@ namespace ts { let subtreeTransformFlags: TransformFlags = TransformFlags.None; let skipTransformFlagAggregation: boolean; + /** + * Inside the binder, we may create a diagnostic for an as-yet unbound node (with potentially no parent pointers, implying no accessible source file) + * If so, the node _must_ be in the current file (as that's the only way anything could have traversed to it to yield it as the error node) + * This version of `createDiagnosticForNode` uses the binder's context to account for this, and always yields correct diagnostics even in these situations. + */ + function createDiagnosticForNode(node: Node, message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number): Diagnostic { + return createDiagnosticForNodeInSourceFile(getSourceFileOfNode(node) || file, node, message, arg0, arg1, arg2); + } + function bindSourceFile(f: SourceFile, opts: CompilerOptions) { file = f; options = opts; From 249c2cbaf754164c3f6d0e7a03c53002575b4060 Mon Sep 17 00:00:00 2001 From: Charles Pierce Date: Tue, 10 Oct 2017 15:39:59 -0700 Subject: [PATCH 083/137] Maintain Export Modifier when Refactoring to ES6 Class #18435 (#19070) --- .../refactors/convertFunctionToEs6Class.ts | 10 ++++++++-- ...nvertFunctionToEs6Class_exportModifier1.ts | 19 +++++++++++++++++++ ...nvertFunctionToEs6Class_exportModifier2.ts | 19 +++++++++++++++++++ 3 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 tests/cases/fourslash/convertFunctionToEs6Class_exportModifier1.ts create mode 100644 tests/cases/fourslash/convertFunctionToEs6Class_exportModifier2.ts diff --git a/src/services/refactors/convertFunctionToEs6Class.ts b/src/services/refactors/convertFunctionToEs6Class.ts index e4cd1a42083..110f64d1220 100644 --- a/src/services/refactors/convertFunctionToEs6Class.ts +++ b/src/services/refactors/convertFunctionToEs6Class.ts @@ -243,7 +243,8 @@ namespace ts.refactor.convertFunctionToES6Class { memberElements.unshift(createConstructor(/*decorators*/ undefined, /*modifiers*/ undefined, initializer.parameters, initializer.body)); } - const cls = createClassDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, node.name, + const modifiers = getExportModifierFromSource(precedingNode); + const cls = createClassDeclaration(/*decorators*/ undefined, modifiers, node.name, /*typeParameters*/ undefined, /*heritageClauses*/ undefined, memberElements); // Don't call copyComments here because we'll already leave them in place return cls; @@ -255,10 +256,15 @@ namespace ts.refactor.convertFunctionToES6Class { memberElements.unshift(createConstructor(/*decorators*/ undefined, /*modifiers*/ undefined, node.parameters, node.body)); } - const cls = createClassDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, node.name, + const modifiers = getExportModifierFromSource(node); + const cls = createClassDeclaration(/*decorators*/ undefined, modifiers, node.name, /*typeParameters*/ undefined, /*heritageClauses*/ undefined, memberElements); // Don't call copyComments here because we'll already leave them in place return cls; } + + function getExportModifierFromSource(source: Node) { + return filter(source.modifiers, modifier => modifier.kind === SyntaxKind.ExportKeyword); + } } } \ No newline at end of file diff --git a/tests/cases/fourslash/convertFunctionToEs6Class_exportModifier1.ts b/tests/cases/fourslash/convertFunctionToEs6Class_exportModifier1.ts new file mode 100644 index 00000000000..940a68a05b6 --- /dev/null +++ b/tests/cases/fourslash/convertFunctionToEs6Class_exportModifier1.ts @@ -0,0 +1,19 @@ +/// + +// @allowNonTsExtensions: true +// @Filename: test123.js +////export function /**/MyClass() { +////} +////MyClass.prototype.foo = function() { +////} + +verify.applicableRefactorAvailableAtMarker(""); +verify.fileAfterApplyingRefactorAtMarker("", +`export class MyClass { + constructor() { + } + foo() { + } +} +`, +'Convert to ES2015 class', 'convert'); diff --git a/tests/cases/fourslash/convertFunctionToEs6Class_exportModifier2.ts b/tests/cases/fourslash/convertFunctionToEs6Class_exportModifier2.ts new file mode 100644 index 00000000000..fb1276d4f03 --- /dev/null +++ b/tests/cases/fourslash/convertFunctionToEs6Class_exportModifier2.ts @@ -0,0 +1,19 @@ +/// + +// @allowNonTsExtensions: true +// @Filename: test123.js +////export const /**/foo = function() { +////}; +////foo.prototype.instanceMethod = function() { +////}; + +verify.applicableRefactorAvailableAtMarker(""); +verify.fileAfterApplyingRefactorAtMarker("", +`export class foo { + constructor() { + } + instanceMethod() { + } +} +`, +'Convert to ES2015 class', 'convert'); From d086b637c53b391922b8f2671a37f9f062e46102 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 10 Oct 2017 15:52:41 -0700 Subject: [PATCH 084/137] Remove `removeWhere` (#19082) --- src/compiler/core.ts | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 45a4a04b6ab..fb5000a58bf 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -356,21 +356,6 @@ namespace ts { return array; } - export function removeWhere(array: T[], f: (x: T) => boolean): boolean { - let outIndex = 0; - for (const item of array) { - if (!f(item)) { - array[outIndex] = item; - outIndex++; - } - } - if (outIndex !== array.length) { - array.length = outIndex; - return true; - } - return false; - } - export function filterMutate(array: T[], f: (x: T, i: number, array: T[]) => boolean): void { let outIndex = 0; for (let i = 0; i < array.length; i++) { From 55bbcff348b49d063efe91e5d22e957ddb358076 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 10 Oct 2017 16:36:09 -0700 Subject: [PATCH 085/137] Modify the changesAffectModuleResolution check --- src/compiler/watch.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/watch.ts b/src/compiler/watch.ts index 1ab80e659f4..4fc67c1cc8f 100644 --- a/src/compiler/watch.ts +++ b/src/compiler/watch.ts @@ -322,7 +322,7 @@ namespace ts { if (hasChangedCompilerOptions) { newLine = getNewLineCharacter(compilerOptions, system); - if (changesAffectModuleResolution(program && program.getCompilerOptions(), compilerOptions)) { + if (program && changesAffectModuleResolution(program.getCompilerOptions(), compilerOptions)) { resolutionCache.clear(); } } From cb326ed298599673a437ca719de032d8bed6501d Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 10 Oct 2017 16:39:13 -0700 Subject: [PATCH 086/137] Function to clear the per directory resolution --- src/compiler/resolutionCache.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/compiler/resolutionCache.ts b/src/compiler/resolutionCache.ts index 680ed98a84a..faf5fb2a9f4 100644 --- a/src/compiler/resolutionCache.ts +++ b/src/compiler/resolutionCache.ts @@ -107,7 +107,9 @@ namespace ts { return { startRecordingFilesWithChangedResolutions, finishRecordingFilesWithChangedResolutions, - startCachingPerDirectoryResolution, + // perDirectoryResolvedModuleNames and perDirectoryResolvedTypeReferenceDirectives could be non empty if there was exception during program update + // (between startCachingPerDirectoryResolution and finishCachingPerDirectoryResolution) + startCachingPerDirectoryResolution: clearPerDirectoryResolutions, finishCachingPerDirectoryResolution, resolveModuleNames, resolveTypeReferenceDirectives, @@ -143,8 +145,7 @@ namespace ts { allFilesHaveInvalidatedResolution = false; // perDirectoryResolvedModuleNames and perDirectoryResolvedTypeReferenceDirectives could be non empty if there was exception during program update // (between startCachingPerDirectoryResolution and finishCachingPerDirectoryResolution) - perDirectoryResolvedModuleNames.clear(); - perDirectoryResolvedTypeReferenceDirectives.clear(); + clearPerDirectoryResolutions(); } function startRecordingFilesWithChangedResolutions() { @@ -168,9 +169,7 @@ namespace ts { return path => collected && collected.has(path); } - function startCachingPerDirectoryResolution() { - // perDirectoryResolvedModuleNames and perDirectoryResolvedTypeReferenceDirectives could be non empty if there was exception during program update - // (between startCachingPerDirectoryResolution and finishCachingPerDirectoryResolution) + function clearPerDirectoryResolutions() { perDirectoryResolvedModuleNames.clear(); perDirectoryResolvedTypeReferenceDirectives.clear(); } @@ -184,8 +183,7 @@ namespace ts { } }); - perDirectoryResolvedModuleNames.clear(); - perDirectoryResolvedTypeReferenceDirectives.clear(); + clearPerDirectoryResolutions(); } function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): ResolvedModuleWithFailedLookupLocations { From edf0a95e891da48b6206710e13c55eb018870ddd Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 10 Oct 2017 16:41:54 -0700 Subject: [PATCH 087/137] Stop erroneous match of midfile sourceMappingUrl (#19084) --- src/harness/unittests/compileOnSave.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/harness/unittests/compileOnSave.ts b/src/harness/unittests/compileOnSave.ts index 1e765054eee..fdec5b192ee 100644 --- a/src/harness/unittests/compileOnSave.ts +++ b/src/harness/unittests/compileOnSave.ts @@ -619,7 +619,7 @@ namespace ts.projectSystem { assert.isTrue(host.fileExists(expectedOutFileName)); const outFileContent = host.readFile(expectedOutFileName); verifyContentHasString(outFileContent, file1.content); - verifyContentHasString(outFileContent, `//# sourceMappingURL=${outFileName}.map`); + verifyContentHasString(outFileContent, `//# ${"sourceMappingURL"}=${outFileName}.map`); // Sometimes tools can sometimes see this line as a source mapping url comment, so we obfuscate it a little // Verify map file const expectedMapFileName = expectedOutFileName + ".map"; From e30a66d22f913b824427fd1323dfd82af20c8a76 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 10 Oct 2017 17:08:47 -0700 Subject: [PATCH 088/137] Add utitlity for stringContains --- src/compiler/checker.ts | 2 +- src/compiler/core.ts | 8 ++++++-- src/compiler/declarationEmitter.ts | 2 +- src/compiler/emitter.ts | 2 +- src/compiler/moduleNameResolver.ts | 2 +- src/compiler/resolutionCache.ts | 3 +-- src/server/editorServices.ts | 2 +- src/server/session.ts | 2 +- src/server/typingsInstaller/nodeTypingsInstaller.ts | 2 +- src/services/pathCompletions.ts | 4 ++-- src/services/refactors/extractSymbol.ts | 2 +- src/services/services.ts | 2 +- 12 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d47a77a7440..ab61d91ef15 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -14012,7 +14012,7 @@ namespace ts { */ function isUnhyphenatedJsxName(name: string | __String) { // - is the only character supported in JSX attribute names that isn't valid in JavaScript identifiers - return (name as string).indexOf("-") < 0; + return !stringContains(name as string, "-"); } /** diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 45a4a04b6ab..442a262bbe2 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -1663,7 +1663,7 @@ namespace ts { } export function isUrl(path: string) { - return path && !isRootedDiskPath(path) && path.indexOf("://") !== -1; + return path && !isRootedDiskPath(path) && stringContains(path, "://"); } export function pathIsRelative(path: string): boolean { @@ -1932,8 +1932,12 @@ namespace ts { return expectedPos >= 0 && str.indexOf(suffix, expectedPos) === expectedPos; } + export function stringContains(str: string, substring: string): boolean { + return str.indexOf(substring) !== -1; + } + export function hasExtension(fileName: string): boolean { - return getBaseFileName(fileName).indexOf(".") >= 0; + return stringContains(getBaseFileName(fileName), "."); } export function fileExtensionIs(path: string, extension: string): boolean { diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index 3de20915029..48b97b048e9 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -172,7 +172,7 @@ namespace ts { function hasInternalAnnotation(range: CommentRange) { const comment = currentText.substring(range.pos, range.end); - return comment.indexOf("@internal") >= 0; + return stringContains(comment, "@internal"); } function stripInternal(node: Node) { diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 8083b3841c8..da6c0e0fca8 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -1226,7 +1226,7 @@ namespace ts { // check if numeric literal is a decimal literal that was originally written with a dot const text = getLiteralTextOfNode(expression); return !expression.numericLiteralFlags - && text.indexOf(tokenToString(SyntaxKind.DotToken)) < 0; + && !stringContains(text, tokenToString(SyntaxKind.DotToken)); } else if (isPropertyAccessExpression(expression) || isElementAccessExpression(expression)) { // check if constant enum value is integer diff --git a/src/compiler/moduleNameResolver.ts b/src/compiler/moduleNameResolver.ts index 560beb39557..ac83dd41311 100644 --- a/src/compiler/moduleNameResolver.ts +++ b/src/compiler/moduleNameResolver.ts @@ -1061,7 +1061,7 @@ namespace ts { export function getPackageNameFromAtTypesDirectory(mangledName: string): string { const withoutAtTypePrefix = removePrefix(mangledName, "@types/"); if (withoutAtTypePrefix !== mangledName) { - return withoutAtTypePrefix.indexOf(mangledScopedPackageSeparator) !== -1 ? + return stringContains(withoutAtTypePrefix, mangledScopedPackageSeparator) ? "@" + withoutAtTypePrefix.replace(mangledScopedPackageSeparator, ts.directorySeparator) : withoutAtTypePrefix; } diff --git a/src/compiler/resolutionCache.ts b/src/compiler/resolutionCache.ts index 25545c0efbc..3f3955b294f 100644 --- a/src/compiler/resolutionCache.ts +++ b/src/compiler/resolutionCache.ts @@ -324,7 +324,7 @@ namespace ts { let dirPath = getDirectoryPath(failedLookupLocationPath); // If directory path contains node module, get the most parent node_modules directory for watching - while (dirPath.indexOf("/node_modules/") !== -1) { + while (stringContains(dirPath, "/node_modules/")) { dir = getDirectoryPath(dir); dirPath = getDirectoryPath(dirPath); } @@ -334,7 +334,6 @@ namespace ts { return { dir, dirPath }; } - // Use some ancestor of the root directory if (rootPath !== undefined) { while (!isInDirectoryPath(dirPath, rootPath)) { diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 2916fb60c57..c683ff0080a 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -1205,7 +1205,7 @@ namespace ts.server { projectRootPath?: NormalizedPath) { let searchPath = asNormalizedPath(getDirectoryPath(info.fileName)); - while (!projectRootPath || searchPath.indexOf(projectRootPath) >= 0) { + while (!projectRootPath || stringContains(searchPath, projectRootPath)) { const canonicalSearchPath = normalizedPathToPath(searchPath, this.currentDirectory, this.toCanonicalFileName); const tsconfigFileName = asNormalizedPath(combinePaths(searchPath, "tsconfig.json")); let result = action(tsconfigFileName, combinePaths(canonicalSearchPath, "tsconfig.json")); diff --git a/src/server/session.ts b/src/server/session.ts index 57dac7ec799..df9c77b9005 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -1608,7 +1608,7 @@ namespace ts.server { } // No need to analyze lib.d.ts - const fileNamesInProject = fileNames.filter(value => value.indexOf("lib.d.ts") < 0); + const fileNamesInProject = fileNames.filter(value => !stringContains(value, "lib.d.ts")); if (fileNamesInProject.length === 0) { return; } diff --git a/src/server/typingsInstaller/nodeTypingsInstaller.ts b/src/server/typingsInstaller/nodeTypingsInstaller.ts index 6a31a114d23..f5d9b866376 100644 --- a/src/server/typingsInstaller/nodeTypingsInstaller.ts +++ b/src/server/typingsInstaller/nodeTypingsInstaller.ts @@ -88,7 +88,7 @@ namespace ts.server.typingsInstaller { this.npmPath = npmLocation !== undefined ? npmLocation : getDefaultNPMLocation(process.argv[0]); // If the NPM path contains spaces and isn't wrapped in quotes, do so. - if (this.npmPath.indexOf(" ") !== -1 && this.npmPath[0] !== `"`) { + if (stringContains(this.npmPath, " ") && this.npmPath[0] !== `"`) { this.npmPath = `"${this.npmPath}"`; } if (this.log.isEnabled()) { diff --git a/src/services/pathCompletions.ts b/src/services/pathCompletions.ts index c41ed798b1d..e3bf9deac89 100644 --- a/src/services/pathCompletions.ts +++ b/src/services/pathCompletions.ts @@ -195,7 +195,7 @@ namespace ts.Completions.PathCompletions { const normalizedPrefixDirectory = getDirectoryPath(normalizedPrefix); const normalizedPrefixBase = getBaseFileName(normalizedPrefix); - const fragmentHasPath = fragment.indexOf(directorySeparator) !== -1; + const fragmentHasPath = stringContains(fragment, directorySeparator); // Try and expand the prefix to include any path from the fragment so that we can limit the readDirectory call const expandedPrefixDirectory = fragmentHasPath ? combinePaths(normalizedPrefixDirectory, normalizedPrefixBase + getDirectoryPath(fragment)) : normalizedPrefixDirectory; @@ -235,7 +235,7 @@ namespace ts.Completions.PathCompletions { function enumeratePotentialNonRelativeModules(fragment: string, scriptPath: string, options: CompilerOptions, typeChecker: TypeChecker, host: LanguageServiceHost): string[] { // Check If this is a nested module - const isNestedModule = fragment.indexOf(directorySeparator) !== -1; + const isNestedModule = stringContains(fragment, directorySeparator); const moduleNameFragment = isNestedModule ? fragment.substr(0, fragment.lastIndexOf(directorySeparator)) : undefined; // Get modules that the type checker picked up diff --git a/src/services/refactors/extractSymbol.ts b/src/services/refactors/extractSymbol.ts index c16a290a30f..124a1f720bd 100644 --- a/src/services/refactors/extractSymbol.ts +++ b/src/services/refactors/extractSymbol.ts @@ -660,7 +660,7 @@ namespace ts.refactor.extractSymbol { function getUniqueName(baseName: string, fileText: string): string { let nameText = baseName; - for (let i = 1; fileText.indexOf(nameText) !== -1; i++) { + for (let i = 1; stringContains(fileText, nameText); i++) { nameText = `${baseName}_${i}`; } return nameText; diff --git a/src/services/services.ts b/src/services/services.ts index bc733a4e2fe..6bdc96d8b4d 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1952,7 +1952,7 @@ namespace ts { function isNodeModulesFile(path: string): boolean { const node_modulesFolderName = "/node_modules/"; - return path.indexOf(node_modulesFolderName) !== -1; + return stringContains(path, node_modulesFolderName); } } From 52d7c7278d7b6d3995777980e73466d630b53837 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 10 Oct 2017 17:14:32 -0700 Subject: [PATCH 089/137] Add comment about swallowing exception --- src/server/server.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/server/server.ts b/src/server/server.ts index 7917f6fb544..f24251ee6ac 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -753,11 +753,13 @@ namespace ts.server { const sys = ts.sys; // use watchGuard process on Windows when node version is 4 or later const useWatchGuard = process.platform === "win32" && getNodeMajorVersion() >= 4; - const originalWatchDirectory = sys.watchDirectory; + const originalWatchDirectory: ServerHost["watchDirectory"] = sys.watchDirectory.bind(sys); const noopWatcher: FileWatcher = { close: noop }; + // This is the function that catches the exceptions when watching directory, and yet lets project service continue to function + // Eg. on linux the number of watches are limited and one could easily exhaust watches and the exception ENOSPC is thrown when creating watcher at that point function watchDirectorySwallowingException(path: string, callback: DirectoryWatcherCallback, recursive?: boolean): FileWatcher { try { - return originalWatchDirectory.call(sys, path, callback, recursive); + return originalWatchDirectory(path, callback, recursive); } catch (e) { logger.info(`Exception when creating directory watcher: ${e.message}`); From 856961b84ceb96098fba52ddac76c9d3ed0b0032 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 10 Oct 2017 17:20:10 -0700 Subject: [PATCH 090/137] Add regression test for #18668 (#19085) --- .../castFunctionExpressionShouldBeParenthesized.js | 5 +++++ ...astFunctionExpressionShouldBeParenthesized.symbols | 4 ++++ .../castFunctionExpressionShouldBeParenthesized.types | 11 +++++++++++ .../castFunctionExpressionShouldBeParenthesized.ts | 1 + 4 files changed, 21 insertions(+) create mode 100644 tests/baselines/reference/castFunctionExpressionShouldBeParenthesized.js create mode 100644 tests/baselines/reference/castFunctionExpressionShouldBeParenthesized.symbols create mode 100644 tests/baselines/reference/castFunctionExpressionShouldBeParenthesized.types create mode 100644 tests/cases/compiler/castFunctionExpressionShouldBeParenthesized.ts diff --git a/tests/baselines/reference/castFunctionExpressionShouldBeParenthesized.js b/tests/baselines/reference/castFunctionExpressionShouldBeParenthesized.js new file mode 100644 index 00000000000..e96b93bae85 --- /dev/null +++ b/tests/baselines/reference/castFunctionExpressionShouldBeParenthesized.js @@ -0,0 +1,5 @@ +//// [castFunctionExpressionShouldBeParenthesized.ts] +(function a() { } as any)().foo() + +//// [castFunctionExpressionShouldBeParenthesized.js] +(function a() { }().foo()); diff --git a/tests/baselines/reference/castFunctionExpressionShouldBeParenthesized.symbols b/tests/baselines/reference/castFunctionExpressionShouldBeParenthesized.symbols new file mode 100644 index 00000000000..975a9480c3c --- /dev/null +++ b/tests/baselines/reference/castFunctionExpressionShouldBeParenthesized.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/castFunctionExpressionShouldBeParenthesized.ts === +(function a() { } as any)().foo() +>a : Symbol(a, Decl(castFunctionExpressionShouldBeParenthesized.ts, 0, 1)) + diff --git a/tests/baselines/reference/castFunctionExpressionShouldBeParenthesized.types b/tests/baselines/reference/castFunctionExpressionShouldBeParenthesized.types new file mode 100644 index 00000000000..337c5163ff2 --- /dev/null +++ b/tests/baselines/reference/castFunctionExpressionShouldBeParenthesized.types @@ -0,0 +1,11 @@ +=== tests/cases/compiler/castFunctionExpressionShouldBeParenthesized.ts === +(function a() { } as any)().foo() +>(function a() { } as any)().foo() : any +>(function a() { } as any)().foo : any +>(function a() { } as any)() : any +>(function a() { } as any) : any +>function a() { } as any : any +>function a() { } : () => void +>a : () => void +>foo : any + diff --git a/tests/cases/compiler/castFunctionExpressionShouldBeParenthesized.ts b/tests/cases/compiler/castFunctionExpressionShouldBeParenthesized.ts new file mode 100644 index 00000000000..3fb1aaf7079 --- /dev/null +++ b/tests/cases/compiler/castFunctionExpressionShouldBeParenthesized.ts @@ -0,0 +1 @@ +(function a() { } as any)().foo() \ No newline at end of file From 5a1d846e76d01069d8fc6af9e3edf16c66990829 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 10 Oct 2017 17:34:16 -0700 Subject: [PATCH 091/137] Properly account for possibly referenced type parameters --- src/compiler/checker.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 58ac3bc52c0..ed131c8936c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -8258,11 +8258,11 @@ namespace ts { // The first time an anonymous type is instantiated we compute and store a list of the type // parameters that are in scope (and therefore potentially referenced). For type literals that // aren't the right hand side of a generic type alias declaration we optimize by reducing the - // set of type parameters to those that are actually referenced somewhere in the literal. + // set of type parameters to those that are possibly referenced in the literal. const declaration = symbol.declarations[0]; const outerTypeParameters = getOuterTypeParameters(declaration, /*includeThisTypes*/ true) || emptyArray; typeParameters = symbol.flags & SymbolFlags.TypeLiteral && !target.aliasTypeArguments ? - filter(outerTypeParameters, tp => isTypeParameterReferencedWithin(tp, declaration)) : + filter(outerTypeParameters, tp => isTypeParameterPossiblyReferenced(tp, declaration)) : outerTypeParameters; links.typeParameters = typeParameters; if (typeParameters.length) { @@ -8288,8 +8288,17 @@ namespace ts { return type; } - function isTypeParameterReferencedWithin(tp: TypeParameter, node: Node) { - return tp.isThisType ? forEachChild(node, checkThis) : forEachChild(node, checkIdentifier); + function isTypeParameterPossiblyReferenced(tp: TypeParameter, node: Node) { + // If the type parameter doesn't have exactly one declaration, if there are invening statement blocks + // between the node and the type parameter declaration, or if the node contains actual references to the + // type parameter, we consider the type parameter possibly referenced. + if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { + const container = tp.symbol.declarations[0].parent; + if (findAncestor(node, n => n.kind === SyntaxKind.Block ? "quit" : n === container)) { + return tp.isThisType ? forEachChild(node, checkThis) : forEachChild(node, checkIdentifier); + } + } + return true; function checkThis(node: Node): boolean { return node.kind === SyntaxKind.ThisType || forEachChild(node, checkThis); } From 83020dbbd6c43ecdbebe7bf6a65b573eb6038aa3 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 10 Oct 2017 17:34:32 -0700 Subject: [PATCH 092/137] Add regression test --- .../indirectTypeParameterReferences.ts | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/cases/compiler/indirectTypeParameterReferences.ts diff --git a/tests/cases/compiler/indirectTypeParameterReferences.ts b/tests/cases/compiler/indirectTypeParameterReferences.ts new file mode 100644 index 00000000000..210a599354d --- /dev/null +++ b/tests/cases/compiler/indirectTypeParameterReferences.ts @@ -0,0 +1,24 @@ +// Repro from #19043 + +type B = {b: string} + +const flowtypes = (b: B) => { + type Combined = A & B + + const combined = (fn: (combined: Combined) => void) => null + const literal = (fn: (aPlusB: A & B) => void) => null + + return {combined, literal} +} + +const {combined, literal} = flowtypes<{a: string}>({b: 'b-value'}) + +literal(aPlusB => { + aPlusB.b + aPlusB.a +}) + +combined(comb => { + comb.b + comb.a +}) From d815ba13f8b67847935c386102288e754f3894de Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 10 Oct 2017 17:34:44 -0700 Subject: [PATCH 093/137] Accept new baselines --- .../indirectTypeParameterReferences.js | 43 +++++++++ .../indirectTypeParameterReferences.symbols | 75 ++++++++++++++++ .../indirectTypeParameterReferences.types | 88 +++++++++++++++++++ 3 files changed, 206 insertions(+) create mode 100644 tests/baselines/reference/indirectTypeParameterReferences.js create mode 100644 tests/baselines/reference/indirectTypeParameterReferences.symbols create mode 100644 tests/baselines/reference/indirectTypeParameterReferences.types diff --git a/tests/baselines/reference/indirectTypeParameterReferences.js b/tests/baselines/reference/indirectTypeParameterReferences.js new file mode 100644 index 00000000000..e6e807a4720 --- /dev/null +++ b/tests/baselines/reference/indirectTypeParameterReferences.js @@ -0,0 +1,43 @@ +//// [indirectTypeParameterReferences.ts] +// Repro from #19043 + +type B = {b: string} + +const flowtypes = (b: B) => { + type Combined = A & B + + const combined = (fn: (combined: Combined) => void) => null + const literal = (fn: (aPlusB: A & B) => void) => null + + return {combined, literal} +} + +const {combined, literal} = flowtypes<{a: string}>({b: 'b-value'}) + +literal(aPlusB => { + aPlusB.b + aPlusB.a +}) + +combined(comb => { + comb.b + comb.a +}) + + +//// [indirectTypeParameterReferences.js] +// Repro from #19043 +var flowtypes = function (b) { + var combined = function (fn) { return null; }; + var literal = function (fn) { return null; }; + return { combined: combined, literal: literal }; +}; +var _a = flowtypes({ b: 'b-value' }), combined = _a.combined, literal = _a.literal; +literal(function (aPlusB) { + aPlusB.b; + aPlusB.a; +}); +combined(function (comb) { + comb.b; + comb.a; +}); diff --git a/tests/baselines/reference/indirectTypeParameterReferences.symbols b/tests/baselines/reference/indirectTypeParameterReferences.symbols new file mode 100644 index 00000000000..0cb091a8622 --- /dev/null +++ b/tests/baselines/reference/indirectTypeParameterReferences.symbols @@ -0,0 +1,75 @@ +=== tests/cases/compiler/indirectTypeParameterReferences.ts === +// Repro from #19043 + +type B = {b: string} +>B : Symbol(B, Decl(indirectTypeParameterReferences.ts, 0, 0)) +>b : Symbol(b, Decl(indirectTypeParameterReferences.ts, 2, 10)) + +const flowtypes = (b: B) => { +>flowtypes : Symbol(flowtypes, Decl(indirectTypeParameterReferences.ts, 4, 5)) +>A : Symbol(A, Decl(indirectTypeParameterReferences.ts, 4, 19)) +>b : Symbol(b, Decl(indirectTypeParameterReferences.ts, 4, 22)) +>B : Symbol(B, Decl(indirectTypeParameterReferences.ts, 0, 0)) + + type Combined = A & B +>Combined : Symbol(Combined, Decl(indirectTypeParameterReferences.ts, 4, 32)) +>A : Symbol(A, Decl(indirectTypeParameterReferences.ts, 4, 19)) +>B : Symbol(B, Decl(indirectTypeParameterReferences.ts, 0, 0)) + + const combined = (fn: (combined: Combined) => void) => null +>combined : Symbol(combined, Decl(indirectTypeParameterReferences.ts, 7, 7)) +>fn : Symbol(fn, Decl(indirectTypeParameterReferences.ts, 7, 20)) +>combined : Symbol(combined, Decl(indirectTypeParameterReferences.ts, 7, 25)) +>Combined : Symbol(Combined, Decl(indirectTypeParameterReferences.ts, 4, 32)) + + const literal = (fn: (aPlusB: A & B) => void) => null +>literal : Symbol(literal, Decl(indirectTypeParameterReferences.ts, 8, 7)) +>fn : Symbol(fn, Decl(indirectTypeParameterReferences.ts, 8, 19)) +>aPlusB : Symbol(aPlusB, Decl(indirectTypeParameterReferences.ts, 8, 24)) +>A : Symbol(A, Decl(indirectTypeParameterReferences.ts, 4, 19)) +>B : Symbol(B, Decl(indirectTypeParameterReferences.ts, 0, 0)) + + return {combined, literal} +>combined : Symbol(combined, Decl(indirectTypeParameterReferences.ts, 10, 10)) +>literal : Symbol(literal, Decl(indirectTypeParameterReferences.ts, 10, 19)) +} + +const {combined, literal} = flowtypes<{a: string}>({b: 'b-value'}) +>combined : Symbol(combined, Decl(indirectTypeParameterReferences.ts, 13, 7)) +>literal : Symbol(literal, Decl(indirectTypeParameterReferences.ts, 13, 16)) +>flowtypes : Symbol(flowtypes, Decl(indirectTypeParameterReferences.ts, 4, 5)) +>a : Symbol(a, Decl(indirectTypeParameterReferences.ts, 13, 39)) +>b : Symbol(b, Decl(indirectTypeParameterReferences.ts, 13, 52)) + +literal(aPlusB => { +>literal : Symbol(literal, Decl(indirectTypeParameterReferences.ts, 13, 16)) +>aPlusB : Symbol(aPlusB, Decl(indirectTypeParameterReferences.ts, 15, 8)) + + aPlusB.b +>aPlusB.b : Symbol(b, Decl(indirectTypeParameterReferences.ts, 2, 10)) +>aPlusB : Symbol(aPlusB, Decl(indirectTypeParameterReferences.ts, 15, 8)) +>b : Symbol(b, Decl(indirectTypeParameterReferences.ts, 2, 10)) + + aPlusB.a +>aPlusB.a : Symbol(a, Decl(indirectTypeParameterReferences.ts, 13, 39)) +>aPlusB : Symbol(aPlusB, Decl(indirectTypeParameterReferences.ts, 15, 8)) +>a : Symbol(a, Decl(indirectTypeParameterReferences.ts, 13, 39)) + +}) + +combined(comb => { +>combined : Symbol(combined, Decl(indirectTypeParameterReferences.ts, 13, 7)) +>comb : Symbol(comb, Decl(indirectTypeParameterReferences.ts, 20, 9)) + + comb.b +>comb.b : Symbol(b, Decl(indirectTypeParameterReferences.ts, 2, 10)) +>comb : Symbol(comb, Decl(indirectTypeParameterReferences.ts, 20, 9)) +>b : Symbol(b, Decl(indirectTypeParameterReferences.ts, 2, 10)) + + comb.a +>comb.a : Symbol(a, Decl(indirectTypeParameterReferences.ts, 13, 39)) +>comb : Symbol(comb, Decl(indirectTypeParameterReferences.ts, 20, 9)) +>a : Symbol(a, Decl(indirectTypeParameterReferences.ts, 13, 39)) + +}) + diff --git a/tests/baselines/reference/indirectTypeParameterReferences.types b/tests/baselines/reference/indirectTypeParameterReferences.types new file mode 100644 index 00000000000..2a8ac9a8b08 --- /dev/null +++ b/tests/baselines/reference/indirectTypeParameterReferences.types @@ -0,0 +1,88 @@ +=== tests/cases/compiler/indirectTypeParameterReferences.ts === +// Repro from #19043 + +type B = {b: string} +>B : B +>b : string + +const flowtypes = (b: B) => { +>flowtypes : (b: B) => { combined: (fn: (combined: A & B) => void) => any; literal: (fn: (aPlusB: A & B) => void) => any; } +>(b: B) => { type Combined = A & B const combined = (fn: (combined: Combined) => void) => null const literal = (fn: (aPlusB: A & B) => void) => null return {combined, literal}} : (b: B) => { combined: (fn: (combined: A & B) => void) => any; literal: (fn: (aPlusB: A & B) => void) => any; } +>A : A +>b : B +>B : B + + type Combined = A & B +>Combined : A & B +>A : A +>B : B + + const combined = (fn: (combined: Combined) => void) => null +>combined : (fn: (combined: A & B) => void) => any +>(fn: (combined: Combined) => void) => null : (fn: (combined: A & B) => void) => any +>fn : (combined: A & B) => void +>combined : A & B +>Combined : A & B +>null : null + + const literal = (fn: (aPlusB: A & B) => void) => null +>literal : (fn: (aPlusB: A & B) => void) => any +>(fn: (aPlusB: A & B) => void) => null : (fn: (aPlusB: A & B) => void) => any +>fn : (aPlusB: A & B) => void +>aPlusB : A & B +>A : A +>B : B +>null : null + + return {combined, literal} +>{combined, literal} : { combined: (fn: (combined: A & B) => void) => any; literal: (fn: (aPlusB: A & B) => void) => any; } +>combined : (fn: (combined: A & B) => void) => any +>literal : (fn: (aPlusB: A & B) => void) => any +} + +const {combined, literal} = flowtypes<{a: string}>({b: 'b-value'}) +>combined : (fn: (combined: { a: string; } & B) => void) => any +>literal : (fn: (aPlusB: { a: string; } & B) => void) => any +>flowtypes<{a: string}>({b: 'b-value'}) : { combined: (fn: (combined: { a: string; } & B) => void) => any; literal: (fn: (aPlusB: { a: string; } & B) => void) => any; } +>flowtypes : (b: B) => { combined: (fn: (combined: A & B) => void) => any; literal: (fn: (aPlusB: A & B) => void) => any; } +>a : string +>{b: 'b-value'} : { b: string; } +>b : string +>'b-value' : "b-value" + +literal(aPlusB => { +>literal(aPlusB => { aPlusB.b aPlusB.a}) : any +>literal : (fn: (aPlusB: { a: string; } & B) => void) => any +>aPlusB => { aPlusB.b aPlusB.a} : (aPlusB: { a: string; } & B) => void +>aPlusB : { a: string; } & B + + aPlusB.b +>aPlusB.b : string +>aPlusB : { a: string; } & B +>b : string + + aPlusB.a +>aPlusB.a : string +>aPlusB : { a: string; } & B +>a : string + +}) + +combined(comb => { +>combined(comb => { comb.b comb.a}) : any +>combined : (fn: (combined: { a: string; } & B) => void) => any +>comb => { comb.b comb.a} : (comb: { a: string; } & B) => void +>comb : { a: string; } & B + + comb.b +>comb.b : string +>comb : { a: string; } & B +>b : string + + comb.a +>comb.a : string +>comb : { a: string; } & B +>a : string + +}) + From c5b4f5e7e72516f2cb946a189e1b06fed17ef199 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 10 Oct 2017 16:28:44 -0700 Subject: [PATCH 094/137] Use filterMutate instead of removeWhere --- src/harness/unittests/telemetry.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/harness/unittests/telemetry.ts b/src/harness/unittests/telemetry.ts index d2a54fdc1bb..25120af45c1 100644 --- a/src/harness/unittests/telemetry.ts +++ b/src/harness/unittests/telemetry.ts @@ -257,11 +257,12 @@ namespace ts.projectSystem { getEventsWithName(eventName: T["eventName"]): ReadonlyArray { let events: T[]; - removeWhere(this.events, event => { + filterMutate(this.events, event => { if (event.eventName === eventName) { (events || (events = [])).push(event as T); - return true; + return false; } + return true; }); return events || emptyArray; } @@ -291,14 +292,15 @@ namespace ts.projectSystem { getEvent(eventName: T["eventName"]): T["data"] { let event: server.ProjectServiceEvent; - removeWhere(this.events, e => { + filterMutate(this.events, e => { if (e.eventName === eventName) { if (event) { assert(false, "more than one event found"); } event = e; - return true; + return false; } + return true; }); assert.equal(event.eventName, eventName); return event.data; From bb4abbd95ecb20ba3e7e4ca12dfe41b1c80533c5 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 10 Oct 2017 17:37:02 -0700 Subject: [PATCH 095/137] Do not generate config file diagnostics event when the file opened doesnot belong to the configured project --- src/harness/unittests/tsserverProjectSystem.ts | 11 ++--------- src/server/editorServices.ts | 10 ++++------ 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index 3d244fd30f8..04b848e7cdf 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -3168,7 +3168,7 @@ namespace ts.projectSystem { serverEventManager.checkEventCountOfType("configFileDiag", 3); }); - it("are generated when the config file doesnot include file opened but has errors", () => { + it("are not generated when the config file doesnot include file opened and config file has errors", () => { const serverEventManager = new TestServerEventManager(); const file = { path: "/a/b/app.ts", @@ -3195,14 +3195,7 @@ namespace ts.projectSystem { eventHandler: serverEventManager.handler }); openFilesForSession([file2], session); - serverEventManager.checkEventCountOfType("configFileDiag", 1); - for (const event of serverEventManager.events) { - if (event.eventName === "configFileDiag") { - assert.equal(event.data.configFileName, configFile.path); - assert.equal(event.data.triggerFile, file2.path); - return; - } - } + serverEventManager.checkEventCountOfType("configFileDiag", 0); }); it("are not generated when the config file doesnot include file opened and doesnt contain any errors", () => { diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index fd229747390..765a3188443 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -1933,12 +1933,10 @@ namespace ts.server { // At this point if file is part of any any configured or external project, then it would be present in the containing projects // So if it still doesnt have any containing projects, it needs to be part of inferred project if (info.isOrphan()) { - // Since the file isnt part of configured project, - // report config file and its error only if config file found had errors (and hence may be didnt include the file) - if (sendConfigFileDiagEvent && !project.getAllProjectErrors().length) { - configFileName = undefined; - sendConfigFileDiagEvent = false; - } + // Since the file isnt part of configured project, do not send config file event + configFileName = undefined; + sendConfigFileDiagEvent = false; + this.assignOrphanScriptInfoToInferredProject(info, projectRootPath); } this.addToListOfOpenFiles(info); From d0168af142dfcaa0310a6825cfd67e5e0e51da1c Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Tue, 10 Oct 2017 17:59:43 -0700 Subject: [PATCH 096/137] Functioning parallel unittests (#18956) --- src/harness/parallel/host.ts | 50 ++++++++++++++++++++-------- src/harness/parallel/shared.ts | 4 +-- src/harness/parallel/worker.ts | 60 ++++++++++++++++++++++++---------- 3 files changed, 81 insertions(+), 33 deletions(-) diff --git a/src/harness/parallel/host.ts b/src/harness/parallel/host.ts index 2aaa4f78728..d7bba70408e 100644 --- a/src/harness/parallel/host.ts +++ b/src/harness/parallel/host.ts @@ -38,20 +38,45 @@ namespace Harness.Parallel.Host { return undefined; } - function hashName(runner: TestRunnerKind, test: string) { + function hashName(runner: TestRunnerKind | "unittest", test: string) { return `tsrunner-${runner}://${test}`; } + let tasks: { runner: TestRunnerKind | "unittest", file: string, size: number }[] = []; + const newTasks: { runner: TestRunnerKind | "unittest", file: string, size: number }[] = []; + let unknownValue: string | undefined; export function start() { - initializeProgressBarsDependencies(); - console.log("Discovering tests..."); - const discoverStart = +(new Date()); - const { statSync }: { statSync(path: string): { size: number }; } = require("fs"); - let tasks: { runner: TestRunnerKind, file: string, size: number }[] = []; - const newTasks: { runner: TestRunnerKind, file: string, size: number }[] = []; const perfData = readSavedPerfData(configOption); let totalCost = 0; - let unknownValue: string | undefined; + if (runUnitTests) { + (global as any).describe = (suiteName: string) => { + // Note, sub-suites are not indexed (we assume such granularity is not required) + let size = 0; + if (perfData) { + size = perfData[hashName("unittest", suiteName)]; + if (size === undefined) { + newTasks.push({ runner: "unittest", file: suiteName, size: 0 }); + unknownValue = suiteName; + return; + } + } + tasks.push({ runner: "unittest", file: suiteName, size }); + totalCost += size; + }; + } + else { + (global as any).describe = ts.noop; + } + + setTimeout(() => startDelayed(perfData, totalCost), 0); // Do real startup on next tick, so all unit tests have been collected + } + + function startDelayed(perfData: {[testHash: string]: number}, totalCost: number) { + initializeProgressBarsDependencies(); + console.log(`Discovered ${tasks.length} unittest suites` + (newTasks.length ? ` and ${newTasks.length} new suites.` : ".")); + console.log("Discovering runner-based tests..."); + const discoverStart = +(new Date()); + const { statSync }: { statSync(path: string): { size: number }; } = require("fs"); for (const runner of runners) { const files = runner.enumerateTestFiles(); for (const file of files) { @@ -87,8 +112,7 @@ namespace Harness.Parallel.Host { } tasks.sort((a, b) => a.size - b.size); tasks = tasks.concat(newTasks); - // 1 fewer batches than threads to account for unittests running on the final thread - const batchCount = runners.length === 1 ? workerCount : workerCount - 1; + const batchCount = workerCount; const packfraction = 0.9; const chunkSize = 1000; // ~1KB or 1s for sending batches near the end of a test const batchSize = (totalCost / workerCount) * packfraction; // Keep spare tests for unittest thread in reserve @@ -113,7 +137,7 @@ namespace Harness.Parallel.Host { let closedWorkers = 0; for (let i = 0; i < workerCount; i++) { // TODO: Just send the config over the IPC channel or in the command line arguments - const config: TestConfig = { light: Harness.lightMode, listenForWork: true, runUnitTests: runners.length === 1 ? false : i === workerCount - 1 }; + const config: TestConfig = { light: Harness.lightMode, listenForWork: true, runUnitTests: runners.length !== 1 }; const configPath = ts.combinePaths(taskConfigsFolder, `task-config${i}.json`); Harness.IO.writeFile(configPath, JSON.stringify(config)); const child = fork(__filename, [`--config="${configPath}"`]); @@ -187,7 +211,7 @@ namespace Harness.Parallel.Host { // It's only really worth doing an initial batching if there are a ton of files to go through if (totalFiles > 1000) { console.log("Batching initial test lists..."); - const batches: { runner: TestRunnerKind, file: string, size: number }[][] = new Array(batchCount); + const batches: { runner: TestRunnerKind | "unittest", file: string, size: number }[][] = new Array(batchCount); const doneBatching = new Array(batchCount); let scheduledTotal = 0; batcher: while (true) { @@ -230,7 +254,7 @@ namespace Harness.Parallel.Host { if (payload) { worker.send({ type: "batch", payload }); } - else { // Unittest thread - send off just one test + else { // Out of batches, send off just one test const payload = tasks.pop(); ts.Debug.assert(!!payload); // The reserve kept above should ensure there is always an initial task available, even in suboptimal scenarios worker.send({ type: "test", payload }); diff --git a/src/harness/parallel/shared.ts b/src/harness/parallel/shared.ts index 85d885c14a1..2eb7777f828 100644 --- a/src/harness/parallel/shared.ts +++ b/src/harness/parallel/shared.ts @@ -1,14 +1,14 @@ /// /// namespace Harness.Parallel { - export type ParallelTestMessage = { type: "test", payload: { runner: TestRunnerKind, file: string } } | never; + export type ParallelTestMessage = { type: "test", payload: { runner: TestRunnerKind | "unittest", file: string } } | never; export type ParallelBatchMessage = { type: "batch", payload: ParallelTestMessage["payload"][] } | never; export type ParallelCloseMessage = { type: "close" } | never; export type ParallelHostMessage = ParallelTestMessage | ParallelCloseMessage | ParallelBatchMessage; export type ParallelErrorMessage = { type: "error", payload: { error: string, stack: string, name?: string[] } } | never; export type ErrorInfo = ParallelErrorMessage["payload"] & { name: string[] }; - export type ParallelResultMessage = { type: "result", payload: { passing: number, errors: ErrorInfo[], duration: number, runner: TestRunnerKind, file: string } } | never; + export type ParallelResultMessage = { type: "result", payload: { passing: number, errors: ErrorInfo[], duration: number, runner: TestRunnerKind | "unittest", file: string } } | never; export type ParallelBatchProgressMessage = { type: "progress", payload: ParallelResultMessage["payload"] } | never; export type ParallelClientMessage = ParallelErrorMessage | ParallelResultMessage | ParallelBatchProgressMessage; } \ No newline at end of file diff --git a/src/harness/parallel/worker.ts b/src/harness/parallel/worker.ts index 7e95831535a..c32b9660a39 100644 --- a/src/harness/parallel/worker.ts +++ b/src/harness/parallel/worker.ts @@ -1,22 +1,13 @@ namespace Harness.Parallel.Worker { let errors: ErrorInfo[] = []; let passing = 0; - let reportedUnitTests = false; type Executor = {name: string, callback: Function, kind: "suite" | "test"} | never; function resetShimHarnessAndExecute(runner: RunnerBase) { - if (reportedUnitTests) { - errors = []; - passing = 0; - testList.length = 0; - } - reportedUnitTests = true; - if (testList.length) { - // Execute unit tests - testList.forEach(({ name, callback, kind }) => executeCallback(name, callback, kind)); - testList.length = 0; - } + errors = []; + passing = 0; + testList.length = 0; const start = +(new Date()); runner.initializeTests(); testList.forEach(({ name, callback, kind }) => executeCallback(name, callback, kind)); @@ -226,13 +217,46 @@ namespace Harness.Parallel.Worker { shimMochaHarness(); } - function handleTest(runner: TestRunnerKind, file: string) { - if (!runners.has(runner)) { - runners.set(runner, createRunner(runner)); + function handleTest(runner: TestRunnerKind | "unittest", file: string) { + collectUnitTestsIfNeeded(); + if (runner === unittest) { + return executeUnitTest(file); + } + else { + if (!runners.has(runner)) { + runners.set(runner, createRunner(runner)); + } + const instance = runners.get(runner); + instance.tests = [file]; + return { ...resetShimHarnessAndExecute(instance), runner, file }; } - const instance = runners.get(runner); - instance.tests = [file]; - return { ...resetShimHarnessAndExecute(instance), runner, file }; } } + + const unittest: "unittest" = "unittest"; + let unitTests: {[name: string]: Function}; + function collectUnitTestsIfNeeded() { + if (!unitTests && testList.length) { + unitTests = {}; + for (const test of testList) { + unitTests[test.name] = test.callback; + } + testList.length = 0; + } + } + + function executeUnitTest(name: string) { + if (!unitTests) { + throw new Error(`Asked to run unit test ${name}, but no unit tests were discovered!`); + } + if (unitTests[name]) { + errors = []; + passing = 0; + const start = +(new Date()); + executeSuiteCallback(name, unitTests[name]); + delete unitTests[name]; + return { file: name, runner: unittest, errors, passing, duration: +(new Date()) - start }; + } + throw new Error(`Unit test with name "${name}" was asked to be run, but such a test does not exist!`); + } } \ No newline at end of file From 0e2eb3a2b88628680ca3ef56703d3679a8439f80 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 10 Oct 2017 18:25:26 -0700 Subject: [PATCH 097/137] Combine the event manager testing --- src/harness/unittests/telemetry.ts | 98 ++--------- .../unittests/tsserverProjectSystem.ts | 154 ++++++++++-------- 2 files changed, 101 insertions(+), 151 deletions(-) diff --git a/src/harness/unittests/telemetry.ts b/src/harness/unittests/telemetry.ts index 25120af45c1..9bb2db73801 100644 --- a/src/harness/unittests/telemetry.ts +++ b/src/harness/unittests/telemetry.ts @@ -5,9 +5,9 @@ namespace ts.projectSystem { describe("project telemetry", () => { it("does nothing for inferred project", () => { const file = makeFile("/a.js"); - const et = new EventTracker([file]); + const et = new TestServerEventManager([file]); et.service.openClientFile(file.path); - assert.equal(et.getEventsWithName(ts.server.ProjectInfoTelemetryEvent).length, 0); + et.hasZeroEvent(ts.server.ProjectInfoTelemetryEvent); }); it("only sends an event once", () => { @@ -15,7 +15,7 @@ namespace ts.projectSystem { const file2 = makeFile("/b.ts"); const tsconfig = makeFile("/a/tsconfig.json", {}); - const et = new EventTracker([file, file2, tsconfig]); + const et = new TestServerEventManager([file, file2, tsconfig]); et.service.openClientFile(file.path); et.assertProjectInfoTelemetryEvent({}, tsconfig.path); @@ -25,12 +25,12 @@ namespace ts.projectSystem { et.service.openClientFile(file2.path); checkNumberOfProjects(et.service, { inferredProjects: 1 }); - assert.equal(et.getEventsWithName(ts.server.ProjectInfoTelemetryEvent).length, 0); + et.hasZeroEvent(ts.server.ProjectInfoTelemetryEvent); et.service.openClientFile(file.path); checkNumberOfProjects(et.service, { configuredProjects: 1, inferredProjects: 1 }); - assert.equal(et.getEventsWithName(ts.server.ProjectInfoTelemetryEvent).length, 0); + et.hasZeroEvent(ts.server.ProjectInfoTelemetryEvent); }); it("counts files by extension", () => { @@ -39,7 +39,7 @@ namespace ts.projectSystem { const compilerOptions: ts.CompilerOptions = { allowJs: true }; const tsconfig = makeFile("/tsconfig.json", { compilerOptions, include: ["src"] }); - const et = new EventTracker([...files, notIncludedFile, tsconfig]); + const et = new TestServerEventManager([...files, notIncludedFile, tsconfig]); et.service.openClientFile(files[0].path); et.assertProjectInfoTelemetryEvent({ fileStats: { ts: 2, tsx: 1, js: 1, jsx: 1, dts: 1 }, @@ -50,7 +50,7 @@ namespace ts.projectSystem { it("works with external project", () => { const file1 = makeFile("/a.ts"); - const et = new EventTracker([file1]); + const et = new TestServerEventManager([file1]); const compilerOptions: ts.server.protocol.CompilerOptions = { strict: true }; const projectFileName = "/hunter2/foo.csproj"; @@ -148,7 +148,7 @@ namespace ts.projectSystem { (compilerOptions as any).unknownCompilerOption = "hunter2"; // These are always ignored. const tsconfig = makeFile("/tsconfig.json", { compilerOptions, files: ["/a.ts"] }); - const et = new EventTracker([file, tsconfig]); + const et = new TestServerEventManager([file, tsconfig]); et.service.openClientFile(file.path); et.assertProjectInfoTelemetryEvent({ @@ -168,7 +168,7 @@ namespace ts.projectSystem { compileOnSave: true, }); - const et = new EventTracker([tsconfig, file]); + const et = new TestServerEventManager([tsconfig, file]); et.service.openClientFile(file.path); et.assertProjectInfoTelemetryEvent({ extends: true, @@ -198,7 +198,7 @@ namespace ts.projectSystem { exclude: [], }, }); - const et = new EventTracker([jsconfig, file]); + const et = new TestServerEventManager([jsconfig, file]); et.service.openClientFile(file.path); et.assertProjectInfoTelemetryEvent({ projectId: Harness.mockHash("/jsconfig.json"), @@ -216,7 +216,7 @@ namespace ts.projectSystem { it("detects whether language service was disabled", () => { const file = makeFile("/a.js"); const tsconfig = makeFile("/jsconfig.json", {}); - const et = new EventTracker([tsconfig, file]); + const et = new TestServerEventManager([tsconfig, file]); et.host.getFileSize = () => server.maxProgramSizeForNonTsFiles + 1; et.service.openClientFile(file.path); et.getEvent(server.ProjectLanguageServiceStateEvent); @@ -235,83 +235,7 @@ namespace ts.projectSystem { }); }); - class EventTracker { - private events: server.ProjectServiceEvent[] = []; - readonly service: TestProjectService; - readonly host: projectSystem.TestServerHost; - - constructor(files: projectSystem.FileOrFolder[]) { - this.host = createServerHost(files); - this.service = createProjectService(this.host, { - eventHandler: event => { - this.events.push(event); - }, - }); - } - - getEvents(): ReadonlyArray { - const events = this.events; - this.events = []; - return events; - } - - getEventsWithName(eventName: T["eventName"]): ReadonlyArray { - let events: T[]; - filterMutate(this.events, event => { - if (event.eventName === eventName) { - (events || (events = [])).push(event as T); - return false; - } - return true; - }); - return events || emptyArray; - } - - assertProjectInfoTelemetryEvent(partial: Partial, configFile?: string): void { - assert.deepEqual(this.getEvent(ts.server.ProjectInfoTelemetryEvent), { - projectId: Harness.mockHash(configFile || "/tsconfig.json"), - fileStats: fileStats({ ts: 1 }), - compilerOptions: {}, - extends: false, - files: false, - include: false, - exclude: false, - compileOnSave: false, - typeAcquisition: { - enable: false, - exclude: false, - include: false, - }, - configFileName: "tsconfig.json", - projectType: "configured", - languageServiceEnabled: true, - version: ts.version, - ...partial, - }); - } - - getEvent(eventName: T["eventName"]): T["data"] { - let event: server.ProjectServiceEvent; - filterMutate(this.events, e => { - if (e.eventName === eventName) { - if (event) { - assert(false, "more than one event found"); - } - event = e; - return false; - } - return true; - }); - assert.equal(event.eventName, eventName); - return event.data; - } - } - function makeFile(path: string, content: {} = ""): projectSystem.FileOrFolder { return { path, content: isString(content) ? "" : JSON.stringify(content) }; } - - function fileStats(nonZeroStats: Partial): server.FileStats { - return { ts: 0, tsx: 0, dts: 0, js: 0, jsx: 0, ...nonZeroStats }; - } } diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index 04b848e7cdf..d5b9b9d62fc 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -132,16 +132,78 @@ namespace ts.projectSystem { return map(fileNames, toExternalFile); } - class TestServerEventManager { - public events: server.ProjectServiceEvent[] = []; + export function fileStats(nonZeroStats: Partial): server.FileStats { + return { ts: 0, tsx: 0, dts: 0, js: 0, jsx: 0, ...nonZeroStats }; + } - handler: server.ProjectServiceEventHandler = (event: server.ProjectServiceEvent) => { - this.events.push(event); + export class TestServerEventManager { + private events: server.ProjectServiceEvent[] = []; + readonly session: TestSession; + readonly service: server.ProjectService; + readonly host: projectSystem.TestServerHost; + constructor(files: projectSystem.FileOrFolder[]) { + this.host = createServerHost(files); + this.session = createSession(this.host, { + canUseEvents: true, + eventHandler: event => this.events.push(event), + }); + this.service = this.session.getProjectService(); } - checkEventCountOfType(eventType: "configFileDiag", expectedCount: number) { - const eventsOfType = filter(this.events, e => e.eventName === eventType); - assert.equal(eventsOfType.length, expectedCount, `The actual event counts of type ${eventType} is ${eventsOfType.length}, while expected ${expectedCount}`); + getEvents(): ReadonlyArray { + const events = this.events; + this.events = []; + return events; + } + + getEvent(eventName: T["eventName"]): T["data"] { + let eventData: T["data"]; + filterMutate(this.events, e => { + if (e.eventName === eventName) { + if (eventData !== undefined) { + assert(false, "more than one event found"); + } + eventData = e.data; + return false; + } + return true; + }); + assert.isDefined(eventData); + return eventData; + } + + hasZeroEvent(eventName: T["eventName"]) { + const eventCount = countWhere(this.events, event => event.eventName === eventName); + assert.equal(eventCount, 0); + } + + checkSingleConfigFileDiagEvent(configFileName: string, triggerFile: string) { + const eventData = this.getEvent(server.ConfigFileDiagEvent); + assert.equal(eventData.configFileName, configFileName); + assert.equal(eventData.triggerFile, triggerFile); + } + + assertProjectInfoTelemetryEvent(partial: Partial, configFile?: string): void { + assert.deepEqual(this.getEvent(ts.server.ProjectInfoTelemetryEvent), { + projectId: Harness.mockHash(configFile || "/tsconfig.json"), + fileStats: fileStats({ ts: 1 }), + compilerOptions: {}, + extends: false, + files: false, + include: false, + exclude: false, + compileOnSave: false, + typeAcquisition: { + enable: false, + exclude: false, + include: false, + }, + configFileName: "tsconfig.json", + projectType: "configured", + languageServiceEnabled: true, + version: ts.version, + ...partial, + }); } } @@ -3076,7 +3138,6 @@ namespace ts.projectSystem { describe("Configure file diagnostics events", () => { it("are generated when the config file has errors", () => { - const serverEventManager = new TestServerEventManager(); const file = { path: "/a/b/app.ts", content: "let x = 10" @@ -3090,26 +3151,12 @@ namespace ts.projectSystem { } }` }; - - const host = createServerHost([file, configFile]); - const session = createSession(host, { - canUseEvents: true, - eventHandler: serverEventManager.handler - }); - openFilesForSession([file], session); - serverEventManager.checkEventCountOfType("configFileDiag", 1); - - for (const event of serverEventManager.events) { - if (event.eventName === "configFileDiag") { - assert.equal(event.data.configFileName, configFile.path); - assert.equal(event.data.triggerFile, file.path); - return; - } - } + const serverEventManager = new TestServerEventManager([file, configFile]); + openFilesForSession([file], serverEventManager.session); + serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, file.path); }); it("are generated when the config file doesn't have errors", () => { - const serverEventManager = new TestServerEventManager(); const file = { path: "/a/b/app.ts", content: "let x = 10" @@ -3120,18 +3167,12 @@ namespace ts.projectSystem { "compilerOptions": {} }` }; - - const host = createServerHost([file, configFile]); - const session = createSession(host, { - canUseEvents: true, - eventHandler: serverEventManager.handler - }); - openFilesForSession([file], session); - serverEventManager.checkEventCountOfType("configFileDiag", 1); + const serverEventManager = new TestServerEventManager([file, configFile]); + openFilesForSession([file], serverEventManager.session); + serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, file.path); }); it("are generated when the config file changes", () => { - const serverEventManager = new TestServerEventManager(); const file = { path: "/a/b/app.ts", content: "let x = 10" @@ -3143,33 +3184,28 @@ namespace ts.projectSystem { }` }; - const host = createServerHost([file, configFile]); - const session = createSession(host, { - canUseEvents: true, - eventHandler: serverEventManager.handler - }); - openFilesForSession([file], session); - serverEventManager.checkEventCountOfType("configFileDiag", 1); + const serverEventManager = new TestServerEventManager([file, configFile]); + openFilesForSession([file], serverEventManager.session); + serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, file.path); configFile.content = `{ "compilerOptions": { "haha": 123 } }`; - host.reloadFS([file, configFile]); - host.runQueuedTimeoutCallbacks(); - serverEventManager.checkEventCountOfType("configFileDiag", 2); + serverEventManager.host.reloadFS([file, configFile]); + serverEventManager.host.runQueuedTimeoutCallbacks(); + serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, configFile.path); configFile.content = `{ "compilerOptions": {} }`; - host.reloadFS([file, configFile]); - host.runQueuedTimeoutCallbacks(); - serverEventManager.checkEventCountOfType("configFileDiag", 3); + serverEventManager.host.reloadFS([file, configFile]); + serverEventManager.host.runQueuedTimeoutCallbacks(); + serverEventManager.checkSingleConfigFileDiagEvent(configFile.path, configFile.path); }); it("are not generated when the config file doesnot include file opened and config file has errors", () => { - const serverEventManager = new TestServerEventManager(); const file = { path: "/a/b/app.ts", content: "let x = 10" @@ -3188,18 +3224,12 @@ namespace ts.projectSystem { "files": ["app.ts"] }` }; - - const host = createServerHost([file, file2, libFile, configFile]); - const session = createSession(host, { - canUseEvents: true, - eventHandler: serverEventManager.handler - }); - openFilesForSession([file2], session); - serverEventManager.checkEventCountOfType("configFileDiag", 0); + const serverEventManager = new TestServerEventManager([file, file2, libFile, configFile]); + openFilesForSession([file2], serverEventManager.session); + serverEventManager.hasZeroEvent("configFileDiag"); }); it("are not generated when the config file doesnot include file opened and doesnt contain any errors", () => { - const serverEventManager = new TestServerEventManager(); const file = { path: "/a/b/app.ts", content: "let x = 10" @@ -3215,13 +3245,9 @@ namespace ts.projectSystem { }` }; - const host = createServerHost([file, file2, libFile, configFile]); - const session = createSession(host, { - canUseEvents: true, - eventHandler: serverEventManager.handler - }); - openFilesForSession([file2], session); - serverEventManager.checkEventCountOfType("configFileDiag", 0); + const serverEventManager = new TestServerEventManager([file, file2, libFile, configFile]); + openFilesForSession([file2], serverEventManager.session); + serverEventManager.hasZeroEvent("configFileDiag"); }); }); From 9767d77143b89ea62b6a48bb8163ba68ab27213f Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 10 Oct 2017 18:41:45 -0700 Subject: [PATCH 098/137] Update comment on emit handler functions --- src/compiler/builder.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/compiler/builder.ts b/src/compiler/builder.ts index 03eb5b7e8ae..093c6ec4d03 100644 --- a/src/compiler/builder.ts +++ b/src/compiler/builder.ts @@ -73,12 +73,17 @@ namespace ts { */ onRemoveSourceFile(path: Path): void; /** - * Called when sourceFile is changed + * For all source files, either "onUpdateSourceFile" or "onUpdateSourceFileWithSameVersion" will be called. + * If the builder is sure that the source file needs an update, "onUpdateSourceFile" will be called; + * otherwise "onUpdateSourceFileWithSameVersion" will be called. + * This should return whether the source file should be marked as changed (meaning that something associated with file has changed, e.g. module resolution) */ onUpdateSourceFile(program: Program, sourceFile: SourceFile): void; /** - * Called when source file has not changed - * If returned true, builder will mark the file as changed (noting that something associated with file has changed eg. module resolution) + * For all source files, either "onUpdateSourceFile" or "onUpdateSourceFileWithSameVersion" will be called. + * If the builder is sure that the source file needs an update, "onUpdateSourceFile" will be called; + * otherwise "onUpdateSourceFileWithSameVersion" will be called. + * This should return whether the source file should be marked as changed (meaning that something associated with file has changed, e.g. module resolution) */ onUpdateSourceFileWithSameVersion(program: Program, sourceFile: SourceFile): boolean; /** From 993890f06c422ab7fc016e07604f2ef0e00311c5 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 10 Oct 2017 20:19:46 -0700 Subject: [PATCH 099/137] Verify errors more correctly in tsc-watch mode --- src/harness/unittests/tscWatchMode.ts | 353 ++++++++++++---------- src/harness/virtualFileSystemWithWatch.ts | 8 +- 2 files changed, 193 insertions(+), 168 deletions(-) diff --git a/src/harness/unittests/tscWatchMode.ts b/src/harness/unittests/tscWatchMode.ts index 31d79df21c1..b25a7b1eb53 100644 --- a/src/harness/unittests/tscWatchMode.ts +++ b/src/harness/unittests/tscWatchMode.ts @@ -80,6 +80,92 @@ namespace ts.tscWatch { checkOutputDoesNotContain(host, expectedNonAffectedFiles); } + function checkOutputErrors(host: WatchedSystem, errors?: ReadonlyArray, isInitial?: true, skipWaiting?: true) { + const outputs = host.getOutput(); + const expectedOutputCount = (isInitial ? 0 : 1) + (errors ? errors.length : 0) + (skipWaiting ? 0 : 1); + assert.equal(outputs.length, expectedOutputCount, "Outputs = " + outputs.toString()); + let index = 0; + if (!isInitial) { + assertWatchDiagnosticAt(host, index, Diagnostics.File_change_detected_Starting_incremental_compilation); + index++; + } + forEach(errors, error => { + assertDiagnosticAt(host, index, error); + index++; + }); + if (!skipWaiting) { + assertWatchDiagnosticAt(host, index, Diagnostics.Compilation_complete_Watching_for_file_changes); + } + host.clearOutput(); + } + + function assertDiagnosticAt(host: WatchedSystem, outputAt: number, diagnostic: Diagnostic) { + const output = host.getOutput()[outputAt]; + assert.equal(output, formatDiagnostic(diagnostic, host), "outputs[" + outputAt + "] is " + output); + } + + function assertWatchDiagnosticAt(host: WatchedSystem, outputAt: number, diagnosticMessage: DiagnosticMessage) { + const output = host.getOutput()[outputAt]; + assert.isTrue(endsWith(output, getWatchDiagnosticWithoutDate(host, diagnosticMessage)), "outputs[" + outputAt + "] is " + output); + } + + function getWatchDiagnosticWithoutDate(host: WatchedSystem, diagnosticMessage: DiagnosticMessage) { + return ` - ${flattenDiagnosticMessageText(getLocaleSpecificMessage(diagnosticMessage), host.newLine)}${host.newLine + host.newLine + host.newLine}`; + } + + function getDiagnosticOfFileFrom(file: SourceFile, text: string, start: number, length: number, message: DiagnosticMessage): Diagnostic { + return { + file, + start, + length, + + messageText: text, + category: message.category, + code: message.code, + }; + } + + function getDiagnosticWithoutFile(message: DiagnosticMessage, ..._args: (string | number)[]): Diagnostic { + let text = getLocaleSpecificMessage(message); + + if (arguments.length > 1) { + text = formatStringFromArgs(text, arguments, 1); + } + + return getDiagnosticOfFileFrom(/*file*/ undefined, text, /*start*/ undefined, /*length*/ undefined, message); + } + + function getDiagnosticOfFile(file: SourceFile, start: number, length: number, message: DiagnosticMessage, ..._args: (string | number)[]): Diagnostic { + let text = getLocaleSpecificMessage(message); + + if (arguments.length > 4) { + text = formatStringFromArgs(text, arguments, 4); + } + + return getDiagnosticOfFileFrom(file, text, start, length, message); + } + + function getUnknownCompilerOption(program: Program, configFile: FileOrFolder, option: string) { + const quotedOption = `"${option}"`; + return getDiagnosticOfFile(program.getCompilerOptions().configFile, configFile.content.indexOf(quotedOption), quotedOption.length, Diagnostics.Unknown_compiler_option_0, option); + } + + function getDiagnosticOfFileFromProgram(program: Program, filePath: string, start: number, length: number, message: DiagnosticMessage, ..._args: (string | number)[]): Diagnostic { + let text = getLocaleSpecificMessage(message); + + if (arguments.length > 5) { + text = formatStringFromArgs(text, arguments, 5); + } + + return getDiagnosticOfFileFrom(program.getSourceFileByPath(toPath(filePath, program.getCurrentDirectory(), s => s.toLowerCase())), + text, start, length, message); + } + + function getDiagnosticModuleNotFoundOfFile(program: Program, file: FileOrFolder, moduleName: string) { + const quotedModuleName = `"${moduleName}"`; + return getDiagnosticOfFileFromProgram(program, file.path, file.content.indexOf(quotedModuleName), quotedModuleName.length, Diagnostics.Cannot_find_module_0, moduleName); + } + describe("tsc-watch program updates", () => { const commonFile1: FileOrFolder = { path: "/a/b/commonFile1.ts", @@ -233,9 +319,10 @@ namespace ts.tscWatch { }); it("handles the missing files - that were added to program because they were added with /// { + const commonFile2Name = "commonFile2.ts"; const file1: FileOrFolder = { path: "/a/b/commonFile1.ts", - content: `/// + content: `/// let x = y` }; const host = createWatchedSystem([file1, libFile]); @@ -243,18 +330,16 @@ namespace ts.tscWatch { checkProgramRootFiles(watch(), [file1.path]); checkProgramActualFiles(watch(), [file1.path, libFile.path]); - const errors = [ - `a/b/commonFile1.ts(1,22): error TS6053: File '${commonFile2.path}' not found.${host.newLine}`, - `a/b/commonFile1.ts(2,29): error TS2304: Cannot find name 'y'.${host.newLine}` - ]; - checkOutputContains(host, errors); - host.clearOutput(); + checkOutputErrors(host, [ + getDiagnosticOfFileFromProgram(watch(), file1.path, file1.content.indexOf(commonFile2Name), commonFile2Name.length, Diagnostics.File_0_not_found, commonFile2.path), + getDiagnosticOfFileFromProgram(watch(), file1.path, file1.content.indexOf("y"), 1, Diagnostics.Cannot_find_name_0, "y") + ], /*isInitial*/ true); host.reloadFS([file1, commonFile2, libFile]); host.runQueuedTimeoutCallbacks(); checkProgramRootFiles(watch(), [file1.path]); checkProgramActualFiles(watch(), [file1.path, libFile.path, commonFile2.path]); - checkOutputDoesNotContain(host, errors); + checkOutputErrors(host); }); it("should reflect change in config file", () => { @@ -578,17 +663,19 @@ namespace ts.tscWatch { path: "/a/b/tsconfig.json", content: JSON.stringify({ compilerOptions: {} }) }; - const host = createWatchedSystem([file1, file2, config]); + const host = createWatchedSystem([file1, file2, libFile, config]); const watch = createWatchModeWithConfigFile(config.path, host); - checkProgramActualFiles(watch(), [file1.path, file2.path]); + checkProgramActualFiles(watch(), [file1.path, file2.path, libFile.path]); + checkOutputErrors(host, emptyArray, /*isInitial*/ true); - host.clearOutput(); - host.reloadFS([file1, file2]); + host.reloadFS([file1, file2, libFile]); host.checkTimeoutQueueLengthAndRun(1); assert.equal(host.exitCode, ExitStatus.DiagnosticsPresent_OutputsSkipped); - checkOutputContains(host, [`error TS6053: File '${config.path}' not found.${host.newLine}`]); + checkOutputErrors(host, [ + getDiagnosticWithoutFile(Diagnostics.File_0_not_found, config.path) + ], /*isInitial*/ undefined, /*skipWaiting*/ true); }); it("Proper errors: document is not contained in project", () => { @@ -687,25 +774,25 @@ namespace ts.tscWatch { }; const file1 = { path: "/a/b/file1.ts", - content: "import * as T from './moduleFile'; T.bar();" + content: 'import * as T from "./moduleFile"; T.bar();' }; const host = createWatchedSystem([moduleFile, file1, libFile]); - createWatchModeWithoutConfigFile([file1.path], host); - const error = "a/b/file1.ts(1,20): error TS2307: Cannot find module \'./moduleFile\'.\n"; - checkOutputDoesNotContain(host, [error]); + const watch = createWatchModeWithoutConfigFile([file1.path], host); + checkOutputErrors(host, emptyArray, /*isInitial*/ true); const moduleFileOldPath = moduleFile.path; const moduleFileNewPath = "/a/b/moduleFile1.ts"; moduleFile.path = moduleFileNewPath; host.reloadFS([moduleFile, file1, libFile]); host.runQueuedTimeoutCallbacks(); - checkOutputContains(host, [error]); + checkOutputErrors(host, [ + getDiagnosticModuleNotFoundOfFile(watch(), file1, "./moduleFile") + ]); - host.clearOutput(); moduleFile.path = moduleFileOldPath; host.reloadFS([moduleFile, file1, libFile]); host.runQueuedTimeoutCallbacks(); - checkOutputDoesNotContain(host, [error]); + checkOutputErrors(host); }); it("rename a module file and rename back should restore the states for configured projects", () => { @@ -715,31 +802,29 @@ namespace ts.tscWatch { }; const file1 = { path: "/a/b/file1.ts", - content: "import * as T from './moduleFile'; T.bar();" + content: 'import * as T from "./moduleFile"; T.bar();' }; const configFile = { path: "/a/b/tsconfig.json", content: `{}` }; const host = createWatchedSystem([moduleFile, file1, configFile, libFile]); - createWatchModeWithConfigFile(configFile.path, host); - - const error = "a/b/file1.ts(1,20): error TS2307: Cannot find module \'./moduleFile\'.\n"; - checkOutputDoesNotContain(host, [error]); + const watch = createWatchModeWithConfigFile(configFile.path, host); + checkOutputErrors(host, emptyArray, /*isInitial*/ true); const moduleFileOldPath = moduleFile.path; const moduleFileNewPath = "/a/b/moduleFile1.ts"; moduleFile.path = moduleFileNewPath; - host.clearOutput(); host.reloadFS([moduleFile, file1, configFile, libFile]); host.runQueuedTimeoutCallbacks(); - checkOutputContains(host, [error]); + checkOutputErrors(host, [ + getDiagnosticModuleNotFoundOfFile(watch(), file1, "./moduleFile") + ]); - host.clearOutput(); moduleFile.path = moduleFileOldPath; host.reloadFS([moduleFile, file1, configFile, libFile]); host.runQueuedTimeoutCallbacks(); - checkOutputDoesNotContain(host, [error]); + checkOutputErrors(host); }); it("types should load from config file path if config exists", () => { @@ -771,18 +856,18 @@ namespace ts.tscWatch { }; const file1 = { path: "/a/b/file1.ts", - content: "import * as T from './moduleFile'; T.bar();" + content: 'import * as T from "./moduleFile"; T.bar();' }; const host = createWatchedSystem([file1, libFile]); - createWatchModeWithoutConfigFile([file1.path], host); + const watch = createWatchModeWithoutConfigFile([file1.path], host); - const error = `a/b/file1.ts(1,20): error TS2307: Cannot find module \'./moduleFile\'.${host.newLine}`; - checkOutputContains(host, [error]); - host.clearOutput(); + checkOutputErrors(host, [ + getDiagnosticModuleNotFoundOfFile(watch(), file1, "./moduleFile") + ], /*isInitial*/ true); host.reloadFS([file1, moduleFile, libFile]); host.runQueuedTimeoutCallbacks(); - checkOutputDoesNotContain(host, [error]); + checkOutputErrors(host); }); it("Configure file diagnostics events are generated when the config file has errors", () => { @@ -801,14 +886,14 @@ namespace ts.tscWatch { }; const host = createWatchedSystem([file, configFile, libFile]); - createWatchModeWithConfigFile(configFile.path, host); - checkOutputContains(host, [ - `a/b/tsconfig.json(3,29): error TS5023: Unknown compiler option \'foo\'.${host.newLine}`, - `a/b/tsconfig.json(4,29): error TS5023: Unknown compiler option \'allowJS\'.${host.newLine}` - ]); + const watch = createWatchModeWithConfigFile(configFile.path, host); + checkOutputErrors(host, [ + getUnknownCompilerOption(watch(), configFile, "foo"), + getUnknownCompilerOption(watch(), configFile, "allowJS") + ], /*isInitial*/ true); }); - it("Configure file diagnostics events are generated when the config file doesn't have errors", () => { + it("If config file doesnt have errors, they are not reported", () => { const file = { path: "/a/b/app.ts", content: "let x = 10" @@ -822,13 +907,10 @@ namespace ts.tscWatch { const host = createWatchedSystem([file, configFile, libFile]); createWatchModeWithConfigFile(configFile.path, host); - checkOutputDoesNotContain(host, [ - `a/b/tsconfig.json(3,29): error TS5023: Unknown compiler option \'foo\'.${host.newLine}`, - `a/b/tsconfig.json(4,29): error TS5023: Unknown compiler option \'allowJS\'.${host.newLine}` - ]); + checkOutputErrors(host, emptyArray, /*isInitial*/ true); }); - it("Configure file diagnostics events are generated when the config file changes", () => { + it("Reports errors when the config file changes", () => { const file = { path: "/a/b/app.ts", content: "let x = 10" @@ -841,9 +923,8 @@ namespace ts.tscWatch { }; const host = createWatchedSystem([file, configFile, libFile]); - createWatchModeWithConfigFile(configFile.path, host); - const error = `a/b/tsconfig.json(3,25): error TS5023: Unknown compiler option 'haha'.${host.newLine}`; - checkOutputDoesNotContain(host, [error]); + const watch = createWatchModeWithConfigFile(configFile.path, host); + checkOutputErrors(host, emptyArray, /*isInitial*/ true); configFile.content = `{ "compilerOptions": { @@ -852,15 +933,16 @@ namespace ts.tscWatch { }`; host.reloadFS([file, configFile, libFile]); host.runQueuedTimeoutCallbacks(); - checkOutputContains(host, [error]); + checkOutputErrors(host, [ + getUnknownCompilerOption(watch(), configFile, "haha") + ]); - host.clearOutput(); configFile.content = `{ "compilerOptions": {} }`; host.reloadFS([file, configFile, libFile]); host.runQueuedTimeoutCallbacks(); - checkOutputDoesNotContain(host, [error]); + checkOutputErrors(host); }); it("non-existing directories listed in config file input array should be tolerated without crashing the server", () => { @@ -935,29 +1017,28 @@ namespace ts.tscWatch { }`; const configFileContentWithComment = configFileContentBeforeComment + configFileContentComment + configFileContentAfterComment; const configFileContentWithoutCommentLine = configFileContentBeforeComment + configFileContentAfterComment; - - const line = 5; - const errors = (line: number) => [ - `a/b/tsconfig.json(${line},25): error TS5053: Option \'allowJs\' cannot be specified with option \'declaration\'.\n`, - `a/b/tsconfig.json(${line + 1},25): error TS5053: Option \'allowJs\' cannot be specified with option \'declaration\'.\n` - ]; - const configFile = { path: "/a/b/tsconfig.json", content: configFileContentWithComment }; - const host = createWatchedSystem([file, libFile, configFile]); - createWatchModeWithConfigFile(configFile.path, host); - checkOutputContains(host, errors(line)); - checkOutputDoesNotContain(host, errors(line - 2)); - host.clearOutput(); + const files = [file, libFile, configFile]; + const host = createWatchedSystem(files); + const watch = createWatchModeWithConfigFile(configFile.path, host); + const errors = () => [ + getDiagnosticOfFile(watch().getCompilerOptions().configFile, configFile.content.indexOf('"allowJs"'), '"allowJs"'.length, Diagnostics.Option_0_cannot_be_specified_with_option_1, "allowJs", "declaration"), + getDiagnosticOfFile(watch().getCompilerOptions().configFile, configFile.content.indexOf('"declaration"'), '"declaration"'.length, Diagnostics.Option_0_cannot_be_specified_with_option_1, "allowJs", "declaration") + ]; + const intialErrors = errors(); + checkOutputErrors(host, intialErrors, /*isInitial*/ true); configFile.content = configFileContentWithoutCommentLine; - host.reloadFS([file, configFile]); + host.reloadFS(files); host.runQueuedTimeoutCallbacks(); - checkOutputContains(host, errors(line - 2)); - checkOutputDoesNotContain(host, errors(line)); + const nowErrors = errors(); + checkOutputErrors(host, nowErrors); + assert.equal(nowErrors[0].start, intialErrors[0].start - configFileContentComment.length); + assert.equal(nowErrors[1].start, intialErrors[1].start - configFileContentComment.length); }); }); @@ -1485,23 +1566,20 @@ namespace ts.tscWatch { path: "/a/d/f0.ts", content: `import {x} from "f1"` }; - const imported = { path: "/a/f1.ts", content: `foo()` }; - const f1IsNotModule = `a/d/f0.ts(1,17): error TS2306: File '${imported.path}' is not a module.\n`; - const cannotFindFoo = `a/f1.ts(1,1): error TS2304: Cannot find name 'foo'.\n`; - const cannotAssignValue = "a/d/f0.ts(2,21): error TS2322: Type '1' is not assignable to type 'string'.\n"; - const files = [root, imported, libFile]; const host = createWatchedSystem(files); - createWatchModeWithoutConfigFile([root.path], host, { module: ModuleKind.AMD }); + const watch = createWatchModeWithoutConfigFile([root.path], host, { module: ModuleKind.AMD }); + + const f1IsNotModule = getDiagnosticOfFileFromProgram(watch(), root.path, root.content.indexOf('"f1"'), '"f1"'.length, Diagnostics.File_0_is_not_a_module, imported.path); + const cannotFindFoo = getDiagnosticOfFileFromProgram(watch(), imported.path, imported.content.indexOf("foo"), "foo".length, Diagnostics.Cannot_find_name_0, "foo"); // ensure that imported file was found - checkOutputContains(host, [f1IsNotModule, cannotFindFoo]); - host.clearOutput(); + checkOutputErrors(host, [f1IsNotModule, cannotFindFoo], /*isInitial*/ true); const originalFileExists = host.fileExists; { @@ -1517,8 +1595,11 @@ namespace ts.tscWatch { host.runQueuedTimeoutCallbacks(); // ensure file has correct number of errors after edit - checkOutputContains(host, [f1IsNotModule, cannotAssignValue]); - host.clearOutput(); + checkOutputErrors(host, [ + f1IsNotModule, + getDiagnosticOfFileFromProgram(watch(), root.path, newContent.indexOf("var x") + "var ".length, "x".length, Diagnostics.Type_0_is_not_assignable_to_type_1, 1, "string"), + cannotFindFoo + ]); } { let fileExistsIsCalled = false; @@ -1534,13 +1615,13 @@ namespace ts.tscWatch { root.content = `import {x} from "f2"`; host.reloadFS(files); - // trigger synchronization to make sure that LSHost will try to find 'f2' module on disk - host.runQueuedTimeoutCallbacks(); + // trigger synchronization to make sure that LSHost will try to find 'f2' module on disk + host.runQueuedTimeoutCallbacks(); - // ensure file has correct number of errors after edit - const cannotFindModuleF2 = `a/d/f0.ts(1,17): error TS2307: Cannot find module 'f2'.\n`; - checkOutputContains(host, [cannotFindModuleF2]); - host.clearOutput(); + // ensure file has correct number of errors after edit + checkOutputErrors(host, [ + getDiagnosticModuleNotFoundOfFile(watch(), root, "f2") + ]); assert.isTrue(fileExistsIsCalled); } @@ -1561,7 +1642,7 @@ namespace ts.tscWatch { host.reloadFS(files); host.runQueuedTimeoutCallbacks(); - checkOutputContains(host, [f1IsNotModule, cannotFindFoo]); + checkOutputErrors(host, [f1IsNotModule, cannotFindFoo]); assert.isTrue(fileExistsCalled); } }); @@ -1593,12 +1674,12 @@ namespace ts.tscWatch { return originalFileExists.call(host, fileName); }; - createWatchModeWithoutConfigFile([root.path], host, { module: ModuleKind.AMD }); + const watch = createWatchModeWithoutConfigFile([root.path], host, { module: ModuleKind.AMD }); - const barNotFound = `a/foo.ts(1,17): error TS2307: Cannot find module 'bar'.\n`; assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called"); - checkOutputContains(host, [barNotFound]); - host.clearOutput(); + checkOutputErrors(host, [ + getDiagnosticModuleNotFoundOfFile(watch(), root, "bar") + ], /*isInitial*/ true); fileExistsCalledForBar = false; root.content = `import {y} from "bar"`; @@ -1606,7 +1687,7 @@ namespace ts.tscWatch { host.runQueuedTimeoutCallbacks(); assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called."); - checkOutputDoesNotContain(host, [barNotFound]); + checkOutputErrors(host); }); it("should compile correctly when resolved module goes missing and then comes back (module is not part of the root)", () => { @@ -1617,7 +1698,7 @@ namespace ts.tscWatch { const imported = { path: `/a/bar.d.ts`, - content: `export const y = 1;` + content: `export const y = 1;export const x = 10;` }; const files = [root, libFile]; @@ -1635,25 +1716,24 @@ namespace ts.tscWatch { return originalFileExists.call(host, fileName); }; - createWatchModeWithoutConfigFile([root.path], host, { module: ModuleKind.AMD }); + const watch = createWatchModeWithoutConfigFile([root.path], host, { module: ModuleKind.AMD }); - const barNotFound = `a/foo.ts(1,17): error TS2307: Cannot find module 'bar'.\n`; assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called"); - checkOutputDoesNotContain(host, [barNotFound]); - host.clearOutput(); + checkOutputErrors(host, emptyArray, /*isInitial*/ true); fileExistsCalledForBar = false; host.reloadFS(files); host.runQueuedTimeoutCallbacks(); assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called."); - checkOutputContains(host, [barNotFound]); - host.clearOutput(); + checkOutputErrors(host, [ + getDiagnosticModuleNotFoundOfFile(watch(), root, "bar") + ]); fileExistsCalledForBar = false; host.reloadFS(filesWithImported); host.checkTimeoutQueueLengthAndRun(1); assert.isTrue(fileExistsCalledForBar, "'fileExists' should be called."); - checkOutputDoesNotContain(host, [barNotFound]); + checkOutputErrors(host); }); it("works when module resolution changes to ambient module", () => { @@ -1677,30 +1757,6 @@ namespace ts.tscWatch { declare module "fs" { export interface Stats { isFile(): boolean; - isDirectory(): boolean; - isBlockDevice(): boolean; - isCharacterDevice(): boolean; - isSymbolicLink(): boolean; - isFIFO(): boolean; - isSocket(): boolean; - dev: number; - ino: number; - mode: number; - nlink: number; - uid: number; - gid: number; - rdev: number; - size: number; - blksize: number; - blocks: number; - atimeMs: number; - mtimeMs: number; - ctimeMs: number; - birthtimeMs: number; - atime: Date; - mtime: Date; - ctime: Date; - birthtime: Date; } }` }; @@ -1709,15 +1765,15 @@ declare module "fs" { const filesWithNodeType = files.concat(packageJson, nodeType); const host = createWatchedSystem(files, { currentDirectory: "/a/b" }); - createWatchModeWithoutConfigFile([root.path], host, { }); + const watch = createWatchModeWithoutConfigFile([root.path], host, { }); - const fsNotFound = `foo.ts(1,21): error TS2307: Cannot find module 'fs'.\n`; - checkOutputContains(host, [fsNotFound]); - host.clearOutput(); + checkOutputErrors(host, [ + getDiagnosticModuleNotFoundOfFile(watch(), root, "fs") + ], /*isInitial*/ true); host.reloadFS(filesWithNodeType); host.runQueuedTimeoutCallbacks(); - checkOutputDoesNotContain(host, [fsNotFound]); + checkOutputErrors(host); }); it("works when included file with ambient module changes", () => { @@ -1735,17 +1791,6 @@ import * as u from "url"; declare module "url" { export interface Url { href?: string; - protocol?: string; - auth?: string; - hostname?: string; - port?: string; - host?: string; - pathname?: string; - search?: string; - query?: string | any; - slashes?: boolean; - hash?: string; - path?: string; } } ` @@ -1755,30 +1800,6 @@ declare module "url" { declare module "fs" { export interface Stats { isFile(): boolean; - isDirectory(): boolean; - isBlockDevice(): boolean; - isCharacterDevice(): boolean; - isSymbolicLink(): boolean; - isFIFO(): boolean; - isSocket(): boolean; - dev: number; - ino: number; - mode: number; - nlink: number; - uid: number; - gid: number; - rdev: number; - size: number; - blksize: number; - blocks: number; - atimeMs: number; - mtimeMs: number; - ctimeMs: number; - birthtimeMs: number; - atime: Date; - mtime: Date; - ctime: Date; - birthtime: Date; } } `; @@ -1786,16 +1807,16 @@ declare module "fs" { const files = [root, file, libFile]; const host = createWatchedSystem(files, { currentDirectory: "/a/b" }); - createWatchModeWithoutConfigFile([root.path, file.path], host, {}); + const watch = createWatchModeWithoutConfigFile([root.path, file.path], host, {}); - const fsNotFound = `foo.ts(2,21): error TS2307: Cannot find module 'fs'.\n`; - checkOutputContains(host, [fsNotFound]); - host.clearOutput(); + checkOutputErrors(host, [ + getDiagnosticModuleNotFoundOfFile(watch(), root, "fs") + ], /*isInitial*/ true); file.content += fileContentWithFS; host.reloadFS(files); host.runQueuedTimeoutCallbacks(); - checkOutputDoesNotContain(host, [fsNotFound]); + checkOutputErrors(host); }); }); } diff --git a/src/harness/virtualFileSystemWithWatch.ts b/src/harness/virtualFileSystemWithWatch.ts index c16f57235e4..cef70910678 100644 --- a/src/harness/virtualFileSystemWithWatch.ts +++ b/src/harness/virtualFileSystemWithWatch.ts @@ -212,13 +212,13 @@ namespace ts.TestFSWithWatch { directoryName: string; } - export class TestServerHost implements server.ServerHost { + export class TestServerHost implements server.ServerHost, FormatDiagnosticsHost { args: string[] = []; private readonly output: string[] = []; private fs: Map = createMap(); - private getCanonicalFileName: (s: string) => string; + getCanonicalFileName: (s: string) => string; private toPath: (f: string) => Path; private timeoutCallbacks = new Callbacks(); private immediateCallbacks = new Callbacks(); @@ -234,6 +234,10 @@ namespace ts.TestFSWithWatch { this.reloadFS(fileOrFolderList); } + getNewLine() { + return this.newLine; + } + toNormalizedAbsolutePath(s: string) { return getNormalizedAbsolutePath(s, this.currentDirectory); } From cf9b83accc62833a109e48f03463bb1c02a5f767 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Tue, 10 Oct 2017 21:15:20 -0700 Subject: [PATCH 100/137] Instead of counting events with name, verify each event to not equal event name --- src/harness/unittests/tsserverProjectSystem.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index d5b9b9d62fc..af85e21260a 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -173,8 +173,7 @@ namespace ts.projectSystem { } hasZeroEvent(eventName: T["eventName"]) { - const eventCount = countWhere(this.events, event => event.eventName === eventName); - assert.equal(eventCount, 0); + this.events.forEach(event => assert.notEqual(event.eventName, eventName)); } checkSingleConfigFileDiagEvent(configFileName: string, triggerFile: string) { From de68f067d5bf1b60aaae6c0162e482480807944e Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Wed, 11 Oct 2017 08:17:40 -0700 Subject: [PATCH 101/137] Set flags on fresh object types from getSpreadType Previously, getSpreadType didn't set any flags and relied on its callers to do so. This was error-prone because getSpreadType often returns non-fresh types. --- src/compiler/checker.ts | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index a61ded007f4..7c62dd4468c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -7846,7 +7846,7 @@ namespace ts { * this function should be called in a left folding style, with left = previous result of getSpreadType * and right = the new element to be spread. */ - function getSpreadType(left: Type, right: Type): Type { + function getSpreadType(left: Type, right: Type, symbol: Symbol, propagatedFlags: TypeFlags): Type { if (left.flags & TypeFlags.Any || right.flags & TypeFlags.Any) { return anyType; } @@ -7857,10 +7857,10 @@ namespace ts { return left; } if (left.flags & TypeFlags.Union) { - return mapType(left, t => getSpreadType(t, right)); + return mapType(left, t => getSpreadType(t, right, symbol, propagatedFlags)); } if (right.flags & TypeFlags.Union) { - return mapType(right, t => getSpreadType(left, t)); + return mapType(right, t => getSpreadType(left, t, symbol, propagatedFlags)); } if (right.flags & TypeFlags.NonPrimitive) { return nonPrimitiveType; @@ -7918,7 +7918,13 @@ namespace ts { members.set(leftProp.escapedName, getNonReadonlySymbol(leftProp)); } } - return createAnonymousType(undefined, members, emptyArray, emptyArray, stringIndexInfo, numberIndexInfo); + + const spread = createAnonymousType(undefined, members, emptyArray, emptyArray, stringIndexInfo, numberIndexInfo); + spread.flags |= propagatedFlags; + spread.flags |= TypeFlags.FreshLiteral; + (spread as ObjectType).objectFlags |= ObjectFlags.ObjectLiteral; + spread.symbol = symbol; + return spread; } function getNonReadonlySymbol(prop: Symbol) { @@ -13858,7 +13864,7 @@ namespace ts { checkExternalEmitHelpers(memberDecl, ExternalEmitHelpers.Assign); } if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType()); + spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags); propertiesArray = []; propertiesTable = createSymbolTable(); hasComputedStringProperty = false; @@ -13870,7 +13876,7 @@ namespace ts { error(memberDecl, Diagnostics.Spread_types_may_only_be_created_from_object_types); return unknownType; } - spread = getSpreadType(spread, type); + spread = getSpreadType(spread, type, node.symbol, propagatedFlags); offset = i + 1; continue; } @@ -13915,17 +13921,8 @@ namespace ts { if (spread !== emptyObjectType) { if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType()); + spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags); } - // only set the symbol and flags if this is a (fresh) object type - forEachType(spread, t => { - if (t.flags & TypeFlags.Object) { - t.flags |= propagatedFlags; - t.flags |= TypeFlags.FreshLiteral; - (t as ObjectType).objectFlags |= ObjectFlags.ObjectLiteral; - t.symbol = node.symbol; - } - }); return spread; } @@ -14045,7 +14042,7 @@ namespace ts { else { Debug.assert(attributeDecl.kind === SyntaxKind.JsxSpreadAttribute); if (attributesArray.length > 0) { - spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable)); + spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable), openingLikeElement.symbol, /*propagatedFlags*/ 0); attributesArray = []; attributesTable = createSymbolTable(); } @@ -14054,7 +14051,7 @@ namespace ts { hasSpreadAnyType = true; } if (isValidSpreadType(exprType)) { - spread = getSpreadType(spread, exprType); + spread = getSpreadType(spread, exprType, openingLikeElement.symbol, /*propagatedFlags*/ 0); } else { typeToIntersect = typeToIntersect ? getIntersectionType([typeToIntersect, exprType]) : exprType; @@ -14065,7 +14062,7 @@ namespace ts { if (!hasSpreadAnyType) { if (spread !== emptyObjectType) { if (attributesArray.length > 0) { - spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable)); + spread = getSpreadType(spread, createJsxAttributesType(attributes.symbol, attributesTable), openingLikeElement.symbol, /*propagatedFlags*/ 0); } attributesArray = getPropertiesOfType(spread); } From 576bd8c25f8970adf6952787af9546bb387f8240 Mon Sep 17 00:00:00 2001 From: Charles Pierce Date: Wed, 11 Oct 2017 09:04:51 -0700 Subject: [PATCH 102/137] Ensure Async Modifier is maintained through ES6 Class Conversion (#19092) --- .../refactors/convertFunctionToEs6Class.ts | 14 +++++----- .../convertFunctionToEs6Class_asyncMethods.ts | 27 +++++++++++++++++++ 2 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 tests/cases/fourslash/convertFunctionToEs6Class_asyncMethods.ts diff --git a/src/services/refactors/convertFunctionToEs6Class.ts b/src/services/refactors/convertFunctionToEs6Class.ts index 110f64d1220..1b02b11678b 100644 --- a/src/services/refactors/convertFunctionToEs6Class.ts +++ b/src/services/refactors/convertFunctionToEs6Class.ts @@ -172,7 +172,8 @@ namespace ts.refactor.convertFunctionToES6Class { switch (assignmentBinaryExpression.right.kind) { case SyntaxKind.FunctionExpression: { const functionExpression = assignmentBinaryExpression.right as FunctionExpression; - const method = createMethod(/*decorators*/ undefined, modifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, + const fullModifiers = concatenate(modifiers, getModifierKindFromSource(functionExpression, SyntaxKind.AsyncKeyword)); + const method = createMethod(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, /*typeParameters*/ undefined, functionExpression.parameters, /*type*/ undefined, functionExpression.body); copyComments(assignmentBinaryExpression, method); return method; @@ -192,7 +193,8 @@ namespace ts.refactor.convertFunctionToES6Class { const expression = arrowFunctionBody as Expression; bodyBlock = createBlock([createReturn(expression)]); } - const method = createMethod(/*decorators*/ undefined, modifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, + const fullModifiers = concatenate(modifiers, getModifierKindFromSource(arrowFunction, SyntaxKind.AsyncKeyword)); + const method = createMethod(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, /*typeParameters*/ undefined, arrowFunction.parameters, /*type*/ undefined, bodyBlock); copyComments(assignmentBinaryExpression, method); return method; @@ -243,7 +245,7 @@ namespace ts.refactor.convertFunctionToES6Class { memberElements.unshift(createConstructor(/*decorators*/ undefined, /*modifiers*/ undefined, initializer.parameters, initializer.body)); } - const modifiers = getExportModifierFromSource(precedingNode); + const modifiers = getModifierKindFromSource(precedingNode, SyntaxKind.ExportKeyword); const cls = createClassDeclaration(/*decorators*/ undefined, modifiers, node.name, /*typeParameters*/ undefined, /*heritageClauses*/ undefined, memberElements); // Don't call copyComments here because we'll already leave them in place @@ -256,15 +258,15 @@ namespace ts.refactor.convertFunctionToES6Class { memberElements.unshift(createConstructor(/*decorators*/ undefined, /*modifiers*/ undefined, node.parameters, node.body)); } - const modifiers = getExportModifierFromSource(node); + const modifiers = getModifierKindFromSource(node, SyntaxKind.ExportKeyword); const cls = createClassDeclaration(/*decorators*/ undefined, modifiers, node.name, /*typeParameters*/ undefined, /*heritageClauses*/ undefined, memberElements); // Don't call copyComments here because we'll already leave them in place return cls; } - function getExportModifierFromSource(source: Node) { - return filter(source.modifiers, modifier => modifier.kind === SyntaxKind.ExportKeyword); + function getModifierKindFromSource(source: Node, kind: SyntaxKind) { + return filter(source.modifiers, modifier => modifier.kind === kind); } } } \ No newline at end of file diff --git a/tests/cases/fourslash/convertFunctionToEs6Class_asyncMethods.ts b/tests/cases/fourslash/convertFunctionToEs6Class_asyncMethods.ts new file mode 100644 index 00000000000..ed230d50435 --- /dev/null +++ b/tests/cases/fourslash/convertFunctionToEs6Class_asyncMethods.ts @@ -0,0 +1,27 @@ +/// + +// @allowNonTsExtensions: true +// @Filename: test123.js +////export function /**/MyClass() { +////} +////MyClass.prototype.foo = async function() { +//// await 2; +////} +////MyClass.bar = async function() { +//// await 3; +////} + +verify.applicableRefactorAvailableAtMarker(""); +verify.fileAfterApplyingRefactorAtMarker("", +`export class MyClass { + constructor() { + } + async foo() { + await 2; + } + static async bar() { + await 3; + } +} +`, +'Convert to ES2015 class', 'convert'); From 0c4fe37a92c6aa16fa9746eb828a2c158f5ea3fe Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 11 Oct 2017 10:03:29 -0700 Subject: [PATCH 103/137] In issue template, recommend to use `typescript@next` (#19098) --- issue_template.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/issue_template.md b/issue_template.md index e812fe7b74c..ddc1d070bc9 100644 --- a/issue_template.md +++ b/issue_template.md @@ -2,7 +2,8 @@ -**TypeScript Version:** 2.4.0 / nightly (2.5.0-dev.201xxxxx) + +**TypeScript Version:** 2.6.0-dev.201xxxxx **Code** From e85c6330bad3255189785e676addbfaf26a65aa3 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 11 Oct 2017 10:03:53 -0700 Subject: [PATCH 104/137] Add package-lock.json to repository (#19099) --- .gitignore | 1 - package-lock.json | 5302 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 5302 insertions(+), 1 deletion(-) create mode 100644 package-lock.json diff --git a/.gitignore b/.gitignore index 9b93436e7f7..90b078fc94f 100644 --- a/.gitignore +++ b/.gitignore @@ -58,5 +58,4 @@ internal/ !tests/baselines/reference/project/nodeModules*/**/* .idea yarn.lock -package-lock.json .parallelperf.* diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000000..cde6c1ff733 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,5302 @@ +{ + "name": "typescript", + "version": "2.6.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@gulp-sourcemaps/identity-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@gulp-sourcemaps/identity-map/-/identity-map-1.0.1.tgz", + "integrity": "sha1-z6I7xYQPkQTOMqZedNt+epdLvuE=", + "dev": true, + "requires": { + "acorn": "5.1.2", + "css": "2.2.1", + "normalize-path": "2.1.1", + "source-map": "0.5.7", + "through2": "2.0.3" + }, + "dependencies": { + "acorn": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.1.2.tgz", + "integrity": "sha512-o96FZLJBPY1lvTuJylGA9Bk3t/GKPPJG8H0ydQQl01crzwJgspa4AEIq/pVTXigmK0PHVQhiAtn8WMBLL9D2WA==", + "dev": true + } + } + }, + "@gulp-sourcemaps/map-sources": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@gulp-sourcemaps/map-sources/-/map-sources-1.0.0.tgz", + "integrity": "sha1-iQrnxdjId/bThIYCFazp1+yUW9o=", + "dev": true, + "requires": { + "normalize-path": "2.1.1", + "through2": "2.0.3" + } + }, + "@types/browserify": { + "version": "12.0.33", + "resolved": "https://registry.npmjs.org/@types/browserify/-/browserify-12.0.33.tgz", + "integrity": "sha512-mY6dYfq1Ns3Xqz/JFUcyoWaXtm0XDoNhkU1vCwM/ULM5zqNL+SbtacJhce/JCgPeCdbqdVqq77tJ4HwdtypSxg==", + "dev": true, + "requires": { + "@types/insert-module-globals": "7.0.0", + "@types/node": "8.0.34" + } + }, + "@types/chai": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.0.4.tgz", + "integrity": "sha512-cvU0HomQ7/aGDQJZsbtJXqBQ7w4J4TqLB0Z/h8mKrpRjfeZEvTbygkfJEb7fWdmwpIeDeFmIVwAEqS0OYuUv3Q==", + "dev": true + }, + "@types/colors": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@types/colors/-/colors-1.1.3.tgz", + "integrity": "sha1-VBOwp6GxbdGL4OP9V9L+7Mgcx3Y=", + "dev": true + }, + "@types/convert-source-map": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@types/convert-source-map/-/convert-source-map-1.5.0.tgz", + "integrity": "sha512-4OHKJEw70U59CN24TLRxU3W+B/9GPp0P6g+eNIsObZLAIqw6NTEBorkjIpei4xsvUCx+YzFwUtt4MBZbfSLvbQ==", + "dev": true + }, + "@types/del": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/del/-/del-3.0.0.tgz", + "integrity": "sha512-18mSs54BvzV8+TTQxt0ancig6tsuPZySnhp3cQkWFFDmDMavU4pmWwR+bHHqRBWODYqpzIzVkqKLuk/fP6yypQ==", + "dev": true, + "requires": { + "@types/glob": "5.0.33" + } + }, + "@types/glob": { + "version": "5.0.33", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-5.0.33.tgz", + "integrity": "sha512-BcD4yyWz+qmCggaYMSFF0Xn7GkO6tgwm3Fh9Gxk/kQmEU3Z7flQTnVlMyKBUNvXXNTCCyjqK4XT4/2hLd1gQ2A==", + "dev": true, + "requires": { + "@types/minimatch": "3.0.1", + "@types/node": "8.0.34" + } + }, + "@types/gulp": { + "version": "3.8.33", + "resolved": "https://registry.npmjs.org/@types/gulp/-/gulp-3.8.33.tgz", + "integrity": "sha512-3UpA2pkKO40cNPe/8bxMQFWSASR9Jx67JfN9Z2Cf6ogfDMwXgEHm2XjKmuLYEtrp1IHYApOWlYMLYNgtTJgSAw==", + "dev": true, + "requires": { + "@types/node": "8.0.34", + "@types/orchestrator": "0.3.0", + "@types/vinyl": "2.0.1" + } + }, + "@types/gulp-concat": { + "version": "0.0.31", + "resolved": "https://registry.npmjs.org/@types/gulp-concat/-/gulp-concat-0.0.31.tgz", + "integrity": "sha512-F14zRcKn15HC59RXRlHpcxj79WoLjkJBJBPfN0NBZOgkRCfDZYVu8rs0Y/CH4CJGUbbc/nHczD2LmepDS+ARaA==", + "dev": true, + "requires": { + "@types/node": "8.0.34" + } + }, + "@types/gulp-help": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/@types/gulp-help/-/gulp-help-0.0.33.tgz", + "integrity": "sha1-ZejGUSQQkiVTf6OQA8S6UfT9GsU=", + "dev": true, + "requires": { + "@types/gulp": "3.8.33", + "@types/node": "8.0.34", + "@types/orchestrator": "0.3.0" + } + }, + "@types/gulp-newer": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/@types/gulp-newer/-/gulp-newer-0.0.30.tgz", + "integrity": "sha1-bqn7oVsFdr5CTpl31IlCAEZKFR4=", + "dev": true, + "requires": { + "@types/node": "8.0.34" + } + }, + "@types/gulp-sourcemaps": { + "version": "0.0.31", + "resolved": "https://registry.npmjs.org/@types/gulp-sourcemaps/-/gulp-sourcemaps-0.0.31.tgz", + "integrity": "sha512-kJD1byVNx+sdQlaBzZpSGeFH/4l99TXTY4XSGW+aRk27eOnVyk6VknXJpsb1Jk5E4ThKxZ8GYy6ais7MtprK1w==", + "dev": true, + "requires": { + "@types/node": "8.0.34" + } + }, + "@types/insert-module-globals": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@types/insert-module-globals/-/insert-module-globals-7.0.0.tgz", + "integrity": "sha512-zudCJPwluh1VUDB6Gl/OQdRp+fYy3+47huJB/JMQubMS2p+sH18MCVK4WUz3FqaWLB12yh5ELxVR/+tqwlm/qA==", + "dev": true, + "requires": { + "@types/node": "8.0.34" + } + }, + "@types/merge2": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@types/merge2/-/merge2-1.1.2.tgz", + "integrity": "sha512-Xy54xPmFQ8oAx0S3ku46i/zXE4dvfxl5M8n4p2M62IwxPau8IpobiRtL4jkrUzX6Kgeyb34BHOh0i70SDjKHeA==", + "dev": true, + "requires": { + "@types/node": "8.0.34" + } + }, + "@types/minimatch": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.1.tgz", + "integrity": "sha512-rUO/jz10KRSyA9SHoCWQ8WX9BICyj5jZYu1/ucKEJKb4KzLZCKMURdYbadP157Q6Zl1x0vHsrU+Z/O0XlhYQDw==", + "dev": true + }, + "@types/minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY=", + "dev": true + }, + "@types/mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/@types/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha512-XA4vNO6GCBz8Smq0hqSRo4yRWMqr4FPQrWjhJt6nKskzly4/p87SfuJMFYGRyYb6jo2WNIQU2FDBsY5r1BibUA==", + "dev": true, + "requires": { + "@types/node": "8.0.34" + } + }, + "@types/mocha": { + "version": "2.2.43", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-2.2.43.tgz", + "integrity": "sha512-xNlAmH+lRJdUMXClMTI9Y0pRqIojdxfm7DHsIxoB2iTzu3fnPmSMEN8SsSx0cdwV36d02PWCWaDUoZPDSln+xw==", + "dev": true + }, + "@types/node": { + "version": "8.0.34", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.0.34.tgz", + "integrity": "sha512-Jnmm57+nHqvJUPwUzt1CLoLzFtF2B2vgG7cWFut+a4nqTp9/L6pL0N+o0Jt3V7AQnCKMsPEqQpLFZYleBCdq3w==", + "dev": true + }, + "@types/orchestrator": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@types/orchestrator/-/orchestrator-0.3.0.tgz", + "integrity": "sha1-v4ShaZyTMNT+ic2BJj6PwJ+zKXg=", + "dev": true, + "requires": { + "@types/node": "8.0.34", + "@types/q": "0.0.37" + }, + "dependencies": { + "@types/q": { + "version": "0.0.37", + "resolved": "https://registry.npmjs.org/@types/q/-/q-0.0.37.tgz", + "integrity": "sha512-vjFGX1zMTMz/kUp3xgfJcxMVLkMWVMrdlyc0RwVyve1y9jxwqNaT8wTcv6M51ylq2a/zn5lm8g7qPSoIS4uvZQ==", + "dev": true + } + } + }, + "@types/q": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/q/-/q-1.0.5.tgz", + "integrity": "sha512-sudQPADzmQjXYS1fS2TxbWA/N/vbbfaO4Y7luPaAEyRWZVXC8jHwKV8KgNDbT7IHQaONNZWy9BYsodxY7IyDXQ==", + "dev": true + }, + "@types/run-sequence": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/run-sequence/-/run-sequence-0.0.29.tgz", + "integrity": "sha1-atD3ODE24TklMi5p/EHbd7MLIHU=", + "dev": true, + "requires": { + "@types/gulp": "3.8.33", + "@types/node": "8.0.34" + } + }, + "@types/through2": { + "version": "2.0.33", + "resolved": "https://registry.npmjs.org/@types/through2/-/through2-2.0.33.tgz", + "integrity": "sha1-H/LoihAN+1sUDnu5h5HxGUQA0TE=", + "dev": true, + "requires": { + "@types/node": "8.0.34" + } + }, + "@types/vinyl": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/vinyl/-/vinyl-2.0.1.tgz", + "integrity": "sha512-Joudabfn2ZofU2usW04y8OLmN75u7ZQkW0MCT3AnoBf5oUBp5iQ3Pgfz9+y1RdWkzhCPZo9/wBJ7FMWW2JrY0g==", + "dev": true, + "requires": { + "@types/node": "8.0.34" + } + }, + "@types/xml2js": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@types/xml2js/-/xml2js-0.4.0.tgz", + "integrity": "sha512-3gw0UqFMq7PsfMDwsawD0/L48soXfzOEh0NSAWVO99IZXnhx9LD3nOldHIpGYzZBsrS9NV2vaRFvEdWe+UweXQ==", + "dev": true, + "requires": { + "@types/node": "8.0.34" + } + }, + "JSONStream": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", + "integrity": "sha1-cH92HgHa6eFvG8+TcDt4xwlmV5o=", + "dev": true, + "requires": { + "jsonparse": "1.3.1", + "through": "2.3.8" + } + }, + "abbrev": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", + "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", + "dev": true + }, + "acorn": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", + "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=", + "dev": true + }, + "align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "dev": true, + "requires": { + "kind-of": "3.2.2", + "longest": "1.0.1", + "repeat-string": "1.6.1" + } + }, + "amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", + "dev": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", + "dev": true + }, + "archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "dev": true + }, + "argparse": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz", + "integrity": "sha1-c9g7wmP4bpf4zE9rrhsOkKfSLIY=", + "dev": true, + "requires": { + "sprintf-js": "1.0.3" + } + }, + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "dev": true, + "requires": { + "arr-flatten": "1.1.0" + } + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "array-differ": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", + "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", + "dev": true + }, + "array-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz", + "integrity": "sha1-p5SvDAWrF1KEbudTofIRoFugxE8=", + "dev": true + }, + "array-filter": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", + "integrity": "sha1-fajPLiZijtcygDWB/SH2fKzS7uw=", + "dev": true + }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true + }, + "array-map": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz", + "integrity": "sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=", + "dev": true + }, + "array-reduce": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz", + "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=", + "dev": true + }, + "array-slice": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.0.0.tgz", + "integrity": "sha1-5zA08A3MH0CHYAj9IP6ud71LfC8=", + "dev": true + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "1.0.3" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "asn1.js": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.9.1.tgz", + "integrity": "sha1-SLokC0WpKA6UdImQull9IWYX/UA=", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "inherits": "2.0.3", + "minimalistic-assert": "1.0.0" + } + }, + "assert": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", + "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", + "dev": true, + "requires": { + "util": "0.10.3" + } + }, + "assertion-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.0.2.tgz", + "integrity": "sha1-E8pRXYYgbaC6xm6DTdOX2HWBCUw=", + "dev": true + }, + "astw": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/astw/-/astw-2.2.0.tgz", + "integrity": "sha1-e9QXhNMkk5h66yOba04cV6hzuRc=", + "dev": true, + "requires": { + "acorn": "4.0.13" + } + }, + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", + "dev": true + }, + "atob": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/atob/-/atob-1.1.3.tgz", + "integrity": "sha1-lfE2KbEsOlGl0hWr3OKqnzL4B3M=", + "dev": true + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base64-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.1.tgz", + "integrity": "sha512-dwVUVIXsBZXwTuwnXI9RK8sBmgq09NDHzyR9SAph9eqk76gKK2JSQmZARC2zRC81JC2QTtxD0ARU5qTS25gIGw==", + "dev": true + }, + "beeper": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/beeper/-/beeper-1.1.1.tgz", + "integrity": "sha1-5tXqjF2tABMEpwsiY4RH9pyy+Ak=", + "dev": true + }, + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", + "integrity": "sha1-wHshHHyVLsH479Uad+8NHTmQopI=", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "dev": true, + "requires": { + "expand-range": "1.8.2", + "preserve": "0.2.0", + "repeat-element": "1.1.2" + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "browser-pack": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.0.2.tgz", + "integrity": "sha1-+GzWzvT1MAyOY+B6TVEvZfv/RTE=", + "dev": true, + "requires": { + "JSONStream": "1.3.1", + "combine-source-map": "0.7.2", + "defined": "1.0.0", + "through2": "2.0.3", + "umd": "3.0.1" + } + }, + "browser-resolve": { + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.2.tgz", + "integrity": "sha1-j/CbCixCFxihBRwmCzLkj0QpOM4=", + "dev": true, + "requires": { + "resolve": "1.1.7" + } + }, + "browser-stdout": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", + "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=", + "dev": true + }, + "browserify": { + "version": "14.4.0", + "resolved": "https://registry.npmjs.org/browserify/-/browserify-14.4.0.tgz", + "integrity": "sha1-CJo0Y69Y0OSNjNQHCz90ZU1avKk=", + "dev": true, + "requires": { + "JSONStream": "1.3.1", + "assert": "1.4.1", + "browser-pack": "6.0.2", + "browser-resolve": "1.11.2", + "browserify-zlib": "0.1.4", + "buffer": "5.0.8", + "cached-path-relative": "1.0.1", + "concat-stream": "1.5.2", + "console-browserify": "1.1.0", + "constants-browserify": "1.0.0", + "crypto-browserify": "3.11.1", + "defined": "1.0.0", + "deps-sort": "2.0.0", + "domain-browser": "1.1.7", + "duplexer2": "0.1.4", + "events": "1.1.1", + "glob": "7.1.2", + "has": "1.0.1", + "htmlescape": "1.1.1", + "https-browserify": "1.0.0", + "inherits": "2.0.3", + "insert-module-globals": "7.0.1", + "labeled-stream-splicer": "2.0.0", + "module-deps": "4.1.1", + "os-browserify": "0.1.2", + "parents": "1.0.1", + "path-browserify": "0.0.0", + "process": "0.11.10", + "punycode": "1.4.1", + "querystring-es3": "0.2.1", + "read-only-stream": "2.0.0", + "readable-stream": "2.3.3", + "resolve": "1.1.7", + "shasum": "1.0.2", + "shell-quote": "1.6.1", + "stream-browserify": "2.0.1", + "stream-http": "2.7.2", + "string_decoder": "1.0.3", + "subarg": "1.0.0", + "syntax-error": "1.3.0", + "through2": "2.0.3", + "timers-browserify": "1.4.2", + "tty-browserify": "0.0.0", + "url": "0.11.0", + "util": "0.10.3", + "vm-browserify": "0.0.4", + "xtend": "4.0.1" + } + }, + "browserify-aes": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.0.8.tgz", + "integrity": "sha512-WYCMOT/PtGTlpOKFht0YJFYcPy6pLCR98CtWfzK13zoynLlBMvAdEMSRGmgnJCw2M2j/5qxBkinZQFobieM8dQ==", + "dev": true, + "requires": { + "buffer-xor": "1.0.3", + "cipher-base": "1.0.4", + "create-hash": "1.1.3", + "evp_bytestokey": "1.0.3", + "inherits": "2.0.3", + "safe-buffer": "5.1.1" + } + }, + "browserify-cipher": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.0.tgz", + "integrity": "sha1-mYgkSHS/XtTijalWZtzWasj8Njo=", + "dev": true, + "requires": { + "browserify-aes": "1.0.8", + "browserify-des": "1.0.0", + "evp_bytestokey": "1.0.3" + } + }, + "browserify-des": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.0.tgz", + "integrity": "sha1-2qJ3cXRwki7S/hhZQRihdUOXId0=", + "dev": true, + "requires": { + "cipher-base": "1.0.4", + "des.js": "1.0.0", + "inherits": "2.0.3" + } + }, + "browserify-rsa": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "randombytes": "2.0.5" + } + }, + "browserify-sign": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", + "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "browserify-rsa": "4.0.1", + "create-hash": "1.1.3", + "create-hmac": "1.1.6", + "elliptic": "6.4.0", + "inherits": "2.0.3", + "parse-asn1": "5.1.0" + } + }, + "browserify-zlib": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.1.4.tgz", + "integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=", + "dev": true, + "requires": { + "pako": "0.2.9" + } + }, + "buffer": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.0.8.tgz", + "integrity": "sha512-xXvjQhVNz50v2nPeoOsNqWCLGfiv4ji/gXZM28jnVwdLJxH4mFyqgqCKfaK9zf1KUbG6zTkjLOy7ou+jSMarGA==", + "dev": true, + "requires": { + "base64-js": "1.2.1", + "ieee754": "1.1.8" + } + }, + "buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", + "dev": true + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", + "dev": true + }, + "cached-path-relative": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.0.1.tgz", + "integrity": "sha1-0JxLUoAKpMB44t2BqGmqyQ0uVOc=", + "dev": true + }, + "camelcase": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", + "dev": true + }, + "camelcase-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "dev": true, + "requires": { + "camelcase": "2.1.1", + "map-obj": "1.0.1" + } + }, + "center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "dev": true, + "optional": true, + "requires": { + "align-text": "0.1.4", + "lazy-cache": "1.0.4" + } + }, + "chai": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.1.2.tgz", + "integrity": "sha1-D2RYS6ZC8PKs4oBiefTwbKI61zw=", + "dev": true, + "requires": { + "assertion-error": "1.0.2", + "check-error": "1.0.2", + "deep-eql": "3.0.1", + "get-func-name": "2.0.0", + "pathval": "1.1.0", + "type-detect": "4.0.3" + } + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "dev": true, + "requires": { + "ansi-styles": "2.2.1", + "escape-string-regexp": "1.0.5", + "has-ansi": "2.0.0", + "strip-ansi": "3.0.1", + "supports-color": "2.0.0" + } + }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "dev": true + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "requires": { + "inherits": "2.0.3", + "safe-buffer": "5.1.1" + } + }, + "cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", + "dev": true, + "optional": true, + "requires": { + "center-align": "0.1.3", + "right-align": "0.1.3", + "wordwrap": "0.0.2" + }, + "dependencies": { + "wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", + "dev": true, + "optional": true + } + } + }, + "clone": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.2.tgz", + "integrity": "sha1-Jgt6meux7f4kdTgXX3gyQ8sZ0Uk=", + "dev": true + }, + "clone-buffer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-buffer/-/clone-buffer-1.0.0.tgz", + "integrity": "sha1-4+JbIHrE5wGvch4staFnksrD3Fg=", + "dev": true + }, + "clone-stats": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-0.0.1.tgz", + "integrity": "sha1-uI+UqCzzi4eR1YBG6kAprYjKmdE=", + "dev": true + }, + "cloneable-readable": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cloneable-readable/-/cloneable-readable-1.0.0.tgz", + "integrity": "sha1-pikNQT8hemEjL5XkWP84QYz7ARc=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "process-nextick-args": "1.0.7", + "through2": "2.0.3" + } + }, + "color-convert": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.0.tgz", + "integrity": "sha1-Gsz5fdc5uYO/mU1W/sj5WFNkG3o=", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "colors": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", + "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", + "dev": true + }, + "combine-source-map": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.7.2.tgz", + "integrity": "sha1-CHAxKFazB6h8xKxIbzqaYq7MwJ4=", + "dev": true, + "requires": { + "convert-source-map": "1.1.3", + "inline-source-map": "0.6.2", + "lodash.memoize": "3.0.4", + "source-map": "0.5.7" + }, + "dependencies": { + "convert-source-map": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz", + "integrity": "sha1-SCnId+n+SbMWHzvzZziI4gRpmGA=", + "dev": true + } + } + }, + "commander": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.11.0.tgz", + "integrity": "sha512-b0553uYA5YAEGgyYIGYROzKQ7X5RAqedkfjiZxwi0kL1g3bOaBNNZfYkzt/CL0umgD5wc9Jec2FbB98CjkMRvQ==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", + "integrity": "sha1-cIl4Yk2FavQaWnQd790mHadSwmY=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.0.6", + "typedarray": "0.0.6" + }, + "dependencies": { + "readable-stream": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "string_decoder": "0.10.31", + "util-deprecate": "1.0.2" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "concat-with-sourcemaps": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/concat-with-sourcemaps/-/concat-with-sourcemaps-1.0.4.tgz", + "integrity": "sha1-9Vs74q60dgGxCi1SWcz7cP0vHdY=", + "dev": true, + "requires": { + "source-map": "0.5.7" + } + }, + "console-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "dev": true, + "requires": { + "date-now": "0.1.4" + } + }, + "constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", + "dev": true + }, + "convert-source-map": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.0.tgz", + "integrity": "sha1-ms1whRxtXf3ZPZKC5e35SgP/RrU=", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "create-ecdh": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.0.tgz", + "integrity": "sha1-iIxyNZbN92EvZJgjPuvXo1MBc30=", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "elliptic": "6.4.0" + } + }, + "create-hash": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.1.3.tgz", + "integrity": "sha1-YGBCrIuSYnUPSDyt2rD1gZFy2P0=", + "dev": true, + "requires": { + "cipher-base": "1.0.4", + "inherits": "2.0.3", + "ripemd160": "2.0.1", + "sha.js": "2.4.9" + } + }, + "create-hmac": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.6.tgz", + "integrity": "sha1-rLniIaThe9sHbpBlfEK5PjcmzwY=", + "dev": true, + "requires": { + "cipher-base": "1.0.4", + "create-hash": "1.1.3", + "inherits": "2.0.3", + "ripemd160": "2.0.1", + "safe-buffer": "5.1.1", + "sha.js": "2.4.9" + } + }, + "crypto-browserify": { + "version": "3.11.1", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.11.1.tgz", + "integrity": "sha512-Na7ZlwCOqoaW5RwUK1WpXws2kv8mNhWdTlzob0UXulk6G9BDbyiJaGTYBIX61Ozn9l1EPPJpICZb4DaOpT9NlQ==", + "dev": true, + "requires": { + "browserify-cipher": "1.0.0", + "browserify-sign": "4.0.4", + "create-ecdh": "4.0.0", + "create-hash": "1.1.3", + "create-hmac": "1.1.6", + "diffie-hellman": "5.0.2", + "inherits": "2.0.3", + "pbkdf2": "3.0.14", + "public-encrypt": "4.0.0", + "randombytes": "2.0.5" + } + }, + "css": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/css/-/css-2.2.1.tgz", + "integrity": "sha1-c6TIHehdtmTU7mdPfUcIXjstVdw=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "source-map": "0.1.43", + "source-map-resolve": "0.3.1", + "urix": "0.1.0" + }, + "dependencies": { + "source-map": { + "version": "0.1.43", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", + "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", + "dev": true, + "requires": { + "amdefine": "1.0.1" + } + } + } + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "requires": { + "array-find-index": "1.0.2" + } + }, + "d": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "dev": true, + "requires": { + "es5-ext": "0.10.31" + } + }, + "date-now": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", + "dev": true + }, + "dateformat": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-2.2.0.tgz", + "integrity": "sha1-QGXiATz5+5Ft39gu+1Bq1MZ2kGI=", + "dev": true + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "debug-fabulous": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/debug-fabulous/-/debug-fabulous-0.2.1.tgz", + "integrity": "sha512-u0TV6HcfLsZ03xLBhdhSViQMldaiQ2o+8/nSILaXkuNSWvxkx66vYJUAam0Eu7gAilJRX/69J4kKdqajQPaPyw==", + "dev": true, + "requires": { + "debug": "3.1.0", + "memoizee": "0.4.11", + "object-assign": "4.1.1" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "requires": { + "type-detect": "4.0.3" + } + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "defaults": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", + "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", + "dev": true, + "requires": { + "clone": "1.0.2" + } + }, + "defined": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", + "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", + "dev": true + }, + "del": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/del/-/del-3.0.0.tgz", + "integrity": "sha1-U+z2mf/LyzljdpGrE7rxYIGXZuU=", + "dev": true, + "requires": { + "globby": "6.1.0", + "is-path-cwd": "1.0.0", + "is-path-in-cwd": "1.0.0", + "p-map": "1.2.0", + "pify": "3.0.0", + "rimraf": "2.6.2" + } + }, + "deprecated": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/deprecated/-/deprecated-0.0.1.tgz", + "integrity": "sha1-+cmvVGSvoeepcUWKi97yqpTVuxk=", + "dev": true + }, + "deps-sort": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.0.tgz", + "integrity": "sha1-CRckkC6EZYJg65EHSMzNGvbiH7U=", + "dev": true, + "requires": { + "JSONStream": "1.3.1", + "shasum": "1.0.2", + "subarg": "1.0.0", + "through2": "2.0.3" + } + }, + "des.js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", + "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "minimalistic-assert": "1.0.0" + } + }, + "detect-file": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-0.1.0.tgz", + "integrity": "sha1-STXe39lIhkjgBrASlWbpOGcR6mM=", + "dev": true, + "requires": { + "fs-exists-sync": "0.1.0" + } + }, + "detect-newline": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz", + "integrity": "sha1-9B8cEL5LAOh7XxPaaAdZ8sW/0+I=", + "dev": true + }, + "detective": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/detective/-/detective-4.5.0.tgz", + "integrity": "sha1-blqMaybmx6JUsca210kNmOyR7dE=", + "dev": true, + "requires": { + "acorn": "4.0.13", + "defined": "1.0.0" + } + }, + "diff": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.3.1.tgz", + "integrity": "sha512-MKPHZDMB0o6yHyDryUOScqZibp914ksXwAMYMTHj6KO8UeKsRYNJD3oNCKjTqZon+V488P7N/HzXF8t7ZR95ww==", + "dev": true + }, + "diffie-hellman": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.2.tgz", + "integrity": "sha1-tYNXOScM/ias9jIJn97SoH8gnl4=", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "miller-rabin": "4.0.1", + "randombytes": "2.0.5" + } + }, + "domain-browser": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.1.7.tgz", + "integrity": "sha1-hnqksJP6oF8d4IwG9NeyH9+GmLw=", + "dev": true + }, + "duplexer2": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", + "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", + "dev": true, + "requires": { + "readable-stream": "2.3.3" + } + }, + "duplexify": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.1.tgz", + "integrity": "sha512-j5goxHTwVED1Fpe5hh3q9R93Kip0Bg2KVAt4f8CEYM3UEwYcPSvWbXaUQOzdX/HtiNomipv+gU7ASQPDbV7pGQ==", + "dev": true, + "requires": { + "end-of-stream": "1.4.0", + "inherits": "2.0.3", + "readable-stream": "2.3.3", + "stream-shift": "1.0.0" + }, + "dependencies": { + "end-of-stream": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.0.tgz", + "integrity": "sha1-epDYM+/abPpurA9JSduw+tOmMgY=", + "dev": true, + "requires": { + "once": "1.4.0" + } + } + } + }, + "elliptic": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz", + "integrity": "sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "brorand": "1.1.0", + "hash.js": "1.1.3", + "hmac-drbg": "1.0.1", + "inherits": "2.0.3", + "minimalistic-assert": "1.0.0", + "minimalistic-crypto-utils": "1.0.1" + } + }, + "end-of-stream": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-0.1.5.tgz", + "integrity": "sha1-jhdyBsPICDfYVjLouTWd/osvbq8=", + "dev": true, + "requires": { + "once": "1.3.3" + }, + "dependencies": { + "once": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", + "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + } + } + }, + "error-ex": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", + "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "dev": true, + "requires": { + "is-arrayish": "0.2.1" + } + }, + "es5-ext": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.31.tgz", + "integrity": "sha1-e7k4yVp/G59ygJLcCcQe3MOY7v4=", + "dev": true, + "requires": { + "es6-iterator": "2.0.1", + "es6-symbol": "3.1.1" + } + }, + "es6-iterator": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.1.tgz", + "integrity": "sha1-jjGcnwRTv1ddN0lAplWSDlnKVRI=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.31", + "es6-symbol": "3.1.1" + } + }, + "es6-promise": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.3.1.tgz", + "integrity": "sha1-oIzd6EzNvzTQJ6FFG8kdS80ophM=", + "dev": true + }, + "es6-symbol": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", + "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.31" + } + }, + "es6-weak-map": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/es6-weak-map/-/es6-weak-map-2.0.2.tgz", + "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.31", + "es6-iterator": "2.0.1", + "es6-symbol": "3.1.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "escodegen": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", + "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", + "dev": true, + "requires": { + "esprima": "2.7.3", + "estraverse": "1.9.3", + "esutils": "2.0.2", + "optionator": "0.8.2", + "source-map": "0.2.0" + }, + "dependencies": { + "source-map": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", + "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", + "dev": true, + "optional": true, + "requires": { + "amdefine": "1.0.1" + } + } + } + }, + "esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", + "dev": true + }, + "estraverse": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", + "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "event-emitter": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", + "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.31" + } + }, + "events": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", + "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", + "dev": true + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "requires": { + "md5.js": "1.3.4", + "safe-buffer": "5.1.1" + } + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "requires": { + "is-posix-bracket": "0.1.1" + } + }, + "expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true, + "requires": { + "fill-range": "2.2.3" + } + }, + "expand-tilde": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-1.2.2.tgz", + "integrity": "sha1-C4HrqJflo9MdHD0QL48BRB5VlEk=", + "dev": true, + "requires": { + "os-homedir": "1.0.2" + } + }, + "extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", + "dev": true + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "0.1.1" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + }, + "fancy-log": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.0.tgz", + "integrity": "sha1-Rb4X0Cu5kX1gzP/UmVyZnmyMmUg=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "time-stamp": "1.1.0" + } + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "filelist": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-0.0.6.tgz", + "integrity": "sha1-WKZBrR9XV0on/oekQO8xiDS1Vxk=", + "dev": true, + "requires": { + "minimatch": "3.0.4", + "utilities": "0.0.37" + }, + "dependencies": { + "utilities": { + "version": "0.0.37", + "resolved": "https://registry.npmjs.org/utilities/-/utilities-0.0.37.tgz", + "integrity": "sha1-o0cNCn9ogULZ6KV87hEo8S4Z4ZY=", + "dev": true + } + } + }, + "filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", + "dev": true + }, + "fill-range": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", + "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", + "dev": true, + "requires": { + "is-number": "2.1.0", + "isobject": "2.1.0", + "randomatic": "1.1.7", + "repeat-element": "1.1.2", + "repeat-string": "1.6.1" + } + }, + "find-index": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/find-index/-/find-index-0.1.1.tgz", + "integrity": "sha1-Z101iyyjiS15Whq0cjL4tuLg3eQ=", + "dev": true + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "2.1.0", + "pinkie-promise": "2.0.1" + } + }, + "findup-sync": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-0.4.3.tgz", + "integrity": "sha1-QAQ5Kee8YK3wt/SCfExudaDeyhI=", + "dev": true, + "requires": { + "detect-file": "0.1.0", + "is-glob": "2.0.1", + "micromatch": "2.3.11", + "resolve-dir": "0.1.1" + } + }, + "fined": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fined/-/fined-1.1.0.tgz", + "integrity": "sha1-s33IRLdqL15wgeiE98CuNE8VNHY=", + "dev": true, + "requires": { + "expand-tilde": "2.0.2", + "is-plain-object": "2.0.4", + "object.defaults": "1.1.0", + "object.pick": "1.3.0", + "parse-filepath": "1.0.1" + }, + "dependencies": { + "expand-tilde": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "dev": true, + "requires": { + "homedir-polyfill": "1.0.1" + } + } + } + }, + "first-chunk-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/first-chunk-stream/-/first-chunk-stream-1.0.0.tgz", + "integrity": "sha1-Wb+1DNkF9g18OUzT2ayqtOatk04=", + "dev": true + }, + "flagged-respawn": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-0.3.2.tgz", + "integrity": "sha1-/xke3c1wiKZ1smEP/8l2vpuAdLU=", + "dev": true + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "dev": true, + "requires": { + "for-in": "1.0.2" + } + }, + "fs-exists-sync": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz", + "integrity": "sha1-mC1ok6+RjnLQjeyehnP/K1qNat0=", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "gaze": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/gaze/-/gaze-0.5.2.tgz", + "integrity": "sha1-QLcJU30k0dRXZ9takIaJ3+aaxE8=", + "dev": true, + "requires": { + "globule": "0.1.0" + } + }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true + }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "dev": true, + "requires": { + "glob-parent": "2.0.0", + "is-glob": "2.0.1" + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "dev": true, + "requires": { + "is-glob": "2.0.1" + } + }, + "glob-stream": { + "version": "3.1.18", + "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-3.1.18.tgz", + "integrity": "sha1-kXCl8St5Awb9/lmPMT+PeVT9FDs=", + "dev": true, + "requires": { + "glob": "4.5.3", + "glob2base": "0.0.12", + "minimatch": "2.0.10", + "ordered-read-streams": "0.1.0", + "through2": "0.6.5", + "unique-stream": "1.0.0" + }, + "dependencies": { + "glob": { + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz", + "integrity": "sha1-xstz0yJsHv7wTePFbQEvAzd+4V8=", + "dev": true, + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "2.0.10", + "once": "1.4.0" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "minimatch": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", + "integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=", + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, + "through2": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", + "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", + "dev": true, + "requires": { + "readable-stream": "1.0.34", + "xtend": "4.0.1" + } + } + } + }, + "glob-watcher": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/glob-watcher/-/glob-watcher-0.0.6.tgz", + "integrity": "sha1-uVtKjfdLOcgymLDAXJeLTZo7cQs=", + "dev": true, + "requires": { + "gaze": "0.5.2" + } + }, + "glob2base": { + "version": "0.0.12", + "resolved": "https://registry.npmjs.org/glob2base/-/glob2base-0.0.12.tgz", + "integrity": "sha1-nUGbPijxLoOjYhZKJ3BVkiycDVY=", + "dev": true, + "requires": { + "find-index": "0.1.1" + } + }, + "global-modules": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-0.2.3.tgz", + "integrity": "sha1-6lo77ULG1s6ZWk+KEmm12uIjgo0=", + "dev": true, + "requires": { + "global-prefix": "0.1.5", + "is-windows": "0.2.0" + } + }, + "global-prefix": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-0.1.5.tgz", + "integrity": "sha1-jTvGuNo8qBEqFg2NSW/wRiv+948=", + "dev": true, + "requires": { + "homedir-polyfill": "1.0.1", + "ini": "1.3.4", + "is-windows": "0.2.0", + "which": "1.3.0" + } + }, + "globby": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", + "dev": true, + "requires": { + "array-union": "1.0.2", + "glob": "7.1.2", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "globule": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/globule/-/globule-0.1.0.tgz", + "integrity": "sha1-2cjt3h2nnRJaFRt5UzuXhnY0auU=", + "dev": true, + "requires": { + "glob": "3.1.21", + "lodash": "1.0.2", + "minimatch": "0.2.14" + }, + "dependencies": { + "glob": { + "version": "3.1.21", + "resolved": "https://registry.npmjs.org/glob/-/glob-3.1.21.tgz", + "integrity": "sha1-0p4KBV3qUTj00H7UDomC6DwgZs0=", + "dev": true, + "requires": { + "graceful-fs": "1.2.3", + "inherits": "1.0.2", + "minimatch": "0.2.14" + } + }, + "graceful-fs": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.3.tgz", + "integrity": "sha1-FaSAaldUfLLS2/J/QuiajDRRs2Q=", + "dev": true + }, + "inherits": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-1.0.2.tgz", + "integrity": "sha1-ykMJ2t7mtUzAuNJH6NfHoJdb3Js=", + "dev": true + }, + "minimatch": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.2.14.tgz", + "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", + "dev": true, + "requires": { + "lru-cache": "2.7.3", + "sigmund": "1.0.1" + } + } + } + }, + "glogg": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.0.tgz", + "integrity": "sha1-f+DxmfV6yQbPUS/urY+Q7kooT8U=", + "dev": true, + "requires": { + "sparkles": "1.0.0" + } + }, + "graceful-fs": { + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.11.tgz", + "integrity": "sha1-dhPHeKGv6mLyXGMKCG1/Osu92Bg=", + "dev": true, + "requires": { + "natives": "1.1.0" + } + }, + "growl": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.3.tgz", + "integrity": "sha512-hKlsbA5Vu3xsh1Cg3J7jSmX/WaW6A5oBeqzM88oNbCRQFz+zUaXm6yxS4RVytp1scBoJzSYl4YAEOQIt6O8V1Q==", + "dev": true + }, + "gulp": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/gulp/-/gulp-3.9.1.tgz", + "integrity": "sha1-VxzkWSjdQK9lFPxAEYZgFsE4RbQ=", + "dev": true, + "requires": { + "archy": "1.0.0", + "chalk": "1.1.3", + "deprecated": "0.0.1", + "gulp-util": "3.0.8", + "interpret": "1.0.4", + "liftoff": "2.3.0", + "minimist": "1.2.0", + "orchestrator": "0.3.8", + "pretty-hrtime": "1.0.3", + "semver": "4.3.6", + "tildify": "1.2.0", + "v8flags": "2.1.1", + "vinyl-fs": "0.3.14" + } + }, + "gulp-clone": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gulp-clone/-/gulp-clone-1.0.0.tgz", + "integrity": "sha1-mubGVr2cTzae6AXu9WV4a8gQBbA=", + "dev": true, + "requires": { + "gulp-util": "2.2.20", + "through2": "0.4.2" + }, + "dependencies": { + "ansi-regex": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz", + "integrity": "sha1-DY6UaWej2BQ/k+JOKYUl/BsiNfk=", + "dev": true + }, + "ansi-styles": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.1.0.tgz", + "integrity": "sha1-6uy/Zs1waIJ2Cy9GkVgrj1XXp94=", + "dev": true + }, + "chalk": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.5.1.tgz", + "integrity": "sha1-Zjs6ZItotV0EaQ1JFnqoN4WPIXQ=", + "dev": true, + "requires": { + "ansi-styles": "1.1.0", + "escape-string-regexp": "1.0.5", + "has-ansi": "0.1.0", + "strip-ansi": "0.3.0", + "supports-color": "0.2.0" + } + }, + "dateformat": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.12.tgz", + "integrity": "sha1-nxJLZ1lMk3/3BpMuSmQsyo27/uk=", + "dev": true, + "requires": { + "get-stdin": "4.0.1", + "meow": "3.7.0" + } + }, + "gulp-util": { + "version": "2.2.20", + "resolved": "https://registry.npmjs.org/gulp-util/-/gulp-util-2.2.20.tgz", + "integrity": "sha1-1xRuVyiRC9jwR6awseVJvCLb1kw=", + "dev": true, + "requires": { + "chalk": "0.5.1", + "dateformat": "1.0.12", + "lodash._reinterpolate": "2.4.1", + "lodash.template": "2.4.1", + "minimist": "0.2.0", + "multipipe": "0.1.2", + "through2": "0.5.1", + "vinyl": "0.2.3" + }, + "dependencies": { + "through2": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.5.1.tgz", + "integrity": "sha1-390BLrnHAOIyP9M084rGIqs3Lac=", + "dev": true, + "requires": { + "readable-stream": "1.0.34", + "xtend": "3.0.0" + } + } + } + }, + "has-ansi": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-0.1.0.tgz", + "integrity": "sha1-hPJlqujA5qiKEtcCKJS3VoiUxi4=", + "dev": true, + "requires": { + "ansi-regex": "0.2.1" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "lodash._reinterpolate": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-2.4.1.tgz", + "integrity": "sha1-TxInqlqHEfxjL1sHofRgequLMiI=", + "dev": true + }, + "lodash.escape": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-2.4.1.tgz", + "integrity": "sha1-LOEsXghNsKV92l5dHu659dF1o7Q=", + "dev": true, + "requires": { + "lodash._escapehtmlchar": "2.4.1", + "lodash._reunescapedhtml": "2.4.1", + "lodash.keys": "2.4.1" + } + }, + "lodash.keys": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-2.4.1.tgz", + "integrity": "sha1-SN6kbfj/djKxDXBrissmWR4rNyc=", + "dev": true, + "requires": { + "lodash._isnative": "2.4.1", + "lodash._shimkeys": "2.4.1", + "lodash.isobject": "2.4.1" + } + }, + "lodash.template": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-2.4.1.tgz", + "integrity": "sha1-nmEQB+32KRKal0qzxIuBez4c8g0=", + "dev": true, + "requires": { + "lodash._escapestringchar": "2.4.1", + "lodash._reinterpolate": "2.4.1", + "lodash.defaults": "2.4.1", + "lodash.escape": "2.4.1", + "lodash.keys": "2.4.1", + "lodash.templatesettings": "2.4.1", + "lodash.values": "2.4.1" + } + }, + "lodash.templatesettings": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-2.4.1.tgz", + "integrity": "sha1-6nbHXRHrhtTb6JqDiTu4YZKaxpk=", + "dev": true, + "requires": { + "lodash._reinterpolate": "2.4.1", + "lodash.escape": "2.4.1" + } + }, + "minimist": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.2.0.tgz", + "integrity": "sha1-Tf/lJdriuGTGbC4jxicdev3s784=", + "dev": true + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, + "strip-ansi": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.3.0.tgz", + "integrity": "sha1-JfSOoiynkYfzF0pNuHWTR7sSYiA=", + "dev": true, + "requires": { + "ansi-regex": "0.2.1" + } + }, + "supports-color": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-0.2.0.tgz", + "integrity": "sha1-2S3iaU6z9nMjlz1649i1W0wiGQo=", + "dev": true + }, + "through2": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.4.2.tgz", + "integrity": "sha1-2/WGYDEVHsg1K7bE22SiKSqEC5s=", + "dev": true, + "requires": { + "readable-stream": "1.0.34", + "xtend": "2.1.2" + }, + "dependencies": { + "xtend": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", + "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", + "dev": true, + "requires": { + "object-keys": "0.4.0" + } + } + } + }, + "vinyl": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.2.3.tgz", + "integrity": "sha1-vKk4IJWC7FpJrVOKAPofEl5RMlI=", + "dev": true, + "requires": { + "clone-stats": "0.0.1" + } + }, + "xtend": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-3.0.0.tgz", + "integrity": "sha1-XM50B7r2Qsunvs2laBEcST9ZZlo=", + "dev": true + } + } + }, + "gulp-concat": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/gulp-concat/-/gulp-concat-2.6.1.tgz", + "integrity": "sha1-Yz0WyV2IUEYorQJmVmPO5aR5M1M=", + "dev": true, + "requires": { + "concat-with-sourcemaps": "1.0.4", + "through2": "2.0.3", + "vinyl": "2.1.0" + }, + "dependencies": { + "clone": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.1.tgz", + "integrity": "sha1-0hfR6WERjjrJpLi7oyhVU79kfNs=", + "dev": true + }, + "clone-stats": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clone-stats/-/clone-stats-1.0.0.tgz", + "integrity": "sha1-s3gt/4u1R04Yuba/D9/ngvh3doA=", + "dev": true + }, + "replace-ext": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz", + "integrity": "sha1-3mMSg3P8v3w8z6TeWkgMRaZ5WOs=", + "dev": true + }, + "vinyl": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.1.0.tgz", + "integrity": "sha1-Ah+cLPlR1rk5lDyJ617lrdT9kkw=", + "dev": true, + "requires": { + "clone": "2.1.1", + "clone-buffer": "1.0.0", + "clone-stats": "1.0.0", + "cloneable-readable": "1.0.0", + "remove-trailing-separator": "1.1.0", + "replace-ext": "1.0.0" + } + } + } + }, + "gulp-help": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/gulp-help/-/gulp-help-1.6.1.tgz", + "integrity": "sha1-Jh2xhuGDl/7z9qLCLpwxW/qIrgw=", + "dev": true, + "requires": { + "chalk": "1.1.3", + "object-assign": "3.0.0" + }, + "dependencies": { + "object-assign": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", + "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=", + "dev": true + } + } + }, + "gulp-insert": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/gulp-insert/-/gulp-insert-0.5.0.tgz", + "integrity": "sha1-MjE/E+SiPPWsylzl8MCAkjx3hgI=", + "dev": true, + "requires": { + "readable-stream": "1.1.14", + "streamqueue": "0.0.6" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "gulp-newer": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/gulp-newer/-/gulp-newer-1.3.0.tgz", + "integrity": "sha1-1Q7Ky7gi7aSStXMkpshaB/2aVcE=", + "dev": true, + "requires": { + "glob": "7.1.2", + "gulp-util": "3.0.8", + "kew": "0.7.0" + } + }, + "gulp-sourcemaps": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/gulp-sourcemaps/-/gulp-sourcemaps-2.6.1.tgz", + "integrity": "sha512-1qHCI3hdmsMdq/SUotxwUh/L8YzlI6J9zQ5ifNOtx4Y6KV5y5sGuORv1KZzWhuKtz/mXNh5xLESUtwC4EndCjA==", + "dev": true, + "requires": { + "@gulp-sourcemaps/identity-map": "1.0.1", + "@gulp-sourcemaps/map-sources": "1.0.0", + "acorn": "4.0.13", + "convert-source-map": "1.5.0", + "css": "2.2.1", + "debug-fabulous": "0.2.1", + "detect-newline": "2.1.0", + "graceful-fs": "4.1.11", + "source-map": "0.5.7", + "strip-bom-string": "1.0.0", + "through2": "2.0.3", + "vinyl": "1.2.0" + }, + "dependencies": { + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "vinyl": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-1.2.0.tgz", + "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", + "dev": true, + "requires": { + "clone": "1.0.2", + "clone-stats": "0.0.1", + "replace-ext": "0.0.1" + } + } + } + }, + "gulp-typescript": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/gulp-typescript/-/gulp-typescript-3.2.2.tgz", + "integrity": "sha1-t+Xh08s193LlPmBAJmAYJuK+d/w=", + "dev": true, + "requires": { + "gulp-util": "3.0.8", + "source-map": "0.5.7", + "through2": "2.0.3", + "vinyl-fs": "2.4.4" + }, + "dependencies": { + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "requires": { + "is-glob": "3.1.0", + "path-dirname": "1.0.2" + } + }, + "glob-stream": { + "version": "5.3.5", + "resolved": "https://registry.npmjs.org/glob-stream/-/glob-stream-5.3.5.tgz", + "integrity": "sha1-pVZlqajM3EGRWofHAeMtTgFvrSI=", + "dev": true, + "requires": { + "extend": "3.0.1", + "glob": "5.0.15", + "glob-parent": "3.1.0", + "micromatch": "2.3.11", + "ordered-read-streams": "0.3.0", + "through2": "0.6.5", + "to-absolute-glob": "0.1.1", + "unique-stream": "2.2.1" + }, + "dependencies": { + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "through2": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", + "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", + "dev": true, + "requires": { + "readable-stream": "1.0.34", + "xtend": "4.0.1" + } + } + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "gulp-sourcemaps": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/gulp-sourcemaps/-/gulp-sourcemaps-1.6.0.tgz", + "integrity": "sha1-uG/zSdgBzrVuHZ59x7vLS33uYAw=", + "dev": true, + "requires": { + "convert-source-map": "1.5.0", + "graceful-fs": "4.1.11", + "strip-bom": "2.0.0", + "through2": "2.0.3", + "vinyl": "1.2.0" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "2.1.1" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "json-stable-stringify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", + "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", + "dev": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "ordered-read-streams": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-0.3.0.tgz", + "integrity": "sha1-cTfmmzKYuzQiR6G77jiByA4v14s=", + "dev": true, + "requires": { + "is-stream": "1.1.0", + "readable-stream": "2.3.3" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "0.2.1" + } + }, + "unique-stream": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.2.1.tgz", + "integrity": "sha1-WqADz76Uxf+GbE59ZouxxNuts2k=", + "dev": true, + "requires": { + "json-stable-stringify": "1.0.1", + "through2-filter": "2.0.0" + } + }, + "vinyl": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-1.2.0.tgz", + "integrity": "sha1-XIgDbPVl5d8FVYv8kR+GVt8hiIQ=", + "dev": true, + "requires": { + "clone": "1.0.2", + "clone-stats": "0.0.1", + "replace-ext": "0.0.1" + } + }, + "vinyl-fs": { + "version": "2.4.4", + "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-2.4.4.tgz", + "integrity": "sha1-vm/zJwy1Xf19MGNkDegfJddTIjk=", + "dev": true, + "requires": { + "duplexify": "3.5.1", + "glob-stream": "5.3.5", + "graceful-fs": "4.1.11", + "gulp-sourcemaps": "1.6.0", + "is-valid-glob": "0.3.0", + "lazystream": "1.0.0", + "lodash.isequal": "4.5.0", + "merge-stream": "1.0.1", + "mkdirp": "0.5.1", + "object-assign": "4.1.1", + "readable-stream": "2.3.3", + "strip-bom": "2.0.0", + "strip-bom-stream": "1.0.0", + "through2": "2.0.3", + "through2-filter": "2.0.0", + "vali-date": "1.0.0", + "vinyl": "1.2.0" + } + } + } + }, + "gulp-util": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/gulp-util/-/gulp-util-3.0.8.tgz", + "integrity": "sha1-AFTh50RQLifATBh8PsxQXdVLu08=", + "dev": true, + "requires": { + "array-differ": "1.0.0", + "array-uniq": "1.0.3", + "beeper": "1.1.1", + "chalk": "1.1.3", + "dateformat": "2.2.0", + "fancy-log": "1.3.0", + "gulplog": "1.0.0", + "has-gulplog": "0.1.0", + "lodash._reescape": "3.0.0", + "lodash._reevaluate": "3.0.0", + "lodash._reinterpolate": "3.0.0", + "lodash.template": "3.6.2", + "minimist": "1.2.0", + "multipipe": "0.1.2", + "object-assign": "3.0.0", + "replace-ext": "0.0.1", + "through2": "2.0.3", + "vinyl": "0.5.3" + }, + "dependencies": { + "object-assign": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-3.0.0.tgz", + "integrity": "sha1-m+3VygiXlJvKR+f/QIBi1Un1h/I=", + "dev": true + } + } + }, + "gulplog": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/gulplog/-/gulplog-1.0.0.tgz", + "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=", + "dev": true, + "requires": { + "glogg": "1.0.0" + } + }, + "handlebars": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.10.tgz", + "integrity": "sha1-PTDHGLCaPZbyPqTMH0A8TTup/08=", + "dev": true, + "requires": { + "async": "1.5.2", + "optimist": "0.6.1", + "source-map": "0.4.4", + "uglify-js": "2.8.29" + }, + "dependencies": { + "source-map": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", + "dev": true, + "requires": { + "amdefine": "1.0.1" + } + } + } + }, + "has": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", + "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=", + "dev": true, + "requires": { + "function-bind": "1.1.1" + } + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "has-color": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz", + "integrity": "sha1-ZxRKUmDDT8PMpnfQQdr1L+e3iy8=", + "dev": true + }, + "has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", + "dev": true + }, + "has-gulplog": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/has-gulplog/-/has-gulplog-0.1.0.tgz", + "integrity": "sha1-ZBTIKRNpfaUVkDl9r7EvIpZ4Ec4=", + "dev": true, + "requires": { + "sparkles": "1.0.0" + } + }, + "hash-base": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-2.0.2.tgz", + "integrity": "sha1-ZuodhW206KVHDK32/OI65SRO8uE=", + "dev": true, + "requires": { + "inherits": "2.0.3" + } + }, + "hash.js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "dev": true, + "requires": { + "inherits": "2.0.3", + "minimalistic-assert": "1.0.0" + } + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "dev": true + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "requires": { + "hash.js": "1.1.3", + "minimalistic-assert": "1.0.0", + "minimalistic-crypto-utils": "1.0.1" + } + }, + "homedir-polyfill": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz", + "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=", + "dev": true, + "requires": { + "parse-passwd": "1.0.0" + } + }, + "hosted-git-info": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", + "integrity": "sha512-pNgbURSuab90KbTqvRPsseaTxOJCZBD0a7t+haSN33piP9cCM4l0CqdzAif2hUqm716UovKB2ROmiabGAKVXyg==", + "dev": true + }, + "htmlescape": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", + "integrity": "sha1-OgPtwiFLyjtmQko+eVk0lQnLA1E=", + "dev": true + }, + "https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", + "dev": true + }, + "ieee754": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.8.tgz", + "integrity": "sha1-vjPUCsEO8ZJnAfbwii2G+/0a0+Q=", + "dev": true + }, + "indent-string": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "dev": true, + "requires": { + "repeating": "2.0.1" + } + }, + "indexof": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", + "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "ini": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", + "integrity": "sha1-BTfLedr1m1mhpRff9wbIbsA5Fi4=", + "dev": true + }, + "inline-source-map": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz", + "integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=", + "dev": true, + "requires": { + "source-map": "0.5.7" + } + }, + "insert-module-globals": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.0.1.tgz", + "integrity": "sha1-wDv04BywhtW15azorQr+eInWOMM=", + "dev": true, + "requires": { + "JSONStream": "1.3.1", + "combine-source-map": "0.7.2", + "concat-stream": "1.5.2", + "is-buffer": "1.1.5", + "lexical-scope": "1.2.0", + "process": "0.11.10", + "through2": "2.0.3", + "xtend": "4.0.1" + } + }, + "interpret": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.0.4.tgz", + "integrity": "sha1-ggzdWIuGj/sZGoCVBtbJyPISsbA=", + "dev": true + }, + "is-absolute": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-0.2.6.tgz", + "integrity": "sha1-IN5p89uULvLYe5wto28XIjWxtes=", + "dev": true, + "requires": { + "is-relative": "0.2.1", + "is-windows": "0.2.0" + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-buffer": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.5.tgz", + "integrity": "sha1-Hzsm72E7IUuIy8ojzGwB2Hlh7sw=", + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "dev": true, + "requires": { + "builtin-modules": "1.1.1" + } + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "dev": true + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "dev": true, + "requires": { + "is-primitive": "2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=", + "dev": true + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "dev": true, + "requires": { + "is-extglob": "1.0.0" + } + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + } + }, + "is-path-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", + "dev": true + }, + "is-path-in-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.0.tgz", + "integrity": "sha1-ZHdYK4IU1gI0YJRWcAO+ip6sBNw=", + "dev": true, + "requires": { + "is-path-inside": "1.0.0" + } + }, + "is-path-inside": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.0.tgz", + "integrity": "sha1-/AbloWg/vaE95mev9xe7wQpI838=", + "dev": true, + "requires": { + "path-is-inside": "1.0.2" + } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "dev": true + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "dev": true + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, + "is-relative": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-relative/-/is-relative-0.2.1.tgz", + "integrity": "sha1-0n9MfVFtF1+2ENuEu+7yPDvJeqU=", + "dev": true, + "requires": { + "is-unc-path": "0.1.2" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-unc-path": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-0.1.2.tgz", + "integrity": "sha1-arBTpyVzwQJQ/0FqOBTDUXivObk=", + "dev": true, + "requires": { + "unc-path-regex": "0.1.2" + } + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "is-valid-glob": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/is-valid-glob/-/is-valid-glob-0.3.0.tgz", + "integrity": "sha1-1LVcafUYhvm2XHDWwmItN+KfSP4=", + "dev": true + }, + "is-windows": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-0.2.0.tgz", + "integrity": "sha1-3hqm1j6indJIc3tp8f+LgALSEIw=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + }, + "istanbul": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.4.5.tgz", + "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", + "dev": true, + "requires": { + "abbrev": "1.0.9", + "async": "1.5.2", + "escodegen": "1.8.1", + "esprima": "2.7.3", + "glob": "5.0.15", + "handlebars": "4.0.10", + "js-yaml": "3.10.0", + "mkdirp": "0.5.1", + "nopt": "3.0.6", + "once": "1.4.0", + "resolve": "1.1.7", + "supports-color": "3.2.3", + "which": "1.3.0", + "wordwrap": "1.0.0" + }, + "dependencies": { + "glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "dev": true, + "requires": { + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", + "dev": true, + "requires": { + "has-flag": "1.0.0" + } + } + } + }, + "jake": { + "version": "8.0.15", + "resolved": "https://registry.npmjs.org/jake/-/jake-8.0.15.tgz", + "integrity": "sha1-8Np9WOeQrBqPhubuDxk+XZIw6rs=", + "dev": true, + "requires": { + "async": "0.9.2", + "chalk": "0.4.0", + "filelist": "0.0.6", + "minimatch": "3.0.4", + "utilities": "1.0.5" + }, + "dependencies": { + "ansi-styles": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.0.0.tgz", + "integrity": "sha1-yxAt8cVvUSPquLZ817mAJ6AnkXg=", + "dev": true + }, + "async": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/async/-/async-0.9.2.tgz", + "integrity": "sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=", + "dev": true + }, + "chalk": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz", + "integrity": "sha1-UZmj3c0MHv4jvAjBsCewYXbgxk8=", + "dev": true, + "requires": { + "ansi-styles": "1.0.0", + "has-color": "0.1.7", + "strip-ansi": "0.1.1" + } + }, + "strip-ansi": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz", + "integrity": "sha1-OeipjQRNFQZgq+SmgIrPcLt7yZE=", + "dev": true + } + } + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "js-yaml": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz", + "integrity": "sha512-O2v52ffjLa9VeM43J4XocZE//WT9N0IiwDa3KSHH7Tu8CtH+1qM8SIZvnsTh6v+4yFy5KUY3BHUVwjpfAWsjIA==", + "dev": true, + "requires": { + "argparse": "1.0.9", + "esprima": "4.0.0" + }, + "dependencies": { + "esprima": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "dev": true + } + } + }, + "json-stable-stringify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz", + "integrity": "sha1-YRwj6BTbN1Un34URk9tZ3Sryf0U=", + "dev": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "jsonify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", + "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", + "dev": true + }, + "jsonparse": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", + "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", + "dev": true + }, + "kew": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/kew/-/kew-0.7.0.tgz", + "integrity": "sha1-edk9LTM2PW/dKXCzNdkUGtWR15s=", + "dev": true + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.5" + } + }, + "labeled-stream-splicer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.0.tgz", + "integrity": "sha1-pS4dE4AkwAuGscDJH2d5GLiuClk=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "isarray": "0.0.1", + "stream-splicer": "2.0.0" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + } + } + }, + "lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", + "dev": true, + "optional": true + }, + "lazystream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lazystream/-/lazystream-1.0.0.tgz", + "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=", + "dev": true, + "requires": { + "readable-stream": "2.3.3" + } + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2", + "type-check": "0.3.2" + } + }, + "lexical-scope": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/lexical-scope/-/lexical-scope-1.2.0.tgz", + "integrity": "sha1-/Ope3HBKSzqHls3KQZw6CvryLfQ=", + "dev": true, + "requires": { + "astw": "2.2.0" + } + }, + "liftoff": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/liftoff/-/liftoff-2.3.0.tgz", + "integrity": "sha1-qY8v9nGD2Lp8+soQVIvX/wVQs4U=", + "dev": true, + "requires": { + "extend": "3.0.1", + "findup-sync": "0.4.3", + "fined": "1.1.0", + "flagged-respawn": "0.3.2", + "lodash.isplainobject": "4.0.6", + "lodash.isstring": "4.0.1", + "lodash.mapvalues": "4.6.0", + "rechoir": "0.6.2", + "resolve": "1.1.7" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "strip-bom": "2.0.0" + }, + "dependencies": { + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "0.2.1" + } + } + } + }, + "lodash": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-1.0.2.tgz", + "integrity": "sha1-j1dWDIO1n8JwvT1WG2kAQ0MOJVE=", + "dev": true + }, + "lodash._basecopy": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", + "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", + "dev": true + }, + "lodash._basetostring": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz", + "integrity": "sha1-0YYdh3+CSlL2aYMtyvPuFVZqB9U=", + "dev": true + }, + "lodash._basevalues": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._basevalues/-/lodash._basevalues-3.0.0.tgz", + "integrity": "sha1-W3dXYoAr3j0yl1A+JjAIIP32Ybc=", + "dev": true + }, + "lodash._escapehtmlchar": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._escapehtmlchar/-/lodash._escapehtmlchar-2.4.1.tgz", + "integrity": "sha1-32fDu2t+jh6DGrSL+geVuSr+iZ0=", + "dev": true, + "requires": { + "lodash._htmlescapes": "2.4.1" + } + }, + "lodash._escapestringchar": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._escapestringchar/-/lodash._escapestringchar-2.4.1.tgz", + "integrity": "sha1-7P4iYYoq3lC/7qQ5N+Ud9m8O23I=", + "dev": true + }, + "lodash._getnative": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", + "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", + "dev": true + }, + "lodash._htmlescapes": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._htmlescapes/-/lodash._htmlescapes-2.4.1.tgz", + "integrity": "sha1-MtFL8IRLbeb4tioFG09nwii2JMs=", + "dev": true + }, + "lodash._isiterateecall": { + "version": "3.0.9", + "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", + "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", + "dev": true + }, + "lodash._isnative": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._isnative/-/lodash._isnative-2.4.1.tgz", + "integrity": "sha1-PqZAS3hKe+g2x7V1gOHN95sUgyw=", + "dev": true + }, + "lodash._objecttypes": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._objecttypes/-/lodash._objecttypes-2.4.1.tgz", + "integrity": "sha1-fAt/admKH3ZSn4kLDNsbTf7BHBE=", + "dev": true + }, + "lodash._reescape": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reescape/-/lodash._reescape-3.0.0.tgz", + "integrity": "sha1-Kx1vXf4HyKNVdT5fJ/rH8c3hYWo=", + "dev": true + }, + "lodash._reevaluate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz", + "integrity": "sha1-WLx0xAZklTrgsSTYBpltrKQx4u0=", + "dev": true + }, + "lodash._reinterpolate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz", + "integrity": "sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0=", + "dev": true + }, + "lodash._reunescapedhtml": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._reunescapedhtml/-/lodash._reunescapedhtml-2.4.1.tgz", + "integrity": "sha1-dHxPxAED6zu4oJduVx96JlnpO6c=", + "dev": true, + "requires": { + "lodash._htmlescapes": "2.4.1", + "lodash.keys": "2.4.1" + }, + "dependencies": { + "lodash.keys": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-2.4.1.tgz", + "integrity": "sha1-SN6kbfj/djKxDXBrissmWR4rNyc=", + "dev": true, + "requires": { + "lodash._isnative": "2.4.1", + "lodash._shimkeys": "2.4.1", + "lodash.isobject": "2.4.1" + } + } + } + }, + "lodash._root": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz", + "integrity": "sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI=", + "dev": true + }, + "lodash._shimkeys": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._shimkeys/-/lodash._shimkeys-2.4.1.tgz", + "integrity": "sha1-bpzJZm/wgfC1psl4uD4kLmlJ0gM=", + "dev": true, + "requires": { + "lodash._objecttypes": "2.4.1" + } + }, + "lodash.defaults": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-2.4.1.tgz", + "integrity": "sha1-p+iIXwXmiFEUS24SqPNngCa8TFQ=", + "dev": true, + "requires": { + "lodash._objecttypes": "2.4.1", + "lodash.keys": "2.4.1" + }, + "dependencies": { + "lodash.keys": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-2.4.1.tgz", + "integrity": "sha1-SN6kbfj/djKxDXBrissmWR4rNyc=", + "dev": true, + "requires": { + "lodash._isnative": "2.4.1", + "lodash._shimkeys": "2.4.1", + "lodash.isobject": "2.4.1" + } + } + } + }, + "lodash.escape": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-3.2.0.tgz", + "integrity": "sha1-mV7g3BjBtIzJLv+ucaEKq1tIdpg=", + "dev": true, + "requires": { + "lodash._root": "3.0.1" + } + }, + "lodash.isarguments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", + "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=", + "dev": true + }, + "lodash.isarray": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", + "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", + "dev": true + }, + "lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=", + "dev": true + }, + "lodash.isobject": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.isobject/-/lodash.isobject-2.4.1.tgz", + "integrity": "sha1-Wi5H/mmVPx7mMafrof5k0tBlWPU=", + "dev": true, + "requires": { + "lodash._objecttypes": "2.4.1" + } + }, + "lodash.isplainobject": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz", + "integrity": "sha1-fFJqUtibRcRcxpC4gWO+BJf1UMs=", + "dev": true + }, + "lodash.isstring": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + "integrity": "sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=", + "dev": true + }, + "lodash.keys": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", + "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", + "dev": true, + "requires": { + "lodash._getnative": "3.9.1", + "lodash.isarguments": "3.1.0", + "lodash.isarray": "3.0.4" + } + }, + "lodash.mapvalues": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/lodash.mapvalues/-/lodash.mapvalues-4.6.0.tgz", + "integrity": "sha1-G6+lAF3p3W9PJmaMMMo3IwzJaJw=", + "dev": true + }, + "lodash.memoize": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz", + "integrity": "sha1-LcvSwofLwKVcxCMovQxzYVDVPj8=", + "dev": true + }, + "lodash.restparam": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", + "integrity": "sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=", + "dev": true + }, + "lodash.template": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-3.6.2.tgz", + "integrity": "sha1-+M3sxhaaJVvpCYrosMU9N4kx0U8=", + "dev": true, + "requires": { + "lodash._basecopy": "3.0.1", + "lodash._basetostring": "3.0.1", + "lodash._basevalues": "3.0.0", + "lodash._isiterateecall": "3.0.9", + "lodash._reinterpolate": "3.0.0", + "lodash.escape": "3.2.0", + "lodash.keys": "3.1.2", + "lodash.restparam": "3.6.1", + "lodash.templatesettings": "3.1.1" + } + }, + "lodash.templatesettings": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-3.1.1.tgz", + "integrity": "sha1-+zB4RHU7Zrnxr6VOJix0UwfbqOU=", + "dev": true, + "requires": { + "lodash._reinterpolate": "3.0.0", + "lodash.escape": "3.2.0" + } + }, + "lodash.values": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.values/-/lodash.values-2.4.1.tgz", + "integrity": "sha1-q/UUQ2s8twUAFieXjLzzCxKA7qQ=", + "dev": true, + "requires": { + "lodash.keys": "2.4.1" + }, + "dependencies": { + "lodash.keys": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-2.4.1.tgz", + "integrity": "sha1-SN6kbfj/djKxDXBrissmWR4rNyc=", + "dev": true, + "requires": { + "lodash._isnative": "2.4.1", + "lodash._shimkeys": "2.4.1", + "lodash.isobject": "2.4.1" + } + } + } + }, + "longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", + "dev": true + }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "requires": { + "currently-unhandled": "0.4.1", + "signal-exit": "3.0.2" + } + }, + "lru-cache": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", + "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=", + "dev": true + }, + "lru-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/lru-queue/-/lru-queue-0.1.0.tgz", + "integrity": "sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM=", + "dev": true, + "requires": { + "es5-ext": "0.10.31" + } + }, + "make-error": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.0.tgz", + "integrity": "sha1-Uq06M5zPEM5itAQLcI/nByRLi5Y=", + "dev": true + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + }, + "md5.js": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.4.tgz", + "integrity": "sha1-6b296UogpawYsENA/Fdk1bCdkB0=", + "dev": true, + "requires": { + "hash-base": "3.0.4", + "inherits": "2.0.3" + }, + "dependencies": { + "hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "safe-buffer": "5.1.1" + } + } + } + }, + "memoizee": { + "version": "0.4.11", + "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.4.11.tgz", + "integrity": "sha1-vemBdmPJ5A/bKk6hw2cpYIeujI8=", + "dev": true, + "requires": { + "d": "1.0.0", + "es5-ext": "0.10.31", + "es6-weak-map": "2.0.2", + "event-emitter": "0.3.5", + "is-promise": "2.1.0", + "lru-queue": "0.1.0", + "next-tick": "1.0.0", + "timers-ext": "0.1.2" + } + }, + "meow": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", + "dev": true, + "requires": { + "camelcase-keys": "2.1.0", + "decamelize": "1.2.0", + "loud-rejection": "1.6.0", + "map-obj": "1.0.1", + "minimist": "1.2.0", + "normalize-package-data": "2.4.0", + "object-assign": "4.1.1", + "read-pkg-up": "1.0.1", + "redent": "1.0.0", + "trim-newlines": "1.0.0" + } + }, + "merge-stream": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz", + "integrity": "sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE=", + "dev": true, + "requires": { + "readable-stream": "2.3.3" + } + }, + "merge2": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.2.0.tgz", + "integrity": "sha1-D4ghUdmIsfPQdYlFQE+nPuWSPT8=", + "dev": true + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "dev": true, + "requires": { + "arr-diff": "2.0.0", + "array-unique": "0.2.1", + "braces": "1.8.5", + "expand-brackets": "0.1.5", + "extglob": "0.3.2", + "filename-regex": "2.0.1", + "is-extglob": "1.0.0", + "is-glob": "2.0.1", + "kind-of": "3.2.2", + "normalize-path": "2.1.1", + "object.omit": "2.0.1", + "parse-glob": "3.0.4", + "regex-cache": "0.4.4" + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "brorand": "1.1.0" + } + }, + "minimalistic-assert": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.0.tgz", + "integrity": "sha1-cCvi3aazf0g2vLP121ZkG2Sh09M=", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.8" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + } + } + }, + "mocha": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-4.0.1.tgz", + "integrity": "sha512-evDmhkoA+cBNiQQQdSKZa2b9+W2mpLoj50367lhy+Klnx9OV8XlCIhigUnn1gaTFLQCa0kdNhEGDr0hCXOQFDw==", + "dev": true, + "requires": { + "browser-stdout": "1.3.0", + "commander": "2.11.0", + "debug": "3.1.0", + "diff": "3.3.1", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.3", + "he": "1.1.1", + "mkdirp": "0.5.1", + "supports-color": "4.4.0" + }, + "dependencies": { + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "dev": true + }, + "supports-color": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", + "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } + } + } + }, + "mocha-fivemat-progress-reporter": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/mocha-fivemat-progress-reporter/-/mocha-fivemat-progress-reporter-0.1.0.tgz", + "integrity": "sha1-zK/w4ckc9Vf+d+B535lUuRt0d1Y=", + "dev": true + }, + "module-deps": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-4.1.1.tgz", + "integrity": "sha1-IyFYM/HaE/1gbMuAh7RIUty4If0=", + "dev": true, + "requires": { + "JSONStream": "1.3.1", + "browser-resolve": "1.11.2", + "cached-path-relative": "1.0.1", + "concat-stream": "1.5.2", + "defined": "1.0.0", + "detective": "4.5.0", + "duplexer2": "0.1.4", + "inherits": "2.0.3", + "parents": "1.0.1", + "readable-stream": "2.3.3", + "resolve": "1.1.7", + "stream-combiner2": "1.1.1", + "subarg": "1.0.0", + "through2": "2.0.3", + "xtend": "4.0.1" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "multipipe": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz", + "integrity": "sha1-Ko8t33Du1WTf8tV/HhoTfZ8FB4s=", + "dev": true, + "requires": { + "duplexer2": "0.0.2" + }, + "dependencies": { + "duplexer2": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz", + "integrity": "sha1-xhTc9n4vsUmVqRcR5aYX6KYKMds=", + "dev": true, + "requires": { + "readable-stream": "1.1.14" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "natives": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/natives/-/natives-1.1.0.tgz", + "integrity": "sha1-6f+EFBimsux6SV6TmYT3jxY+bjE=", + "dev": true + }, + "next-tick": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=", + "dev": true + }, + "nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, + "requires": { + "abbrev": "1.0.9" + } + }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "dev": true, + "requires": { + "hosted-git-info": "2.5.0", + "is-builtin-module": "1.0.0", + "semver": "4.3.6", + "validate-npm-package-license": "3.0.1" + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "1.1.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-keys": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", + "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=", + "dev": true + }, + "object.defaults": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object.defaults/-/object.defaults-1.1.0.tgz", + "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", + "dev": true, + "requires": { + "array-each": "1.0.1", + "array-slice": "1.0.0", + "for-own": "1.0.0", + "isobject": "3.0.1" + }, + "dependencies": { + "for-own": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", + "dev": true, + "requires": { + "for-in": "1.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "dev": true, + "requires": { + "for-own": "0.1.5", + "is-extendable": "0.1.1" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + } + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "optimist": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", + "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "dev": true, + "requires": { + "minimist": "0.0.10", + "wordwrap": "0.0.3" + }, + "dependencies": { + "minimist": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", + "dev": true + }, + "wordwrap": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", + "dev": true + } + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "0.1.3", + "fast-levenshtein": "2.0.6", + "levn": "0.3.0", + "prelude-ls": "1.1.2", + "type-check": "0.3.2", + "wordwrap": "1.0.0" + } + }, + "orchestrator": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/orchestrator/-/orchestrator-0.3.8.tgz", + "integrity": "sha1-FOfp4nZPcxX7rBhOUGx6pt+UrX4=", + "dev": true, + "requires": { + "end-of-stream": "0.1.5", + "sequencify": "0.0.7", + "stream-consume": "0.1.0" + } + }, + "ordered-read-streams": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/ordered-read-streams/-/ordered-read-streams-0.1.0.tgz", + "integrity": "sha1-/VZamvjrRHO6abbtijQ1LLVS8SY=", + "dev": true + }, + "os-browserify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.1.2.tgz", + "integrity": "sha1-ScoCk+CxlZCl9d4Qx/JlphfY/lQ=", + "dev": true + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true + }, + "p-map": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-1.2.0.tgz", + "integrity": "sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA==", + "dev": true + }, + "pako": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", + "integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=", + "dev": true + }, + "parents": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", + "integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=", + "dev": true, + "requires": { + "path-platform": "0.11.15" + } + }, + "parse-asn1": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.0.tgz", + "integrity": "sha1-N8T5t+06tlx0gXtfJICTf7+XxxI=", + "dev": true, + "requires": { + "asn1.js": "4.9.1", + "browserify-aes": "1.0.8", + "create-hash": "1.1.3", + "evp_bytestokey": "1.0.3", + "pbkdf2": "3.0.14" + } + }, + "parse-filepath": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-filepath/-/parse-filepath-1.0.1.tgz", + "integrity": "sha1-FZ1hVdQ5BNFsEO9piRHaHpGWm3M=", + "dev": true, + "requires": { + "is-absolute": "0.2.6", + "map-cache": "0.2.2", + "path-root": "0.1.1" + } + }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "dev": true, + "requires": { + "glob-base": "0.3.0", + "is-dotfile": "1.0.3", + "is-extglob": "1.0.0", + "is-glob": "2.0.1" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "1.3.1" + } + }, + "parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "dev": true + }, + "path-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", + "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=", + "dev": true + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "2.0.1" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-parse": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "dev": true + }, + "path-platform": { + "version": "0.11.15", + "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz", + "integrity": "sha1-6GQhf3TDaFDwhSt43Hv31KVyG/I=", + "dev": true + }, + "path-root": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/path-root/-/path-root-0.1.1.tgz", + "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", + "dev": true, + "requires": { + "path-root-regex": "0.1.2" + } + }, + "path-root-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/path-root-regex/-/path-root-regex-0.1.2.tgz", + "integrity": "sha1-v8zcjfWxLcUsi0PsONGNcsBLqW0=", + "dev": true + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + }, + "dependencies": { + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "pathval": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", + "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", + "dev": true + }, + "pbkdf2": { + "version": "3.0.14", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.14.tgz", + "integrity": "sha512-gjsZW9O34fm0R7PaLHRJmLLVfSoesxztjPjE9o6R+qtVJij90ltg1joIovN9GKrRW3t1PzhDDG3UMEMFfZ+1wA==", + "dev": true, + "requires": { + "create-hash": "1.1.3", + "create-hmac": "1.1.6", + "ripemd160": "2.0.1", + "safe-buffer": "5.1.1", + "sha.js": "2.4.9" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "2.0.4" + } + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "dev": true + }, + "pretty-hrtime": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", + "integrity": "sha1-t+PqQkNaTJsnWdmeDyAesZWALuE=", + "dev": true + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true + }, + "process-nextick-args": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", + "dev": true + }, + "public-encrypt": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.0.tgz", + "integrity": "sha1-OfaZ86RlYN1eusvKaTyvfGXBjMY=", + "dev": true, + "requires": { + "bn.js": "4.11.8", + "browserify-rsa": "4.0.1", + "create-hash": "1.1.3", + "parse-asn1": "5.1.0", + "randombytes": "2.0.5" + } + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "q": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/q/-/q-1.5.0.tgz", + "integrity": "sha1-3QG6ydBtMObyGa7LglPunr3DCPE=", + "dev": true + }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "dev": true + }, + "querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", + "dev": true + }, + "randomatic": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", + "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", + "dev": true, + "requires": { + "is-number": "3.0.0", + "kind-of": "4.0.0" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "3.2.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "1.1.5" + } + } + } + }, + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "1.1.5" + } + } + } + }, + "randombytes": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.5.tgz", + "integrity": "sha512-8T7Zn1AhMsQ/HI1SjcCfT/t4ii3eAqco3yOcSzS4mozsOz69lHLsoMXmF9nZgnFanYscnSlUSgs8uZyKzpE6kg==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "read-only-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz", + "integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=", + "dev": true, + "requires": { + "readable-stream": "2.3.3" + } + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "1.1.0", + "normalize-package-data": "2.4.0", + "path-type": "1.1.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "1.1.2", + "read-pkg": "1.1.0" + } + }, + "readable-stream": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", + "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", + "dev": true, + "requires": { + "resolve": "1.1.7" + } + }, + "redent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "dev": true, + "requires": { + "indent-string": "2.1.0", + "strip-indent": "1.0.1" + } + }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "dev": true, + "requires": { + "is-equal-shallow": "0.1.3" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "1.0.2" + } + }, + "replace-ext": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz", + "integrity": "sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ=", + "dev": true + }, + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + }, + "resolve-dir": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-0.1.1.tgz", + "integrity": "sha1-shklmlYC+sXFxJatiUpujMQwJh4=", + "dev": true, + "requires": { + "expand-tilde": "1.2.2", + "global-modules": "0.2.3" + } + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", + "dev": true, + "optional": true, + "requires": { + "align-text": "0.1.4" + } + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "7.1.2" + } + }, + "ripemd160": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.1.tgz", + "integrity": "sha1-D0WEKVxTo2KK9+bXmsohzlfRxuc=", + "dev": true, + "requires": { + "hash-base": "2.0.2", + "inherits": "2.0.3" + } + }, + "run-sequence": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/run-sequence/-/run-sequence-2.2.0.tgz", + "integrity": "sha512-xW5DmUwdvoyYQUMPKN8UW7TZSFs7AxtT59xo1m5y91jHbvwGlGgOmdV1Yw5P68fkjf3aHUZ4G1o1mZCtNe0qtw==", + "dev": true, + "requires": { + "chalk": "1.1.3", + "gulp-util": "3.0.8" + } + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", + "dev": true + }, + "sander": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/sander/-/sander-0.5.1.tgz", + "integrity": "sha1-dB4kXiMfB8r7b98PEzrfohalAq0=", + "dev": true, + "requires": { + "es6-promise": "3.3.1", + "graceful-fs": "4.1.11", + "mkdirp": "0.5.1", + "rimraf": "2.6.2" + }, + "dependencies": { + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + } + } + }, + "sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true + }, + "semver": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-4.3.6.tgz", + "integrity": "sha1-MAvG4OhjdPe6YQaLWx7NV/xlMto=", + "dev": true + }, + "sequencify": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/sequencify/-/sequencify-0.0.7.tgz", + "integrity": "sha1-kM/xnQLgcCf9dn9erT57ldHnOAw=", + "dev": true + }, + "sha.js": { + "version": "2.4.9", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.9.tgz", + "integrity": "sha512-G8zektVqbiPHrylgew9Zg1VRB1L/DtXNUVAM6q4QLy8NE3qtHlFXTf8VLL4k1Yl6c7NMjtZUTdXV+X44nFaT6A==", + "dev": true, + "requires": { + "inherits": "2.0.3", + "safe-buffer": "5.1.1" + } + }, + "shasum": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz", + "integrity": "sha1-5wEjENj0F/TetXEhUOVni4euVl8=", + "dev": true, + "requires": { + "json-stable-stringify": "0.0.1", + "sha.js": "2.4.9" + } + }, + "shell-quote": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", + "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", + "dev": true, + "requires": { + "array-filter": "0.0.1", + "array-map": "0.0.0", + "array-reduce": "0.0.0", + "jsonify": "0.0.0" + } + }, + "sigmund": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", + "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "sorcery": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/sorcery/-/sorcery-0.10.0.tgz", + "integrity": "sha1-iukK19fLBfxZ8asMY3hF1cFaUrc=", + "dev": true, + "requires": { + "buffer-crc32": "0.2.13", + "minimist": "1.2.0", + "sander": "0.5.1", + "sourcemap-codec": "1.3.1" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-resolve": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.3.1.tgz", + "integrity": "sha1-YQ9hIqRFuN1RU1oqcbeD38Ekh2E=", + "dev": true, + "requires": { + "atob": "1.1.3", + "resolve-url": "0.2.1", + "source-map-url": "0.3.0", + "urix": "0.1.0" + } + }, + "source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "dev": true, + "requires": { + "source-map": "0.5.7" + } + }, + "source-map-url": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.3.0.tgz", + "integrity": "sha1-fsrxO1e80J2opAxdJp2zN5nUqvk=", + "dev": true + }, + "sourcemap-codec": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.3.1.tgz", + "integrity": "sha1-mtb5vb1pGTEBbjCTnbyGhnMyMUY=", + "dev": true, + "requires": { + "vlq": "0.2.3" + } + }, + "sparkles": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.0.tgz", + "integrity": "sha1-Gsu/tZJDbRC76PeFt8xvgoFQEsM=", + "dev": true + }, + "spdx-correct": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", + "integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=", + "dev": true, + "requires": { + "spdx-license-ids": "1.2.2" + } + }, + "spdx-expression-parse": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz", + "integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=", + "dev": true + }, + "spdx-license-ids": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz", + "integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "stream-browserify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", + "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.3" + } + }, + "stream-combiner2": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", + "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=", + "dev": true, + "requires": { + "duplexer2": "0.1.4", + "readable-stream": "2.3.3" + } + }, + "stream-consume": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/stream-consume/-/stream-consume-0.1.0.tgz", + "integrity": "sha1-pB6tGm1ggc63n2WwYZAbbY89HQ8=", + "dev": true + }, + "stream-http": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.7.2.tgz", + "integrity": "sha512-c0yTD2rbQzXtSsFSVhtpvY/vS6u066PcXOX9kBB3mSO76RiUQzL340uJkGBWnlBg4/HZzqiUXtaVA7wcRcJgEw==", + "dev": true, + "requires": { + "builtin-status-codes": "3.0.0", + "inherits": "2.0.3", + "readable-stream": "2.3.3", + "to-arraybuffer": "1.0.1", + "xtend": "4.0.1" + } + }, + "stream-shift": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", + "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", + "dev": true + }, + "stream-splicer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.0.tgz", + "integrity": "sha1-G2O+Q4oTPktnHMGTUZdgAXWRDYM=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.3" + } + }, + "streamqueue": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/streamqueue/-/streamqueue-0.0.6.tgz", + "integrity": "sha1-ZvX17JTpuK8knkrsLdH3Qb/pTeM=", + "dev": true, + "requires": { + "readable-stream": "1.1.14" + }, + "dependencies": { + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + } + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-bom": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-1.0.0.tgz", + "integrity": "sha1-hbiGLzhEtabV7IRnqTWYFzo295Q=", + "dev": true, + "requires": { + "first-chunk-stream": "1.0.0", + "is-utf8": "0.2.1" + } + }, + "strip-bom-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-bom-stream/-/strip-bom-stream-1.0.0.tgz", + "integrity": "sha1-5xRDmFd9Uaa+0PoZlPoF9D/ZiO4=", + "dev": true, + "requires": { + "first-chunk-stream": "1.0.0", + "strip-bom": "2.0.0" + }, + "dependencies": { + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "0.2.1" + } + } + } + }, + "strip-bom-string": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-bom-string/-/strip-bom-string-1.0.0.tgz", + "integrity": "sha1-5SEekiQ2n7uB1jOi8ABE3IztrZI=", + "dev": true + }, + "strip-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "dev": true, + "requires": { + "get-stdin": "4.0.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "subarg": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz", + "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=", + "dev": true, + "requires": { + "minimist": "1.2.0" + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", + "dev": true + }, + "syntax-error": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.3.0.tgz", + "integrity": "sha1-HtkmbE1AvnXcVb+bsct3Biu5bKE=", + "dev": true, + "requires": { + "acorn": "4.0.13" + } + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "dev": true, + "requires": { + "readable-stream": "2.3.3", + "xtend": "4.0.1" + } + }, + "through2-filter": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-2.0.0.tgz", + "integrity": "sha1-YLxVoNrLdghdsfna6Zq0P4PWIuw=", + "dev": true, + "requires": { + "through2": "2.0.3", + "xtend": "4.0.1" + } + }, + "tildify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/tildify/-/tildify-1.2.0.tgz", + "integrity": "sha1-3OwD9V3Km3qj5bBPIYF+tW5jWIo=", + "dev": true, + "requires": { + "os-homedir": "1.0.2" + } + }, + "time-stamp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/time-stamp/-/time-stamp-1.1.0.tgz", + "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=", + "dev": true + }, + "timers-browserify": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz", + "integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=", + "dev": true, + "requires": { + "process": "0.11.10" + } + }, + "timers-ext": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.2.tgz", + "integrity": "sha1-YcxHp2wavTGV8UUn+XjViulMUgQ=", + "dev": true, + "requires": { + "es5-ext": "0.10.31", + "next-tick": "1.0.0" + } + }, + "to-absolute-glob": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-0.1.1.tgz", + "integrity": "sha1-HN+kcqnvUMI57maZm2YsoOs5k38=", + "dev": true, + "requires": { + "extend-shallow": "2.0.1" + } + }, + "to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", + "dev": true + }, + "travis-fold": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/travis-fold/-/travis-fold-0.1.2.tgz", + "integrity": "sha1-/sAF+dyqJZo/lFnOWmkGq6TFRdo=", + "dev": true + }, + "trim-newlines": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", + "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", + "dev": true + }, + "ts-node": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-3.3.0.tgz", + "integrity": "sha1-wTxqMCTjC+EYDdUwOPwgkonUv2k=", + "dev": true, + "requires": { + "arrify": "1.0.1", + "chalk": "2.1.0", + "diff": "3.3.1", + "make-error": "1.3.0", + "minimist": "1.2.0", + "mkdirp": "0.5.1", + "source-map-support": "0.4.18", + "tsconfig": "6.0.0", + "v8flags": "3.0.1", + "yn": "2.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", + "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "dev": true, + "requires": { + "color-convert": "1.9.0" + } + }, + "chalk": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.1.0.tgz", + "integrity": "sha512-LUHGS/dge4ujbXMJrnihYMcL4AoOweGnw9Tp3kQuqy1Kx5c1qKjqvMJZ6nVJPMWJtKCTN72ZogH3oeSO9g9rXQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.0", + "escape-string-regexp": "1.0.5", + "supports-color": "4.4.0" + } + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "dev": true + }, + "supports-color": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.4.0.tgz", + "integrity": "sha512-rKC3+DyXWgK0ZLKwmRsrkyHVZAjNkfzeehuFWdGGcqGDTZFH73+RH6S/RDAAxl9GusSjZSUWYLmT9N5pzXFOXQ==", + "dev": true, + "requires": { + "has-flag": "2.0.0" + } + }, + "v8flags": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.0.1.tgz", + "integrity": "sha1-3Oj8N5wX2fLJ6e142JzgAFKxt2s=", + "dev": true, + "requires": { + "homedir-polyfill": "1.0.1" + } + } + } + }, + "tsconfig": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/tsconfig/-/tsconfig-6.0.0.tgz", + "integrity": "sha1-aw6DdgA9evGGT434+J3QBZ/80DI=", + "dev": true, + "requires": { + "strip-bom": "3.0.0", + "strip-json-comments": "2.0.1" + }, + "dependencies": { + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, + "tslib": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.8.0.tgz", + "integrity": "sha512-ymKWWZJST0/CkgduC2qkzjMOWr4bouhuURNXCn/inEX0L57BnRG6FhX76o7FOnsjHazCjfU2LKeSrlS2sIKQJg==", + "dev": true + }, + "tslint": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.7.0.tgz", + "integrity": "sha1-wl4NDJL6EgHCvDDoROCOaCtPNVI=", + "dev": true, + "requires": { + "babel-code-frame": "6.26.0", + "colors": "1.1.2", + "commander": "2.11.0", + "diff": "3.3.1", + "glob": "7.1.2", + "minimatch": "3.0.4", + "resolve": "1.4.0", + "semver": "5.4.1", + "tslib": "1.8.0", + "tsutils": "2.12.1" + }, + "dependencies": { + "resolve": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.4.0.tgz", + "integrity": "sha512-aW7sVKPufyHqOmyyLzg/J+8606v5nevBgaliIlV7nUpVMsDnoBGV/cbSLNjZAg9q0Cfd/+easKVKQ8vOu8fn1Q==", + "dev": true, + "requires": { + "path-parse": "1.0.5" + } + }, + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==", + "dev": true + } + } + }, + "tsutils": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.12.1.tgz", + "integrity": "sha1-9Nlc4zkciXHkblTEzw7bCiHdWyQ=", + "dev": true, + "requires": { + "tslib": "1.8.0" + } + }, + "tty-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", + "dev": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2" + } + }, + "type-detect": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.3.tgz", + "integrity": "sha1-Dj8mcLRAmbC0bChNE2p+9Jx0wuo=", + "dev": true + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "typescript": { + "version": "2.6.0-dev.20171011", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.6.0-dev.20171011.tgz", + "integrity": "sha512-il66U8zNRbF875Gq6cP3K/CthG7Dp9PRpu5w5mVHaPcolzJhrdLa3K2WavqqJg/7h7sPOZvsU8nYdXO61sHagg==", + "dev": true + }, + "uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", + "dev": true, + "optional": true, + "requires": { + "source-map": "0.5.7", + "uglify-to-browserify": "1.0.2", + "yargs": "3.10.0" + } + }, + "uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", + "dev": true, + "optional": true + }, + "umd": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/umd/-/umd-3.0.1.tgz", + "integrity": "sha1-iuVW4RAR9jwllnCKiDclnwGz1g4=", + "dev": true + }, + "unc-path-regex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", + "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", + "dev": true + }, + "unique-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-1.0.0.tgz", + "integrity": "sha1-1ZpKdUJ0R9mqbJHnAmP40mpLEEs=", + "dev": true + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "dev": true, + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + } + } + }, + "user-home": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz", + "integrity": "sha1-K1viOjK2Onyd640PKNSFcko98ZA=", + "dev": true + }, + "util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "dev": true, + "requires": { + "inherits": "2.0.1" + }, + "dependencies": { + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "dev": true + } + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "utilities": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/utilities/-/utilities-1.0.5.tgz", + "integrity": "sha1-8rd6iPNRBzP8chW1xIalBKdaskU=", + "dev": true + }, + "v8flags": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.1.1.tgz", + "integrity": "sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ=", + "dev": true, + "requires": { + "user-home": "1.1.1" + } + }, + "vali-date": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz", + "integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY=", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", + "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=", + "dev": true, + "requires": { + "spdx-correct": "1.0.2", + "spdx-expression-parse": "1.0.4" + } + }, + "vinyl": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.5.3.tgz", + "integrity": "sha1-sEVbOPxeDPMNQyUTLkYZcMIJHN4=", + "dev": true, + "requires": { + "clone": "1.0.2", + "clone-stats": "0.0.1", + "replace-ext": "0.0.1" + } + }, + "vinyl-fs": { + "version": "0.3.14", + "resolved": "https://registry.npmjs.org/vinyl-fs/-/vinyl-fs-0.3.14.tgz", + "integrity": "sha1-mmhRzhysHBzqX+hsCTHWIMLPqeY=", + "dev": true, + "requires": { + "defaults": "1.0.3", + "glob-stream": "3.1.18", + "glob-watcher": "0.0.6", + "graceful-fs": "3.0.11", + "mkdirp": "0.5.1", + "strip-bom": "1.0.0", + "through2": "0.6.5", + "vinyl": "0.4.6" + }, + "dependencies": { + "clone": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/clone/-/clone-0.2.0.tgz", + "integrity": "sha1-xhJqkK1Pctv1rNskPMN3JP6T/B8=", + "dev": true + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + }, + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, + "through2": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", + "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", + "dev": true, + "requires": { + "readable-stream": "1.0.34", + "xtend": "4.0.1" + } + }, + "vinyl": { + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-0.4.6.tgz", + "integrity": "sha1-LzVsh6VQolVGHza76ypbqL94SEc=", + "dev": true, + "requires": { + "clone": "0.2.0", + "clone-stats": "0.0.1" + } + } + } + }, + "vlq": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz", + "integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==", + "dev": true + }, + "vm-browserify": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", + "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", + "dev": true, + "requires": { + "indexof": "0.0.1" + } + }, + "which": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "dev": true, + "requires": { + "isexe": "2.0.0" + } + }, + "window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", + "dev": true, + "optional": true + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "xml2js": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz", + "integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==", + "dev": true, + "requires": { + "sax": "1.2.4", + "xmlbuilder": "9.0.4" + } + }, + "xmlbuilder": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.4.tgz", + "integrity": "sha1-UZy0ymhtAFqEINNJbz8MruzKWA8=", + "dev": true + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "dev": true + }, + "yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", + "dev": true, + "optional": true, + "requires": { + "camelcase": "1.2.1", + "cliui": "2.1.0", + "decamelize": "1.2.0", + "window-size": "0.1.0" + }, + "dependencies": { + "camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", + "dev": true, + "optional": true + } + } + }, + "yn": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz", + "integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=", + "dev": true + } + } +} From 142a88a4aeab6d24a179cc0782d6914eb0904f30 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 11 Oct 2017 10:51:46 -0700 Subject: [PATCH 105/137] Update the comment on emit handler method --- src/compiler/builder.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/compiler/builder.ts b/src/compiler/builder.ts index 093c6ec4d03..192f1e43027 100644 --- a/src/compiler/builder.ts +++ b/src/compiler/builder.ts @@ -76,14 +76,13 @@ namespace ts { * For all source files, either "onUpdateSourceFile" or "onUpdateSourceFileWithSameVersion" will be called. * If the builder is sure that the source file needs an update, "onUpdateSourceFile" will be called; * otherwise "onUpdateSourceFileWithSameVersion" will be called. - * This should return whether the source file should be marked as changed (meaning that something associated with file has changed, e.g. module resolution) */ onUpdateSourceFile(program: Program, sourceFile: SourceFile): void; /** * For all source files, either "onUpdateSourceFile" or "onUpdateSourceFileWithSameVersion" will be called. * If the builder is sure that the source file needs an update, "onUpdateSourceFile" will be called; * otherwise "onUpdateSourceFileWithSameVersion" will be called. - * This should return whether the source file should be marked as changed (meaning that something associated with file has changed, e.g. module resolution) + * This function should return whether the source file should be marked as changed (meaning that something associated with file has changed, e.g. module resolution) */ onUpdateSourceFileWithSameVersion(program: Program, sourceFile: SourceFile): boolean; /** From 81fc2a14d19ae763286f75a6fba61e05e777edd3 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 11 Oct 2017 12:01:26 -0700 Subject: [PATCH 106/137] Don't check for callbacks in recursive call that resulted from callbacks --- src/compiler/checker.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ce1769118a4..0cb7fe909dc 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -8579,16 +8579,16 @@ namespace ts { for (let i = 0; i < checkCount; i++) { const sourceType = i < sourceMax ? getTypeOfParameter(sourceParams[i]) : getRestTypeOfSignature(source); const targetType = i < targetMax ? getTypeOfParameter(targetParams[i]) : getRestTypeOfSignature(target); - const sourceSig = getSingleCallSignature(getNonNullableType(sourceType)); - const targetSig = getSingleCallSignature(getNonNullableType(targetType)); // In order to ensure that any generic type Foo is at least co-variant with respect to T no matter // how Foo uses T, we need to relate parameters bi-variantly (given that parameters are input positions, // they naturally relate only contra-variantly). However, if the source and target parameters both have - // function types with a single call signature, we known we are relating two callback parameters. In + // function types with a single call signature, we know we are relating two callback parameters. In // that case it is sufficient to only relate the parameters of the signatures co-variantly because, // similar to return values, callback parameters are output positions. This means that a Promise, // where T is used only in callback parameter positions, will be co-variant (as opposed to bi-variant) // with respect to T. + const sourceSig = callbackCheck ? undefined : getSingleCallSignature(getNonNullableType(sourceType)); + const targetSig = callbackCheck ? undefined : getSingleCallSignature(getNonNullableType(targetType)); const callbacks = sourceSig && targetSig && !sourceSig.typePredicate && !targetSig.typePredicate && (getFalsyFlags(sourceType) & TypeFlags.Nullable) === (getFalsyFlags(targetType) & TypeFlags.Nullable); const related = callbacks ? From 07e4819b8bb5db64c2d00c91b7ce184de1eb4723 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 11 Oct 2017 12:01:38 -0700 Subject: [PATCH 107/137] Add regression test --- tests/cases/compiler/mutuallyRecursiveCallbacks.ts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 tests/cases/compiler/mutuallyRecursiveCallbacks.ts diff --git a/tests/cases/compiler/mutuallyRecursiveCallbacks.ts b/tests/cases/compiler/mutuallyRecursiveCallbacks.ts new file mode 100644 index 00000000000..94f2d285786 --- /dev/null +++ b/tests/cases/compiler/mutuallyRecursiveCallbacks.ts @@ -0,0 +1,7 @@ +// Repro from #18277 + +interface Foo { (bar: Bar): void }; +type Bar = (foo: Foo) => Foo; +declare function foo(bar: Bar): void; +declare var bar: Bar<{}>; +bar = foo; From 38cec121902d505de3cf71711f7c4c847563e9d6 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 11 Oct 2017 12:02:01 -0700 Subject: [PATCH 108/137] Accept new baselines --- .../mutuallyRecursiveCallbacks.errors.txt | 24 +++++++++++++ .../reference/mutuallyRecursiveCallbacks.js | 14 ++++++++ .../mutuallyRecursiveCallbacks.symbols | 34 ++++++++++++++++++ .../mutuallyRecursiveCallbacks.types | 35 +++++++++++++++++++ 4 files changed, 107 insertions(+) create mode 100644 tests/baselines/reference/mutuallyRecursiveCallbacks.errors.txt create mode 100644 tests/baselines/reference/mutuallyRecursiveCallbacks.js create mode 100644 tests/baselines/reference/mutuallyRecursiveCallbacks.symbols create mode 100644 tests/baselines/reference/mutuallyRecursiveCallbacks.types diff --git a/tests/baselines/reference/mutuallyRecursiveCallbacks.errors.txt b/tests/baselines/reference/mutuallyRecursiveCallbacks.errors.txt new file mode 100644 index 00000000000..0682caad5b8 --- /dev/null +++ b/tests/baselines/reference/mutuallyRecursiveCallbacks.errors.txt @@ -0,0 +1,24 @@ +tests/cases/compiler/mutuallyRecursiveCallbacks.ts(7,1): error TS2322: Type '(bar: Bar) => void' is not assignable to type 'Bar<{}>'. + Types of parameters 'bar' and 'foo' are incompatible. + Types of parameters 'bar' and 'foo' are incompatible. + Type 'Foo<{}>' is not assignable to type 'Bar<{}>'. + Types of parameters 'bar' and 'foo' are incompatible. + Type 'void' is not assignable to type 'Foo<{}>'. + + +==== tests/cases/compiler/mutuallyRecursiveCallbacks.ts (1 errors) ==== + // Repro from #18277 + + interface Foo { (bar: Bar): void }; + type Bar = (foo: Foo) => Foo; + declare function foo(bar: Bar): void; + declare var bar: Bar<{}>; + bar = foo; + ~~~ +!!! error TS2322: Type '(bar: Bar) => void' is not assignable to type 'Bar<{}>'. +!!! error TS2322: Types of parameters 'bar' and 'foo' are incompatible. +!!! error TS2322: Types of parameters 'bar' and 'foo' are incompatible. +!!! error TS2322: Type 'Foo<{}>' is not assignable to type 'Bar<{}>'. +!!! error TS2322: Types of parameters 'bar' and 'foo' are incompatible. +!!! error TS2322: Type 'void' is not assignable to type 'Foo<{}>'. + \ No newline at end of file diff --git a/tests/baselines/reference/mutuallyRecursiveCallbacks.js b/tests/baselines/reference/mutuallyRecursiveCallbacks.js new file mode 100644 index 00000000000..df52508df7a --- /dev/null +++ b/tests/baselines/reference/mutuallyRecursiveCallbacks.js @@ -0,0 +1,14 @@ +//// [mutuallyRecursiveCallbacks.ts] +// Repro from #18277 + +interface Foo { (bar: Bar): void }; +type Bar = (foo: Foo) => Foo; +declare function foo(bar: Bar): void; +declare var bar: Bar<{}>; +bar = foo; + + +//// [mutuallyRecursiveCallbacks.js] +// Repro from #18277 +; +bar = foo; diff --git a/tests/baselines/reference/mutuallyRecursiveCallbacks.symbols b/tests/baselines/reference/mutuallyRecursiveCallbacks.symbols new file mode 100644 index 00000000000..50cb0c0dea0 --- /dev/null +++ b/tests/baselines/reference/mutuallyRecursiveCallbacks.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/mutuallyRecursiveCallbacks.ts === +// Repro from #18277 + +interface Foo { (bar: Bar): void }; +>Foo : Symbol(Foo, Decl(mutuallyRecursiveCallbacks.ts, 0, 0)) +>T : Symbol(T, Decl(mutuallyRecursiveCallbacks.ts, 2, 14)) +>bar : Symbol(bar, Decl(mutuallyRecursiveCallbacks.ts, 2, 20)) +>Bar : Symbol(Bar, Decl(mutuallyRecursiveCallbacks.ts, 2, 41)) +>T : Symbol(T, Decl(mutuallyRecursiveCallbacks.ts, 2, 14)) + +type Bar = (foo: Foo) => Foo; +>Bar : Symbol(Bar, Decl(mutuallyRecursiveCallbacks.ts, 2, 41)) +>T : Symbol(T, Decl(mutuallyRecursiveCallbacks.ts, 3, 9)) +>foo : Symbol(foo, Decl(mutuallyRecursiveCallbacks.ts, 3, 15)) +>Foo : Symbol(Foo, Decl(mutuallyRecursiveCallbacks.ts, 0, 0)) +>T : Symbol(T, Decl(mutuallyRecursiveCallbacks.ts, 3, 9)) +>Foo : Symbol(Foo, Decl(mutuallyRecursiveCallbacks.ts, 0, 0)) +>T : Symbol(T, Decl(mutuallyRecursiveCallbacks.ts, 3, 9)) + +declare function foo(bar: Bar): void; +>foo : Symbol(foo, Decl(mutuallyRecursiveCallbacks.ts, 3, 38)) +>T : Symbol(T, Decl(mutuallyRecursiveCallbacks.ts, 4, 21)) +>bar : Symbol(bar, Decl(mutuallyRecursiveCallbacks.ts, 4, 24)) +>Bar : Symbol(Bar, Decl(mutuallyRecursiveCallbacks.ts, 2, 41)) +>T : Symbol(T, Decl(mutuallyRecursiveCallbacks.ts, 4, 21)) + +declare var bar: Bar<{}>; +>bar : Symbol(bar, Decl(mutuallyRecursiveCallbacks.ts, 5, 11)) +>Bar : Symbol(Bar, Decl(mutuallyRecursiveCallbacks.ts, 2, 41)) + +bar = foo; +>bar : Symbol(bar, Decl(mutuallyRecursiveCallbacks.ts, 5, 11)) +>foo : Symbol(foo, Decl(mutuallyRecursiveCallbacks.ts, 3, 38)) + diff --git a/tests/baselines/reference/mutuallyRecursiveCallbacks.types b/tests/baselines/reference/mutuallyRecursiveCallbacks.types new file mode 100644 index 00000000000..4a7b4dd0493 --- /dev/null +++ b/tests/baselines/reference/mutuallyRecursiveCallbacks.types @@ -0,0 +1,35 @@ +=== tests/cases/compiler/mutuallyRecursiveCallbacks.ts === +// Repro from #18277 + +interface Foo { (bar: Bar): void }; +>Foo : Foo +>T : T +>bar : Bar +>Bar : Bar +>T : T + +type Bar = (foo: Foo) => Foo; +>Bar : Bar +>T : T +>foo : Foo +>Foo : Foo +>T : T +>Foo : Foo +>T : T + +declare function foo(bar: Bar): void; +>foo : (bar: Bar) => void +>T : T +>bar : Bar +>Bar : Bar +>T : T + +declare var bar: Bar<{}>; +>bar : Bar<{}> +>Bar : Bar + +bar = foo; +>bar = foo : (bar: Bar) => void +>bar : Bar<{}> +>foo : (bar: Bar) => void + From 26290a88ac8daa7bcc4e12f077d2184cd99e0cd3 Mon Sep 17 00:00:00 2001 From: Ron Buckton Date: Wed, 11 Oct 2017 12:07:16 -0700 Subject: [PATCH 109/137] Updated error baseline --- tests/baselines/reference/genericDefaultsErrors.errors.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/baselines/reference/genericDefaultsErrors.errors.txt b/tests/baselines/reference/genericDefaultsErrors.errors.txt index 762bb92535b..b1afd6f173b 100644 --- a/tests/baselines/reference/genericDefaultsErrors.errors.txt +++ b/tests/baselines/reference/genericDefaultsErrors.errors.txt @@ -21,7 +21,7 @@ tests/cases/compiler/genericDefaultsErrors.ts(33,15): error TS2707: Generic type tests/cases/compiler/genericDefaultsErrors.ts(36,15): error TS2707: Generic type 'i09' requires between 2 and 3 type arguments. tests/cases/compiler/genericDefaultsErrors.ts(38,20): error TS2304: Cannot find name 'T'. tests/cases/compiler/genericDefaultsErrors.ts(38,20): error TS4033: Property 'x' of exported interface has or is using private name 'T'. -tests/cases/compiler/genericDefaultsErrors.ts(42,29): error TS2715: Type parameter 'T' has a circular default. +tests/cases/compiler/genericDefaultsErrors.ts(42,29): error TS2716: Type parameter 'T' has a circular default. ==== tests/cases/compiler/genericDefaultsErrors.ts (22 errors) ==== @@ -112,4 +112,4 @@ tests/cases/compiler/genericDefaultsErrors.ts(42,29): error TS2715: Type paramet // https://github.com/Microsoft/TypeScript/issues/16221 interface SelfReference {} ~~~~~~~~~~~~~ -!!! error TS2715: Type parameter 'T' has a circular default. \ No newline at end of file +!!! error TS2716: Type parameter 'T' has a circular default. \ No newline at end of file From deed981715dcce5d10b3cbfa1701794672212be3 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 11 Oct 2017 12:27:21 -0700 Subject: [PATCH 110/137] Handle case sensitivity when looking up config file for Script info Fixes #17726 --- .../unittests/tsserverProjectSystem.ts | 46 +++++++++++++++++++ src/server/editorServices.ts | 2 +- 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index 2d761ae33c2..f7d082128cd 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -2917,6 +2917,52 @@ namespace ts.projectSystem { function checkSnapLength(snap: IScriptSnapshot, expectedLength: number) { assert.equal(snap.getLength(), expectedLength, "Incorrect snapshot size"); } + + function verifyOpenFileWorks(useCaseSensitiveFileNames: boolean) { + const file1: FileOrFolder = { + path: "/a/b/src/app.ts", + content: "let x = 10;" + }; + const file2: FileOrFolder = { + path: "/a/B/lib/module2.ts", + content: "let z = 10;" + }; + const configFile: FileOrFolder = { + path: "/a/b/tsconfig.json", + content: "" + }; + const configFile2: FileOrFolder = { + path: "/a/tsconfig.json", + content: "" + }; + const host = createServerHost([file1, file2, configFile, configFile2], { + useCaseSensitiveFileNames + }); + const service = createProjectService(host); + + // Open file1 -> configFile + verifyConfigFileName(file1, "/a", configFile); + verifyConfigFileName(file1, "/a/b", configFile); + verifyConfigFileName(file1, "/a/B", useCaseSensitiveFileNames ? undefined : configFile); + + // Open file2 use root "/a/b" + verifyConfigFileName(file2, "/a", useCaseSensitiveFileNames ? configFile2 : configFile); + verifyConfigFileName(file2, "/a/b", useCaseSensitiveFileNames ? undefined : configFile); + verifyConfigFileName(file2, "/a/B", useCaseSensitiveFileNames ? undefined : configFile); + + function verifyConfigFileName(file: FileOrFolder, projectRoot: string, expectedConfigFile: FileOrFolder | undefined) { + const { configFileName } = service.openClientFile(file.path, /*fileContent*/ undefined, /*scriptKind*/ undefined, projectRoot); + assert.equal(configFileName, expectedConfigFile && expectedConfigFile.path); + service.closeClientFile(file.path); + } + } + it("works when project root is used with case-sensitive system", () => { + verifyOpenFileWorks(/*useCaseSensitiveFileNames*/ true); + }); + + it("works when project root is used with case-insensitive system", () => { + verifyOpenFileWorks(/*useCaseSensitiveFileNames*/ false); + }); }); describe("Language service", () => { diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 173fd86afe4..379a5fbfe7e 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -1218,7 +1218,7 @@ namespace ts.server { projectRootPath?: NormalizedPath) { let searchPath = asNormalizedPath(getDirectoryPath(info.fileName)); - while (!projectRootPath || stringContains(searchPath, projectRootPath)) { + while (!projectRootPath || containsPath(projectRootPath, searchPath, this.currentDirectory, !this.host.useCaseSensitiveFileNames)) { const canonicalSearchPath = normalizedPathToPath(searchPath, this.currentDirectory, this.toCanonicalFileName); const tsconfigFileName = asNormalizedPath(combinePaths(searchPath, "tsconfig.json")); let result = action(tsconfigFileName, combinePaths(canonicalSearchPath, "tsconfig.json")); From 7e1dd66c19d01fea072ab32a16a8d7354cae247d Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 11 Oct 2017 13:44:07 -0700 Subject: [PATCH 111/137] Update to use `help wanted` instead of `Accepting PRs` (#19105) --- pull_request_template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pull_request_template.md b/pull_request_template.md index 683e6acbf89..2c49c84641b 100644 --- a/pull_request_template.md +++ b/pull_request_template.md @@ -3,7 +3,7 @@ Thank you for submitting a pull request! Here's a checklist you might find useful. [ ] There is an associated issue that is labelled - 'Bug' or 'Accepting PRs' or is in the Community milestone + 'Bug' or 'help wanted' or is in the Community milestone [ ] Code is up-to-date with the `master` branch [ ] You've successfully run `jake runtests` locally [ ] You've signed the CLA From 3fef16008d2c29951476321144763b0ce9d5a777 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Wed, 11 Oct 2017 14:01:25 -0700 Subject: [PATCH 112/137] Fill missing type arguments during error reporting Previously, only the success path did this; it was missing in the error reporting path in resolveCall. This resulted in crashes for unsupplied type arguments when the supplied type arguments were incorrect. --- src/compiler/checker.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 36ee2a00eb9..56835e13dde 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -16203,8 +16203,10 @@ namespace ts { checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, /*excludeArgument*/ undefined, /*reportErrors*/ true); } else if (candidateForTypeArgumentError) { + const isJavascript = isInJavaScriptFile(candidateForTypeArgumentError.declaration); const typeArguments = (node).typeArguments; - checkTypeArguments(candidateForTypeArgumentError, typeArguments, map(typeArguments, getTypeFromTypeNode), /*reportErrors*/ true, fallbackError); + const typeArgumentTypes = fillMissingTypeArguments(map(typeArguments, getTypeFromTypeNode), candidateForTypeArgumentError.typeParameters, getMinTypeArgumentCount(candidateForTypeArgumentError.typeParameters), isJavascript); + checkTypeArguments(candidateForTypeArgumentError, typeArguments, typeArgumentTypes, /*reportErrors*/ true, fallbackError); } else if (typeArguments && every(signatures, sig => length(sig.typeParameters) !== typeArguments.length)) { let min = Number.POSITIVE_INFINITY; From 156e7e206969b63247944e420a0b6abda970c925 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Wed, 11 Oct 2017 14:02:20 -0700 Subject: [PATCH 113/137] Test:Incorrect number of type args during err reporting --- ...peArgumentsDuringErrorReporting.errors.txt | 28 ++++++++ ...mberOfTypeArgumentsDuringErrorReporting.js | 30 ++++++++ ...fTypeArgumentsDuringErrorReporting.symbols | 60 ++++++++++++++++ ...rOfTypeArgumentsDuringErrorReporting.types | 68 +++++++++++++++++++ ...mberOfTypeArgumentsDuringErrorReporting.ts | 21 ++++++ 5 files changed, 207 insertions(+) create mode 100644 tests/baselines/reference/incorrectNumberOfTypeArgumentsDuringErrorReporting.errors.txt create mode 100644 tests/baselines/reference/incorrectNumberOfTypeArgumentsDuringErrorReporting.js create mode 100644 tests/baselines/reference/incorrectNumberOfTypeArgumentsDuringErrorReporting.symbols create mode 100644 tests/baselines/reference/incorrectNumberOfTypeArgumentsDuringErrorReporting.types create mode 100644 tests/cases/compiler/incorrectNumberOfTypeArgumentsDuringErrorReporting.ts diff --git a/tests/baselines/reference/incorrectNumberOfTypeArgumentsDuringErrorReporting.errors.txt b/tests/baselines/reference/incorrectNumberOfTypeArgumentsDuringErrorReporting.errors.txt new file mode 100644 index 00000000000..41aadb4d465 --- /dev/null +++ b/tests/baselines/reference/incorrectNumberOfTypeArgumentsDuringErrorReporting.errors.txt @@ -0,0 +1,28 @@ +tests/cases/compiler/incorrectNumberOfTypeArgumentsDuringErrorReporting.ts(18,4): error TS2559: Type 'MyObjA' has no properties in common with type 'ObjA'. + + +==== tests/cases/compiler/incorrectNumberOfTypeArgumentsDuringErrorReporting.ts (1 errors) ==== + interface ObjA { + y?:string, + } + + interface ObjB {[key:string]:any} + + interface Opts {a:A, b:B} + + const fn = < + A extends ObjA, + B extends ObjB = ObjB + >(opts:Opts):string => 'Z' + + interface MyObjA { + x:string, + } + + fn({ + ~~~~~~ +!!! error TS2559: Type 'MyObjA' has no properties in common with type 'ObjA'. + a: {x: 'X', y: 'Y'}, + b: {}, + }) + \ No newline at end of file diff --git a/tests/baselines/reference/incorrectNumberOfTypeArgumentsDuringErrorReporting.js b/tests/baselines/reference/incorrectNumberOfTypeArgumentsDuringErrorReporting.js new file mode 100644 index 00000000000..d74360e8edc --- /dev/null +++ b/tests/baselines/reference/incorrectNumberOfTypeArgumentsDuringErrorReporting.js @@ -0,0 +1,30 @@ +//// [incorrectNumberOfTypeArgumentsDuringErrorReporting.ts] +interface ObjA { + y?:string, +} + +interface ObjB {[key:string]:any} + +interface Opts {a:A, b:B} + +const fn = < + A extends ObjA, + B extends ObjB = ObjB +>(opts:Opts):string => 'Z' + +interface MyObjA { + x:string, +} + +fn({ + a: {x: 'X', y: 'Y'}, + b: {}, +}) + + +//// [incorrectNumberOfTypeArgumentsDuringErrorReporting.js] +var fn = function (opts) { return 'Z'; }; +fn({ + a: { x: 'X', y: 'Y' }, + b: {} +}); diff --git a/tests/baselines/reference/incorrectNumberOfTypeArgumentsDuringErrorReporting.symbols b/tests/baselines/reference/incorrectNumberOfTypeArgumentsDuringErrorReporting.symbols new file mode 100644 index 00000000000..5f94ad312c0 --- /dev/null +++ b/tests/baselines/reference/incorrectNumberOfTypeArgumentsDuringErrorReporting.symbols @@ -0,0 +1,60 @@ +=== tests/cases/compiler/incorrectNumberOfTypeArgumentsDuringErrorReporting.ts === +interface ObjA { +>ObjA : Symbol(ObjA, Decl(incorrectNumberOfTypeArgumentsDuringErrorReporting.ts, 0, 0)) + + y?:string, +>y : Symbol(ObjA.y, Decl(incorrectNumberOfTypeArgumentsDuringErrorReporting.ts, 0, 16)) +} + +interface ObjB {[key:string]:any} +>ObjB : Symbol(ObjB, Decl(incorrectNumberOfTypeArgumentsDuringErrorReporting.ts, 2, 1)) +>key : Symbol(key, Decl(incorrectNumberOfTypeArgumentsDuringErrorReporting.ts, 4, 17)) + +interface Opts {a:A, b:B} +>Opts : Symbol(Opts, Decl(incorrectNumberOfTypeArgumentsDuringErrorReporting.ts, 4, 33)) +>A : Symbol(A, Decl(incorrectNumberOfTypeArgumentsDuringErrorReporting.ts, 6, 15)) +>B : Symbol(B, Decl(incorrectNumberOfTypeArgumentsDuringErrorReporting.ts, 6, 17)) +>a : Symbol(Opts.a, Decl(incorrectNumberOfTypeArgumentsDuringErrorReporting.ts, 6, 22)) +>A : Symbol(A, Decl(incorrectNumberOfTypeArgumentsDuringErrorReporting.ts, 6, 15)) +>b : Symbol(Opts.b, Decl(incorrectNumberOfTypeArgumentsDuringErrorReporting.ts, 6, 26)) +>B : Symbol(B, Decl(incorrectNumberOfTypeArgumentsDuringErrorReporting.ts, 6, 17)) + +const fn = < +>fn : Symbol(fn, Decl(incorrectNumberOfTypeArgumentsDuringErrorReporting.ts, 8, 5)) + + A extends ObjA, +>A : Symbol(A, Decl(incorrectNumberOfTypeArgumentsDuringErrorReporting.ts, 8, 12)) +>ObjA : Symbol(ObjA, Decl(incorrectNumberOfTypeArgumentsDuringErrorReporting.ts, 0, 0)) + + B extends ObjB = ObjB +>B : Symbol(B, Decl(incorrectNumberOfTypeArgumentsDuringErrorReporting.ts, 9, 17)) +>ObjB : Symbol(ObjB, Decl(incorrectNumberOfTypeArgumentsDuringErrorReporting.ts, 2, 1)) +>ObjB : Symbol(ObjB, Decl(incorrectNumberOfTypeArgumentsDuringErrorReporting.ts, 2, 1)) + +>(opts:Opts):string => 'Z' +>opts : Symbol(opts, Decl(incorrectNumberOfTypeArgumentsDuringErrorReporting.ts, 11, 2)) +>Opts : Symbol(Opts, Decl(incorrectNumberOfTypeArgumentsDuringErrorReporting.ts, 4, 33)) +>A : Symbol(A, Decl(incorrectNumberOfTypeArgumentsDuringErrorReporting.ts, 8, 12)) +>B : Symbol(B, Decl(incorrectNumberOfTypeArgumentsDuringErrorReporting.ts, 9, 17)) + +interface MyObjA { +>MyObjA : Symbol(MyObjA, Decl(incorrectNumberOfTypeArgumentsDuringErrorReporting.ts, 11, 32)) + + x:string, +>x : Symbol(MyObjA.x, Decl(incorrectNumberOfTypeArgumentsDuringErrorReporting.ts, 13, 18)) +} + +fn({ +>fn : Symbol(fn, Decl(incorrectNumberOfTypeArgumentsDuringErrorReporting.ts, 8, 5)) +>MyObjA : Symbol(MyObjA, Decl(incorrectNumberOfTypeArgumentsDuringErrorReporting.ts, 11, 32)) + + a: {x: 'X', y: 'Y'}, +>a : Symbol(a, Decl(incorrectNumberOfTypeArgumentsDuringErrorReporting.ts, 17, 12)) +>x : Symbol(x, Decl(incorrectNumberOfTypeArgumentsDuringErrorReporting.ts, 18, 6)) +>y : Symbol(y, Decl(incorrectNumberOfTypeArgumentsDuringErrorReporting.ts, 18, 13)) + + b: {}, +>b : Symbol(b, Decl(incorrectNumberOfTypeArgumentsDuringErrorReporting.ts, 18, 22)) + +}) + diff --git a/tests/baselines/reference/incorrectNumberOfTypeArgumentsDuringErrorReporting.types b/tests/baselines/reference/incorrectNumberOfTypeArgumentsDuringErrorReporting.types new file mode 100644 index 00000000000..681a05eba09 --- /dev/null +++ b/tests/baselines/reference/incorrectNumberOfTypeArgumentsDuringErrorReporting.types @@ -0,0 +1,68 @@ +=== tests/cases/compiler/incorrectNumberOfTypeArgumentsDuringErrorReporting.ts === +interface ObjA { +>ObjA : ObjA + + y?:string, +>y : string +} + +interface ObjB {[key:string]:any} +>ObjB : ObjB +>key : string + +interface Opts {a:A, b:B} +>Opts : Opts +>A : A +>B : B +>a : A +>A : A +>b : B +>B : B + +const fn = < +>fn : (opts: Opts) => string +>< A extends ObjA, B extends ObjB = ObjB>(opts:Opts):string => 'Z' : (opts: Opts) => string + + A extends ObjA, +>A : A +>ObjA : ObjA + + B extends ObjB = ObjB +>B : B +>ObjB : ObjB +>ObjB : ObjB + +>(opts:Opts):string => 'Z' +>opts : Opts +>Opts : Opts +>A : A +>B : B +>'Z' : "Z" + +interface MyObjA { +>MyObjA : MyObjA + + x:string, +>x : string +} + +fn({ +>fn({ a: {x: 'X', y: 'Y'}, b: {},}) : any +>fn : (opts: Opts) => string +>MyObjA : MyObjA +>{ a: {x: 'X', y: 'Y'}, b: {},} : { a: { x: string; y: string; }; b: {}; } + + a: {x: 'X', y: 'Y'}, +>a : { x: string; y: string; } +>{x: 'X', y: 'Y'} : { x: string; y: string; } +>x : string +>'X' : "X" +>y : string +>'Y' : "Y" + + b: {}, +>b : {} +>{} : {} + +}) + diff --git a/tests/cases/compiler/incorrectNumberOfTypeArgumentsDuringErrorReporting.ts b/tests/cases/compiler/incorrectNumberOfTypeArgumentsDuringErrorReporting.ts new file mode 100644 index 00000000000..2f6c8c71250 --- /dev/null +++ b/tests/cases/compiler/incorrectNumberOfTypeArgumentsDuringErrorReporting.ts @@ -0,0 +1,21 @@ +interface ObjA { + y?:string, +} + +interface ObjB {[key:string]:any} + +interface Opts {a:A, b:B} + +const fn = < + A extends ObjA, + B extends ObjB = ObjB +>(opts:Opts):string => 'Z' + +interface MyObjA { + x:string, +} + +fn({ + a: {x: 'X', y: 'Y'}, + b: {}, +}) From 917ae32937053026f2c5421a4c2fa6256d31c10f Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 11 Oct 2017 14:50:45 -0700 Subject: [PATCH 114/137] Always log output of execSync (#19110) * Always log output of execSync * Fix lint --- .../typingsInstaller/nodeTypingsInstaller.ts | 49 +++++++++++++------ 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/src/server/typingsInstaller/nodeTypingsInstaller.ts b/src/server/typingsInstaller/nodeTypingsInstaller.ts index f5d9b866376..98478c2d5fc 100644 --- a/src/server/typingsInstaller/nodeTypingsInstaller.ts +++ b/src/server/typingsInstaller/nodeTypingsInstaller.ts @@ -68,10 +68,14 @@ namespace ts.server.typingsInstaller { return combinePaths(normalizeSlashes(globalTypingsCacheLocation), `node_modules/${TypesRegistryPackageName}/index.json`); } - type ExecSync = (command: string, options: { cwd: string, stdio?: "ignore" }) => any; + interface ExecSyncOptions { + cwd: string; + encoding: "utf-8"; + } + type ExecSync = (command: string, options: ExecSyncOptions) => string; export class NodeTypingsInstaller extends TypingsInstaller { - private readonly execSync: ExecSync; + private readonly nodeExecSync: ExecSync; private readonly npmPath: string; readonly typesRegistry: Map; @@ -95,7 +99,7 @@ namespace ts.server.typingsInstaller { this.log.writeLine(`Process id: ${process.pid}`); this.log.writeLine(`NPM location: ${this.npmPath} (explicit '${Arguments.NpmLocation}' ${npmLocation === undefined ? "not " : ""} provided)`); } - ({ execSync: this.execSync } = require("child_process")); + ({ execSync: this.nodeExecSync } = require("child_process")); this.ensurePackageDirectoryExists(globalTypingsCacheLocation); @@ -103,7 +107,7 @@ namespace ts.server.typingsInstaller { if (this.log.isEnabled()) { this.log.writeLine(`Updating ${TypesRegistryPackageName} npm package...`); } - this.execSync(`${this.npmPath} install --ignore-scripts ${TypesRegistryPackageName}`, { cwd: globalTypingsCacheLocation, stdio: "ignore" }); + this.execSyncAndLog(`${this.npmPath} install --ignore-scripts ${TypesRegistryPackageName}`, { cwd: globalTypingsCacheLocation }); if (this.log.isEnabled()) { this.log.writeLine(`Updated ${TypesRegistryPackageName} npm package`); } @@ -155,22 +159,31 @@ namespace ts.server.typingsInstaller { } const command = `${this.npmPath} install --ignore-scripts ${args.join(" ")} --save-dev --user-agent="typesInstaller/${version}"`; const start = Date.now(); - let stdout: Buffer; - let stderr: Buffer; - let hasError = false; - try { - stdout = this.execSync(command, { cwd }); - } - catch (e) { - stdout = e.stdout; - stderr = e.stderr; - hasError = true; - } + const hasError = this.execSyncAndLog(command, { cwd }); if (this.log.isEnabled()) { - this.log.writeLine(`npm install #${requestId} took: ${Date.now() - start} ms${sys.newLine}stdout: ${stdout && stdout.toString()}${sys.newLine}stderr: ${stderr && stderr.toString()}`); + this.log.writeLine(`npm install #${requestId} took: ${Date.now() - start} ms`); } onRequestCompleted(!hasError); } + + /** Returns 'true' in case of error. */ + private execSyncAndLog(command: string, options: Pick): boolean { + if (this.log.isEnabled()) { + this.log.writeLine(`Exec: ${command}`); + } + try { + const stdout = this.nodeExecSync(command, { ...options, encoding: "utf-8" }); + if (this.log.isEnabled()) { + this.log.writeLine(` Succeeded. stdout:${indent(sys.newLine, stdout)}`); + } + return false; + } + catch (error) { + const { stdout, stderr } = error; + this.log.writeLine(` Failed. stdout:${indent(sys.newLine, stdout)}${sys.newLine} stderr:${indent(sys.newLine, stderr)}`); + return true; + } + } } const logFilePath = findArgument(server.Arguments.LogFile); @@ -193,4 +206,8 @@ namespace ts.server.typingsInstaller { }); const installer = new NodeTypingsInstaller(globalTypingsCacheLocation, typingSafeListLocation, typesMapLocation, npmLocation, /*throttleLimit*/5, log); installer.listen(); + + function indent(newline: string, string: string): string { + return `${newline} ` + string.replace(/\r?\n/, `${newline} `); + } } From 9f4130b204024f33cdc6c8ecafebb70edd7fb4ac Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 11 Oct 2017 14:52:23 -0700 Subject: [PATCH 115/137] Fix incorrect cast target (#19093) Found while updating #18285 to latest master. Not sure what this fixes, but it was definitely incorrect - `node` must be a `Block` at this point, so this cast must have been intended for `node.parent`, which was checked against `TryStatement` right before it. --- src/services/refactors/extractSymbol.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/refactors/extractSymbol.ts b/src/services/refactors/extractSymbol.ts index 124a1f720bd..ba5a6d9d1b5 100644 --- a/src/services/refactors/extractSymbol.ts +++ b/src/services/refactors/extractSymbol.ts @@ -375,7 +375,7 @@ namespace ts.refactor.extractSymbol { permittedJumps = PermittedJumps.None; break; case SyntaxKind.Block: - if (node.parent && node.parent.kind === SyntaxKind.TryStatement && (node).finallyBlock === node) { + if (node.parent && node.parent.kind === SyntaxKind.TryStatement && (node.parent).finallyBlock === node) { // allow unconditional returns from finally blocks permittedJumps = PermittedJumps.Return; } From b94924533690661c9b5e6b2ef60b136e624adb83 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Wed, 11 Oct 2017 15:13:33 -0700 Subject: [PATCH 116/137] Add ValueModule as a valid object literal type, as they are immutable (#19090) * Add ValueModule as a valid object literal type, as they are immutable * Rename method based on usage --- src/compiler/checker.ts | 10 +++---- .../inferredIndexerOnNamespaceImport.js | 28 +++++++++++++++++++ .../inferredIndexerOnNamespaceImport.symbols | 23 +++++++++++++++ .../inferredIndexerOnNamespaceImport.types | 26 +++++++++++++++++ .../inferredIndexerOnNamespaceImport.ts | 12 ++++++++ 5 files changed, 94 insertions(+), 5 deletions(-) create mode 100644 tests/baselines/reference/inferredIndexerOnNamespaceImport.js create mode 100644 tests/baselines/reference/inferredIndexerOnNamespaceImport.symbols create mode 100644 tests/baselines/reference/inferredIndexerOnNamespaceImport.types create mode 100644 tests/cases/compiler/inferredIndexerOnNamespaceImport.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 36ee2a00eb9..a756faae036 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -6274,7 +6274,7 @@ namespace ts { } function getImplicitIndexTypeOfType(type: Type, kind: IndexKind): Type { - if (isObjectLiteralType(type)) { + if (isObjectTypeWithInferableIndex(type)) { const propTypes: Type[] = []; for (const prop of getPropertiesOfType(type)) { if (kind === IndexKind.String || isNumericLiteralName(prop.escapedName)) { @@ -9831,7 +9831,7 @@ namespace ts { // if T is related to U. return kind === IndexKind.String && isRelatedTo(getTemplateTypeFromMappedType(source), targetInfo.type, reportErrors); } - if (isObjectLiteralType(source)) { + if (isObjectTypeWithInferableIndex(source)) { let related = Ternary.True; if (kind === IndexKind.String) { const sourceNumberInfo = getIndexInfoOfType(source, IndexKind.Number); @@ -10344,11 +10344,11 @@ namespace ts { } /** - * Return true if type was inferred from an object literal or written as an object type literal + * Return true if type was inferred from an object literal, written as an object type literal, or is the shape of a module * with no call or construct signatures. */ - function isObjectLiteralType(type: Type) { - return type.symbol && (type.symbol.flags & (SymbolFlags.ObjectLiteral | SymbolFlags.TypeLiteral)) !== 0 && + function isObjectTypeWithInferableIndex(type: Type) { + return type.symbol && (type.symbol.flags & (SymbolFlags.ObjectLiteral | SymbolFlags.TypeLiteral | SymbolFlags.ValueModule)) !== 0 && getSignaturesOfType(type, SignatureKind.Call).length === 0 && getSignaturesOfType(type, SignatureKind.Construct).length === 0; } diff --git a/tests/baselines/reference/inferredIndexerOnNamespaceImport.js b/tests/baselines/reference/inferredIndexerOnNamespaceImport.js new file mode 100644 index 00000000000..10fbc0890b7 --- /dev/null +++ b/tests/baselines/reference/inferredIndexerOnNamespaceImport.js @@ -0,0 +1,28 @@ +//// [tests/cases/compiler/inferredIndexerOnNamespaceImport.ts] //// + +//// [foo.ts] +export const x = 3; +export const y = 5; + +//// [bar.ts] +import * as foo from "./foo"; + +function f(map: { [k: string]: number }) { + // ... +} + +f(foo); + +//// [foo.js] +"use strict"; +exports.__esModule = true; +exports.x = 3; +exports.y = 5; +//// [bar.js] +"use strict"; +exports.__esModule = true; +var foo = require("./foo"); +function f(map) { + // ... +} +f(foo); diff --git a/tests/baselines/reference/inferredIndexerOnNamespaceImport.symbols b/tests/baselines/reference/inferredIndexerOnNamespaceImport.symbols new file mode 100644 index 00000000000..ea0337ee9c2 --- /dev/null +++ b/tests/baselines/reference/inferredIndexerOnNamespaceImport.symbols @@ -0,0 +1,23 @@ +=== tests/cases/compiler/foo.ts === +export const x = 3; +>x : Symbol(x, Decl(foo.ts, 0, 12)) + +export const y = 5; +>y : Symbol(y, Decl(foo.ts, 1, 12)) + +=== tests/cases/compiler/bar.ts === +import * as foo from "./foo"; +>foo : Symbol(foo, Decl(bar.ts, 0, 6)) + +function f(map: { [k: string]: number }) { +>f : Symbol(f, Decl(bar.ts, 0, 29)) +>map : Symbol(map, Decl(bar.ts, 2, 11)) +>k : Symbol(k, Decl(bar.ts, 2, 19)) + + // ... +} + +f(foo); +>f : Symbol(f, Decl(bar.ts, 0, 29)) +>foo : Symbol(foo, Decl(bar.ts, 0, 6)) + diff --git a/tests/baselines/reference/inferredIndexerOnNamespaceImport.types b/tests/baselines/reference/inferredIndexerOnNamespaceImport.types new file mode 100644 index 00000000000..4a88b2330a0 --- /dev/null +++ b/tests/baselines/reference/inferredIndexerOnNamespaceImport.types @@ -0,0 +1,26 @@ +=== tests/cases/compiler/foo.ts === +export const x = 3; +>x : 3 +>3 : 3 + +export const y = 5; +>y : 5 +>5 : 5 + +=== tests/cases/compiler/bar.ts === +import * as foo from "./foo"; +>foo : typeof foo + +function f(map: { [k: string]: number }) { +>f : (map: { [k: string]: number; }) => void +>map : { [k: string]: number; } +>k : string + + // ... +} + +f(foo); +>f(foo) : void +>f : (map: { [k: string]: number; }) => void +>foo : typeof foo + diff --git a/tests/cases/compiler/inferredIndexerOnNamespaceImport.ts b/tests/cases/compiler/inferredIndexerOnNamespaceImport.ts new file mode 100644 index 00000000000..dd231361d27 --- /dev/null +++ b/tests/cases/compiler/inferredIndexerOnNamespaceImport.ts @@ -0,0 +1,12 @@ +// @filename: foo.ts +export const x = 3; +export const y = 5; + +// @filename: bar.ts +import * as foo from "./foo"; + +function f(map: { [k: string]: number }) { + // ... +} + +f(foo); \ No newline at end of file From 4d7c112ef7f5cd18f5563fff8158cc9e6eef6a98 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Wed, 11 Oct 2017 14:21:09 -0700 Subject: [PATCH 117/137] Make sure project root paths of inferred projects are canonical when comparing --- .../unittests/tsserverProjectSystem.ts | 111 +++++++++++++++++- src/server/editorServices.ts | 15 +-- src/server/project.ts | 6 +- .../reference/api/tsserverlibrary.d.ts | 3 +- 4 files changed, 124 insertions(+), 11 deletions(-) diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index f7d082128cd..b52a6968774 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -220,11 +220,11 @@ namespace ts.projectSystem { checkNumberOfProjects(this, count); } } - export function createProjectService(host: server.ServerHost, parameters: CreateProjectServiceParameters = {}) { + export function createProjectService(host: server.ServerHost, parameters: CreateProjectServiceParameters = {}, options?: Partial) { const cancellationToken = parameters.cancellationToken || server.nullCancellationToken; const logger = parameters.logger || nullLogger; const useSingleInferredProject = parameters.useSingleInferredProject !== undefined ? parameters.useSingleInferredProject : false; - return new TestProjectService(host, logger, cancellationToken, useSingleInferredProject, parameters.typingsInstaller, parameters.eventHandler); + return new TestProjectService(host, logger, cancellationToken, useSingleInferredProject, parameters.typingsInstaller, parameters.eventHandler, options); } export function checkNumberOfConfiguredProjects(projectService: server.ProjectService, expected: number) { @@ -3703,6 +3703,113 @@ namespace ts.projectSystem { assert.equal(projectService.inferredProjects[1].getCompilationSettings().target, ScriptTarget.ESNext); assert.equal(projectService.inferredProjects[2].getCompilationSettings().target, ScriptTarget.ES2015); }); + + function checkInferredProject(inferredProject: server.InferredProject, actualFiles: FileOrFolder[], target: ScriptTarget) { + checkProjectActualFiles(inferredProject, actualFiles.map(f => f.path)); + assert.equal(inferredProject.getCompilationSettings().target, target); + } + + function verifyProjectRootWithCaseSensitivity(useCaseSensitiveFileNames: boolean) { + const files: [FileOrFolder, FileOrFolder, FileOrFolder, FileOrFolder] = [ + { path: "/a/file1.ts", content: "let x = 1;" }, + { path: "/A/file2.ts", content: "let y = 2;" }, + { path: "/b/file2.ts", content: "let x = 3;" }, + { path: "/c/file3.ts", content: "let z = 4;" } + ]; + const host = createServerHost(files, { useCaseSensitiveFileNames }); + const projectService = createProjectService(host, { useSingleInferredProject: true, }, { useInferredProjectPerProjectRoot: true }); + projectService.setCompilerOptionsForInferredProjects({ + allowJs: true, + target: ScriptTarget.ESNext + }); + projectService.setCompilerOptionsForInferredProjects({ + allowJs: true, + target: ScriptTarget.ES2015 + }, "/a"); + + openClientFiles(["/a", "/a", "/b", undefined]); + verifyInferredProjectsState([ + [[files[3]], ScriptTarget.ESNext], + [[files[0], files[1]], ScriptTarget.ES2015], + [[files[2]], ScriptTarget.ESNext] + ]); + closeClientFiles(); + + openClientFiles(["/a", "/A", "/b", undefined]); + if (useCaseSensitiveFileNames) { + verifyInferredProjectsState([ + [[files[3]], ScriptTarget.ESNext], + [[files[0]], ScriptTarget.ES2015], + [[files[1]], ScriptTarget.ESNext], + [[files[2]], ScriptTarget.ESNext] + ]); + } + else { + verifyInferredProjectsState([ + [[files[3]], ScriptTarget.ESNext], + [[files[0], files[1]], ScriptTarget.ES2015], + [[files[2]], ScriptTarget.ESNext] + ]); + } + closeClientFiles(); + + projectService.setCompilerOptionsForInferredProjects({ + allowJs: true, + target: ScriptTarget.ES2017 + }, "/A"); + + openClientFiles(["/a", "/a", "/b", undefined]); + verifyInferredProjectsState([ + [[files[3]], ScriptTarget.ESNext], + [[files[0], files[1]], useCaseSensitiveFileNames ? ScriptTarget.ES2015 : ScriptTarget.ES2017], + [[files[2]], ScriptTarget.ESNext] + ]); + closeClientFiles(); + + openClientFiles(["/a", "/A", "/b", undefined]); + if (useCaseSensitiveFileNames) { + verifyInferredProjectsState([ + [[files[3]], ScriptTarget.ESNext], + [[files[0]], ScriptTarget.ES2015], + [[files[1]], ScriptTarget.ES2017], + [[files[2]], ScriptTarget.ESNext] + ]); + } + else { + verifyInferredProjectsState([ + [[files[3]], ScriptTarget.ESNext], + [[files[0], files[1]], ScriptTarget.ES2017], + [[files[2]], ScriptTarget.ESNext] + ]); + } + closeClientFiles(); + + function openClientFiles(projectRoots: [string | undefined, string | undefined, string | undefined, string | undefined]) { + files.forEach((file, index) => { + projectService.openClientFile(file.path, file.content, ScriptKind.JS, projectRoots[index]); + }); + } + + function closeClientFiles() { + files.forEach(file => projectService.closeClientFile(file.path)); + } + + function verifyInferredProjectsState(expected: [FileOrFolder[], ScriptTarget][]) { + checkNumberOfProjects(projectService, { inferredProjects: expected.length }); + projectService.inferredProjects.forEach((p, index) => { + const [actualFiles, target] = expected[index]; + checkInferredProject(p, actualFiles, target); + }); + } + } + + it("inferred projects per project root with case sensitive system", () => { + verifyProjectRootWithCaseSensitivity(/*useCaseSensitiveFileNames*/ true); + }); + + it("inferred projects per project root with case insensitive system", () => { + verifyProjectRootWithCaseSensitivity(/*useCaseSensitiveFileNames*/ false); + }); }); describe("No overwrite emit error", () => { diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index 379a5fbfe7e..98112b3f24e 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -590,9 +590,9 @@ namespace ts.server { // always set 'allowNonTsExtensions' for inferred projects since user cannot configure it from the outside // previously we did not expose a way for user to change these settings and this option was enabled by default compilerOptions.allowNonTsExtensions = true; - - if (projectRootPath) { - this.compilerOptionsForInferredProjectsPerProjectRoot.set(projectRootPath, compilerOptions); + const canonicalProjectRootPath = projectRootPath && this.toCanonicalFileName(projectRootPath); + if (canonicalProjectRootPath) { + this.compilerOptionsForInferredProjectsPerProjectRoot.set(canonicalProjectRootPath, compilerOptions); } else { this.compilerOptionsForInferredProjects = compilerOptions; @@ -608,9 +608,9 @@ namespace ts.server { // root path // - Inferred projects with a projectRootPath, if the new options apply to that // project root path. - if (projectRootPath ? - project.projectRootPath === projectRootPath : - !project.projectRootPath || !this.compilerOptionsForInferredProjectsPerProjectRoot.has(project.projectRootPath)) { + if (canonicalProjectRootPath ? + project.projectRootPath === canonicalProjectRootPath : + !project.projectRootPath || !this.compilerOptionsForInferredProjectsPerProjectRoot.has(project.projectRootPath)) { project.setCompilerOptions(compilerOptions); project.compileOnSaveEnabled = compilerOptions.compileOnSave; project.markAsDirty(); @@ -1596,9 +1596,10 @@ namespace ts.server { } if (projectRootPath) { + const canonicalProjectRootPath = this.toCanonicalFileName(projectRootPath); // if we have an explicit project root path, find (or create) the matching inferred project. for (const project of this.inferredProjects) { - if (project.projectRootPath === projectRootPath) { + if (project.projectRootPath === canonicalProjectRootPath) { return project; } } diff --git a/src/server/project.ts b/src/server/project.ts index 9c66f8b4a6c..bf060b66a27 100644 --- a/src/server/project.ts +++ b/src/server/project.ts @@ -1047,12 +1047,15 @@ namespace ts.server { super.setCompilerOptions(newOptions); } + /** this is canonical project root path */ + readonly projectRootPath: string | undefined; + /*@internal*/ constructor( projectService: ProjectService, documentRegistry: DocumentRegistry, compilerOptions: CompilerOptions, - readonly projectRootPath: string | undefined, + projectRootPath: string | undefined, currentDirectory: string | undefined) { super(InferredProject.newName(), ProjectKind.Inferred, @@ -1064,6 +1067,7 @@ namespace ts.server { /*compileOnSaveEnabled*/ false, projectService.host, currentDirectory); + this.projectRootPath = projectRootPath && projectService.toCanonicalFileName(projectRootPath); } addRoot(info: ScriptInfo) { diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index d862513c293..61320be7eb7 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -7186,11 +7186,12 @@ declare namespace ts.server { * the file and its imports/references are put into an InferredProject. */ class InferredProject extends Project { - readonly projectRootPath: string | undefined; private static readonly newName; private _isJsInferredProject; toggleJsInferredProject(isJsInferredProject: boolean): void; setCompilerOptions(options?: CompilerOptions): void; + /** this is canonical project root path*/ + readonly projectRootPath: string | undefined; addRoot(info: ScriptInfo): void; removeRoot(info: ScriptInfo): void; isProjectWithSingleRoot(): boolean; From eb4f067ecbdd3b43b9df8ea9c4826b766f38f8b7 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Wed, 11 Oct 2017 13:53:52 -0700 Subject: [PATCH 118/137] Don't clobber the position of cloned nodes --- src/services/utilities.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 5affb8a8887..a8dea4ddd0e 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -1349,15 +1349,16 @@ namespace ts { const visited = visitEachChild(node, getSynthesizedDeepClone, nullTransformationContext); if (visited === node) { // This only happens for leaf nodes - internal nodes always see their children change. - return getSynthesizedClone(node); + const clone = getSynthesizedClone(node); + clone.pos = node.pos; + clone.end = node.end; + return clone; } // PERF: As an optimization, rather than calling getSynthesizedClone, we'll update // the new node created by visitEachChild with the extra changes getSynthesizedClone // would have made. - visited.pos = -1; - visited.end = -1; visited.parent = undefined; return visited; From d00ab417c6a4e5e084c3bbeab9b31ccd9fbc5854 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Wed, 11 Oct 2017 15:58:54 -0700 Subject: [PATCH 119/137] checkTypeParameters now always calls fillMissingTypeArguments And refactor checkTypeParameters to be easier to use and to read. --- src/compiler/checker.ts | 61 +++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 56835e13dde..ff78ccaa135 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -15643,34 +15643,35 @@ namespace ts { return getInferredTypes(context); } - function checkTypeArguments(signature: Signature, typeArgumentNodes: ReadonlyArray, typeArgumentTypes: Type[], reportErrors: boolean, headMessage?: DiagnosticMessage): boolean { + function checkTypeArguments(signature: Signature, typeArguments: ReadonlyArray, reportErrors: boolean, headMessage?: DiagnosticMessage): Type[] | false { + const isJavascript = isInJavaScriptFile(signature.declaration); const typeParameters = signature.typeParameters; - let typeArgumentsAreAssignable = true; + const typeArgumentTypes = fillMissingTypeArguments(map(typeArguments, getTypeFromTypeNode), typeParameters, getMinTypeArgumentCount(typeParameters), isJavascript); let mapper: TypeMapper; - for (let i = 0; i < typeArgumentNodes.length; i++) { - if (typeArgumentsAreAssignable /* so far */) { - const constraint = getConstraintOfTypeParameter(typeParameters[i]); - if (constraint) { - let errorInfo: DiagnosticMessageChain; - let typeArgumentHeadMessage = Diagnostics.Type_0_does_not_satisfy_the_constraint_1; - if (reportErrors && headMessage) { - errorInfo = chainDiagnosticMessages(errorInfo, typeArgumentHeadMessage); - typeArgumentHeadMessage = headMessage; - } - if (!mapper) { - mapper = createTypeMapper(typeParameters, typeArgumentTypes); - } - const typeArgument = typeArgumentTypes[i]; - typeArgumentsAreAssignable = checkTypeAssignableTo( - typeArgument, - getTypeWithThisArgument(instantiateType(constraint, mapper), typeArgument), - reportErrors ? typeArgumentNodes[i] : undefined, - typeArgumentHeadMessage, - errorInfo); + for (let i = 0; i < typeArguments.length; i++) { + const constraint = getConstraintOfTypeParameter(typeParameters[i]); + if (constraint) { + let errorInfo: DiagnosticMessageChain; + let typeArgumentHeadMessage = Diagnostics.Type_0_does_not_satisfy_the_constraint_1; + if (reportErrors && headMessage) { + errorInfo = chainDiagnosticMessages(errorInfo, typeArgumentHeadMessage); + typeArgumentHeadMessage = headMessage; + } + if (!mapper) { + mapper = createTypeMapper(typeParameters, typeArgumentTypes); + } + const typeArgument = typeArgumentTypes[i]; + if (!checkTypeAssignableTo( + typeArgument, + getTypeWithThisArgument(instantiateType(constraint, mapper), typeArgument), + reportErrors ? typeArguments[i] : undefined, + typeArgumentHeadMessage, + errorInfo)) { + return false; } } } - return typeArgumentsAreAssignable; + return typeArgumentTypes; } /** @@ -16203,10 +16204,7 @@ namespace ts { checkApplicableSignature(node, args, candidateForArgumentError, assignableRelation, /*excludeArgument*/ undefined, /*reportErrors*/ true); } else if (candidateForTypeArgumentError) { - const isJavascript = isInJavaScriptFile(candidateForTypeArgumentError.declaration); - const typeArguments = (node).typeArguments; - const typeArgumentTypes = fillMissingTypeArguments(map(typeArguments, getTypeFromTypeNode), candidateForTypeArgumentError.typeParameters, getMinTypeArgumentCount(candidateForTypeArgumentError.typeParameters), isJavascript); - checkTypeArguments(candidateForTypeArgumentError, typeArguments, typeArgumentTypes, /*reportErrors*/ true, fallbackError); + checkTypeArguments(candidateForTypeArgumentError, (node as CallExpression).typeArguments, /*reportErrors*/ true, fallbackError); } else if (typeArguments && every(signatures, sig => length(sig.typeParameters) !== typeArguments.length)) { let min = Number.POSITIVE_INFINITY; @@ -16305,10 +16303,12 @@ namespace ts { candidate = originalCandidate; if (candidate.typeParameters) { let typeArgumentTypes: Type[]; - const isJavascript = isInJavaScriptFile(candidate.declaration); if (typeArguments) { - typeArgumentTypes = fillMissingTypeArguments(map(typeArguments, getTypeFromTypeNode), candidate.typeParameters, getMinTypeArgumentCount(candidate.typeParameters), isJavascript); - if (!checkTypeArguments(candidate, typeArguments, typeArgumentTypes, /*reportErrors*/ false)) { + const typeArgumentResult = checkTypeArguments(candidate, typeArguments, /*reportErrors*/ false); + if (typeArgumentResult) { + typeArgumentTypes = typeArgumentResult; + } + else { candidateForTypeArgumentError = originalCandidate; break; } @@ -16316,6 +16316,7 @@ namespace ts { else { typeArgumentTypes = inferTypeArguments(node, candidate, args, excludeArgument, inferenceContext); } + const isJavascript = isInJavaScriptFile(candidate.declaration); candidate = getSignatureInstantiation(candidate, typeArgumentTypes, isJavascript); } if (!checkApplicableSignature(node, args, candidate, relation, excludeArgument, /*reportErrors*/ false)) { From 9ef417b846694bb609e6d2a36b90b87b4e58cc34 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 11 Oct 2017 16:02:58 -0700 Subject: [PATCH 120/137] Account for type queries in type literals --- src/compiler/checker.ts | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ed131c8936c..9224b6afd7c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -8290,20 +8290,25 @@ namespace ts { function isTypeParameterPossiblyReferenced(tp: TypeParameter, node: Node) { // If the type parameter doesn't have exactly one declaration, if there are invening statement blocks - // between the node and the type parameter declaration, or if the node contains actual references to the - // type parameter, we consider the type parameter possibly referenced. + // between the node and the type parameter declaration, if the node contains actual references to the + // type parameter, or if the node contains type queries, we consider the type parameter possibly referenced. if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { const container = tp.symbol.declarations[0].parent; if (findAncestor(node, n => n.kind === SyntaxKind.Block ? "quit" : n === container)) { - return tp.isThisType ? forEachChild(node, checkThis) : forEachChild(node, checkIdentifier); + return forEachChild(node, containsReference); } } return true; - function checkThis(node: Node): boolean { - return node.kind === SyntaxKind.ThisType || forEachChild(node, checkThis); - } - function checkIdentifier(node: Node): boolean { - return node.kind === SyntaxKind.Identifier && isPartOfTypeNode(node) && getTypeFromTypeNode(node) === tp || forEachChild(node, checkIdentifier); + function containsReference(node: Node): boolean { + switch (node.kind) { + case SyntaxKind.ThisType: + return tp.isThisType; + case SyntaxKind.Identifier: + return !tp.isThisType && isPartOfTypeNode(node) && getTypeFromTypeNode(node) === tp; + case SyntaxKind.TypeQuery: + return true; + } + return forEachChild(node, containsReference); } } From 19f70f6d3dac5ec210e1184631f2bee055e0fb4b Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 11 Oct 2017 16:03:15 -0700 Subject: [PATCH 121/137] Add additional test --- tests/cases/compiler/indirectTypeParameterReferences.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/cases/compiler/indirectTypeParameterReferences.ts b/tests/cases/compiler/indirectTypeParameterReferences.ts index 210a599354d..c8cb56ad5e7 100644 --- a/tests/cases/compiler/indirectTypeParameterReferences.ts +++ b/tests/cases/compiler/indirectTypeParameterReferences.ts @@ -22,3 +22,8 @@ combined(comb => { comb.b comb.a }) + +// Repro from #19091 + +declare function f(a: T): { a: typeof a }; +let n: number = f(2).a; From 7ee96293ca23b3e8b6b2d64762b9366b2df59b71 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Wed, 11 Oct 2017 16:03:23 -0700 Subject: [PATCH 122/137] Accept new baselines --- .../indirectTypeParameterReferences.js | 6 ++++++ .../indirectTypeParameterReferences.symbols | 16 ++++++++++++++++ .../indirectTypeParameterReferences.types | 18 ++++++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/tests/baselines/reference/indirectTypeParameterReferences.js b/tests/baselines/reference/indirectTypeParameterReferences.js index e6e807a4720..f947b8f7c1f 100644 --- a/tests/baselines/reference/indirectTypeParameterReferences.js +++ b/tests/baselines/reference/indirectTypeParameterReferences.js @@ -23,6 +23,11 @@ combined(comb => { comb.b comb.a }) + +// Repro from #19091 + +declare function f(a: T): { a: typeof a }; +let n: number = f(2).a; //// [indirectTypeParameterReferences.js] @@ -41,3 +46,4 @@ combined(function (comb) { comb.b; comb.a; }); +var n = f(2).a; diff --git a/tests/baselines/reference/indirectTypeParameterReferences.symbols b/tests/baselines/reference/indirectTypeParameterReferences.symbols index 0cb091a8622..cf0f3e7bbc9 100644 --- a/tests/baselines/reference/indirectTypeParameterReferences.symbols +++ b/tests/baselines/reference/indirectTypeParameterReferences.symbols @@ -73,3 +73,19 @@ combined(comb => { }) +// Repro from #19091 + +declare function f(a: T): { a: typeof a }; +>f : Symbol(f, Decl(indirectTypeParameterReferences.ts, 23, 2)) +>T : Symbol(T, Decl(indirectTypeParameterReferences.ts, 27, 19)) +>a : Symbol(a, Decl(indirectTypeParameterReferences.ts, 27, 22)) +>T : Symbol(T, Decl(indirectTypeParameterReferences.ts, 27, 19)) +>a : Symbol(a, Decl(indirectTypeParameterReferences.ts, 27, 30)) +>a : Symbol(a, Decl(indirectTypeParameterReferences.ts, 27, 22)) + +let n: number = f(2).a; +>n : Symbol(n, Decl(indirectTypeParameterReferences.ts, 28, 3)) +>f(2).a : Symbol(a, Decl(indirectTypeParameterReferences.ts, 27, 30)) +>f : Symbol(f, Decl(indirectTypeParameterReferences.ts, 23, 2)) +>a : Symbol(a, Decl(indirectTypeParameterReferences.ts, 27, 30)) + diff --git a/tests/baselines/reference/indirectTypeParameterReferences.types b/tests/baselines/reference/indirectTypeParameterReferences.types index 2a8ac9a8b08..e38f5dd2577 100644 --- a/tests/baselines/reference/indirectTypeParameterReferences.types +++ b/tests/baselines/reference/indirectTypeParameterReferences.types @@ -86,3 +86,21 @@ combined(comb => { }) +// Repro from #19091 + +declare function f(a: T): { a: typeof a }; +>f : (a: T) => { a: T; } +>T : T +>a : T +>T : T +>a : T +>a : T + +let n: number = f(2).a; +>n : number +>f(2).a : number +>f(2) : { a: number; } +>f : (a: T) => { a: T; } +>2 : 2 +>a : number + From 568c8a3298fa10f1192a5fd3721414d27b0221b5 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Wed, 4 Oct 2017 14:09:32 -0700 Subject: [PATCH 123/137] Allow extraction of variable decls used outside the extracted range If there are only declarations, use the new function as the initializer for a destructuring declaration. If there are declarations and writes, changes all of the `const` declarations to `let` and add `| undefined` onto any explicit types. Use destructuring assignment to accomplish both "initialization" and writes. I don't believe there is a case where there are both declarations and a return (since the declarations wouldn't be available after the return). UNDONE: this could probably be generalized to handle binding patterns but, for now, only identifiers are supported. Fixes #18242 Fixes #18855 --- src/harness/unittests/extractFunctions.ts | 136 ++++++++++ src/services/refactors/extractSymbol.ts | 251 ++++++++++++++---- .../extractFunction/extractFunction11.ts | 6 +- .../extractFunction/extractFunction12.ts | 2 +- .../extractFunction/extractFunction6.ts | 6 +- .../extractFunction/extractFunction7.ts | 6 +- ...nction_VariableDeclaration_Const_NoType.js | 14 + ...nction_VariableDeclaration_Const_NoType.ts | 14 + ...Function_VariableDeclaration_Const_Type.ts | 14 + ...ction_VariableDeclaration_ConsumedTwice.ts | 14 + ...ction_VariableDeclaration_DeclaredTwice.js | 16 ++ ...ction_VariableDeclaration_DeclaredTwice.ts | 16 ++ ...Function_VariableDeclaration_Let_NoType.js | 14 + ...Function_VariableDeclaration_Let_NoType.ts | 14 + ...ctFunction_VariableDeclaration_Let_Type.ts | 14 + ...tFunction_VariableDeclaration_Multiple1.ts | 14 + ...tFunction_VariableDeclaration_Multiple2.js | 16 ++ ...tFunction_VariableDeclaration_Multiple2.ts | 16 ++ ...tFunction_VariableDeclaration_Multiple3.ts | 16 ++ ...n_VariableDeclaration_ShorthandProperty.js | 27 ++ ...n_VariableDeclaration_ShorthandProperty.ts | 27 ++ ...extractFunction_VariableDeclaration_Var.js | 14 + ...extractFunction_VariableDeclaration_Var.ts | 14 + ...VariableDeclaration_Writes_Const_NoType.js | 34 +++ ...VariableDeclaration_Writes_Const_NoType.ts | 34 +++ ...n_VariableDeclaration_Writes_Const_Type.ts | 34 +++ ...n_VariableDeclaration_Writes_Let_NoType.js | 34 +++ ...n_VariableDeclaration_Writes_Let_NoType.ts | 34 +++ ...ion_VariableDeclaration_Writes_Let_Type.ts | 34 +++ ...ction_VariableDeclaration_Writes_Mixed1.js | 38 +++ ...ction_VariableDeclaration_Writes_Mixed1.ts | 38 +++ ...ction_VariableDeclaration_Writes_Mixed2.js | 38 +++ ...ction_VariableDeclaration_Writes_Mixed2.ts | 38 +++ ...ction_VariableDeclaration_Writes_Mixed3.ts | 38 +++ ...riableDeclaration_Writes_UnionUndefined.ts | 42 +++ ...Function_VariableDeclaration_Writes_Var.js | 34 +++ ...Function_VariableDeclaration_Writes_Var.ts | 34 +++ tests/cases/fourslash/extract-method14.ts | 2 +- 38 files changed, 1117 insertions(+), 70 deletions(-) create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Const_NoType.js create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Const_NoType.ts create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Const_Type.ts create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_ConsumedTwice.ts create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_DeclaredTwice.js create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_DeclaredTwice.ts create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Let_NoType.js create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Let_NoType.ts create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Let_Type.ts create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Multiple1.ts create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Multiple2.js create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Multiple2.ts create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Multiple3.ts create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_ShorthandProperty.js create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_ShorthandProperty.ts create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Var.js create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Var.ts create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Const_NoType.js create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Const_NoType.ts create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Const_Type.ts create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_NoType.js create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_NoType.ts create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_Type.ts create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed1.js create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed1.ts create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed2.js create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed2.ts create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed3.ts create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_UnionUndefined.ts create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Var.js create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Var.ts diff --git a/src/harness/unittests/extractFunctions.ts b/src/harness/unittests/extractFunctions.ts index 750e590ca4c..715a4f5aa0c 100644 --- a/src/harness/unittests/extractFunctions.ts +++ b/src/harness/unittests/extractFunctions.ts @@ -360,6 +360,142 @@ function parsePrimaryExpression(): any { export const j = 10; export const y = [#|j * j|]; }`); + + testExtractFunction("extractFunction_VariableDeclaration_Var", ` +[#|var x = 1;|] +x; +`); + + testExtractFunction("extractFunction_VariableDeclaration_Let_Type", ` +[#|let x: number = 1;|] +x; +`); + + testExtractFunction("extractFunction_VariableDeclaration_Let_NoType", ` +[#|let x = 1;|] +x; +`); + + testExtractFunction("extractFunction_VariableDeclaration_Const_Type", ` +[#|const x: number = 1;|] +x; +`); + + testExtractFunction("extractFunction_VariableDeclaration_Const_NoType", ` +[#|const x = 1;|] +x; +`); + + testExtractFunction("extractFunction_VariableDeclaration_Multiple1", ` +[#|const x = 1, y: string = "a";|] +x; y; +`); + + testExtractFunction("extractFunction_VariableDeclaration_Multiple2", ` +[#|const x = 1, y = "a"; +const z = 3;|] +x; y; z; +`); + + testExtractFunction("extractFunction_VariableDeclaration_Multiple3", ` +[#|const x = 1, y: string = "a"; +let z = 3;|] +x; y; z; +`); + + testExtractFunction("extractFunction_VariableDeclaration_ConsumedTwice", ` +[#|const x: number = 1;|] +x; x; +`); + + testExtractFunction("extractFunction_VariableDeclaration_DeclaredTwice", ` +[#|var x = 1; +var x = 2;|] +x; +`); + + testExtractFunction("extractFunction_VariableDeclaration_Writes_Var", ` +function f() { + let a = 1; + [#|var x = 1; + a++;|] + a; x; +}`); + + testExtractFunction("extractFunction_VariableDeclaration_Writes_Let_NoType", ` +function f() { + let a = 1; + [#|let x = 1; + a++;|] + a; x; +}`); + + testExtractFunction("extractFunction_VariableDeclaration_Writes_Let_Type", ` +function f() { + let a = 1; + [#|let x: number = 1; + a++;|] + a; x; +}`); + + testExtractFunction("extractFunction_VariableDeclaration_Writes_Const_NoType", ` +function f() { + let a = 1; + [#|const x = 1; + a++;|] + a; x; +}`); + + testExtractFunction("extractFunction_VariableDeclaration_Writes_Const_Type", ` +function f() { + let a = 1; + [#|const x: number = 1; + a++;|] + a; x; +}`); + + testExtractFunction("extractFunction_VariableDeclaration_Writes_Mixed1", ` +function f() { + let a = 1; + [#|const x = 1; + let y = 2; + a++;|] + a; x; y; +}`); + + testExtractFunction("extractFunction_VariableDeclaration_Writes_Mixed2", ` +function f() { + let a = 1; + [#|var x = 1; + let y = 2; + a++;|] + a; x; y; +}`); + + testExtractFunction("extractFunction_VariableDeclaration_Writes_Mixed3", ` +function f() { + let a = 1; + [#|let x: number = 1; + let y = 2; + a++;|] + a; x; y; +}`); + + testExtractFunction("extractFunction_VariableDeclaration_Writes_UnionUndefined", ` +function f() { + let a = 1; + [#|let x: number | undefined = 1; + let y: undefined | number = 2; + let z: (undefined | number) = 3; + a++;|] + a; x; y; z; +}`); + + testExtractFunction("extractFunction_VariableDeclaration_ShorthandProperty", ` +function f() { + [#|let x;|] + return { x }; +}`); }); function testExtractFunction(caption: string, text: string) { diff --git a/src/services/refactors/extractSymbol.ts b/src/services/refactors/extractSymbol.ts index 9defe3dd1f0..a03bb843600 100644 --- a/src/services/refactors/extractSymbol.ts +++ b/src/services/refactors/extractSymbol.ts @@ -137,7 +137,7 @@ namespace ts.refactor.extractSymbol { export const FunctionWillNotBeVisibleInTheNewScope = createMessage("Function will not visible in the new scope."); export const CannotExtractIdentifier = createMessage("Select more than a single identifier."); export const CannotExtractExportedEntity = createMessage("Cannot extract exported declaration"); - export const CannotCombineWritesAndReturns = createMessage("Cannot combine writes and returns"); + export const CannotWriteInExpression = createMessage("Cannot write back side-effects when extracting an expression"); export const CannotExtractReadonlyPropertyInitializerOutsideConstructor = createMessage("Cannot move initialization of read-only class property outside of the constructor"); export const CannotExtractAmbientBlock = createMessage("Cannot extract code from ambient contexts"); export const CannotAccessVariablesFromNestedScopes = createMessage("Cannot access variables from nested scopes"); @@ -507,15 +507,16 @@ namespace ts.refactor.extractSymbol { } function getFunctionExtractionAtIndex(targetRange: TargetRange, context: RefactorContext, requestedChangesIndex: number): RefactorEditInfo { - const { scopes, readsAndWrites: { target, usagesPerScope, functionErrorsPerScope } } = getPossibleExtractionsWorker(targetRange, context); + const { scopes, readsAndWrites: { target, usagesPerScope, functionErrorsPerScope, exposedVariableDeclarations } } = getPossibleExtractionsWorker(targetRange, context); Debug.assert(!functionErrorsPerScope[requestedChangesIndex].length, "The extraction went missing? How?"); context.cancellationToken.throwIfCancellationRequested(); - return extractFunctionInScope(target, scopes[requestedChangesIndex], usagesPerScope[requestedChangesIndex], targetRange, context); + return extractFunctionInScope(target, scopes[requestedChangesIndex], usagesPerScope[requestedChangesIndex], exposedVariableDeclarations, targetRange, context); } function getConstantExtractionAtIndex(targetRange: TargetRange, context: RefactorContext, requestedChangesIndex: number): RefactorEditInfo { - const { scopes, readsAndWrites: { target, usagesPerScope, constantErrorsPerScope } } = getPossibleExtractionsWorker(targetRange, context); + const { scopes, readsAndWrites: { target, usagesPerScope, constantErrorsPerScope, exposedVariableDeclarations } } = getPossibleExtractionsWorker(targetRange, context); Debug.assert(!constantErrorsPerScope[requestedChangesIndex].length, "The extraction went missing? How?"); + Debug.assert(exposedVariableDeclarations.length === 0, "Extract constant accepted a range containing a variable declaration?"); context.cancellationToken.throwIfCancellationRequested(); const expression = isExpression(target) ? target @@ -674,6 +675,7 @@ namespace ts.refactor.extractSymbol { node: Statement | Expression | Block, scope: Scope, { usages: usagesInScope, typeParameterUsages, substitutions }: ScopeUsages, + exposedVariableDeclarations: ReadonlyArray, range: TargetRange, context: RefactorContext): RefactorEditInfo { @@ -731,10 +733,10 @@ namespace ts.refactor.extractSymbol { // to avoid problems when there are literal types present if (isExpression(node) && !isJS) { const contextualType = checker.getContextualType(node); - returnType = checker.typeToTypeNode(contextualType); + returnType = checker.typeToTypeNode(contextualType, scope, NodeBuilderFlags.NoTruncation); } - const { body, returnValueProperty } = transformFunctionBody(node, writes, substitutions, !!(range.facts & RangeFacts.HasReturn)); + const { body, returnValueProperty } = transformFunctionBody(node, exposedVariableDeclarations, writes, substitutions, !!(range.facts & RangeFacts.HasReturn)); let newFunction: MethodDeclaration | FunctionDeclaration; if (isClassLike(scope)) { @@ -796,38 +798,114 @@ namespace ts.refactor.extractSymbol { call = createAwait(call); } - if (writes) { + if (exposedVariableDeclarations.length && !writes) { + // No need to mix declarations and writes. + + // How could any variables be exposed if there's a return statement? + Debug.assert(!returnValueProperty); + Debug.assert(!(range.facts & RangeFacts.HasReturn)); + + if (exposedVariableDeclarations.length === 1) { + // Declaring exactly one variable: let x = newFunction(); + const variableDeclaration = exposedVariableDeclarations[0]; + newNodes.push(createVariableStatement( + /*modifiers*/ undefined, + createVariableDeclarationList( + [createVariableDeclaration(getSynthesizedDeepClone(variableDeclaration.name), /*type*/ getSynthesizedDeepClone(variableDeclaration.type), /*initializer*/ call)], // TODO (acasey): test binding patterns + variableDeclaration.parent.flags))); + } + else { + // Declaring multiple variables / return properties: + // let {x, y} = newFunction(); + const bindingElements: BindingElement[] = []; + const typeElements: TypeElement[] = []; + let commonNodeFlags = exposedVariableDeclarations[0].parent.flags; + let sawExplicitType = false; + for (const variableDeclaration of exposedVariableDeclarations) { + bindingElements.push(createBindingElement( + /*dotDotDotToken*/ undefined, + /*propertyName*/ undefined, + /*name*/ getSynthesizedDeepClone(variableDeclaration.name))); + + // Being returned through an object literal will have widened the type. + const variableType: TypeNode = checker.typeToTypeNode( + checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(variableDeclaration)), + scope, + NodeBuilderFlags.NoTruncation); + + typeElements.push(createPropertySignature( + /*modifiers*/ undefined, + /*name*/ variableDeclaration.symbol.name, + /*questionToken*/ undefined, + /*type*/ variableType, + /*initializer*/ undefined)); + sawExplicitType = sawExplicitType || variableDeclaration.type !== undefined; + commonNodeFlags = commonNodeFlags & variableDeclaration.parent.flags; + } + + const typeLiteral: TypeLiteralNode | undefined = sawExplicitType ? createTypeLiteralNode(typeElements) : undefined; + if (typeLiteral) { + setEmitFlags(typeLiteral, EmitFlags.SingleLine); + } + + newNodes.push(createVariableStatement( + /*modifiers*/ undefined, + createVariableDeclarationList( + [createVariableDeclaration( + createObjectBindingPattern(bindingElements), + /*type*/ typeLiteral, + /*initializer*/call)], + commonNodeFlags))); + } + } + else if (exposedVariableDeclarations.length || writes) { + if (exposedVariableDeclarations.length) { + // CONSIDER: we're going to create one statement per variable, but we could actually preserve their original grouping. + for (const variableDeclaration of exposedVariableDeclarations) { + let flags: NodeFlags = variableDeclaration.parent.flags; + if (flags & NodeFlags.Const) { + flags = (flags & ~NodeFlags.Const) | NodeFlags.Let; + } + + newNodes.push(createVariableStatement( + /*modifiers*/ undefined, + createVariableDeclarationList( + [createVariableDeclaration(variableDeclaration.symbol.name, getTypeDeepCloneUnionUndefined(variableDeclaration.type))], + flags))); + } + } + if (returnValueProperty) { // has both writes and return, need to create variable declaration to hold return value; newNodes.push(createVariableStatement( /*modifiers*/ undefined, - [createVariableDeclaration(returnValueProperty, createKeywordTypeNode(SyntaxKind.AnyKeyword))] - )); + createVariableDeclarationList( + [createVariableDeclaration(returnValueProperty, getTypeDeepCloneUnionUndefined(returnType))], + NodeFlags.Let))); } - const assignments = getPropertyAssignmentsForWrites(writes); + const assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); if (returnValueProperty) { assignments.unshift(createShorthandPropertyAssignment(returnValueProperty)); } // propagate writes back if (assignments.length === 1) { - if (returnValueProperty) { - newNodes.push(createReturn(createIdentifier(returnValueProperty))); - } - else { - newNodes.push(createStatement(createBinary(assignments[0].name, SyntaxKind.EqualsToken, call))); + // We would only have introduced a return value property if there had been + // other assignments to make. + Debug.assert(!returnValueProperty); - if (range.facts & RangeFacts.HasReturn) { - newNodes.push(createReturn()); - } + newNodes.push(createStatement(createAssignment(assignments[0].name, call))); + + if (range.facts & RangeFacts.HasReturn) { + newNodes.push(createReturn()); } } else { // emit e.g. // { a, b, __return } = newFunction(a, b); // return __return; - newNodes.push(createStatement(createBinary(createObjectLiteral(assignments), SyntaxKind.EqualsToken, call))); + newNodes.push(createStatement(createAssignment(createObjectLiteral(assignments), call))); if (returnValueProperty) { newNodes.push(createReturn(createIdentifier(returnValueProperty))); } @@ -861,6 +939,21 @@ namespace ts.refactor.extractSymbol { const renameFilename = renameRange.getSourceFile().fileName; const renameLocation = getRenameLocation(edits, renameFilename, functionNameText, /*isDeclaredBeforeUse*/ false); return { renameFilename, renameLocation, edits }; + + function getTypeDeepCloneUnionUndefined(typeNode: TypeNode | undefined): TypeNode | undefined { + if (typeNode === undefined) { + return undefined; + } + + const clone = getSynthesizedDeepClone(typeNode); + let withoutParens = clone; + while (isParenthesizedTypeNode(withoutParens)) { + withoutParens = withoutParens.type; + } + return isUnionTypeNode(withoutParens) && find(withoutParens.types, t => t.kind === SyntaxKind.UndefinedKeyword) + ? clone + : createUnionTypeNode([clone, createKeywordTypeNode(SyntaxKind.UndefinedKeyword)]); + } } /** @@ -883,7 +976,7 @@ namespace ts.refactor.extractSymbol { const variableType = isJS ? undefined - : checker.typeToTypeNode(checker.getContextualType(node)); + : checker.typeToTypeNode(checker.getContextualType(node), scope, NodeBuilderFlags.NoTruncation); const initializer = transformConstantInitializer(node, substitutions); @@ -1088,21 +1181,22 @@ namespace ts.refactor.extractSymbol { } } - function transformFunctionBody(body: Node, writes: ReadonlyArray, substitutions: ReadonlyMap, hasReturn: boolean): { body: Block, returnValueProperty: string } { - if (isBlock(body) && !writes && substitutions.size === 0) { - // already block, no writes to propagate back, no substitutions - can use node as is + function transformFunctionBody(body: Node, exposedVariableDeclarations: ReadonlyArray, writes: ReadonlyArray, substitutions: ReadonlyMap, hasReturn: boolean): { body: Block, returnValueProperty: string } { + const hasWritesOrVariableDeclarations = writes !== undefined || exposedVariableDeclarations.length > 0; + if (isBlock(body) && !hasWritesOrVariableDeclarations && substitutions.size === 0) { + // already block, no declarations or writes to propagate back, no substitutions - can use node as is return { body: createBlock(body.statements, /*multLine*/ true), returnValueProperty: undefined }; } let returnValueProperty: string; let ignoreReturns = false; const statements = createNodeArray(isBlock(body) ? body.statements.slice(0) : [isStatement(body) ? body : createReturn(body)]); // rewrite body if either there are writes that should be propagated back via return statements or there are substitutions - if (writes || substitutions.size) { + if (hasWritesOrVariableDeclarations || substitutions.size) { const rewrittenStatements = visitNodes(statements, visitor).slice(); - if (writes && !hasReturn && isStatement(body)) { + if (hasWritesOrVariableDeclarations && !hasReturn && isStatement(body)) { // add return at the end to propagate writes back in case if control flow falls out of the function body // it is ok to know that range has at least one return since it we only allow unconditional returns - const assignments = getPropertyAssignmentsForWrites(writes); + const assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); if (assignments.length === 1) { rewrittenStatements.push(createReturn(assignments[0].name)); } @@ -1117,8 +1211,8 @@ namespace ts.refactor.extractSymbol { } function visitor(node: Node): VisitResult { - if (!ignoreReturns && node.kind === SyntaxKind.ReturnStatement && writes) { - const assignments: ObjectLiteralElementLike[] = getPropertyAssignmentsForWrites(writes); + if (!ignoreReturns && node.kind === SyntaxKind.ReturnStatement && hasWritesOrVariableDeclarations) { + const assignments: ObjectLiteralElementLike[] = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); if ((node).expression) { if (!returnValueProperty) { returnValueProperty = "__return"; @@ -1240,8 +1334,18 @@ namespace ts.refactor.extractSymbol { } } - function getPropertyAssignmentsForWrites(writes: ReadonlyArray): ShorthandPropertyAssignment[] { - return writes.map(w => createShorthandPropertyAssignment(w.symbol.name)); + function getPropertyAssignmentsForWritesAndVariableDeclarations( + exposedVariableDeclarations: ReadonlyArray, + writes: ReadonlyArray) { + + const variableAssignments = map(exposedVariableDeclarations, v => createShorthandPropertyAssignment(v.symbol.name)); + const writeAssignments = map(writes, w => createShorthandPropertyAssignment(w.symbol.name)); + + return variableAssignments === undefined + ? writeAssignments + : writeAssignments === undefined + ? variableAssignments + : variableAssignments.concat(writeAssignments); } function isReadonlyArray(v: any): v is ReadonlyArray { @@ -1287,6 +1391,7 @@ namespace ts.refactor.extractSymbol { readonly usagesPerScope: ReadonlyArray; readonly functionErrorsPerScope: ReadonlyArray>; readonly constantErrorsPerScope: ReadonlyArray>; + readonly exposedVariableDeclarations: ReadonlyArray; } function collectReadsAndWrites( targetRange: TargetRange, @@ -1301,7 +1406,10 @@ namespace ts.refactor.extractSymbol { const substitutionsPerScope: Map[] = []; const functionErrorsPerScope: Diagnostic[][] = []; const constantErrorsPerScope: Diagnostic[][] = []; - const visibleDeclarationsInExtractedRange: Symbol[] = []; + const visibleDeclarationsInExtractedRange: NamedDeclaration[] = []; + const exposedVariableSymbolSet = createMap(); // Key is symbol ID + const exposedVariableDeclarations: VariableDeclaration[] = []; + let firstExposedNonVariableDeclaration: NamedDeclaration | undefined = undefined; const expression = !isReadonlyArray(targetRange.range) ? targetRange.range @@ -1346,7 +1454,6 @@ namespace ts.refactor.extractSymbol { const seenUsages = createMap(); const target = isReadonlyArray(targetRange.range) ? createBlock(targetRange.range) : targetRange.range; - const containingLexicalScopeOfExtraction = isBlockScope(scopes[0], scopes[0].parent) ? scopes[0] : getEnclosingBlockScopeContainer(scopes[0]); const unmodifiedNode = isReadonlyArray(targetRange.range) ? first(targetRange.range) : targetRange.range; const inGenericContext = isInGenericContext(unmodifiedNode); @@ -1392,6 +1499,15 @@ namespace ts.refactor.extractSymbol { Debug.assert(i === scopes.length); } + // If there are any declarations in the extracted block that are used in the same enclosing + // lexical scope, we can't move the extraction "up" as those declarations will become unreachable + if (visibleDeclarationsInExtractedRange.length) { + const containingLexicalScopeOfExtraction = isBlockScope(scopes[0], scopes[0].parent) + ? scopes[0] + : getEnclosingBlockScopeContainer(scopes[0]); + forEachChild(containingLexicalScopeOfExtraction, checkForUsedDeclarations); + } + for (let i = 0; i < scopes.length; i++) { const scopeUsages = usagesPerScope[i]; // Special case: in the innermost scope, all usages are available. @@ -1415,8 +1531,11 @@ namespace ts.refactor.extractSymbol { } }); - if (hasWrite && !isReadonlyArray(targetRange.range) && isExpression(targetRange.range)) { - const diag = createDiagnosticForNode(targetRange.range, Messages.CannotCombineWritesAndReturns); + // If an expression was extracted, then there shouldn't have been any variable declarations. + Debug.assert(isReadonlyArray(targetRange.range) || exposedVariableDeclarations.length === 0); + + if (hasWrite && !isReadonlyArray(targetRange.range)) { + const diag = createDiagnosticForNode(targetRange.range, Messages.CannotWriteInExpression); functionErrorsPerScope[i].push(diag); constantErrorsPerScope[i].push(diag); } @@ -1425,15 +1544,14 @@ namespace ts.refactor.extractSymbol { functionErrorsPerScope[i].push(diag); constantErrorsPerScope[i].push(diag); } + else if (firstExposedNonVariableDeclaration) { + const diag = createDiagnosticForNode(firstExposedNonVariableDeclaration, Messages.CannotExtractExportedEntity); + functionErrorsPerScope[i].push(diag); + constantErrorsPerScope[i].push(diag); + } } - // If there are any declarations in the extracted block that are used in the same enclosing - // lexical scope, we can't move the extraction "up" as those declarations will become unreachable - if (visibleDeclarationsInExtractedRange.length) { - forEachChild(containingLexicalScopeOfExtraction, checkForUsedDeclarations); - } - - return { target, usagesPerScope, functionErrorsPerScope, constantErrorsPerScope }; + return { target, usagesPerScope, functionErrorsPerScope, constantErrorsPerScope, exposedVariableDeclarations }; function hasTypeParameters(node: Node) { return isDeclarationWithTypeParameters(node) && @@ -1472,7 +1590,7 @@ namespace ts.refactor.extractSymbol { } if (isDeclaration(node) && node.symbol) { - visibleDeclarationsInExtractedRange.push(node.symbol); + visibleDeclarationsInExtractedRange.push(node); } if (isAssignmentExpression(node)) { @@ -1518,11 +1636,7 @@ namespace ts.refactor.extractSymbol { } function recordUsagebySymbol(identifier: Identifier, usage: Usage, isTypeName: boolean) { - // If the identifier is both a property name and its value, we're only interested in its value - // (since the name is a declaration and will be included in the extracted range). - const symbol = identifier.parent && isShorthandPropertyAssignment(identifier.parent) && identifier.parent.name === identifier - ? checker.getShorthandAssignmentValueSymbol(identifier.parent) - : checker.getSymbolAtLocation(identifier); + const symbol = getSymbolReferencedByIdentifier(identifier); if (!symbol) { // cannot find symbol - do nothing return undefined; @@ -1606,20 +1720,39 @@ namespace ts.refactor.extractSymbol { } // Otherwise check and recurse. - const sym = checker.getSymbolAtLocation(node); - if (sym && visibleDeclarationsInExtractedRange.some(d => d === sym)) { - const diag = createDiagnosticForNode(node, Messages.CannotExtractExportedEntity); - for (const errors of functionErrorsPerScope) { - errors.push(diag); + const sym = isIdentifier(node) + ? getSymbolReferencedByIdentifier(node) + : checker.getSymbolAtLocation(node); + if (sym) { + const decl = find(visibleDeclarationsInExtractedRange, d => d.symbol === sym); + if (decl) { + if (isVariableDeclaration(decl)) { + const idString = decl.symbol.id.toString(); + if (!exposedVariableSymbolSet.has(idString)) { + exposedVariableDeclarations.push(decl); + exposedVariableSymbolSet.set(idString, true); + } + } + else { + // CONSIDER: this includes binding elements, which we could + // expose in the same way as variables. + firstExposedNonVariableDeclaration = firstExposedNonVariableDeclaration || decl; + } } - for (const errors of constantErrorsPerScope) { - errors.push(diag); - } - return true; - } - else { - forEachChild(node, checkForUsedDeclarations); } + + forEachChild(node, checkForUsedDeclarations); + } + + /** + * Return the symbol referenced by an identifier (even if it declares a different symbol). + */ + function getSymbolReferencedByIdentifier(identifier: Identifier) { + // If the identifier is both a property name and its value, we're only interested in its value + // (since the name is a declaration and will be included in the extracted range). + return identifier.parent && isShorthandPropertyAssignment(identifier.parent) && identifier.parent.name === identifier + ? checker.getShorthandAssignmentValueSymbol(identifier.parent) + : checker.getSymbolAtLocation(identifier); } function tryReplaceWithQualifiedNameOrPropertyAccess(symbol: Symbol, scopeDecl: Node, isTypeNode: boolean): PropertyAccessExpression | EntityName { diff --git a/tests/baselines/reference/extractFunction/extractFunction11.ts b/tests/baselines/reference/extractFunction/extractFunction11.ts index d07a1826439..4bb88123a2f 100644 --- a/tests/baselines/reference/extractFunction/extractFunction11.ts +++ b/tests/baselines/reference/extractFunction/extractFunction11.ts @@ -17,7 +17,7 @@ namespace A { class C { a() { let z = 1; - var __return: any; + let __return; ({ __return, z } = this./*RENAME*/newMethod(z)); return __return; } @@ -36,7 +36,7 @@ namespace A { class C { a() { let z = 1; - var __return: any; + let __return; ({ __return, z } = /*RENAME*/newFunction(z)); return __return; } @@ -55,7 +55,7 @@ namespace A { class C { a() { let z = 1; - var __return: any; + let __return; ({ __return, y, z } = /*RENAME*/newFunction(y, z)); return __return; } diff --git a/tests/baselines/reference/extractFunction/extractFunction12.ts b/tests/baselines/reference/extractFunction/extractFunction12.ts index 37274bdcc87..49e87151b9b 100644 --- a/tests/baselines/reference/extractFunction/extractFunction12.ts +++ b/tests/baselines/reference/extractFunction/extractFunction12.ts @@ -20,7 +20,7 @@ namespace A { b() {} a() { let z = 1; - var __return: any; + let __return; ({ __return, z } = this./*RENAME*/newMethod(z)); return __return; } diff --git a/tests/baselines/reference/extractFunction/extractFunction6.ts b/tests/baselines/reference/extractFunction/extractFunction6.ts index f6c94216b46..a01cb25e061 100644 --- a/tests/baselines/reference/extractFunction/extractFunction6.ts +++ b/tests/baselines/reference/extractFunction/extractFunction6.ts @@ -43,7 +43,7 @@ namespace A { function a() { let a = 1; - var __return: any; + let __return; ({ __return, a } = /*RENAME*/newFunction(a)); return __return; } @@ -65,7 +65,7 @@ namespace A { function a() { let a = 1; - var __return: any; + let __return; ({ __return, a } = /*RENAME*/newFunction(a)); return __return; } @@ -87,7 +87,7 @@ namespace A { function a() { let a = 1; - var __return: any; + let __return; ({ __return, a } = /*RENAME*/newFunction(x, a)); return __return; } diff --git a/tests/baselines/reference/extractFunction/extractFunction7.ts b/tests/baselines/reference/extractFunction/extractFunction7.ts index 91377868e0f..4111558904c 100644 --- a/tests/baselines/reference/extractFunction/extractFunction7.ts +++ b/tests/baselines/reference/extractFunction/extractFunction7.ts @@ -49,7 +49,7 @@ namespace A { function a() { let a = 1; - var __return: any; + let __return; ({ __return, a } = /*RENAME*/newFunction(a)); return __return; } @@ -73,7 +73,7 @@ namespace A { function a() { let a = 1; - var __return: any; + let __return; ({ __return, a } = /*RENAME*/newFunction(a)); return __return; } @@ -97,7 +97,7 @@ namespace A { function a() { let a = 1; - var __return: any; + let __return; ({ __return, a } = /*RENAME*/newFunction(x, a)); return __return; } diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Const_NoType.js b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Const_NoType.js new file mode 100644 index 00000000000..fff1488ef41 --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Const_NoType.js @@ -0,0 +1,14 @@ +// ==ORIGINAL== + +/*[#|*/const x = 1;/*|]*/ +x; + +// ==SCOPE::Extract to function in global scope== + +const x = /*RENAME*/newFunction(); +x; + +function newFunction() { + const x = 1; + return x; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Const_NoType.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Const_NoType.ts new file mode 100644 index 00000000000..fff1488ef41 --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Const_NoType.ts @@ -0,0 +1,14 @@ +// ==ORIGINAL== + +/*[#|*/const x = 1;/*|]*/ +x; + +// ==SCOPE::Extract to function in global scope== + +const x = /*RENAME*/newFunction(); +x; + +function newFunction() { + const x = 1; + return x; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Const_Type.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Const_Type.ts new file mode 100644 index 00000000000..94576953758 --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Const_Type.ts @@ -0,0 +1,14 @@ +// ==ORIGINAL== + +/*[#|*/const x: number = 1;/*|]*/ +x; + +// ==SCOPE::Extract to function in global scope== + +const x: number = /*RENAME*/newFunction(); +x; + +function newFunction() { + const x: number = 1; + return x; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_ConsumedTwice.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_ConsumedTwice.ts new file mode 100644 index 00000000000..ac57711614c --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_ConsumedTwice.ts @@ -0,0 +1,14 @@ +// ==ORIGINAL== + +/*[#|*/const x: number = 1;/*|]*/ +x; x; + +// ==SCOPE::Extract to function in global scope== + +const x: number = /*RENAME*/newFunction(); +x; x; + +function newFunction() { + const x: number = 1; + return x; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_DeclaredTwice.js b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_DeclaredTwice.js new file mode 100644 index 00000000000..e6f314acd9c --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_DeclaredTwice.js @@ -0,0 +1,16 @@ +// ==ORIGINAL== + +/*[#|*/var x = 1; +var x = 2;/*|]*/ +x; + +// ==SCOPE::Extract to function in global scope== + +var x = /*RENAME*/newFunction(); +x; + +function newFunction() { + var x = 1; + var x = 2; + return x; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_DeclaredTwice.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_DeclaredTwice.ts new file mode 100644 index 00000000000..e6f314acd9c --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_DeclaredTwice.ts @@ -0,0 +1,16 @@ +// ==ORIGINAL== + +/*[#|*/var x = 1; +var x = 2;/*|]*/ +x; + +// ==SCOPE::Extract to function in global scope== + +var x = /*RENAME*/newFunction(); +x; + +function newFunction() { + var x = 1; + var x = 2; + return x; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Let_NoType.js b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Let_NoType.js new file mode 100644 index 00000000000..4f407ce5703 --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Let_NoType.js @@ -0,0 +1,14 @@ +// ==ORIGINAL== + +/*[#|*/let x = 1;/*|]*/ +x; + +// ==SCOPE::Extract to function in global scope== + +let x = /*RENAME*/newFunction(); +x; + +function newFunction() { + let x = 1; + return x; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Let_NoType.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Let_NoType.ts new file mode 100644 index 00000000000..4f407ce5703 --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Let_NoType.ts @@ -0,0 +1,14 @@ +// ==ORIGINAL== + +/*[#|*/let x = 1;/*|]*/ +x; + +// ==SCOPE::Extract to function in global scope== + +let x = /*RENAME*/newFunction(); +x; + +function newFunction() { + let x = 1; + return x; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Let_Type.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Let_Type.ts new file mode 100644 index 00000000000..048b77094ea --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Let_Type.ts @@ -0,0 +1,14 @@ +// ==ORIGINAL== + +/*[#|*/let x: number = 1;/*|]*/ +x; + +// ==SCOPE::Extract to function in global scope== + +let x: number = /*RENAME*/newFunction(); +x; + +function newFunction() { + let x: number = 1; + return x; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Multiple1.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Multiple1.ts new file mode 100644 index 00000000000..07ec452e360 --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Multiple1.ts @@ -0,0 +1,14 @@ +// ==ORIGINAL== + +/*[#|*/const x = 1, y: string = "a";/*|]*/ +x; y; + +// ==SCOPE::Extract to function in global scope== + +const { x, y }: { x: number; y: string; } = /*RENAME*/newFunction(); +x; y; + +function newFunction() { + const x = 1, y: string = "a"; + return { x, y }; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Multiple2.js b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Multiple2.js new file mode 100644 index 00000000000..c58c39bf6b8 --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Multiple2.js @@ -0,0 +1,16 @@ +// ==ORIGINAL== + +/*[#|*/const x = 1, y = "a"; +const z = 3;/*|]*/ +x; y; z; + +// ==SCOPE::Extract to function in global scope== + +const { x, y, z } = /*RENAME*/newFunction(); +x; y; z; + +function newFunction() { + const x = 1, y = "a"; + const z = 3; + return { x, y, z }; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Multiple2.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Multiple2.ts new file mode 100644 index 00000000000..c58c39bf6b8 --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Multiple2.ts @@ -0,0 +1,16 @@ +// ==ORIGINAL== + +/*[#|*/const x = 1, y = "a"; +const z = 3;/*|]*/ +x; y; z; + +// ==SCOPE::Extract to function in global scope== + +const { x, y, z } = /*RENAME*/newFunction(); +x; y; z; + +function newFunction() { + const x = 1, y = "a"; + const z = 3; + return { x, y, z }; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Multiple3.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Multiple3.ts new file mode 100644 index 00000000000..b8ae2b72883 --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Multiple3.ts @@ -0,0 +1,16 @@ +// ==ORIGINAL== + +/*[#|*/const x = 1, y: string = "a"; +let z = 3;/*|]*/ +x; y; z; + +// ==SCOPE::Extract to function in global scope== + +var { x, y, z }: { x: number; y: string; z: number; } = /*RENAME*/newFunction(); +x; y; z; + +function newFunction() { + const x = 1, y: string = "a"; + let z = 3; + return { x, y, z }; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_ShorthandProperty.js b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_ShorthandProperty.js new file mode 100644 index 00000000000..67b4f64290c --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_ShorthandProperty.js @@ -0,0 +1,27 @@ +// ==ORIGINAL== + +function f() { + /*[#|*/let x;/*|]*/ + return { x }; +} +// ==SCOPE::Extract to inner function in function 'f'== + +function f() { + let x = /*RENAME*/newFunction(); + return { x }; + + function newFunction() { + let x; + return x; + } +} +// ==SCOPE::Extract to function in global scope== + +function f() { + let x = /*RENAME*/newFunction(); + return { x }; +} +function newFunction() { + let x; + return x; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_ShorthandProperty.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_ShorthandProperty.ts new file mode 100644 index 00000000000..67b4f64290c --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_ShorthandProperty.ts @@ -0,0 +1,27 @@ +// ==ORIGINAL== + +function f() { + /*[#|*/let x;/*|]*/ + return { x }; +} +// ==SCOPE::Extract to inner function in function 'f'== + +function f() { + let x = /*RENAME*/newFunction(); + return { x }; + + function newFunction() { + let x; + return x; + } +} +// ==SCOPE::Extract to function in global scope== + +function f() { + let x = /*RENAME*/newFunction(); + return { x }; +} +function newFunction() { + let x; + return x; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Var.js b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Var.js new file mode 100644 index 00000000000..5a784c366c1 --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Var.js @@ -0,0 +1,14 @@ +// ==ORIGINAL== + +/*[#|*/var x = 1;/*|]*/ +x; + +// ==SCOPE::Extract to function in global scope== + +var x = /*RENAME*/newFunction(); +x; + +function newFunction() { + var x = 1; + return x; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Var.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Var.ts new file mode 100644 index 00000000000..5a784c366c1 --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Var.ts @@ -0,0 +1,14 @@ +// ==ORIGINAL== + +/*[#|*/var x = 1;/*|]*/ +x; + +// ==SCOPE::Extract to function in global scope== + +var x = /*RENAME*/newFunction(); +x; + +function newFunction() { + var x = 1; + return x; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Const_NoType.js b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Const_NoType.js new file mode 100644 index 00000000000..1da5a568333 --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Const_NoType.js @@ -0,0 +1,34 @@ +// ==ORIGINAL== + +function f() { + let a = 1; + /*[#|*/const x = 1; + a++;/*|]*/ + a; x; +} +// ==SCOPE::Extract to inner function in function 'f'== + +function f() { + let a = 1; + const x = /*RENAME*/newFunction(); + a; x; + + function newFunction() { + const x = 1; + a++; + return x; + } +} +// ==SCOPE::Extract to function in global scope== + +function f() { + let a = 1; + let x; + ({ x, a } = /*RENAME*/newFunction(a)); + a; x; +} +function newFunction(a) { + const x = 1; + a++; + return { x, a }; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Const_NoType.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Const_NoType.ts new file mode 100644 index 00000000000..f93f43ceebf --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Const_NoType.ts @@ -0,0 +1,34 @@ +// ==ORIGINAL== + +function f() { + let a = 1; + /*[#|*/const x = 1; + a++;/*|]*/ + a; x; +} +// ==SCOPE::Extract to inner function in function 'f'== + +function f() { + let a = 1; + const x = /*RENAME*/newFunction(); + a; x; + + function newFunction() { + const x = 1; + a++; + return x; + } +} +// ==SCOPE::Extract to function in global scope== + +function f() { + let a = 1; + let x; + ({ x, a } = /*RENAME*/newFunction(a)); + a; x; +} +function newFunction(a: number) { + const x = 1; + a++; + return { x, a }; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Const_Type.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Const_Type.ts new file mode 100644 index 00000000000..ec846f7f288 --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Const_Type.ts @@ -0,0 +1,34 @@ +// ==ORIGINAL== + +function f() { + let a = 1; + /*[#|*/const x: number = 1; + a++;/*|]*/ + a; x; +} +// ==SCOPE::Extract to inner function in function 'f'== + +function f() { + let a = 1; + const x: number = /*RENAME*/newFunction(); + a; x; + + function newFunction() { + const x: number = 1; + a++; + return x; + } +} +// ==SCOPE::Extract to function in global scope== + +function f() { + let a = 1; + let x: number | undefined; + ({ x, a } = /*RENAME*/newFunction(a)); + a; x; +} +function newFunction(a: number) { + const x: number = 1; + a++; + return { x, a }; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_NoType.js b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_NoType.js new file mode 100644 index 00000000000..2f298c8719f --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_NoType.js @@ -0,0 +1,34 @@ +// ==ORIGINAL== + +function f() { + let a = 1; + /*[#|*/let x = 1; + a++;/*|]*/ + a; x; +} +// ==SCOPE::Extract to inner function in function 'f'== + +function f() { + let a = 1; + let x = /*RENAME*/newFunction(); + a; x; + + function newFunction() { + let x = 1; + a++; + return x; + } +} +// ==SCOPE::Extract to function in global scope== + +function f() { + let a = 1; + let x; + ({ x, a } = /*RENAME*/newFunction(a)); + a; x; +} +function newFunction(a) { + let x = 1; + a++; + return { x, a }; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_NoType.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_NoType.ts new file mode 100644 index 00000000000..e4afefa9da6 --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_NoType.ts @@ -0,0 +1,34 @@ +// ==ORIGINAL== + +function f() { + let a = 1; + /*[#|*/let x = 1; + a++;/*|]*/ + a; x; +} +// ==SCOPE::Extract to inner function in function 'f'== + +function f() { + let a = 1; + let x = /*RENAME*/newFunction(); + a; x; + + function newFunction() { + let x = 1; + a++; + return x; + } +} +// ==SCOPE::Extract to function in global scope== + +function f() { + let a = 1; + let x; + ({ x, a } = /*RENAME*/newFunction(a)); + a; x; +} +function newFunction(a: number) { + let x = 1; + a++; + return { x, a }; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_Type.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_Type.ts new file mode 100644 index 00000000000..795effbeb7e --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_Type.ts @@ -0,0 +1,34 @@ +// ==ORIGINAL== + +function f() { + let a = 1; + /*[#|*/let x: number = 1; + a++;/*|]*/ + a; x; +} +// ==SCOPE::Extract to inner function in function 'f'== + +function f() { + let a = 1; + let x: number = /*RENAME*/newFunction(); + a; x; + + function newFunction() { + let x: number = 1; + a++; + return x; + } +} +// ==SCOPE::Extract to function in global scope== + +function f() { + let a = 1; + let x: number | undefined; + ({ x, a } = /*RENAME*/newFunction(a)); + a; x; +} +function newFunction(a: number) { + let x: number = 1; + a++; + return { x, a }; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed1.js b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed1.js new file mode 100644 index 00000000000..c36557847f7 --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed1.js @@ -0,0 +1,38 @@ +// ==ORIGINAL== + +function f() { + let a = 1; + /*[#|*/const x = 1; + let y = 2; + a++;/*|]*/ + a; x; y; +} +// ==SCOPE::Extract to inner function in function 'f'== + +function f() { + let a = 1; + var { x, y } = /*RENAME*/newFunction(); + a; x; y; + + function newFunction() { + const x = 1; + let y = 2; + a++; + return { x, y }; + } +} +// ==SCOPE::Extract to function in global scope== + +function f() { + let a = 1; + let x; + let y; + ({ x, y, a } = /*RENAME*/newFunction(a)); + a; x; y; +} +function newFunction(a) { + const x = 1; + let y = 2; + a++; + return { x, y, a }; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed1.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed1.ts new file mode 100644 index 00000000000..eaeb781bc48 --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed1.ts @@ -0,0 +1,38 @@ +// ==ORIGINAL== + +function f() { + let a = 1; + /*[#|*/const x = 1; + let y = 2; + a++;/*|]*/ + a; x; y; +} +// ==SCOPE::Extract to inner function in function 'f'== + +function f() { + let a = 1; + var { x, y } = /*RENAME*/newFunction(); + a; x; y; + + function newFunction() { + const x = 1; + let y = 2; + a++; + return { x, y }; + } +} +// ==SCOPE::Extract to function in global scope== + +function f() { + let a = 1; + let x; + let y; + ({ x, y, a } = /*RENAME*/newFunction(a)); + a; x; y; +} +function newFunction(a: number) { + const x = 1; + let y = 2; + a++; + return { x, y, a }; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed2.js b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed2.js new file mode 100644 index 00000000000..2d1151a549c --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed2.js @@ -0,0 +1,38 @@ +// ==ORIGINAL== + +function f() { + let a = 1; + /*[#|*/var x = 1; + let y = 2; + a++;/*|]*/ + a; x; y; +} +// ==SCOPE::Extract to inner function in function 'f'== + +function f() { + let a = 1; + var { x, y } = /*RENAME*/newFunction(); + a; x; y; + + function newFunction() { + var x = 1; + let y = 2; + a++; + return { x, y }; + } +} +// ==SCOPE::Extract to function in global scope== + +function f() { + let a = 1; + var x; + let y; + ({ x, y, a } = /*RENAME*/newFunction(a)); + a; x; y; +} +function newFunction(a) { + var x = 1; + let y = 2; + a++; + return { x, y, a }; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed2.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed2.ts new file mode 100644 index 00000000000..9466b5dc37f --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed2.ts @@ -0,0 +1,38 @@ +// ==ORIGINAL== + +function f() { + let a = 1; + /*[#|*/var x = 1; + let y = 2; + a++;/*|]*/ + a; x; y; +} +// ==SCOPE::Extract to inner function in function 'f'== + +function f() { + let a = 1; + var { x, y } = /*RENAME*/newFunction(); + a; x; y; + + function newFunction() { + var x = 1; + let y = 2; + a++; + return { x, y }; + } +} +// ==SCOPE::Extract to function in global scope== + +function f() { + let a = 1; + var x; + let y; + ({ x, y, a } = /*RENAME*/newFunction(a)); + a; x; y; +} +function newFunction(a: number) { + var x = 1; + let y = 2; + a++; + return { x, y, a }; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed3.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed3.ts new file mode 100644 index 00000000000..604d2a33c43 --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed3.ts @@ -0,0 +1,38 @@ +// ==ORIGINAL== + +function f() { + let a = 1; + /*[#|*/let x: number = 1; + let y = 2; + a++;/*|]*/ + a; x; y; +} +// ==SCOPE::Extract to inner function in function 'f'== + +function f() { + let a = 1; + let { x, y }: { x: number; y: number; } = /*RENAME*/newFunction(); + a; x; y; + + function newFunction() { + let x: number = 1; + let y = 2; + a++; + return { x, y }; + } +} +// ==SCOPE::Extract to function in global scope== + +function f() { + let a = 1; + let x: number | undefined; + let y; + ({ x, y, a } = /*RENAME*/newFunction(a)); + a; x; y; +} +function newFunction(a: number) { + let x: number = 1; + let y = 2; + a++; + return { x, y, a }; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_UnionUndefined.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_UnionUndefined.ts new file mode 100644 index 00000000000..0cf71e45e28 --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_UnionUndefined.ts @@ -0,0 +1,42 @@ +// ==ORIGINAL== + +function f() { + let a = 1; + /*[#|*/let x: number | undefined = 1; + let y: undefined | number = 2; + let z: (undefined | number) = 3; + a++;/*|]*/ + a; x; y; z; +} +// ==SCOPE::Extract to inner function in function 'f'== + +function f() { + let a = 1; + let { x, y, z }: { x: number; y: number; z: number; } = /*RENAME*/newFunction(); + a; x; y; z; + + function newFunction() { + let x: number | undefined = 1; + let y: undefined | number = 2; + let z: (undefined | number) = 3; + a++; + return { x, y, z }; + } +} +// ==SCOPE::Extract to function in global scope== + +function f() { + let a = 1; + let x: number | undefined; + let y: undefined | number; + let z: (undefined | number); + ({ x, y, z, a } = /*RENAME*/newFunction(a)); + a; x; y; z; +} +function newFunction(a: number) { + let x: number | undefined = 1; + let y: undefined | number = 2; + let z: (undefined | number) = 3; + a++; + return { x, y, z, a }; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Var.js b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Var.js new file mode 100644 index 00000000000..25e910713d8 --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Var.js @@ -0,0 +1,34 @@ +// ==ORIGINAL== + +function f() { + let a = 1; + /*[#|*/var x = 1; + a++;/*|]*/ + a; x; +} +// ==SCOPE::Extract to inner function in function 'f'== + +function f() { + let a = 1; + var x = /*RENAME*/newFunction(); + a; x; + + function newFunction() { + var x = 1; + a++; + return x; + } +} +// ==SCOPE::Extract to function in global scope== + +function f() { + let a = 1; + var x; + ({ x, a } = /*RENAME*/newFunction(a)); + a; x; +} +function newFunction(a) { + var x = 1; + a++; + return { x, a }; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Var.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Var.ts new file mode 100644 index 00000000000..e215e3d0978 --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Var.ts @@ -0,0 +1,34 @@ +// ==ORIGINAL== + +function f() { + let a = 1; + /*[#|*/var x = 1; + a++;/*|]*/ + a; x; +} +// ==SCOPE::Extract to inner function in function 'f'== + +function f() { + let a = 1; + var x = /*RENAME*/newFunction(); + a; x; + + function newFunction() { + var x = 1; + a++; + return x; + } +} +// ==SCOPE::Extract to function in global scope== + +function f() { + let a = 1; + var x; + ({ x, a } = /*RENAME*/newFunction(a)); + a; x; +} +function newFunction(a: number) { + var x = 1; + a++; + return { x, a }; +} diff --git a/tests/cases/fourslash/extract-method14.ts b/tests/cases/fourslash/extract-method14.ts index ea051aabbe7..ddfd8cbcbd6 100644 --- a/tests/cases/fourslash/extract-method14.ts +++ b/tests/cases/fourslash/extract-method14.ts @@ -18,7 +18,7 @@ edit.applyRefactor({ newContent: `function foo() { var i = 10; - var __return: any; + let __return; ({ __return, i } = /*RENAME*/newFunction(i)); return __return; } From c5f40a1b2b77d99d3ed81b4e9ecb3dac41d15e8a Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Wed, 11 Oct 2017 17:26:41 -0700 Subject: [PATCH 124/137] Add additional deep clone tests --- src/harness/unittests/extractFunctions.ts | 36 +++++++++++++++++++ src/services/utilities.ts | 5 +++ ...ableDeclaration_Writes_Let_LiteralType1.ts | 34 ++++++++++++++++++ ...ableDeclaration_Writes_Let_LiteralType2.ts | 34 ++++++++++++++++++ ...Declaration_Writes_Let_TypeWithComments.ts | 34 ++++++++++++++++++ 5 files changed, 143 insertions(+) create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_LiteralType1.ts create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_LiteralType2.ts create mode 100644 tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_TypeWithComments.ts diff --git a/src/harness/unittests/extractFunctions.ts b/src/harness/unittests/extractFunctions.ts index 715a4f5aa0c..c69026c0be8 100644 --- a/src/harness/unittests/extractFunctions.ts +++ b/src/harness/unittests/extractFunctions.ts @@ -438,6 +438,42 @@ function f() { a; x; }`); + // We propagate numericLiteralFlags, but it's not consumed by the emitter, + // so everything comes out decimal. It would be nice to improve this. + testExtractFunction("extractFunction_VariableDeclaration_Writes_Let_LiteralType1", ` +function f() { + let a = 1; + [#|let x: 0o10 | 10 | 0b10 = 10; + a++;|] + a; x; +}`); + + testExtractFunction("extractFunction_VariableDeclaration_Writes_Let_LiteralType2", ` +function f() { + let a = 1; + [#|let x: "a" | 'b' = 'a'; + a++;|] + a; x; +}`); + + // We propagate numericLiteralFlags, but it's not consumed by the emitter, + // so everything comes out decimal. It would be nice to improve this. + testExtractFunction("extractFunction_VariableDeclaration_Writes_Let_LiteralType1", ` +function f() { + let a = 1; + [#|let x: 0o10 | 10 | 0b10 = 10; + a++;|] + a; x; +}`); + + testExtractFunction("extractFunction_VariableDeclaration_Writes_Let_TypeWithComments", ` +function f() { + let a = 1; + [#|let x: /*A*/ "a" /*B*/ | /*C*/ 'b' /*D*/ = 'a'; + a++;|] + a; x; +}`); + testExtractFunction("extractFunction_VariableDeclaration_Writes_Const_NoType", ` function f() { let a = 1; diff --git a/src/services/utilities.ts b/src/services/utilities.ts index a8dea4ddd0e..c57b82bc8b8 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -1350,6 +1350,11 @@ namespace ts { if (visited === node) { // This only happens for leaf nodes - internal nodes always see their children change. const clone = getSynthesizedClone(node); + if (isStringLiteral(clone)) { + clone.textSourceNode = node as any; + } else if (isNumericLiteral(clone)) { + clone.numericLiteralFlags = (node as any).numericLiteralFlags; + } clone.pos = node.pos; clone.end = node.end; return clone; diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_LiteralType1.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_LiteralType1.ts new file mode 100644 index 00000000000..50bad34efce --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_LiteralType1.ts @@ -0,0 +1,34 @@ +// ==ORIGINAL== + +function f() { + let a = 1; + /*[#|*/let x: 0o10 | 10 | 0b10 = 10; + a++;/*|]*/ + a; x; +} +// ==SCOPE::Extract to inner function in function 'f'== + +function f() { + let a = 1; + let x: 8 | 10 | 2 = /*RENAME*/newFunction(); + a; x; + + function newFunction() { + let x: 0o10 | 10 | 0b10 = 10; + a++; + return x; + } +} +// ==SCOPE::Extract to function in global scope== + +function f() { + let a = 1; + let x: (8 | 10 | 2) | undefined; + ({ x, a } = /*RENAME*/newFunction(a)); + a; x; +} +function newFunction(a: number) { + let x: 0o10 | 10 | 0b10 = 10; + a++; + return { x, a }; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_LiteralType2.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_LiteralType2.ts new file mode 100644 index 00000000000..2df8ab67e9f --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_LiteralType2.ts @@ -0,0 +1,34 @@ +// ==ORIGINAL== + +function f() { + let a = 1; + /*[#|*/let x: "a" | 'b' = 'a'; + a++;/*|]*/ + a; x; +} +// ==SCOPE::Extract to inner function in function 'f'== + +function f() { + let a = 1; + let x: "a" | 'b' = /*RENAME*/newFunction(); + a; x; + + function newFunction() { + let x: "a" | 'b' = 'a'; + a++; + return x; + } +} +// ==SCOPE::Extract to function in global scope== + +function f() { + let a = 1; + let x: ("a" | 'b') | undefined; + ({ x, a } = /*RENAME*/newFunction(a)); + a; x; +} +function newFunction(a: number) { + let x: "a" | 'b' = 'a'; + a++; + return { x, a }; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_TypeWithComments.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_TypeWithComments.ts new file mode 100644 index 00000000000..53599c26d08 --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_TypeWithComments.ts @@ -0,0 +1,34 @@ +// ==ORIGINAL== + +function f() { + let a = 1; + /*[#|*/let x: /*A*/ "a" /*B*/ | /*C*/ 'b' /*D*/ = 'a'; + a++;/*|]*/ + a; x; +} +// ==SCOPE::Extract to inner function in function 'f'== + +function f() { + let a = 1; + let x: /*A*/ "a" /*B*/ | /*C*/ 'b' /*D*/ = /*RENAME*/newFunction(); + a; x; + + function newFunction() { + let x: /*A*/ "a" /*B*/ | /*C*/ 'b' /*D*/ = 'a'; + a++; + return x; + } +} +// ==SCOPE::Extract to function in global scope== + +function f() { + let a = 1; + let x: (/*A*/ "a" /*B*/ | /*C*/ 'b' /*D*/) | undefined; + ({ x, a } = /*RENAME*/newFunction(a)); + a; x; +} +function newFunction(a: number) { + let x: /*A*/ "a" /*B*/ | /*C*/ 'b' /*D*/ = 'a'; + a++; + return { x, a }; +} From 1b896c2f80d7283fa06dd6dca17568e627f5af13 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Wed, 11 Oct 2017 17:35:52 -0700 Subject: [PATCH 125/137] Fix lint error --- src/services/utilities.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/services/utilities.ts b/src/services/utilities.ts index c57b82bc8b8..0eb3f88cc9a 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -1352,7 +1352,8 @@ namespace ts { const clone = getSynthesizedClone(node); if (isStringLiteral(clone)) { clone.textSourceNode = node as any; - } else if (isNumericLiteral(clone)) { + } + else if (isNumericLiteral(clone)) { clone.numericLiteralFlags = (node as any).numericLiteralFlags; } clone.pos = node.pos; From 625486455d5a4333fa564772c488b014f7967424 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 12 Oct 2017 09:02:22 -0700 Subject: [PATCH 126/137] Update public api baseline --- tests/baselines/reference/api/tsserverlibrary.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 61320be7eb7..baa7abbbd9c 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -7190,7 +7190,7 @@ declare namespace ts.server { private _isJsInferredProject; toggleJsInferredProject(isJsInferredProject: boolean): void; setCompilerOptions(options?: CompilerOptions): void; - /** this is canonical project root path*/ + /** this is canonical project root path */ readonly projectRootPath: string | undefined; addRoot(info: ScriptInfo): void; removeRoot(info: ScriptInfo): void; From 73826bdb7b921e1bf497f97e95ef9ce5e01e5857 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Tue, 3 Oct 2017 15:39:12 -0700 Subject: [PATCH 127/137] Allow Extract Constant into enclosing scope in spite of RangeFacts.UsesThis --- src/harness/unittests/extractConstants.ts | 24 +++++++++++++++++ src/services/refactors/extractSymbol.ts | 5 +++- .../extractConstant_This_Constructor.js | 16 ++++++++++++ .../extractConstant_This_Constructor.ts | 26 +++++++++++++++++++ .../extractConstant_This_Method.js | 16 ++++++++++++ .../extractConstant_This_Method.ts | 26 +++++++++++++++++++ .../extractConstant_This_Property.ts | 18 +++++++++++++ tests/cases/fourslash/extract-method20.ts | 5 ++-- 8 files changed, 133 insertions(+), 3 deletions(-) create mode 100644 tests/baselines/reference/extractConstant/extractConstant_This_Constructor.js create mode 100644 tests/baselines/reference/extractConstant/extractConstant_This_Constructor.ts create mode 100644 tests/baselines/reference/extractConstant/extractConstant_This_Method.js create mode 100644 tests/baselines/reference/extractConstant/extractConstant_This_Method.ts create mode 100644 tests/baselines/reference/extractConstant/extractConstant_This_Property.ts diff --git a/src/harness/unittests/extractConstants.ts b/src/harness/unittests/extractConstants.ts index c5ddc18fea4..09f8db34f31 100644 --- a/src/harness/unittests/extractConstants.ts +++ b/src/harness/unittests/extractConstants.ts @@ -230,6 +230,30 @@ function f(): void { } testExtractConstantFailed("extractConstant_Never", ` function f(): never { } [#|f();|]`); + + testExtractConstant("extractConstant_This_Constructor", ` +class C { + constructor() { + [#|this.m2()|]; + } + m2() { return 1; } +}`); + + testExtractConstant("extractConstant_This_Method", ` +class C { + m1() { + [#|this.m2()|]; + } + m2() { return 1; } +}`); + + testExtractConstant("extractConstant_This_Property", ` +namespace N { // Force this test to be TS-only + class C { + x = 1; + y = [#|this.x|]; + } +}`); }); function testExtractConstant(caption: string, text: string) { diff --git a/src/services/refactors/extractSymbol.ts b/src/services/refactors/extractSymbol.ts index a03bb843600..9dd148e5420 100644 --- a/src/services/refactors/extractSymbol.ts +++ b/src/services/refactors/extractSymbol.ts @@ -476,7 +476,10 @@ namespace ts.refactor.extractSymbol { // if range uses this as keyword or as type inside the class then it can only be extracted to a method of the containing class const containingClass = getContainingClass(current); if (containingClass) { - return [containingClass]; + const containingFunction = findAncestor(current, isFunctionLikeDeclaration); + return containingFunction + ? [containingFunction, containingClass] + : [containingClass]; } } diff --git a/tests/baselines/reference/extractConstant/extractConstant_This_Constructor.js b/tests/baselines/reference/extractConstant/extractConstant_This_Constructor.js new file mode 100644 index 00000000000..cf45ab2cd3f --- /dev/null +++ b/tests/baselines/reference/extractConstant/extractConstant_This_Constructor.js @@ -0,0 +1,16 @@ +// ==ORIGINAL== + +class C { + constructor() { + /*[#|*/this.m2()/*|]*/; + } + m2() { return 1; } +} +// ==SCOPE::Extract to constant in enclosing scope== + +class C { + constructor() { + const /*RENAME*/newLocal = this.m2(); + } + m2() { return 1; } +} \ No newline at end of file diff --git a/tests/baselines/reference/extractConstant/extractConstant_This_Constructor.ts b/tests/baselines/reference/extractConstant/extractConstant_This_Constructor.ts new file mode 100644 index 00000000000..d36d1a6fa21 --- /dev/null +++ b/tests/baselines/reference/extractConstant/extractConstant_This_Constructor.ts @@ -0,0 +1,26 @@ +// ==ORIGINAL== + +class C { + constructor() { + /*[#|*/this.m2()/*|]*/; + } + m2() { return 1; } +} +// ==SCOPE::Extract to constant in enclosing scope== + +class C { + constructor() { + const /*RENAME*/newLocal = this.m2(); + } + m2() { return 1; } +} +// ==SCOPE::Extract to readonly field in class 'C'== + +class C { + private readonly newProperty = this.m2(); + + constructor() { + this./*RENAME*/newProperty; + } + m2() { return 1; } +} \ No newline at end of file diff --git a/tests/baselines/reference/extractConstant/extractConstant_This_Method.js b/tests/baselines/reference/extractConstant/extractConstant_This_Method.js new file mode 100644 index 00000000000..fd703868e9f --- /dev/null +++ b/tests/baselines/reference/extractConstant/extractConstant_This_Method.js @@ -0,0 +1,16 @@ +// ==ORIGINAL== + +class C { + m1() { + /*[#|*/this.m2()/*|]*/; + } + m2() { return 1; } +} +// ==SCOPE::Extract to constant in enclosing scope== + +class C { + m1() { + const /*RENAME*/newLocal = this.m2(); + } + m2() { return 1; } +} \ No newline at end of file diff --git a/tests/baselines/reference/extractConstant/extractConstant_This_Method.ts b/tests/baselines/reference/extractConstant/extractConstant_This_Method.ts new file mode 100644 index 00000000000..0dbaa4372d4 --- /dev/null +++ b/tests/baselines/reference/extractConstant/extractConstant_This_Method.ts @@ -0,0 +1,26 @@ +// ==ORIGINAL== + +class C { + m1() { + /*[#|*/this.m2()/*|]*/; + } + m2() { return 1; } +} +// ==SCOPE::Extract to constant in enclosing scope== + +class C { + m1() { + const /*RENAME*/newLocal = this.m2(); + } + m2() { return 1; } +} +// ==SCOPE::Extract to readonly field in class 'C'== + +class C { + private readonly newProperty = this.m2(); + + m1() { + this./*RENAME*/newProperty; + } + m2() { return 1; } +} \ No newline at end of file diff --git a/tests/baselines/reference/extractConstant/extractConstant_This_Property.ts b/tests/baselines/reference/extractConstant/extractConstant_This_Property.ts new file mode 100644 index 00000000000..04b3b50da1b --- /dev/null +++ b/tests/baselines/reference/extractConstant/extractConstant_This_Property.ts @@ -0,0 +1,18 @@ +// ==ORIGINAL== + +namespace N { // Force this test to be TS-only + class C { + x = 1; + y = /*[#|*/this.x/*|]*/; + } +} +// ==SCOPE::Extract to readonly field in class 'C'== + +namespace N { // Force this test to be TS-only + class C { + x = 1; + private readonly newProperty = this.x; + + y = this./*RENAME*/newProperty; + } +} \ No newline at end of file diff --git a/tests/cases/fourslash/extract-method20.ts b/tests/cases/fourslash/extract-method20.ts index 75927f0fd5c..bd137c55d19 100644 --- a/tests/cases/fourslash/extract-method20.ts +++ b/tests/cases/fourslash/extract-method20.ts @@ -10,5 +10,6 @@ //// } goTo.select('a', 'b') -verify.refactorAvailable('Extract Symbol', 'function_scope_0'); -verify.not.refactorAvailable('Extract Symbol', 'function_scope_1'); +verify.not.refactorAvailable('Extract Symbol', 'function_scope_0'); +verify.refactorAvailable('Extract Symbol', 'function_scope_1'); +verify.not.refactorAvailable('Extract Symbol', 'function_scope_2'); From e4313f62c66375316dd9c6e979e770f3c36c8e27 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Thu, 12 Oct 2017 09:44:02 -0700 Subject: [PATCH 128/137] Add missing test coverage for jumps in finally blocks --- src/harness/unittests/extractRanges.ts | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/harness/unittests/extractRanges.ts b/src/harness/unittests/extractRanges.ts index 2ddcac482a9..a467bb23e0f 100644 --- a/src/harness/unittests/extractRanges.ts +++ b/src/harness/unittests/extractRanges.ts @@ -152,6 +152,16 @@ namespace ts { } } `); + testExtractRange(` + function f(x: number) { + [#|[$|try { + x++; + } + finally { + return 1; + }|]|] + } + `); }); testExtractRangeFailed("extractRangeFailed1", @@ -313,6 +323,23 @@ switch (x) { refactor.extractSymbol.Messages.CannotExtractRange.message ]); + testExtractRangeFailed("extractRangeFailed11", + ` + function f(x: number) { + while (true) { + [#|try { + x++; + } + finally { + break; + }|] + } + } + `, + [ + refactor.extractSymbol.Messages.CannotExtractRangeContainingConditionalBreakOrContinueStatements.message + ]); + testExtractRangeFailed("extract-method-not-for-token-expression-statement", `[#|a|]`, [refactor.extractSymbol.Messages.CannotExtractIdentifier.message]); }); } \ No newline at end of file From da0c79f2a3fe4793c00b1c47274c36e26a0ff2c4 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Thu, 12 Oct 2017 10:09:52 -0700 Subject: [PATCH 129/137] Simplify checkTypeArguments based on PR comments --- src/compiler/checker.ts | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ff78ccaa135..a58fa1cc9b5 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -15643,32 +15643,28 @@ namespace ts { return getInferredTypes(context); } - function checkTypeArguments(signature: Signature, typeArguments: ReadonlyArray, reportErrors: boolean, headMessage?: DiagnosticMessage): Type[] | false { + function checkTypeArguments(signature: Signature, typeArgumentNodes: ReadonlyArray, reportErrors: boolean, headMessage?: DiagnosticMessage): Type[] | false { const isJavascript = isInJavaScriptFile(signature.declaration); const typeParameters = signature.typeParameters; - const typeArgumentTypes = fillMissingTypeArguments(map(typeArguments, getTypeFromTypeNode), typeParameters, getMinTypeArgumentCount(typeParameters), isJavascript); + const typeArgumentTypes = fillMissingTypeArguments(map(typeArgumentNodes, getTypeFromTypeNode), typeParameters, getMinTypeArgumentCount(typeParameters), isJavascript); let mapper: TypeMapper; - for (let i = 0; i < typeArguments.length; i++) { + for (let i = 0; i < typeArgumentNodes.length; i++) { const constraint = getConstraintOfTypeParameter(typeParameters[i]); - if (constraint) { - let errorInfo: DiagnosticMessageChain; - let typeArgumentHeadMessage = Diagnostics.Type_0_does_not_satisfy_the_constraint_1; - if (reportErrors && headMessage) { - errorInfo = chainDiagnosticMessages(errorInfo, typeArgumentHeadMessage); - typeArgumentHeadMessage = headMessage; - } - if (!mapper) { - mapper = createTypeMapper(typeParameters, typeArgumentTypes); - } - const typeArgument = typeArgumentTypes[i]; - if (!checkTypeAssignableTo( - typeArgument, - getTypeWithThisArgument(instantiateType(constraint, mapper), typeArgument), - reportErrors ? typeArguments[i] : undefined, - typeArgumentHeadMessage, - errorInfo)) { - return false; - } + if (!constraint) continue; + + const errorInfo = reportErrors && headMessage && chainDiagnosticMessages(undefined, Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + const typeArgumentHeadMessage = headMessage || Diagnostics.Type_0_does_not_satisfy_the_constraint_1; + if (!mapper) { + mapper = createTypeMapper(typeParameters, typeArgumentTypes); + } + const typeArgument = typeArgumentTypes[i]; + if (!checkTypeAssignableTo( + typeArgument, + getTypeWithThisArgument(instantiateType(constraint, mapper), typeArgument), + reportErrors ? typeArgumentNodes[i] : undefined, + typeArgumentHeadMessage, + errorInfo)) { + return false; } } return typeArgumentTypes; From 8ea13bef48cc276634e770009144995b843f5553 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Thu, 12 Oct 2017 10:11:09 -0700 Subject: [PATCH 130/137] Fix lint --- 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 a58fa1cc9b5..3380e89cd0f 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -15652,7 +15652,7 @@ namespace ts { const constraint = getConstraintOfTypeParameter(typeParameters[i]); if (!constraint) continue; - const errorInfo = reportErrors && headMessage && chainDiagnosticMessages(undefined, Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + const errorInfo = reportErrors && headMessage && chainDiagnosticMessages(/*details*/ undefined, Diagnostics.Type_0_does_not_satisfy_the_constraint_1); const typeArgumentHeadMessage = headMessage || Diagnostics.Type_0_does_not_satisfy_the_constraint_1; if (!mapper) { mapper = createTypeMapper(typeParameters, typeArgumentTypes); From 4487917f89bd5e068a4d35e8db22bf728cab4b74 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 12 Oct 2017 10:14:58 -0700 Subject: [PATCH 131/137] Quick fix for no-implicit-any errors to add explicit type annotation (#14786) * Infer from usage quick fix * Change full function singature * Add property/element access support * Fix a few issues * Some cleanup * Expose getArrayType and getPromiseType * Switch to collecting all usage before infering * Infer array and promise type arguments * Handel enums in binary operators * consolidate usage of addCandidateTypes * Handel rest paramters * Properly handel `+=` and `+` inference for numbers and strings * Add print quickfixes debug helper * Add rest param tests * Add optional paramter tests * Handel set accessors * Support getters * Support no implicit any error for variable at use site * Support properties * Only offer quick fix if an infered type other than any is available * Rename functions * Move to a separate namespace * Check cancellation token * Cleanup * Check for accesibile symbols where serializing types * Remove JS support * Reorganize functions * Mark APIs as internal * Fix lint errors * Removed conflict markers. * Update 'createSymbol' to use '__String'. * Fixed most problems relating to '__String' and 'includeJsDocComments' in the fix itself. * Addressed most API changes. * Make all helpers internal * Use a diffrent writer and not the built-in single line write * Infer types for all parameters in a parameter list instead of one at a time * Accept baselines * Code review commments * Respond to code review comments --- src/compiler/checker.ts | 18 + src/compiler/core.ts | 6 +- src/compiler/diagnosticMessages.json | 16 +- src/compiler/types.ts | 18 + src/compiler/utilities.ts | 8 + src/services/codefixes/fixes.ts | 1 + src/services/codefixes/inferFromUsage.ts | 653 ++++++++++++++++++ .../reference/api/tsserverlibrary.d.ts | 2 + tests/baselines/reference/api/typescript.d.ts | 2 + .../cases/fourslash/codeFixInferFromUsage.ts | 9 + .../fourslash/codeFixInferFromUsageGetter.ts | 10 + .../fourslash/codeFixInferFromUsageGetter2.ts | 11 + .../codeFixInferFromUsageInaccessibleTypes.ts | 20 + .../fourslash/codeFixInferFromUsageMember.ts | 11 + .../fourslash/codeFixInferFromUsageMember2.ts | 10 + .../fourslash/codeFixInferFromUsageMember3.ts | 9 + ...codeFixInferFromUsageMultipleParameters.ts | 9 + .../codeFixInferFromUsageOptionalParam.ts | 9 + .../codeFixInferFromUsageOptionalParam2.ts | 8 + .../codeFixInferFromUsageRestParam.ts | 11 + .../codeFixInferFromUsageRestParam2.ts | 11 + .../codeFixInferFromUsageRestParam3.ts | 8 + .../fourslash/codeFixInferFromUsageSetter.ts | 10 + .../fourslash/codeFixInferFromUsageSetter2.ts | 10 + .../codeFixInferFromUsageVariable.ts | 9 + .../codeFixInferFromUsageVariable2.ts | 13 + 26 files changed, 893 insertions(+), 9 deletions(-) create mode 100644 src/services/codefixes/inferFromUsage.ts create mode 100644 tests/cases/fourslash/codeFixInferFromUsage.ts create mode 100644 tests/cases/fourslash/codeFixInferFromUsageGetter.ts create mode 100644 tests/cases/fourslash/codeFixInferFromUsageGetter2.ts create mode 100644 tests/cases/fourslash/codeFixInferFromUsageInaccessibleTypes.ts create mode 100644 tests/cases/fourslash/codeFixInferFromUsageMember.ts create mode 100644 tests/cases/fourslash/codeFixInferFromUsageMember2.ts create mode 100644 tests/cases/fourslash/codeFixInferFromUsageMember3.ts create mode 100644 tests/cases/fourslash/codeFixInferFromUsageMultipleParameters.ts create mode 100644 tests/cases/fourslash/codeFixInferFromUsageOptionalParam.ts create mode 100644 tests/cases/fourslash/codeFixInferFromUsageOptionalParam2.ts create mode 100644 tests/cases/fourslash/codeFixInferFromUsageRestParam.ts create mode 100644 tests/cases/fourslash/codeFixInferFromUsageRestParam2.ts create mode 100644 tests/cases/fourslash/codeFixInferFromUsageRestParam3.ts create mode 100644 tests/cases/fourslash/codeFixInferFromUsageSetter.ts create mode 100644 tests/cases/fourslash/codeFixInferFromUsageSetter2.ts create mode 100644 tests/cases/fourslash/codeFixInferFromUsageVariable.ts create mode 100644 tests/cases/fourslash/codeFixInferFromUsageVariable2.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index efdf4589be4..e835fb6c828 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -226,6 +226,23 @@ namespace ts { return tryFindAmbientModule(moduleName, /*withAugmentations*/ false); }, getApparentType, + getUnionType, + createAnonymousType, + createSignature, + createSymbol, + createIndexInfo, + getAnyType: () => anyType, + getStringType: () => stringType, + getNumberType: () => numberType, + createPromiseType, + createArrayType, + getBooleanType: () => booleanType, + getVoidType: () => voidType, + getUndefinedType: () => undefinedType, + getNullType: () => nullType, + getESSymbolType: () => esSymbolType, + getNeverType: () => neverType, + isSymbolAccessible, isArrayLikeType, getAllPossiblePropertiesOfTypes, getSuggestionForNonexistentProperty: (node, type) => getSuggestionForNonexistentProperty(node, type), @@ -3675,6 +3692,7 @@ namespace ts { function buildParameterDisplay(p: Symbol, writer: SymbolWriter, enclosingDeclaration?: Node, flags?: TypeFormatFlags, symbolStack?: Symbol[]) { const parameterNode = p.valueDeclaration; + if (parameterNode ? isRestParameter(parameterNode) : isTransientSymbol(p) && p.isRestParameter) { writePunctuation(writer, SyntaxKind.DotDotDotToken); } diff --git a/src/compiler/core.ts b/src/compiler/core.ts index af02cec79c5..f838d6abfef 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -213,11 +213,13 @@ namespace ts { return undefined; } - export function zipWith(arrayA: ReadonlyArray, arrayB: ReadonlyArray, callback: (a: T, b: U, index: number) => void): void { + export function zipWith(arrayA: ReadonlyArray, arrayB: ReadonlyArray, callback: (a: T, b: U, index: number) => V): V[] { + const result: V[] = []; Debug.assert(arrayA.length === arrayB.length); for (let i = 0; i < arrayA.length; i++) { - callback(arrayA[i], arrayB[i], i); + result.push(callback(arrayA[i], arrayB[i], i)); } + return result; } export function zipToMap(keys: ReadonlyArray, values: ReadonlyArray): Map { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 5b601c1b2a1..1db368bb541 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -3681,6 +3681,7 @@ "category": "Message", "code": 90017 }, + "Disable checking for this file.": { "category": "Message", "code": 90018 @@ -3725,7 +3726,6 @@ "category": "Message", "code": 90028 }, - "Convert function to an ES2015 class": { "category": "Message", "code": 95001 @@ -3734,34 +3734,36 @@ "category": "Message", "code": 95002 }, - "Extract symbol": { "category": "Message", "code": 95003 }, - "Extract to {0} in {1}": { "category": "Message", "code": 95004 }, - "Extract function": { "category": "Message", "code": 95005 }, - "Extract constant": { "category": "Message", "code": 95006 }, - "Extract to {0} in enclosing scope": { "category": "Message", "code": 95007 }, - "Extract to {0} in {1} scope": { "category": "Message", "code": 95008 + }, + "Infer type of '{0}' from usage.": { + "category": "Message", + "code": 95009 + }, + "Infer parameter types from usage.": { + "category": "Message", + "code": 95010 } } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 528664f5eee..42e8292b13b 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2695,6 +2695,24 @@ namespace ts { getSuggestionForNonexistentSymbol(location: Node, name: string, meaning: SymbolFlags): string | undefined; /* @internal */ getBaseConstraintOfType(type: Type): Type | undefined; + /* @internal */ getAnyType(): Type; + /* @internal */ getStringType(): Type; + /* @internal */ getNumberType(): Type; + /* @internal */ getBooleanType(): Type; + /* @internal */ getVoidType(): Type; + /* @internal */ getUndefinedType(): Type; + /* @internal */ getNullType(): Type; + /* @internal */ getESSymbolType(): Type; + /* @internal */ getNeverType(): Type; + /* @internal */ getUnionType(types: Type[], subtypeReduction?: boolean): Type; + /* @internal */ createArrayType(elementType: Type): Type; + /* @internal */ createPromiseType(type: Type): Type; + + /* @internal */ createAnonymousType(symbol: Symbol, members: SymbolTable, callSignatures: Signature[], constructSignatures: Signature[], stringIndexInfo: IndexInfo, numberIndexInfo: IndexInfo): Type; + /* @internal */ createSignature(declaration: SignatureDeclaration, typeParameters: TypeParameter[], thisParameter: Symbol | undefined, parameters: Symbol[], resolvedReturnType: Type, typePredicate: TypePredicate, minArgumentCount: number, hasRestParameter: boolean, hasLiteralTypes: boolean): Signature; + /* @internal */ createSymbol(flags: SymbolFlags, name: __String): TransientSymbol; + /* @internal */ createIndexInfo(type: Type, isReadonly: boolean, declaration?: SignatureDeclaration): IndexInfo; + /* @internal */ isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags, shouldComputeAliasToMarkVisible: boolean): SymbolAccessibilityResult; /* @internal */ tryFindAmbientModuleWithoutAugmentations(moduleName: string): Symbol | undefined; /* @internal */ getSymbolWalker(accept?: (symbol: Symbol) => boolean): SymbolWalker; diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 291e1f2fa66..4688a7779e3 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -5649,6 +5649,14 @@ namespace ts { return node.kind >= SyntaxKind.FirstJSDocTagNode && node.kind <= SyntaxKind.LastJSDocTagNode; } + export function isSetAccessor(node: Node): node is SetAccessorDeclaration { + return node.kind === SyntaxKind.SetAccessor; + } + + export function isGetAccessor(node: Node): node is GetAccessorDeclaration { + return node.kind === SyntaxKind.GetAccessor; + } + /** True if has jsdoc nodes attached to it. */ /* @internal */ export function hasJSDocNodes(node: Node): node is HasJSDoc { diff --git a/src/services/codefixes/fixes.ts b/src/services/codefixes/fixes.ts index b024dfae7cd..7ee0aaa6799 100644 --- a/src/services/codefixes/fixes.ts +++ b/src/services/codefixes/fixes.ts @@ -13,3 +13,4 @@ /// /// /// +/// diff --git a/src/services/codefixes/inferFromUsage.ts b/src/services/codefixes/inferFromUsage.ts new file mode 100644 index 00000000000..046eb915c1e --- /dev/null +++ b/src/services/codefixes/inferFromUsage.ts @@ -0,0 +1,653 @@ +/* @internal */ +namespace ts.codefix { + registerCodeFix({ + errorCodes: [ + // Variable declarations + Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code, + + // Variable uses + Diagnostics.Variable_0_implicitly_has_an_1_type.code, + + // Parameter declarations + Diagnostics.Parameter_0_implicitly_has_an_1_type.code, + Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code, + + // Get Accessor declarations + Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code, + Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code, + + // Set Accessor declarations + Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code, + + // Property declarations + Diagnostics.Member_0_implicitly_has_an_1_type.code, + ], + getCodeActions: getActionsForAddExplicitTypeAnnotation + }); + + function getActionsForAddExplicitTypeAnnotation({ sourceFile, program, span: { start }, errorCode, cancellationToken }: CodeFixContext): CodeAction[] | undefined { + const token = getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); + let writer: StringSymbolWriter; + + if (isInJavaScriptFile(token)) { + return undefined; + } + + switch (token.kind) { + case SyntaxKind.Identifier: + case SyntaxKind.DotDotDotToken: + case SyntaxKind.PublicKeyword: + case SyntaxKind.PrivateKeyword: + case SyntaxKind.ProtectedKeyword: + case SyntaxKind.ReadonlyKeyword: + // Allowed + break; + default: + return undefined; + } + + const containingFunction = getContainingFunction(token); + const checker = program.getTypeChecker(); + + switch (errorCode) { + // Variable and Property declarations + case Diagnostics.Member_0_implicitly_has_an_1_type.code: + case Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code: + return getCodeActionForVariableDeclaration(token.parent); + case Diagnostics.Variable_0_implicitly_has_an_1_type.code: + return getCodeActionForVariableUsage(token); + + // Parameter declarations + case Diagnostics.Parameter_0_implicitly_has_an_1_type.code: + if (isSetAccessor(containingFunction)) { + return getCodeActionForSetAccessor(containingFunction); + } + // falls through + case Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code: + return getCodeActionForParameters(token.parent); + + // Get Accessor declarations + case Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code: + case Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code: + return isGetAccessor(containingFunction) ? getCodeActionForGetAccessor(containingFunction) : undefined; + + // Set Accessor declarations + case Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code: + return isSetAccessor(containingFunction) ? getCodeActionForSetAccessor(containingFunction) : undefined; + } + + return undefined; + + function getCodeActionForVariableDeclaration(declaration: VariableDeclaration | PropertyDeclaration | PropertySignature) { + if (!isIdentifier(declaration.name)) { + return undefined; + } + + const type = inferTypeForVariableFromUsage(declaration.name); + const typeString = type && typeToString(type, declaration); + + if (!typeString) { + return undefined; + } + + return createCodeActions(declaration.name.getText(), declaration.name.getEnd(), `: ${typeString}`); + } + + function getCodeActionForVariableUsage(token: Identifier) { + const symbol = checker.getSymbolAtLocation(token); + return symbol && symbol.valueDeclaration && getCodeActionForVariableDeclaration(symbol.valueDeclaration); + } + + function isApplicableFunctionForInference(declaration: FunctionLike): declaration is MethodDeclaration | FunctionDeclaration | ConstructorDeclaration { + switch (declaration.kind) { + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.MethodDeclaration: + case SyntaxKind.Constructor: + return true; + case SyntaxKind.FunctionExpression: + return !!(declaration as FunctionExpression).name; + } + return false; + } + + function getCodeActionForParameters(parameterDeclaration: ParameterDeclaration): CodeAction[] { + if (!isIdentifier(parameterDeclaration.name) || !isApplicableFunctionForInference(containingFunction)) { + return undefined; + } + + const types = inferTypeForParametersFromUsage(containingFunction) || + map(containingFunction.parameters, p => isIdentifier(p.name) && inferTypeForVariableFromUsage(p.name)); + + if (!types) { + return undefined; + } + + const textChanges: TextChange[] = zipWith(containingFunction.parameters, types, (parameter, type) => { + if (type && !parameter.type && !parameter.initializer) { + const typeString = typeToString(type, containingFunction); + return typeString ? { + span: { start: parameter.end, length: 0 }, + newText: `: ${typeString}` + } : undefined; + } + }).filter(c => !!c); + + return textChanges.length ? [{ + description: formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Infer_parameter_types_from_usage), [parameterDeclaration.name.getText()]), + changes: [{ + fileName: sourceFile.fileName, + textChanges + }] + }] : undefined; + } + + function getCodeActionForSetAccessor(setAccessorDeclaration: SetAccessorDeclaration) { + const setAccessorParameter = setAccessorDeclaration.parameters[0]; + if (!setAccessorParameter || !isIdentifier(setAccessorDeclaration.name) || !isIdentifier(setAccessorParameter.name)) { + return undefined; + } + + const type = inferTypeForVariableFromUsage(setAccessorDeclaration.name) || + inferTypeForVariableFromUsage(setAccessorParameter.name); + const typeString = type && typeToString(type, containingFunction); + if (!typeString) { + return undefined; + } + + return createCodeActions(setAccessorDeclaration.name.getText(), setAccessorParameter.name.getEnd(), `: ${typeString}`); + } + + function getCodeActionForGetAccessor(getAccessorDeclaration: GetAccessorDeclaration) { + if (!isIdentifier(getAccessorDeclaration.name)) { + return undefined; + } + + const type = inferTypeForVariableFromUsage(getAccessorDeclaration.name); + const typeString = type && typeToString(type, containingFunction); + if (!typeString) { + return undefined; + } + + const closeParenToken = getFirstChildOfKind(getAccessorDeclaration, sourceFile, SyntaxKind.CloseParenToken); + return createCodeActions(getAccessorDeclaration.name.getText(), closeParenToken.getEnd(), `: ${typeString}`); + } + + function createCodeActions(name: string, start: number, typeString: string) { + return [{ + description: formatStringFromArgs(getLocaleSpecificMessage(Diagnostics.Infer_type_of_0_from_usage), [name]), + changes: [{ + fileName: sourceFile.fileName, + textChanges: [{ + span: { start, length: 0 }, + newText: typeString + }] + }] + }]; + } + + function getReferences(token: PropertyName | Token) { + const references = FindAllReferences.findReferencedSymbols( + program, + cancellationToken, + program.getSourceFiles(), + token.getSourceFile(), + token.getStart()); + + Debug.assert(!!references, "Found no references!"); + Debug.assert(references.length === 1, "Found more references than expected"); + + return map(references[0].references, r => getTokenAtPosition(program.getSourceFile(r.fileName), r.textSpan.start, /*includeJsDocComment*/ false)); + } + + function inferTypeForVariableFromUsage(token: Identifier) { + return InferFromReference.inferTypeFromReferences(getReferences(token), checker, cancellationToken); + } + + function inferTypeForParametersFromUsage(containingFunction: FunctionLikeDeclaration) { + switch (containingFunction.kind) { + case SyntaxKind.Constructor: + case SyntaxKind.FunctionExpression: + case SyntaxKind.FunctionDeclaration: + case SyntaxKind.MethodDeclaration: + const isConstructor = containingFunction.kind === SyntaxKind.Constructor; + const searchToken = isConstructor ? + >getFirstChildOfKind(containingFunction, sourceFile, SyntaxKind.ConstructorKeyword) : + containingFunction.name; + if (searchToken) { + return InferFromReference.inferTypeForParametersFromReferences(getReferences(searchToken), containingFunction, checker, cancellationToken); + } + } + } + + function getTypeAccessiblityWriter() { + if (!writer) { + let str = ""; + let typeIsAccessible = true; + + const writeText: (text: string) => void = text => str += text; + writer = { + string: () => typeIsAccessible ? str : undefined, + writeKeyword: writeText, + writeOperator: writeText, + writePunctuation: writeText, + writeSpace: writeText, + writeStringLiteral: writeText, + writeParameter: writeText, + writeProperty: writeText, + writeSymbol: writeText, + writeLine: () => str += " ", + increaseIndent: noop, + decreaseIndent: noop, + clear: () => { str = ""; typeIsAccessible = true; }, + trackSymbol: (symbol, declaration, meaning) => { + if (checker.isSymbolAccessible(symbol, declaration, meaning, /*shouldComputeAliasToMarkVisible*/ false).accessibility !== SymbolAccessibility.Accessible) { + typeIsAccessible = false; + } + }, + reportInaccessibleThisError: () => { typeIsAccessible = false; }, + reportPrivateInBaseOfClassExpression: () => { typeIsAccessible = false; }, + }; + } + writer.clear(); + return writer; + } + + function typeToString(type: Type, enclosingDeclaration: Declaration) { + const writer = getTypeAccessiblityWriter(); + checker.getSymbolDisplayBuilder().buildTypeDisplay(type, writer, enclosingDeclaration); + return writer.string(); + } + + function getFirstChildOfKind(node: Node, sourcefile: SourceFile, kind: SyntaxKind) { + for (const child of node.getChildren(sourcefile)) { + if (child.kind === kind) return child; + } + return undefined; + } + } + + namespace InferFromReference { + interface CallContext { + argumentTypes: Type[]; + returnType: UsageContext; + } + + interface UsageContext { + isNumber?: boolean; + isString?: boolean; + isNumberOrString?: boolean; + candidateTypes?: Type[]; + properties?: UnderscoreEscapedMap; + callContexts?: CallContext[]; + constructContexts?: CallContext[]; + numberIndexContext?: UsageContext; + stringIndexContext?: UsageContext; + } + + export function inferTypeFromReferences(references: Identifier[], checker: TypeChecker, cancellationToken: CancellationToken): Type | undefined { + const usageContext: UsageContext = {}; + for (const reference of references) { + cancellationToken.throwIfCancellationRequested(); + inferTypeFromContext(reference, checker, usageContext); + } + return getTypeFromUsageContext(usageContext, checker); + } + + export function inferTypeForParametersFromReferences(references: Identifier[], declaration: FunctionLikeDeclaration, checker: TypeChecker, cancellationToken: CancellationToken): (Type | undefined)[] | undefined { + if (declaration.parameters) { + const usageContext: UsageContext = {}; + for (const reference of references) { + cancellationToken.throwIfCancellationRequested(); + inferTypeFromContext(reference, checker, usageContext); + } + const isConstructor = declaration.kind === SyntaxKind.Constructor; + const callContexts = isConstructor ? usageContext.constructContexts : usageContext.callContexts; + if (callContexts) { + const paramTypes: Type[] = []; + for (let parameterIndex = 0; parameterIndex < declaration.parameters.length; parameterIndex++) { + let types: Type[] = []; + const isRestParameter = ts.isRestParameter(declaration.parameters[parameterIndex]); + for (const callContext of callContexts) { + if (callContext.argumentTypes.length > parameterIndex) { + if (isRestParameter) { + types = concatenate(types, map(callContext.argumentTypes.slice(parameterIndex), a => checker.getBaseTypeOfLiteralType(a))); + } + else { + types.push(checker.getBaseTypeOfLiteralType(callContext.argumentTypes[parameterIndex])); + } + } + } + if (types.length) { + const type = checker.getWidenedType(checker.getUnionType(types, /*subtypeReduction*/ true)); + paramTypes[parameterIndex] = isRestParameter ? checker.createArrayType(type) : type; + } + } + return paramTypes; + } + } + return undefined; + } + + function inferTypeFromContext(node: Expression, checker: TypeChecker, usageContext: UsageContext): void { + while (isRightSideOfQualifiedNameOrPropertyAccess(node)) { + node = node.parent; + } + + switch (node.parent.kind) { + case SyntaxKind.PostfixUnaryExpression: + usageContext.isNumber = true; + break; + case SyntaxKind.PrefixUnaryExpression: + inferTypeFromPrefixUnaryExpressionContext(node.parent, usageContext); + break; + case SyntaxKind.BinaryExpression: + inferTypeFromBinaryExpressionContext(node, node.parent, checker, usageContext); + break; + case SyntaxKind.CaseClause: + case SyntaxKind.DefaultClause: + inferTypeFromSwitchStatementLabelContext(node.parent, checker, usageContext); + break; + case SyntaxKind.CallExpression: + case SyntaxKind.NewExpression: + if ((node.parent).expression === node) { + inferTypeFromCallExpressionContext(node.parent, checker, usageContext); + } + else { + inferTypeFromContextualType(node, checker, usageContext); + } + break; + case SyntaxKind.PropertyAccessExpression: + inferTypeFromPropertyAccessExpressionContext(node.parent, checker, usageContext); + break; + case SyntaxKind.ElementAccessExpression: + inferTypeFromPropertyElementExpressionContext(node.parent, node, checker, usageContext); + break; + default: + return inferTypeFromContextualType(node, checker, usageContext); + } + } + + function inferTypeFromContextualType(node: Expression, checker: TypeChecker, usageContext: UsageContext): void { + if (isPartOfExpression(node)) { + addCandidateType(usageContext, checker.getContextualType(node)); + } + } + + function inferTypeFromPrefixUnaryExpressionContext(node: PrefixUnaryExpression, usageContext: UsageContext): void { + switch (node.operator) { + case SyntaxKind.PlusPlusToken: + case SyntaxKind.MinusMinusToken: + case SyntaxKind.MinusToken: + case SyntaxKind.TildeToken: + usageContext.isNumber = true; + break; + + case SyntaxKind.PlusToken: + usageContext.isNumberOrString = true; + break; + + // case SyntaxKind.ExclamationToken: + // no inferences here; + } + } + + function inferTypeFromBinaryExpressionContext(node: Expression, parent: BinaryExpression, checker: TypeChecker, usageContext: UsageContext): void { + switch (parent.operatorToken.kind) { + // ExponentiationOperator + case SyntaxKind.AsteriskAsteriskToken: + + // MultiplicativeOperator + case SyntaxKind.AsteriskToken: + case SyntaxKind.SlashToken: + case SyntaxKind.PercentToken: + + // ShiftOperator + case SyntaxKind.LessThanLessThanToken: + case SyntaxKind.GreaterThanGreaterThanToken: + case SyntaxKind.GreaterThanGreaterThanGreaterThanToken: + + // BitwiseOperator + case SyntaxKind.AmpersandToken: + case SyntaxKind.BarToken: + case SyntaxKind.CaretToken: + + // CompoundAssignmentOperator + case SyntaxKind.MinusEqualsToken: + case SyntaxKind.AsteriskAsteriskEqualsToken: + case SyntaxKind.AsteriskEqualsToken: + case SyntaxKind.SlashEqualsToken: + case SyntaxKind.PercentEqualsToken: + case SyntaxKind.AmpersandEqualsToken: + case SyntaxKind.BarEqualsToken: + case SyntaxKind.CaretEqualsToken: + case SyntaxKind.LessThanLessThanEqualsToken: + case SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken: + case SyntaxKind.GreaterThanGreaterThanEqualsToken: + + // AdditiveOperator + case SyntaxKind.MinusToken: + + // RelationalOperator + case SyntaxKind.LessThanToken: + case SyntaxKind.LessThanEqualsToken: + case SyntaxKind.GreaterThanToken: + case SyntaxKind.GreaterThanEqualsToken: + const operandType = checker.getTypeAtLocation(parent.left === node ? parent.right : parent.left); + if (operandType.flags & TypeFlags.EnumLike) { + addCandidateType(usageContext, operandType); + } + else { + usageContext.isNumber = true; + } + break; + + case SyntaxKind.PlusEqualsToken: + case SyntaxKind.PlusToken: + const otherOperandType = checker.getTypeAtLocation(parent.left === node ? parent.right : parent.left); + if (otherOperandType.flags & TypeFlags.EnumLike) { + addCandidateType(usageContext, otherOperandType); + } + else if (otherOperandType.flags & TypeFlags.NumberLike) { + usageContext.isNumber = true; + } + else if (otherOperandType.flags & TypeFlags.StringLike) { + usageContext.isString = true; + } + else { + usageContext.isNumberOrString = true; + } + break; + + // AssignmentOperators + case SyntaxKind.EqualsToken: + case SyntaxKind.EqualsEqualsToken: + case SyntaxKind.EqualsEqualsEqualsToken: + case SyntaxKind.ExclamationEqualsEqualsToken: + case SyntaxKind.ExclamationEqualsToken: + addCandidateType(usageContext, checker.getTypeAtLocation(parent.left === node ? parent.right : parent.left)); + break; + + case SyntaxKind.InKeyword: + if (node === parent.left) { + usageContext.isString = true; + } + break; + + // LogicalOperator + case SyntaxKind.BarBarToken: + if (node === parent.left && + (node.parent.parent.kind === SyntaxKind.VariableDeclaration || isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { + // var x = x || {}; + // TODO: use getFalsyflagsOfType + addCandidateType(usageContext, checker.getTypeAtLocation(parent.right)); + } + break; + + case SyntaxKind.AmpersandAmpersandToken: + case SyntaxKind.CommaToken: + case SyntaxKind.InstanceOfKeyword: + // nothing to infer here + break; + } + } + + function inferTypeFromSwitchStatementLabelContext(parent: CaseOrDefaultClause, checker: TypeChecker, usageContext: UsageContext): void { + addCandidateType(usageContext, checker.getTypeAtLocation((parent.parent.parent).expression)); + } + + function inferTypeFromCallExpressionContext(parent: CallExpression | NewExpression, checker: TypeChecker, usageContext: UsageContext): void { + const callContext: CallContext = { + argumentTypes: [], + returnType: {} + }; + + if (parent.arguments) { + for (const argument of parent.arguments) { + callContext.argumentTypes.push(checker.getTypeAtLocation(argument)); + } + } + + inferTypeFromContext(parent, checker, callContext.returnType); + if (parent.kind === SyntaxKind.CallExpression) { + (usageContext.callContexts || (usageContext.callContexts = [])).push(callContext); + } + else { + (usageContext.constructContexts || (usageContext.constructContexts = [])).push(callContext); + } + } + + function inferTypeFromPropertyAccessExpressionContext(parent: PropertyAccessExpression, checker: TypeChecker, usageContext: UsageContext): void { + const name = escapeLeadingUnderscores(parent.name.text); + if (!usageContext.properties) { + usageContext.properties = createUnderscoreEscapedMap(); + } + const propertyUsageContext = {}; + inferTypeFromContext(parent, checker, propertyUsageContext); + usageContext.properties.set(name, propertyUsageContext); + } + + function inferTypeFromPropertyElementExpressionContext(parent: ElementAccessExpression, node: Expression, checker: TypeChecker, usageContext: UsageContext): void { + if (node === parent.argumentExpression) { + usageContext.isNumberOrString = true; + return; + } + else { + const indexType = checker.getTypeAtLocation(parent); + const indexUsageContext = {}; + inferTypeFromContext(parent, checker, indexUsageContext); + if (indexType.flags & TypeFlags.NumberLike) { + usageContext.numberIndexContext = indexUsageContext; + } + else { + usageContext.stringIndexContext = indexUsageContext; + } + } + } + + function getTypeFromUsageContext(usageContext: UsageContext, checker: TypeChecker): Type | undefined { + if (usageContext.isNumberOrString && !usageContext.isNumber && !usageContext.isString) { + return checker.getUnionType([checker.getNumberType(), checker.getStringType()]); + } + else if (usageContext.isNumber) { + return checker.getNumberType(); + } + else if (usageContext.isString) { + return checker.getStringType(); + } + else if (usageContext.candidateTypes) { + return checker.getWidenedType(checker.getUnionType(map(usageContext.candidateTypes, t => checker.getBaseTypeOfLiteralType(t)), /*subtypeReduction*/ true)); + } + else if (usageContext.properties && hasCallContext(usageContext.properties.get("then" as __String))) { + const paramType = getParameterTypeFromCallContexts(0, usageContext.properties.get("then" as __String).callContexts, /*isRestParameter*/ false, checker); + const types = paramType.getCallSignatures().map(c => c.getReturnType()); + return checker.createPromiseType(types.length ? checker.getUnionType(types, /*subtypeReduction*/ true) : checker.getAnyType()); + } + else if (usageContext.properties && hasCallContext(usageContext.properties.get("push" as __String))) { + return checker.createArrayType(getParameterTypeFromCallContexts(0, usageContext.properties.get("push" as __String).callContexts, /*isRestParameter*/ false, checker)); + } + else if (usageContext.properties || usageContext.callContexts || usageContext.constructContexts || usageContext.numberIndexContext || usageContext.stringIndexContext) { + const members = createUnderscoreEscapedMap(); + const callSignatures: Signature[] = []; + const constructSignatures: Signature[] = []; + let stringIndexInfo: IndexInfo; + let numberIndexInfo: IndexInfo; + + if (usageContext.properties) { + usageContext.properties.forEach((context, name) => { + const symbol = checker.createSymbol(SymbolFlags.Property, name); + symbol.type = getTypeFromUsageContext(context, checker); + members.set(name, symbol); + }); + } + + if (usageContext.callContexts) { + for (const callContext of usageContext.callContexts) { + callSignatures.push(getSignatureFromCallContext(callContext, checker)); + } + } + + if (usageContext.constructContexts) { + for (const constructContext of usageContext.constructContexts) { + constructSignatures.push(getSignatureFromCallContext(constructContext, checker)); + } + } + + if (usageContext.numberIndexContext) { + numberIndexInfo = checker.createIndexInfo(getTypeFromUsageContext(usageContext.numberIndexContext, checker), /*isReadonly*/ false); + } + + if (usageContext.stringIndexContext) { + stringIndexInfo = checker.createIndexInfo(getTypeFromUsageContext(usageContext.stringIndexContext, checker), /*isReadonly*/ false); + } + + return checker.createAnonymousType(/*symbol*/ undefined, members, callSignatures, constructSignatures, stringIndexInfo, numberIndexInfo); + } + else { + return undefined; + } + } + + function getParameterTypeFromCallContexts(parameterIndex: number, callContexts: CallContext[], isRestParameter: boolean, checker: TypeChecker) { + let types: Type[] = []; + if (callContexts) { + for (const callContext of callContexts) { + if (callContext.argumentTypes.length > parameterIndex) { + if (isRestParameter) { + types = concatenate(types, map(callContext.argumentTypes.slice(parameterIndex), a => checker.getBaseTypeOfLiteralType(a))); + } + else { + types.push(checker.getBaseTypeOfLiteralType(callContext.argumentTypes[parameterIndex])); + } + } + } + } + + if (types.length) { + const type = checker.getWidenedType(checker.getUnionType(types, /*subtypeReduction*/ true)); + return isRestParameter ? checker.createArrayType(type) : type; + } + return undefined; + } + + function getSignatureFromCallContext(callContext: CallContext, checker: TypeChecker): Signature { + const parameters: Symbol[] = []; + for (let i = 0; i < callContext.argumentTypes.length; i++) { + const symbol = checker.createSymbol(SymbolFlags.FunctionScopedVariable, escapeLeadingUnderscores(`arg${i}`)); + symbol.type = checker.getWidenedType(checker.getBaseTypeOfLiteralType(callContext.argumentTypes[i])); + parameters.push(symbol); + } + const returnType = getTypeFromUsageContext(callContext.returnType, checker); + return checker.createSignature(/*declaration*/ undefined, /*typeParameters*/ undefined, /*thisParameter*/ undefined, parameters, returnType, /*typePredicate*/ undefined, callContext.argumentTypes.length, /*hasRestParameter*/ false, /*hasLiteralTypes*/ false); + } + + function addCandidateType(context: UsageContext, type: Type) { + if (type && !(type.flags & TypeFlags.Any) && !(type.flags & TypeFlags.Never)) { + (context.candidateTypes || (context.candidateTypes = [])).push(type); + } + } + + function hasCallContext(usageContext: UsageContext) { + return usageContext && usageContext.callContexts; + } + } +} diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index b1595030df0..82c593d8d42 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -3068,6 +3068,8 @@ declare namespace ts { function isCaseOrDefaultClause(node: Node): node is CaseOrDefaultClause; /** True if node is of a kind that may contain comment text. */ function isJSDocCommentContainingNode(node: Node): boolean; + function isSetAccessor(node: Node): node is SetAccessorDeclaration; + function isGetAccessor(node: Node): node is GetAccessorDeclaration; } declare namespace ts { interface ErrorCallback { diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 0c74f74c741..14fae7d0d77 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -3123,6 +3123,8 @@ declare namespace ts { function isCaseOrDefaultClause(node: Node): node is CaseOrDefaultClause; /** True if node is of a kind that may contain comment text. */ function isJSDocCommentContainingNode(node: Node): boolean; + function isSetAccessor(node: Node): node is SetAccessorDeclaration; + function isGetAccessor(node: Node): node is GetAccessorDeclaration; } declare namespace ts { function createNode(kind: SyntaxKind, pos?: number, end?: number): Node; diff --git a/tests/cases/fourslash/codeFixInferFromUsage.ts b/tests/cases/fourslash/codeFixInferFromUsage.ts new file mode 100644 index 00000000000..5de8d989799 --- /dev/null +++ b/tests/cases/fourslash/codeFixInferFromUsage.ts @@ -0,0 +1,9 @@ +/// + +// @noImplicitAny: true +////[|var foo;|] +////function f() { +//// foo += 2; +////} + +verify.rangeAfterCodeFix("var foo: number;",/*includeWhiteSpace*/ undefined, /*errorCode*/ undefined, 0); \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixInferFromUsageGetter.ts b/tests/cases/fourslash/codeFixInferFromUsageGetter.ts new file mode 100644 index 00000000000..f83eed1432d --- /dev/null +++ b/tests/cases/fourslash/codeFixInferFromUsageGetter.ts @@ -0,0 +1,10 @@ +/// + +// @noImplicitAny: true +////declare class C { +//// [|get x();|] +////} +////} +////(new C).x = 1; + +verify.rangeAfterCodeFix("get x(): number;", undefined, undefined, 0); \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixInferFromUsageGetter2.ts b/tests/cases/fourslash/codeFixInferFromUsageGetter2.ts new file mode 100644 index 00000000000..a50d471ad12 --- /dev/null +++ b/tests/cases/fourslash/codeFixInferFromUsageGetter2.ts @@ -0,0 +1,11 @@ +/// + +// @noImplicitAny: true +////class C { +//// [|get x() |]{ +//// return undefined; +//// } +////} +////(new C).x = 1; + +verify.rangeAfterCodeFix("get x(): number", undefined, undefined, 0); \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixInferFromUsageInaccessibleTypes.ts b/tests/cases/fourslash/codeFixInferFromUsageInaccessibleTypes.ts new file mode 100644 index 00000000000..ae9106be8c4 --- /dev/null +++ b/tests/cases/fourslash/codeFixInferFromUsageInaccessibleTypes.ts @@ -0,0 +1,20 @@ +/// + +// @noImplicitAny: true +////function f1([|a |]) { } +////function h1() { +//// class C { p: number }; +//// f1({ ofTypeC: new C() }); +////} +//// +////function f2([|a |]) { } +////function h2() { +//// interface I { a: number } +//// var i: I = {a : 1}; +//// f2(i); +//// f2(2); +//// f2(false); +////} +//// + +verify.not.codeFixAvailable(); diff --git a/tests/cases/fourslash/codeFixInferFromUsageMember.ts b/tests/cases/fourslash/codeFixInferFromUsageMember.ts new file mode 100644 index 00000000000..c82542e5e3f --- /dev/null +++ b/tests/cases/fourslash/codeFixInferFromUsageMember.ts @@ -0,0 +1,11 @@ +/// + +// @noImplicitAny: true +////class C { +//// [|p;|] +//// method() { +//// this.p.push(10); +//// } +////} + +verify.rangeAfterCodeFix("p: number[];"); \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixInferFromUsageMember2.ts b/tests/cases/fourslash/codeFixInferFromUsageMember2.ts new file mode 100644 index 00000000000..486112935ee --- /dev/null +++ b/tests/cases/fourslash/codeFixInferFromUsageMember2.ts @@ -0,0 +1,10 @@ +/// + +// @noImplicitAny: true +////interface I { +//// [|p;|] +////} +////var i: I; +////i.p = 0; + +verify.rangeAfterCodeFix("p: number;"); \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixInferFromUsageMember3.ts b/tests/cases/fourslash/codeFixInferFromUsageMember3.ts new file mode 100644 index 00000000000..49f2cb66c18 --- /dev/null +++ b/tests/cases/fourslash/codeFixInferFromUsageMember3.ts @@ -0,0 +1,9 @@ +/// + +// @noImplicitAny: true +////class C { +//// constructor([|public p)|] { } +////} +////new C("string"); + +verify.rangeAfterCodeFix("public p: string)"); diff --git a/tests/cases/fourslash/codeFixInferFromUsageMultipleParameters.ts b/tests/cases/fourslash/codeFixInferFromUsageMultipleParameters.ts new file mode 100644 index 00000000000..89e2c935e87 --- /dev/null +++ b/tests/cases/fourslash/codeFixInferFromUsageMultipleParameters.ts @@ -0,0 +1,9 @@ +/// + +// @noImplicitAny: true +//// function f([|a, b, c, d: number, e = 0, ...d |]) { +//// } +//// f(1, "string", { a: 1 }, {shouldNotBeHere: 2}, {shouldNotBeHere: 2}, 3, "string"); + + +verify.rangeAfterCodeFix("a: number, b: string, c: { a: number; }, d: number, e = 0, ...d: (string | number)[]", /*includeWhiteSpace*/ false, /*errorCode*/ undefined, /*index*/ 1); diff --git a/tests/cases/fourslash/codeFixInferFromUsageOptionalParam.ts b/tests/cases/fourslash/codeFixInferFromUsageOptionalParam.ts new file mode 100644 index 00000000000..f10de4bb03a --- /dev/null +++ b/tests/cases/fourslash/codeFixInferFromUsageOptionalParam.ts @@ -0,0 +1,9 @@ +/// + +// @noImplicitAny: true +////function f([|a? |]){ +////} +////f(); +////f(1); + +verify.rangeAfterCodeFix("a?: number"); \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixInferFromUsageOptionalParam2.ts b/tests/cases/fourslash/codeFixInferFromUsageOptionalParam2.ts new file mode 100644 index 00000000000..2ca820e0327 --- /dev/null +++ b/tests/cases/fourslash/codeFixInferFromUsageOptionalParam2.ts @@ -0,0 +1,8 @@ +/// + +// @noImplicitAny: true +////function f([|a? |]){ +//// if (a < 9) return; +////} + +verify.rangeAfterCodeFix("a?: number"); \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixInferFromUsageRestParam.ts b/tests/cases/fourslash/codeFixInferFromUsageRestParam.ts new file mode 100644 index 00000000000..963f84d6515 --- /dev/null +++ b/tests/cases/fourslash/codeFixInferFromUsageRestParam.ts @@ -0,0 +1,11 @@ +/// + +// @noImplicitAny: true +////function f(a: number, [|...rest |]){ +////} +////f(1); +////f(2, "s1"); +////f(3, "s1", "s2"); +////f(3, "s1", "s2", "s3", "s4"); + +verify.rangeAfterCodeFix("...rest: string[]"); \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixInferFromUsageRestParam2.ts b/tests/cases/fourslash/codeFixInferFromUsageRestParam2.ts new file mode 100644 index 00000000000..ae826240228 --- /dev/null +++ b/tests/cases/fourslash/codeFixInferFromUsageRestParam2.ts @@ -0,0 +1,11 @@ +/// + +// @noImplicitAny: true +////function f(a: number, [|...rest |]){ +////} +////f(1); +////f(2, "s1"); +////f(3, false, "s2"); +////f(4, "s1", "s2", false, "s4"); + +verify.rangeAfterCodeFix("...rest: (string | boolean)[]"); \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixInferFromUsageRestParam3.ts b/tests/cases/fourslash/codeFixInferFromUsageRestParam3.ts new file mode 100644 index 00000000000..4752176a324 --- /dev/null +++ b/tests/cases/fourslash/codeFixInferFromUsageRestParam3.ts @@ -0,0 +1,8 @@ +/// + +// @noImplicitAny: true +////function f(a: number, [|...rest |]){ +//// rest.push(22); +////} + +verify.rangeAfterCodeFix("...rest: number[]"); \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixInferFromUsageSetter.ts b/tests/cases/fourslash/codeFixInferFromUsageSetter.ts new file mode 100644 index 00000000000..f515cd5a906 --- /dev/null +++ b/tests/cases/fourslash/codeFixInferFromUsageSetter.ts @@ -0,0 +1,10 @@ +/// + +// @noImplicitAny: true +////class C { +//// set [|x(v)|] { +//// } +////} +////(new C).x = 1; + +verify.rangeAfterCodeFix("x(v: number)", undefined, undefined, 0); \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixInferFromUsageSetter2.ts b/tests/cases/fourslash/codeFixInferFromUsageSetter2.ts new file mode 100644 index 00000000000..a1169a03df1 --- /dev/null +++ b/tests/cases/fourslash/codeFixInferFromUsageSetter2.ts @@ -0,0 +1,10 @@ +/// + +// @noImplicitAny: true +////class C { +//// set [|x(v)|] { +//// } +////} +////(new C).x = 1; + +verify.rangeAfterCodeFix("x(v: number)", undefined, undefined, 1); \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixInferFromUsageVariable.ts b/tests/cases/fourslash/codeFixInferFromUsageVariable.ts new file mode 100644 index 00000000000..f89b8c867f9 --- /dev/null +++ b/tests/cases/fourslash/codeFixInferFromUsageVariable.ts @@ -0,0 +1,9 @@ +/// + +// @noImplicitAny: true +////[|var x;|] +////function f() { +//// x++; +////} + +verify.rangeAfterCodeFix("var x: number;", /*includeWhiteSpace*/ undefined, /*errorCode*/ undefined, 0); \ No newline at end of file diff --git a/tests/cases/fourslash/codeFixInferFromUsageVariable2.ts b/tests/cases/fourslash/codeFixInferFromUsageVariable2.ts new file mode 100644 index 00000000000..bf8e2bb07e5 --- /dev/null +++ b/tests/cases/fourslash/codeFixInferFromUsageVariable2.ts @@ -0,0 +1,13 @@ +/// + +// @noImplicitAny: true +////[|var x; +////function f() { +//// x++; +////}|] + +verify.rangeAfterCodeFix(`var x: number; +function f() { + x++; +} +`, /*includeWhiteSpace*/ undefined, /*errorCode*/ undefined, 1); \ No newline at end of file From 27b4417304cebfc6fe22aeb747c0dca368ed906f Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Thu, 12 Oct 2017 10:38:02 -0700 Subject: [PATCH 132/137] Assert:checkTypeArguments isn't passed too many type arguments --- src/compiler/checker.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 3380e89cd0f..3b6ef850ce8 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -15649,6 +15649,7 @@ namespace ts { const typeArgumentTypes = fillMissingTypeArguments(map(typeArgumentNodes, getTypeFromTypeNode), typeParameters, getMinTypeArgumentCount(typeParameters), isJavascript); let mapper: TypeMapper; for (let i = 0; i < typeArgumentNodes.length; i++) { + Debug.assert(typeParameters[i] !== undefined, "Should not call checkTypeArguments with too many type arguments"); const constraint = getConstraintOfTypeParameter(typeParameters[i]); if (!constraint) continue; From 4de6b0dd2d104754ddca97d3c03e1819e0793668 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Thu, 12 Oct 2017 11:34:34 -0700 Subject: [PATCH 133/137] Introduce and consume suppressLeadingAndTrailingTrivia Fixes #18626 --- src/compiler/factory.ts | 10 ++++++ src/harness/unittests/extractConstants.ts | 8 +++++ src/harness/unittests/extractFunctions.ts | 8 +++++ src/services/refactors/extractSymbol.ts | 18 +++++----- src/services/utilities.ts | 35 +++++++++++++++++++ .../extractConstant_PreserveTrivia.js | 17 +++++++++ .../extractConstant_PreserveTrivia.ts | 17 +++++++++ .../extractFunction/extractFunction13.ts | 6 ++-- .../extractFunction_PreserveTrivia.js | 19 ++++++++++ .../extractFunction_PreserveTrivia.ts | 19 ++++++++++ .../fourslash/extract-method-uniqueName.ts | 5 ++- 11 files changed, 146 insertions(+), 16 deletions(-) create mode 100644 tests/baselines/reference/extractConstant/extractConstant_PreserveTrivia.js create mode 100644 tests/baselines/reference/extractConstant/extractConstant_PreserveTrivia.ts create mode 100644 tests/baselines/reference/extractFunction/extractFunction_PreserveTrivia.js create mode 100644 tests/baselines/reference/extractFunction/extractFunction_PreserveTrivia.ts diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index fe183c5e806..65c1c92f366 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -2612,6 +2612,16 @@ namespace ts { return node; } + /** + * Sets flags that control emit behavior of a node. + */ + /* @internal */ + export function addEmitFlags(node: T, emitFlags: EmitFlags) { + const emitNode = getOrCreateEmitNode(node); + emitNode.flags = emitNode.flags | emitFlags; + return node; + } + /** * Gets a custom text range to use when emitting source maps. */ diff --git a/src/harness/unittests/extractConstants.ts b/src/harness/unittests/extractConstants.ts index 09f8db34f31..61ffbd01a63 100644 --- a/src/harness/unittests/extractConstants.ts +++ b/src/harness/unittests/extractConstants.ts @@ -223,6 +223,14 @@ const f = () => { testExtractConstant("extractConstant_ArrowFunction_Expression", `const f = () => [#|2 + 1|];`); + testExtractConstant("extractConstant_PreserveTrivia", ` +// a +var q = /*b*/ //c + /*d*/ [#|1 /*e*/ //f + /*g*/ + /*h*/ //i + /*j*/ 2|] /*k*/ //l + /*m*/; /*n*/ //o`); + testExtractConstantFailed("extractConstant_Void", ` function f(): void { } [#|f();|]`); diff --git a/src/harness/unittests/extractFunctions.ts b/src/harness/unittests/extractFunctions.ts index c69026c0be8..789882ffd50 100644 --- a/src/harness/unittests/extractFunctions.ts +++ b/src/harness/unittests/extractFunctions.ts @@ -532,6 +532,14 @@ function f() { [#|let x;|] return { x }; }`); + + testExtractFunction("extractFunction_PreserveTrivia", ` +// a +var q = /*b*/ //c + /*d*/ [#|1 /*e*/ //f + /*g*/ + /*h*/ //i + /*j*/ 2|] /*k*/ //l + /*m*/; /*n*/ //o`); }); function testExtractFunction(caption: string, text: string) { diff --git a/src/services/refactors/extractSymbol.ts b/src/services/refactors/extractSymbol.ts index 9dd148e5420..715b42b6bc8 100644 --- a/src/services/refactors/extractSymbol.ts +++ b/src/services/refactors/extractSymbol.ts @@ -740,6 +740,8 @@ namespace ts.refactor.extractSymbol { } const { body, returnValueProperty } = transformFunctionBody(node, exposedVariableDeclarations, writes, substitutions, !!(range.facts & RangeFacts.HasReturn)); + suppressLeadingAndTrailingTrivia(body); + let newFunction: MethodDeclaration | FunctionDeclaration; if (isClassLike(scope)) { @@ -926,15 +928,10 @@ namespace ts.refactor.extractSymbol { } } - if (isReadonlyArray(range.range)) { - changeTracker.replaceNodesWithNodes(context.file, range.range, newNodes, { - nodeSeparator: context.newLineCharacter, - suffix: context.newLineCharacter // insert newline only when replacing statements - }); - } - else { - changeTracker.replaceNodeWithNodes(context.file, range.range, newNodes, { nodeSeparator: context.newLineCharacter }); - } + const replacementRange = isReadonlyArray(range.range) + ? { pos: first(range.range).getStart(), end: last(range.range).end } + : { pos: range.range.getStart(), end: range.range.end }; + changeTracker.replaceRangeWithNodes(context.file, replacementRange, newNodes, { nodeSeparator: context.newLineCharacter }); const edits = changeTracker.getChanges(); const renameRange = isReadonlyArray(range.range) ? first(range.range) : range.range; @@ -982,6 +979,7 @@ namespace ts.refactor.extractSymbol { : checker.typeToTypeNode(checker.getContextualType(node), scope, NodeBuilderFlags.NoTruncation); const initializer = transformConstantInitializer(node, substitutions); + suppressLeadingAndTrailingTrivia(initializer); const changeTracker = textChanges.ChangeTracker.fromContext(context); @@ -1014,7 +1012,7 @@ namespace ts.refactor.extractSymbol { changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariable, { suffix: context.newLineCharacter + context.newLineCharacter }); // Consume - changeTracker.replaceNodeWithNodes(context.file, node, [localReference], { nodeSeparator: context.newLineCharacter }); + changeTracker.replaceRange(context.file, { pos: node.getStart(), end: node.end }, localReference); } else { const newVariableDeclaration = createVariableDeclaration(localNameText, variableType, initializer); diff --git a/src/services/utilities.ts b/src/services/utilities.ts index 0eb3f88cc9a..df3f3c5c6b4 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -1369,4 +1369,39 @@ namespace ts { return visited; } + + /** + * Sets EmitFlags to suppress leading and trailing trivia on the node. + */ + /* @internal */ + export function suppressLeadingAndTrailingTrivia(node: Node) { + Debug.assert(node !== undefined); + + suppressLeading(node); + suppressTrailing(node); + + function suppressLeading(node: Node) { + addEmitFlags(node, EmitFlags.NoLeadingComments); + + const firstChild = forEachChild(node, child => child); + firstChild && suppressLeading(firstChild); + } + + function suppressTrailing(node: Node) { + addEmitFlags(node, EmitFlags.NoTrailingComments); + + let lastChild: Node = undefined; + forEachChild( + node, + child => (lastChild = child, undefined), + children => { + // As an optimization, jump straight to the end of the list. + if (children.length) { + lastChild = last(children); + } + return undefined; + }); + lastChild && suppressTrailing(lastChild); + } + } } diff --git a/tests/baselines/reference/extractConstant/extractConstant_PreserveTrivia.js b/tests/baselines/reference/extractConstant/extractConstant_PreserveTrivia.js new file mode 100644 index 00000000000..22abb77901d --- /dev/null +++ b/tests/baselines/reference/extractConstant/extractConstant_PreserveTrivia.js @@ -0,0 +1,17 @@ +// ==ORIGINAL== + +// a +var q = /*b*/ //c + /*d*/ /*[#|*/1 /*e*/ //f + /*g*/ + /*h*/ //i + /*j*/ 2/*|]*/ /*k*/ //l + /*m*/; /*n*/ //o +// ==SCOPE::Extract to constant in enclosing scope== +const newLocal = 1 /*e*/ //f + /*g*/ + /*h*/ //i + /*j*/ 2; + +// a +var q = /*b*/ //c + /*d*/ /*RENAME*/newLocal /*k*/ //l + /*m*/; /*n*/ //o \ No newline at end of file diff --git a/tests/baselines/reference/extractConstant/extractConstant_PreserveTrivia.ts b/tests/baselines/reference/extractConstant/extractConstant_PreserveTrivia.ts new file mode 100644 index 00000000000..22abb77901d --- /dev/null +++ b/tests/baselines/reference/extractConstant/extractConstant_PreserveTrivia.ts @@ -0,0 +1,17 @@ +// ==ORIGINAL== + +// a +var q = /*b*/ //c + /*d*/ /*[#|*/1 /*e*/ //f + /*g*/ + /*h*/ //i + /*j*/ 2/*|]*/ /*k*/ //l + /*m*/; /*n*/ //o +// ==SCOPE::Extract to constant in enclosing scope== +const newLocal = 1 /*e*/ //f + /*g*/ + /*h*/ //i + /*j*/ 2; + +// a +var q = /*b*/ //c + /*d*/ /*RENAME*/newLocal /*k*/ //l + /*m*/; /*n*/ //o \ No newline at end of file diff --git a/tests/baselines/reference/extractFunction/extractFunction13.ts b/tests/baselines/reference/extractFunction/extractFunction13.ts index 4987039d5da..662701ebf41 100644 --- a/tests/baselines/reference/extractFunction/extractFunction13.ts +++ b/tests/baselines/reference/extractFunction/extractFunction13.ts @@ -20,7 +20,7 @@ (u2a: U2a, u2b: U2b) => { function F2(t2a: T2a, t2b: T2b) { (u3a: U3a, u3b: U3b) => { - /*RENAME*/newFunction(u3a); + /*RENAME*/newFunction(u3a); } function newFunction(u3a: U3a) { @@ -40,7 +40,7 @@ (u2a: U2a, u2b: U2b) => { function F2(t2a: T2a, t2b: T2b) { (u3a: U3a, u3b: U3b) => { - /*RENAME*/newFunction(t2a, u2a, u3a); + /*RENAME*/newFunction(t2a, u2a, u3a); } } } @@ -60,7 +60,7 @@ (u2a: U2a, u2b: U2b) => { function F2(t2a: T2a, t2b: T2b) { (u3a: U3a, u3b: U3b) => { - /*RENAME*/newFunction(t1a, t2a, u1a, u2a, u3a); + /*RENAME*/newFunction(t1a, t2a, u1a, u2a, u3a); } } } diff --git a/tests/baselines/reference/extractFunction/extractFunction_PreserveTrivia.js b/tests/baselines/reference/extractFunction/extractFunction_PreserveTrivia.js new file mode 100644 index 00000000000..b5e4bc76c6e --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_PreserveTrivia.js @@ -0,0 +1,19 @@ +// ==ORIGINAL== + +// a +var q = /*b*/ //c + /*d*/ /*[#|*/1 /*e*/ //f + /*g*/ + /*h*/ //i + /*j*/ 2/*|]*/ /*k*/ //l + /*m*/; /*n*/ //o +// ==SCOPE::Extract to function in global scope== + +// a +var q = /*b*/ //c + /*d*/ /*RENAME*/newFunction() /*k*/ //l + /*m*/; /*n*/ //o +function newFunction() { + return 1 /*e*/ //f + /*g*/ + /*h*/ //i + /*j*/ 2; +} diff --git a/tests/baselines/reference/extractFunction/extractFunction_PreserveTrivia.ts b/tests/baselines/reference/extractFunction/extractFunction_PreserveTrivia.ts new file mode 100644 index 00000000000..b5e4bc76c6e --- /dev/null +++ b/tests/baselines/reference/extractFunction/extractFunction_PreserveTrivia.ts @@ -0,0 +1,19 @@ +// ==ORIGINAL== + +// a +var q = /*b*/ //c + /*d*/ /*[#|*/1 /*e*/ //f + /*g*/ + /*h*/ //i + /*j*/ 2/*|]*/ /*k*/ //l + /*m*/; /*n*/ //o +// ==SCOPE::Extract to function in global scope== + +// a +var q = /*b*/ //c + /*d*/ /*RENAME*/newFunction() /*k*/ //l + /*m*/; /*n*/ //o +function newFunction() { + return 1 /*e*/ //f + /*g*/ + /*h*/ //i + /*j*/ 2; +} diff --git a/tests/cases/fourslash/extract-method-uniqueName.ts b/tests/cases/fourslash/extract-method-uniqueName.ts index 4271d9e84d2..da4c68cfb7e 100644 --- a/tests/cases/fourslash/extract-method-uniqueName.ts +++ b/tests/cases/fourslash/extract-method-uniqueName.ts @@ -11,10 +11,9 @@ edit.applyRefactor({ actionName: "function_scope_0", actionDescription: "Extract to function in global scope", newContent: -`/*RENAME*/newFunction_1(); - +`// newFunction +/*RENAME*/newFunction_1(); function newFunction_1() { - // newFunction 1 + 1; } ` From 9af21eb00eb957240159745c181077e21df9da17 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 12 Oct 2017 12:53:12 -0700 Subject: [PATCH 134/137] Transform nested dynamic imports (#18998) * Fix nested dynamic imports when targeting es6 * Fixup nested dynamic imports when targeting downlevel * Remove duplicated expressions in UMD emit * Code review feedback, clone arg if need be * More CR feedback, apply user quotemark styles * Remove blank lines * Use behavior of visitEachChild instead of enw codepath, add new test, use createLiteral to retain quotemarks * Set lib flag for test --- src/compiler/transformers/generators.ts | 3 +- src/compiler/transformers/module/module.ts | 46 ++++++---- src/compiler/transformers/module/system.ts | 2 +- src/compiler/transformers/utilities.ts | 13 +++ .../reference/asyncImportNestedYield.js | 58 +++++++++++++ .../reference/asyncImportNestedYield.symbols | 6 ++ .../reference/asyncImportNestedYield.types | 14 ++++ .../dynamicImportWithNestedThis_es2015.js | 3 +- .../dynamicImportWithNestedThis_es5.js | 3 +- .../importCallExpressionGrammarError.js | 2 +- .../importCallExpressionNestedAMD.js | 33 ++++++++ .../importCallExpressionNestedAMD.symbols | 12 +++ .../importCallExpressionNestedAMD.types | 17 ++++ .../importCallExpressionNestedAMD2.js | 66 +++++++++++++++ .../importCallExpressionNestedAMD2.symbols | 12 +++ .../importCallExpressionNestedAMD2.types | 17 ++++ .../importCallExpressionNestedCJS.js | 28 +++++++ .../importCallExpressionNestedCJS.symbols | 12 +++ .../importCallExpressionNestedCJS.types | 17 ++++ .../importCallExpressionNestedCJS2.js | 61 ++++++++++++++ .../importCallExpressionNestedCJS2.symbols | 12 +++ .../importCallExpressionNestedCJS2.types | 17 ++++ ...mportCallExpressionNestedES2015.errors.txt | 15 ++++ .../importCallExpressionNestedES2015.js | 26 ++++++ .../importCallExpressionNestedES2015.symbols | 12 +++ .../importCallExpressionNestedES2015.types | 17 ++++ ...portCallExpressionNestedES20152.errors.txt | 15 ++++ .../importCallExpressionNestedES20152.js | 59 +++++++++++++ .../importCallExpressionNestedES20152.symbols | 12 +++ .../importCallExpressionNestedES20152.types | 17 ++++ .../importCallExpressionNestedESNext.js | 26 ++++++ .../importCallExpressionNestedESNext.symbols | 12 +++ .../importCallExpressionNestedESNext.types | 17 ++++ .../importCallExpressionNestedESNext2.js | 59 +++++++++++++ .../importCallExpressionNestedESNext2.symbols | 12 +++ .../importCallExpressionNestedESNext2.types | 17 ++++ .../importCallExpressionNestedSystem.js | 43 ++++++++++ .../importCallExpressionNestedSystem.symbols | 12 +++ .../importCallExpressionNestedSystem.types | 17 ++++ .../importCallExpressionNestedSystem2.js | 76 +++++++++++++++++ .../importCallExpressionNestedSystem2.symbols | 12 +++ .../importCallExpressionNestedSystem2.types | 17 ++++ .../importCallExpressionNestedUMD.js | 51 +++++++++++ .../importCallExpressionNestedUMD.symbols | 12 +++ .../importCallExpressionNestedUMD.types | 17 ++++ .../importCallExpressionNestedUMD2.js | 84 +++++++++++++++++++ .../importCallExpressionNestedUMD2.symbols | 12 +++ .../importCallExpressionNestedUMD2.types | 17 ++++ .../cases/compiler/asyncImportNestedYield.ts | 4 + .../importCallExpressionNestedAMD.ts | 11 +++ .../importCallExpressionNestedAMD2.ts | 11 +++ .../importCallExpressionNestedCJS.ts | 11 +++ .../importCallExpressionNestedCJS2.ts | 11 +++ .../importCallExpressionNestedES2015.ts | 11 +++ .../importCallExpressionNestedES20152.ts | 11 +++ .../importCallExpressionNestedESNext.ts | 11 +++ .../importCallExpressionNestedESNext2.ts | 11 +++ .../importCallExpressionNestedSystem.ts | 11 +++ .../importCallExpressionNestedSystem2.ts | 11 +++ .../importCallExpressionNestedUMD.ts | 11 +++ .../importCallExpressionNestedUMD2.ts | 11 +++ 61 files changed, 1254 insertions(+), 22 deletions(-) create mode 100644 tests/baselines/reference/asyncImportNestedYield.js create mode 100644 tests/baselines/reference/asyncImportNestedYield.symbols create mode 100644 tests/baselines/reference/asyncImportNestedYield.types create mode 100644 tests/baselines/reference/importCallExpressionNestedAMD.js create mode 100644 tests/baselines/reference/importCallExpressionNestedAMD.symbols create mode 100644 tests/baselines/reference/importCallExpressionNestedAMD.types create mode 100644 tests/baselines/reference/importCallExpressionNestedAMD2.js create mode 100644 tests/baselines/reference/importCallExpressionNestedAMD2.symbols create mode 100644 tests/baselines/reference/importCallExpressionNestedAMD2.types create mode 100644 tests/baselines/reference/importCallExpressionNestedCJS.js create mode 100644 tests/baselines/reference/importCallExpressionNestedCJS.symbols create mode 100644 tests/baselines/reference/importCallExpressionNestedCJS.types create mode 100644 tests/baselines/reference/importCallExpressionNestedCJS2.js create mode 100644 tests/baselines/reference/importCallExpressionNestedCJS2.symbols create mode 100644 tests/baselines/reference/importCallExpressionNestedCJS2.types create mode 100644 tests/baselines/reference/importCallExpressionNestedES2015.errors.txt create mode 100644 tests/baselines/reference/importCallExpressionNestedES2015.js create mode 100644 tests/baselines/reference/importCallExpressionNestedES2015.symbols create mode 100644 tests/baselines/reference/importCallExpressionNestedES2015.types create mode 100644 tests/baselines/reference/importCallExpressionNestedES20152.errors.txt create mode 100644 tests/baselines/reference/importCallExpressionNestedES20152.js create mode 100644 tests/baselines/reference/importCallExpressionNestedES20152.symbols create mode 100644 tests/baselines/reference/importCallExpressionNestedES20152.types create mode 100644 tests/baselines/reference/importCallExpressionNestedESNext.js create mode 100644 tests/baselines/reference/importCallExpressionNestedESNext.symbols create mode 100644 tests/baselines/reference/importCallExpressionNestedESNext.types create mode 100644 tests/baselines/reference/importCallExpressionNestedESNext2.js create mode 100644 tests/baselines/reference/importCallExpressionNestedESNext2.symbols create mode 100644 tests/baselines/reference/importCallExpressionNestedESNext2.types create mode 100644 tests/baselines/reference/importCallExpressionNestedSystem.js create mode 100644 tests/baselines/reference/importCallExpressionNestedSystem.symbols create mode 100644 tests/baselines/reference/importCallExpressionNestedSystem.types create mode 100644 tests/baselines/reference/importCallExpressionNestedSystem2.js create mode 100644 tests/baselines/reference/importCallExpressionNestedSystem2.symbols create mode 100644 tests/baselines/reference/importCallExpressionNestedSystem2.types create mode 100644 tests/baselines/reference/importCallExpressionNestedUMD.js create mode 100644 tests/baselines/reference/importCallExpressionNestedUMD.symbols create mode 100644 tests/baselines/reference/importCallExpressionNestedUMD.types create mode 100644 tests/baselines/reference/importCallExpressionNestedUMD2.js create mode 100644 tests/baselines/reference/importCallExpressionNestedUMD2.symbols create mode 100644 tests/baselines/reference/importCallExpressionNestedUMD2.types create mode 100644 tests/cases/compiler/asyncImportNestedYield.ts create mode 100644 tests/cases/conformance/dynamicImport/importCallExpressionNestedAMD.ts create mode 100644 tests/cases/conformance/dynamicImport/importCallExpressionNestedAMD2.ts create mode 100644 tests/cases/conformance/dynamicImport/importCallExpressionNestedCJS.ts create mode 100644 tests/cases/conformance/dynamicImport/importCallExpressionNestedCJS2.ts create mode 100644 tests/cases/conformance/dynamicImport/importCallExpressionNestedES2015.ts create mode 100644 tests/cases/conformance/dynamicImport/importCallExpressionNestedES20152.ts create mode 100644 tests/cases/conformance/dynamicImport/importCallExpressionNestedESNext.ts create mode 100644 tests/cases/conformance/dynamicImport/importCallExpressionNestedESNext2.ts create mode 100644 tests/cases/conformance/dynamicImport/importCallExpressionNestedSystem.ts create mode 100644 tests/cases/conformance/dynamicImport/importCallExpressionNestedSystem2.ts create mode 100644 tests/cases/conformance/dynamicImport/importCallExpressionNestedUMD.ts create mode 100644 tests/cases/conformance/dynamicImport/importCallExpressionNestedUMD2.ts diff --git a/src/compiler/transformers/generators.ts b/src/compiler/transformers/generators.ts index 84ed997a70e..7ede62b1540 100644 --- a/src/compiler/transformers/generators.ts +++ b/src/compiler/transformers/generators.ts @@ -1112,7 +1112,7 @@ namespace ts { } function visitCallExpression(node: CallExpression) { - if (forEach(node.arguments, containsYield)) { + if (!isImportCall(node) && forEach(node.arguments, containsYield)) { // [source] // a.b(1, yield, 2); // @@ -1123,7 +1123,6 @@ namespace ts { // .yield resumeLabel // .mark resumeLabel // _b.apply(_a, _c.concat([%sent%, 2])); - const { target, thisArg } = createCallBinding(node.expression, hoistVariableDeclaration, languageVersion, /*cacheIdentifiers*/ true); return setOriginalNode( createFunctionApply( diff --git a/src/compiler/transformers/module/module.ts b/src/compiler/transformers/module/module.ts index ba262bf2c59..bd360fdffe4 100644 --- a/src/compiler/transformers/module/module.ts +++ b/src/compiler/transformers/module/module.ts @@ -21,7 +21,8 @@ namespace ts { const { startLexicalEnvironment, - endLexicalEnvironment + endLexicalEnvironment, + hoistVariableDeclaration } = context; const compilerOptions = context.getCompilerOptions(); @@ -519,18 +520,20 @@ namespace ts { } function visitImportCallExpression(node: ImportCall): Expression { + const argument = visitNode(firstOrUndefined(node.arguments), importCallExpressionVisitor); + const containsLexicalThis = !!(node.transformFlags & TransformFlags.ContainsLexicalThis); switch (compilerOptions.module) { case ModuleKind.AMD: - return transformImportCallExpressionAMD(node); + return createImportCallExpressionAMD(argument, containsLexicalThis); case ModuleKind.UMD: - return transformImportCallExpressionUMD(node); + return createImportCallExpressionUMD(argument, containsLexicalThis); case ModuleKind.CommonJS: default: - return transformImportCallExpressionCommonJS(node); + return createImportCallExpressionCommonJS(argument, containsLexicalThis); } } - function transformImportCallExpressionUMD(node: ImportCall): Expression { + function createImportCallExpressionUMD(arg: Expression | undefined, containsLexicalThis: boolean): Expression { // (function (factory) { // ... (regular UMD) // } @@ -545,14 +548,25 @@ namespace ts { // : new Promise(function (_a, _b) { require([x], _a, _b); }); /*Amd Require*/ // }); needUMDDynamicImportHelper = true; - return createConditional( - /*condition*/ createIdentifier("__syncRequire"), - /*whenTrue*/ transformImportCallExpressionCommonJS(node), - /*whenFalse*/ transformImportCallExpressionAMD(node) - ); + if (isSimpleCopiableExpression(arg)) { + const argClone = isGeneratedIdentifier(arg) ? arg : isStringLiteral(arg) ? createLiteral(arg) : setEmitFlags(setTextRange(getSynthesizedClone(arg), arg), EmitFlags.NoComments); + return createConditional( + /*condition*/ createIdentifier("__syncRequire"), + /*whenTrue*/ createImportCallExpressionCommonJS(arg, containsLexicalThis), + /*whenFalse*/ createImportCallExpressionAMD(argClone, containsLexicalThis) + ); + } + else { + const temp = createTempVariable(hoistVariableDeclaration); + return createComma(createAssignment(temp, arg), createConditional( + /*condition*/ createIdentifier("__syncRequire"), + /*whenTrue*/ createImportCallExpressionCommonJS(temp, containsLexicalThis), + /*whenFalse*/ createImportCallExpressionAMD(temp, containsLexicalThis) + )); + } } - function transformImportCallExpressionAMD(node: ImportCall): Expression { + function createImportCallExpressionAMD(arg: Expression | undefined, containsLexicalThis: boolean): Expression { // improt("./blah") // emit as // define(["require", "exports", "blah"], function (require, exports) { @@ -570,7 +584,7 @@ namespace ts { createCall( createIdentifier("require"), /*typeArguments*/ undefined, - [createArrayLiteral([firstOrUndefined(node.arguments) || createOmittedExpression()]), resolve, reject] + [createArrayLiteral([arg || createOmittedExpression()]), resolve, reject] ) ) ]); @@ -598,7 +612,7 @@ namespace ts { // if there is a lexical 'this' in the import call arguments, ensure we indicate // that this new function expression indicates it captures 'this' so that the // es2015 transformer will properly substitute 'this' with '_this'. - if (node.transformFlags & TransformFlags.ContainsLexicalThis) { + if (containsLexicalThis) { setEmitFlags(func, EmitFlags.CapturesThis); } } @@ -606,14 +620,14 @@ namespace ts { return createNew(createIdentifier("Promise"), /*typeArguments*/ undefined, [func]); } - function transformImportCallExpressionCommonJS(node: ImportCall): Expression { + function createImportCallExpressionCommonJS(arg: Expression | undefined, containsLexicalThis: boolean): Expression { // import("./blah") // emit as // Promise.resolve().then(function () { return require(x); }) /*CommonJs Require*/ // We have to wrap require in then callback so that require is done in asynchronously // if we simply do require in resolve callback in Promise constructor. We will execute the loading immediately const promiseResolveCall = createCall(createPropertyAccess(createIdentifier("Promise"), "resolve"), /*typeArguments*/ undefined, /*argumentsArray*/ []); - const requireCall = createCall(createIdentifier("require"), /*typeArguments*/ undefined, node.arguments); + const requireCall = createCall(createIdentifier("require"), /*typeArguments*/ undefined, arg ? [arg] : []); let func: FunctionExpression | ArrowFunction; if (languageVersion >= ScriptTarget.ES2015) { @@ -638,7 +652,7 @@ namespace ts { // if there is a lexical 'this' in the import call arguments, ensure we indicate // that this new function expression indicates it captures 'this' so that the // es2015 transformer will properly substitute 'this' with '_this'. - if (node.transformFlags & TransformFlags.ContainsLexicalThis) { + if (containsLexicalThis) { setEmitFlags(func, EmitFlags.CapturesThis); } } diff --git a/src/compiler/transformers/module/system.ts b/src/compiler/transformers/module/system.ts index af77c499e8d..ed943eb90ce 100644 --- a/src/compiler/transformers/module/system.ts +++ b/src/compiler/transformers/module/system.ts @@ -1495,7 +1495,7 @@ namespace ts { createIdentifier("import") ), /*typeArguments*/ undefined, - node.arguments + some(node.arguments) ? [visitNode(node.arguments[0], destructuringAndImportCallVisitor)] : [] ); } diff --git a/src/compiler/transformers/utilities.ts b/src/compiler/transformers/utilities.ts index 00a0753eaa1..a012c9be7db 100644 --- a/src/compiler/transformers/utilities.ts +++ b/src/compiler/transformers/utilities.ts @@ -178,4 +178,17 @@ namespace ts { } return values; } + + /** + * Used in the module transformer to check if an expression is reasonably without sideeffect, + * and thus better to copy into multiple places rather than to cache in a temporary variable + * - this is mostly subjective beyond the requirement that the expression not be sideeffecting + */ + export function isSimpleCopiableExpression(expression: Expression) { + return expression.kind === SyntaxKind.StringLiteral || + expression.kind === SyntaxKind.NumericLiteral || + expression.kind === SyntaxKind.NoSubstitutionTemplateLiteral || + isKeyword(expression.kind) || + isIdentifier(expression); + } } \ No newline at end of file diff --git a/tests/baselines/reference/asyncImportNestedYield.js b/tests/baselines/reference/asyncImportNestedYield.js new file mode 100644 index 00000000000..0dd76a13ace --- /dev/null +++ b/tests/baselines/reference/asyncImportNestedYield.js @@ -0,0 +1,58 @@ +//// [asyncImportNestedYield.ts] +async function* foo() { + import((await import(yield "foo")).default); +} + +//// [asyncImportNestedYield.js] +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +}; +function foo() { + return __asyncGenerator(this, arguments, function foo_1() { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, "foo"]; + case 1: return [4 /*yield*/, __await.apply(void 0, [Promise.resolve().then(function () { return require(_a.sent()); })])]; + case 2: + Promise.resolve().then(function () { return require((_a.sent())["default"]); }); + return [2 /*return*/]; + } + }); + }); +} diff --git a/tests/baselines/reference/asyncImportNestedYield.symbols b/tests/baselines/reference/asyncImportNestedYield.symbols new file mode 100644 index 00000000000..01107ba5bf6 --- /dev/null +++ b/tests/baselines/reference/asyncImportNestedYield.symbols @@ -0,0 +1,6 @@ +=== tests/cases/compiler/asyncImportNestedYield.ts === +async function* foo() { +>foo : Symbol(foo, Decl(asyncImportNestedYield.ts, 0, 0)) + + import((await import(yield "foo")).default); +} diff --git a/tests/baselines/reference/asyncImportNestedYield.types b/tests/baselines/reference/asyncImportNestedYield.types new file mode 100644 index 00000000000..872e3141500 --- /dev/null +++ b/tests/baselines/reference/asyncImportNestedYield.types @@ -0,0 +1,14 @@ +=== tests/cases/compiler/asyncImportNestedYield.ts === +async function* foo() { +>foo : () => AsyncIterableIterator<"foo"> + + import((await import(yield "foo")).default); +>import((await import(yield "foo")).default) : Promise +>(await import(yield "foo")).default : any +>(await import(yield "foo")) : any +>await import(yield "foo") : any +>import(yield "foo") : Promise +>yield "foo" : any +>"foo" : "foo" +>default : any +} diff --git a/tests/baselines/reference/dynamicImportWithNestedThis_es2015.js b/tests/baselines/reference/dynamicImportWithNestedThis_es2015.js index 86fba0c0b5d..4f79e0caec1 100644 --- a/tests/baselines/reference/dynamicImportWithNestedThis_es2015.js +++ b/tests/baselines/reference/dynamicImportWithNestedThis_es2015.js @@ -29,7 +29,8 @@ c.dynamic(); this._path = './other'; } dynamic() { - return __syncRequire ? Promise.resolve().then(() => require(this._path)) : new Promise((resolve_1, reject_1) => { require([this._path], resolve_1, reject_1); }); + return _a = this._path, __syncRequire ? Promise.resolve().then(() => require(_a)) : new Promise((resolve_1, reject_1) => { require([_a], resolve_1, reject_1); }); + var _a; } } const c = new C(); diff --git a/tests/baselines/reference/dynamicImportWithNestedThis_es5.js b/tests/baselines/reference/dynamicImportWithNestedThis_es5.js index cde1979b25b..fcfde9e9887 100644 --- a/tests/baselines/reference/dynamicImportWithNestedThis_es5.js +++ b/tests/baselines/reference/dynamicImportWithNestedThis_es5.js @@ -30,7 +30,8 @@ c.dynamic(); } C.prototype.dynamic = function () { var _this = this; - return __syncRequire ? Promise.resolve().then(function () { return require(_this._path); }) : new Promise(function (resolve_1, reject_1) { require([_this._path], resolve_1, reject_1); }); + return _a = this._path, __syncRequire ? Promise.resolve().then(function () { return require(_a); }) : new Promise(function (resolve_1, reject_1) { require([_a], resolve_1, reject_1); }); + var _a; }; return C; }()); diff --git a/tests/baselines/reference/importCallExpressionGrammarError.js b/tests/baselines/reference/importCallExpressionGrammarError.js index e2ffc55577d..435eab35d4e 100644 --- a/tests/baselines/reference/importCallExpressionGrammarError.js +++ b/tests/baselines/reference/importCallExpressionGrammarError.js @@ -16,4 +16,4 @@ Promise.resolve().then(() => require(...["PathModule"])); var p1 = Promise.resolve().then(() => require(...a)); const p2 = Promise.resolve().then(() => require()); const p3 = Promise.resolve().then(() => require()); -const p4 = Promise.resolve().then(() => require("pathToModule", "secondModule")); +const p4 = Promise.resolve().then(() => require("pathToModule")); diff --git a/tests/baselines/reference/importCallExpressionNestedAMD.js b/tests/baselines/reference/importCallExpressionNestedAMD.js new file mode 100644 index 00000000000..dc211d44003 --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedAMD.js @@ -0,0 +1,33 @@ +//// [tests/cases/conformance/dynamicImport/importCallExpressionNestedAMD.ts] //// + +//// [foo.ts] +export default "./foo"; + +//// [index.ts] +async function foo() { + return await import((await import("./foo")).default); +} + +//// [foo.js] +define(["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = "./foo"; +}); +//// [index.js] +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +define(["require", "exports"], function (require, exports) { + "use strict"; + function foo() { + return __awaiter(this, void 0, void 0, function* () { + return yield new Promise((resolve_1, reject_1) => { require([(yield new Promise((resolve_2, reject_2) => { require(["./foo"], resolve_2, reject_2); })).default], resolve_1, reject_1); }); + }); + } +}); diff --git a/tests/baselines/reference/importCallExpressionNestedAMD.symbols b/tests/baselines/reference/importCallExpressionNestedAMD.symbols new file mode 100644 index 00000000000..67e2eabd6fd --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedAMD.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/dynamicImport/foo.ts === +export default "./foo"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +async function foo() { +>foo : Symbol(foo, Decl(index.ts, 0, 0)) + + return await import((await import("./foo")).default); +>(await import("./foo")).default : Symbol(default, Decl(foo.ts, 0, 0)) +>"./foo" : Symbol("tests/cases/conformance/dynamicImport/foo", Decl(foo.ts, 0, 0)) +>default : Symbol(default, Decl(foo.ts, 0, 0)) +} diff --git a/tests/baselines/reference/importCallExpressionNestedAMD.types b/tests/baselines/reference/importCallExpressionNestedAMD.types new file mode 100644 index 00000000000..2f74d78b6c8 --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedAMD.types @@ -0,0 +1,17 @@ +=== tests/cases/conformance/dynamicImport/foo.ts === +export default "./foo"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +async function foo() { +>foo : () => Promise + + return await import((await import("./foo")).default); +>await import((await import("./foo")).default) : any +>import((await import("./foo")).default) : Promise +>(await import("./foo")).default : "./foo" +>(await import("./foo")) : typeof "tests/cases/conformance/dynamicImport/foo" +>await import("./foo") : typeof "tests/cases/conformance/dynamicImport/foo" +>import("./foo") : Promise +>"./foo" : "./foo" +>default : "./foo" +} diff --git a/tests/baselines/reference/importCallExpressionNestedAMD2.js b/tests/baselines/reference/importCallExpressionNestedAMD2.js new file mode 100644 index 00000000000..1e159af2180 --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedAMD2.js @@ -0,0 +1,66 @@ +//// [tests/cases/conformance/dynamicImport/importCallExpressionNestedAMD2.ts] //// + +//// [foo.ts] +export default "./foo"; + +//// [index.ts] +async function foo() { + return await import((await import("./foo")).default); +} + +//// [foo.js] +define(["require", "exports"], function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = "./foo"; +}); +//// [index.js] +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +define(["require", "exports"], function (require, exports) { + "use strict"; + function foo() { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, new Promise(function (resolve_1, reject_1) { require(["./foo"], resolve_1, reject_1); })]; + case 1: return [4 /*yield*/, new Promise(function (resolve_2, reject_2) { require([(_a.sent()).default], resolve_2, reject_2); })]; + case 2: return [2 /*return*/, _a.sent()]; + } + }); + }); + } +}); diff --git a/tests/baselines/reference/importCallExpressionNestedAMD2.symbols b/tests/baselines/reference/importCallExpressionNestedAMD2.symbols new file mode 100644 index 00000000000..67e2eabd6fd --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedAMD2.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/dynamicImport/foo.ts === +export default "./foo"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +async function foo() { +>foo : Symbol(foo, Decl(index.ts, 0, 0)) + + return await import((await import("./foo")).default); +>(await import("./foo")).default : Symbol(default, Decl(foo.ts, 0, 0)) +>"./foo" : Symbol("tests/cases/conformance/dynamicImport/foo", Decl(foo.ts, 0, 0)) +>default : Symbol(default, Decl(foo.ts, 0, 0)) +} diff --git a/tests/baselines/reference/importCallExpressionNestedAMD2.types b/tests/baselines/reference/importCallExpressionNestedAMD2.types new file mode 100644 index 00000000000..2f74d78b6c8 --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedAMD2.types @@ -0,0 +1,17 @@ +=== tests/cases/conformance/dynamicImport/foo.ts === +export default "./foo"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +async function foo() { +>foo : () => Promise + + return await import((await import("./foo")).default); +>await import((await import("./foo")).default) : any +>import((await import("./foo")).default) : Promise +>(await import("./foo")).default : "./foo" +>(await import("./foo")) : typeof "tests/cases/conformance/dynamicImport/foo" +>await import("./foo") : typeof "tests/cases/conformance/dynamicImport/foo" +>import("./foo") : Promise +>"./foo" : "./foo" +>default : "./foo" +} diff --git a/tests/baselines/reference/importCallExpressionNestedCJS.js b/tests/baselines/reference/importCallExpressionNestedCJS.js new file mode 100644 index 00000000000..07c0f234bf7 --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedCJS.js @@ -0,0 +1,28 @@ +//// [tests/cases/conformance/dynamicImport/importCallExpressionNestedCJS.ts] //// + +//// [foo.ts] +export default "./foo"; + +//// [index.ts] +async function foo() { + return await import((await import("./foo")).default); +} + +//// [foo.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = "./foo"; +//// [index.js] +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +function foo() { + return __awaiter(this, void 0, void 0, function* () { + return yield Promise.resolve().then(() => require((yield Promise.resolve().then(() => require("./foo"))).default)); + }); +} diff --git a/tests/baselines/reference/importCallExpressionNestedCJS.symbols b/tests/baselines/reference/importCallExpressionNestedCJS.symbols new file mode 100644 index 00000000000..67e2eabd6fd --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedCJS.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/dynamicImport/foo.ts === +export default "./foo"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +async function foo() { +>foo : Symbol(foo, Decl(index.ts, 0, 0)) + + return await import((await import("./foo")).default); +>(await import("./foo")).default : Symbol(default, Decl(foo.ts, 0, 0)) +>"./foo" : Symbol("tests/cases/conformance/dynamicImport/foo", Decl(foo.ts, 0, 0)) +>default : Symbol(default, Decl(foo.ts, 0, 0)) +} diff --git a/tests/baselines/reference/importCallExpressionNestedCJS.types b/tests/baselines/reference/importCallExpressionNestedCJS.types new file mode 100644 index 00000000000..2f74d78b6c8 --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedCJS.types @@ -0,0 +1,17 @@ +=== tests/cases/conformance/dynamicImport/foo.ts === +export default "./foo"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +async function foo() { +>foo : () => Promise + + return await import((await import("./foo")).default); +>await import((await import("./foo")).default) : any +>import((await import("./foo")).default) : Promise +>(await import("./foo")).default : "./foo" +>(await import("./foo")) : typeof "tests/cases/conformance/dynamicImport/foo" +>await import("./foo") : typeof "tests/cases/conformance/dynamicImport/foo" +>import("./foo") : Promise +>"./foo" : "./foo" +>default : "./foo" +} diff --git a/tests/baselines/reference/importCallExpressionNestedCJS2.js b/tests/baselines/reference/importCallExpressionNestedCJS2.js new file mode 100644 index 00000000000..c76044ec05c --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedCJS2.js @@ -0,0 +1,61 @@ +//// [tests/cases/conformance/dynamicImport/importCallExpressionNestedCJS2.ts] //// + +//// [foo.ts] +export default "./foo"; + +//// [index.ts] +async function foo() { + return await import((await import("./foo")).default); +} + +//// [foo.js] +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = "./foo"; +//// [index.js] +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +function foo() { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, Promise.resolve().then(function () { return require("./foo"); })]; + case 1: return [4 /*yield*/, Promise.resolve().then(function () { return require((_a.sent()).default); })]; + case 2: return [2 /*return*/, _a.sent()]; + } + }); + }); +} diff --git a/tests/baselines/reference/importCallExpressionNestedCJS2.symbols b/tests/baselines/reference/importCallExpressionNestedCJS2.symbols new file mode 100644 index 00000000000..67e2eabd6fd --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedCJS2.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/dynamicImport/foo.ts === +export default "./foo"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +async function foo() { +>foo : Symbol(foo, Decl(index.ts, 0, 0)) + + return await import((await import("./foo")).default); +>(await import("./foo")).default : Symbol(default, Decl(foo.ts, 0, 0)) +>"./foo" : Symbol("tests/cases/conformance/dynamicImport/foo", Decl(foo.ts, 0, 0)) +>default : Symbol(default, Decl(foo.ts, 0, 0)) +} diff --git a/tests/baselines/reference/importCallExpressionNestedCJS2.types b/tests/baselines/reference/importCallExpressionNestedCJS2.types new file mode 100644 index 00000000000..2f74d78b6c8 --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedCJS2.types @@ -0,0 +1,17 @@ +=== tests/cases/conformance/dynamicImport/foo.ts === +export default "./foo"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +async function foo() { +>foo : () => Promise + + return await import((await import("./foo")).default); +>await import((await import("./foo")).default) : any +>import((await import("./foo")).default) : Promise +>(await import("./foo")).default : "./foo" +>(await import("./foo")) : typeof "tests/cases/conformance/dynamicImport/foo" +>await import("./foo") : typeof "tests/cases/conformance/dynamicImport/foo" +>import("./foo") : Promise +>"./foo" : "./foo" +>default : "./foo" +} diff --git a/tests/baselines/reference/importCallExpressionNestedES2015.errors.txt b/tests/baselines/reference/importCallExpressionNestedES2015.errors.txt new file mode 100644 index 00000000000..1208dd0c709 --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedES2015.errors.txt @@ -0,0 +1,15 @@ +tests/cases/conformance/dynamicImport/index.ts(2,18): error TS1323: Dynamic import cannot be used when targeting ECMAScript 2015 modules. +tests/cases/conformance/dynamicImport/index.ts(2,32): error TS1323: Dynamic import cannot be used when targeting ECMAScript 2015 modules. + + +==== tests/cases/conformance/dynamicImport/foo.ts (0 errors) ==== + export default "./foo"; + +==== tests/cases/conformance/dynamicImport/index.ts (2 errors) ==== + async function foo() { + return await import((await import("./foo")).default); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1323: Dynamic import cannot be used when targeting ECMAScript 2015 modules. + ~~~~~~~~~~~~~~~ +!!! error TS1323: Dynamic import cannot be used when targeting ECMAScript 2015 modules. + } \ No newline at end of file diff --git a/tests/baselines/reference/importCallExpressionNestedES2015.js b/tests/baselines/reference/importCallExpressionNestedES2015.js new file mode 100644 index 00000000000..5c8a6a9edb5 --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedES2015.js @@ -0,0 +1,26 @@ +//// [tests/cases/conformance/dynamicImport/importCallExpressionNestedES2015.ts] //// + +//// [foo.ts] +export default "./foo"; + +//// [index.ts] +async function foo() { + return await import((await import("./foo")).default); +} + +//// [foo.js] +export default "./foo"; +//// [index.js] +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +function foo() { + return __awaiter(this, void 0, void 0, function* () { + return yield import((yield import("./foo")).default); + }); +} diff --git a/tests/baselines/reference/importCallExpressionNestedES2015.symbols b/tests/baselines/reference/importCallExpressionNestedES2015.symbols new file mode 100644 index 00000000000..67e2eabd6fd --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedES2015.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/dynamicImport/foo.ts === +export default "./foo"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +async function foo() { +>foo : Symbol(foo, Decl(index.ts, 0, 0)) + + return await import((await import("./foo")).default); +>(await import("./foo")).default : Symbol(default, Decl(foo.ts, 0, 0)) +>"./foo" : Symbol("tests/cases/conformance/dynamicImport/foo", Decl(foo.ts, 0, 0)) +>default : Symbol(default, Decl(foo.ts, 0, 0)) +} diff --git a/tests/baselines/reference/importCallExpressionNestedES2015.types b/tests/baselines/reference/importCallExpressionNestedES2015.types new file mode 100644 index 00000000000..2f74d78b6c8 --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedES2015.types @@ -0,0 +1,17 @@ +=== tests/cases/conformance/dynamicImport/foo.ts === +export default "./foo"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +async function foo() { +>foo : () => Promise + + return await import((await import("./foo")).default); +>await import((await import("./foo")).default) : any +>import((await import("./foo")).default) : Promise +>(await import("./foo")).default : "./foo" +>(await import("./foo")) : typeof "tests/cases/conformance/dynamicImport/foo" +>await import("./foo") : typeof "tests/cases/conformance/dynamicImport/foo" +>import("./foo") : Promise +>"./foo" : "./foo" +>default : "./foo" +} diff --git a/tests/baselines/reference/importCallExpressionNestedES20152.errors.txt b/tests/baselines/reference/importCallExpressionNestedES20152.errors.txt new file mode 100644 index 00000000000..1208dd0c709 --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedES20152.errors.txt @@ -0,0 +1,15 @@ +tests/cases/conformance/dynamicImport/index.ts(2,18): error TS1323: Dynamic import cannot be used when targeting ECMAScript 2015 modules. +tests/cases/conformance/dynamicImport/index.ts(2,32): error TS1323: Dynamic import cannot be used when targeting ECMAScript 2015 modules. + + +==== tests/cases/conformance/dynamicImport/foo.ts (0 errors) ==== + export default "./foo"; + +==== tests/cases/conformance/dynamicImport/index.ts (2 errors) ==== + async function foo() { + return await import((await import("./foo")).default); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1323: Dynamic import cannot be used when targeting ECMAScript 2015 modules. + ~~~~~~~~~~~~~~~ +!!! error TS1323: Dynamic import cannot be used when targeting ECMAScript 2015 modules. + } \ No newline at end of file diff --git a/tests/baselines/reference/importCallExpressionNestedES20152.js b/tests/baselines/reference/importCallExpressionNestedES20152.js new file mode 100644 index 00000000000..2496f43f84f --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedES20152.js @@ -0,0 +1,59 @@ +//// [tests/cases/conformance/dynamicImport/importCallExpressionNestedES20152.ts] //// + +//// [foo.ts] +export default "./foo"; + +//// [index.ts] +async function foo() { + return await import((await import("./foo")).default); +} + +//// [foo.js] +export default "./foo"; +//// [index.js] +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +function foo() { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, import("./foo")]; + case 1: return [4 /*yield*/, import((_a.sent()).default)]; + case 2: return [2 /*return*/, _a.sent()]; + } + }); + }); +} diff --git a/tests/baselines/reference/importCallExpressionNestedES20152.symbols b/tests/baselines/reference/importCallExpressionNestedES20152.symbols new file mode 100644 index 00000000000..67e2eabd6fd --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedES20152.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/dynamicImport/foo.ts === +export default "./foo"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +async function foo() { +>foo : Symbol(foo, Decl(index.ts, 0, 0)) + + return await import((await import("./foo")).default); +>(await import("./foo")).default : Symbol(default, Decl(foo.ts, 0, 0)) +>"./foo" : Symbol("tests/cases/conformance/dynamicImport/foo", Decl(foo.ts, 0, 0)) +>default : Symbol(default, Decl(foo.ts, 0, 0)) +} diff --git a/tests/baselines/reference/importCallExpressionNestedES20152.types b/tests/baselines/reference/importCallExpressionNestedES20152.types new file mode 100644 index 00000000000..2f74d78b6c8 --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedES20152.types @@ -0,0 +1,17 @@ +=== tests/cases/conformance/dynamicImport/foo.ts === +export default "./foo"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +async function foo() { +>foo : () => Promise + + return await import((await import("./foo")).default); +>await import((await import("./foo")).default) : any +>import((await import("./foo")).default) : Promise +>(await import("./foo")).default : "./foo" +>(await import("./foo")) : typeof "tests/cases/conformance/dynamicImport/foo" +>await import("./foo") : typeof "tests/cases/conformance/dynamicImport/foo" +>import("./foo") : Promise +>"./foo" : "./foo" +>default : "./foo" +} diff --git a/tests/baselines/reference/importCallExpressionNestedESNext.js b/tests/baselines/reference/importCallExpressionNestedESNext.js new file mode 100644 index 00000000000..8ec9b988201 --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedESNext.js @@ -0,0 +1,26 @@ +//// [tests/cases/conformance/dynamicImport/importCallExpressionNestedESNext.ts] //// + +//// [foo.ts] +export default "./foo"; + +//// [index.ts] +async function foo() { + return await import((await import("./foo")).default); +} + +//// [foo.js] +export default "./foo"; +//// [index.js] +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +function foo() { + return __awaiter(this, void 0, void 0, function* () { + return yield import((yield import("./foo")).default); + }); +} diff --git a/tests/baselines/reference/importCallExpressionNestedESNext.symbols b/tests/baselines/reference/importCallExpressionNestedESNext.symbols new file mode 100644 index 00000000000..67e2eabd6fd --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedESNext.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/dynamicImport/foo.ts === +export default "./foo"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +async function foo() { +>foo : Symbol(foo, Decl(index.ts, 0, 0)) + + return await import((await import("./foo")).default); +>(await import("./foo")).default : Symbol(default, Decl(foo.ts, 0, 0)) +>"./foo" : Symbol("tests/cases/conformance/dynamicImport/foo", Decl(foo.ts, 0, 0)) +>default : Symbol(default, Decl(foo.ts, 0, 0)) +} diff --git a/tests/baselines/reference/importCallExpressionNestedESNext.types b/tests/baselines/reference/importCallExpressionNestedESNext.types new file mode 100644 index 00000000000..2f74d78b6c8 --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedESNext.types @@ -0,0 +1,17 @@ +=== tests/cases/conformance/dynamicImport/foo.ts === +export default "./foo"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +async function foo() { +>foo : () => Promise + + return await import((await import("./foo")).default); +>await import((await import("./foo")).default) : any +>import((await import("./foo")).default) : Promise +>(await import("./foo")).default : "./foo" +>(await import("./foo")) : typeof "tests/cases/conformance/dynamicImport/foo" +>await import("./foo") : typeof "tests/cases/conformance/dynamicImport/foo" +>import("./foo") : Promise +>"./foo" : "./foo" +>default : "./foo" +} diff --git a/tests/baselines/reference/importCallExpressionNestedESNext2.js b/tests/baselines/reference/importCallExpressionNestedESNext2.js new file mode 100644 index 00000000000..9a4d9f44f7a --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedESNext2.js @@ -0,0 +1,59 @@ +//// [tests/cases/conformance/dynamicImport/importCallExpressionNestedESNext2.ts] //// + +//// [foo.ts] +export default "./foo"; + +//// [index.ts] +async function foo() { + return await import((await import("./foo")).default); +} + +//// [foo.js] +export default "./foo"; +//// [index.js] +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +function foo() { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, import("./foo")]; + case 1: return [4 /*yield*/, import((_a.sent()).default)]; + case 2: return [2 /*return*/, _a.sent()]; + } + }); + }); +} diff --git a/tests/baselines/reference/importCallExpressionNestedESNext2.symbols b/tests/baselines/reference/importCallExpressionNestedESNext2.symbols new file mode 100644 index 00000000000..67e2eabd6fd --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedESNext2.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/dynamicImport/foo.ts === +export default "./foo"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +async function foo() { +>foo : Symbol(foo, Decl(index.ts, 0, 0)) + + return await import((await import("./foo")).default); +>(await import("./foo")).default : Symbol(default, Decl(foo.ts, 0, 0)) +>"./foo" : Symbol("tests/cases/conformance/dynamicImport/foo", Decl(foo.ts, 0, 0)) +>default : Symbol(default, Decl(foo.ts, 0, 0)) +} diff --git a/tests/baselines/reference/importCallExpressionNestedESNext2.types b/tests/baselines/reference/importCallExpressionNestedESNext2.types new file mode 100644 index 00000000000..2f74d78b6c8 --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedESNext2.types @@ -0,0 +1,17 @@ +=== tests/cases/conformance/dynamicImport/foo.ts === +export default "./foo"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +async function foo() { +>foo : () => Promise + + return await import((await import("./foo")).default); +>await import((await import("./foo")).default) : any +>import((await import("./foo")).default) : Promise +>(await import("./foo")).default : "./foo" +>(await import("./foo")) : typeof "tests/cases/conformance/dynamicImport/foo" +>await import("./foo") : typeof "tests/cases/conformance/dynamicImport/foo" +>import("./foo") : Promise +>"./foo" : "./foo" +>default : "./foo" +} diff --git a/tests/baselines/reference/importCallExpressionNestedSystem.js b/tests/baselines/reference/importCallExpressionNestedSystem.js new file mode 100644 index 00000000000..839a3601e38 --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedSystem.js @@ -0,0 +1,43 @@ +//// [tests/cases/conformance/dynamicImport/importCallExpressionNestedSystem.ts] //// + +//// [foo.ts] +export default "./foo"; + +//// [index.ts] +async function foo() { + return await import((await import("./foo")).default); +} + +//// [foo.js] +System.register([], function (exports_1, context_1) { + "use strict"; + var __moduleName = context_1 && context_1.id; + return { + setters: [], + execute: function () { + exports_1("default", "./foo"); + } + }; +}); +//// [index.js] +System.register([], function (exports_1, context_1) { + var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + var __moduleName = context_1 && context_1.id; + function foo() { + return __awaiter(this, void 0, void 0, function* () { + return yield context_1.import((yield context_1.import("./foo")).default); + }); + } + return { + setters: [], + execute: function () { + } + }; +}); diff --git a/tests/baselines/reference/importCallExpressionNestedSystem.symbols b/tests/baselines/reference/importCallExpressionNestedSystem.symbols new file mode 100644 index 00000000000..67e2eabd6fd --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedSystem.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/dynamicImport/foo.ts === +export default "./foo"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +async function foo() { +>foo : Symbol(foo, Decl(index.ts, 0, 0)) + + return await import((await import("./foo")).default); +>(await import("./foo")).default : Symbol(default, Decl(foo.ts, 0, 0)) +>"./foo" : Symbol("tests/cases/conformance/dynamicImport/foo", Decl(foo.ts, 0, 0)) +>default : Symbol(default, Decl(foo.ts, 0, 0)) +} diff --git a/tests/baselines/reference/importCallExpressionNestedSystem.types b/tests/baselines/reference/importCallExpressionNestedSystem.types new file mode 100644 index 00000000000..2f74d78b6c8 --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedSystem.types @@ -0,0 +1,17 @@ +=== tests/cases/conformance/dynamicImport/foo.ts === +export default "./foo"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +async function foo() { +>foo : () => Promise + + return await import((await import("./foo")).default); +>await import((await import("./foo")).default) : any +>import((await import("./foo")).default) : Promise +>(await import("./foo")).default : "./foo" +>(await import("./foo")) : typeof "tests/cases/conformance/dynamicImport/foo" +>await import("./foo") : typeof "tests/cases/conformance/dynamicImport/foo" +>import("./foo") : Promise +>"./foo" : "./foo" +>default : "./foo" +} diff --git a/tests/baselines/reference/importCallExpressionNestedSystem2.js b/tests/baselines/reference/importCallExpressionNestedSystem2.js new file mode 100644 index 00000000000..9b0fc20886d --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedSystem2.js @@ -0,0 +1,76 @@ +//// [tests/cases/conformance/dynamicImport/importCallExpressionNestedSystem2.ts] //// + +//// [foo.ts] +export default "./foo"; + +//// [index.ts] +async function foo() { + return await import((await import("./foo")).default); +} + +//// [foo.js] +System.register([], function (exports_1, context_1) { + "use strict"; + var __moduleName = context_1 && context_1.id; + return { + setters: [], + execute: function () { + exports_1("default", "./foo"); + } + }; +}); +//// [index.js] +System.register([], function (exports_1, context_1) { + var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; + var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } + }; + var __moduleName = context_1 && context_1.id; + function foo() { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, context_1.import("./foo")]; + case 1: return [4 /*yield*/, context_1.import((_a.sent()).default)]; + case 2: return [2 /*return*/, _a.sent()]; + } + }); + }); + } + return { + setters: [], + execute: function () { + } + }; +}); diff --git a/tests/baselines/reference/importCallExpressionNestedSystem2.symbols b/tests/baselines/reference/importCallExpressionNestedSystem2.symbols new file mode 100644 index 00000000000..67e2eabd6fd --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedSystem2.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/dynamicImport/foo.ts === +export default "./foo"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +async function foo() { +>foo : Symbol(foo, Decl(index.ts, 0, 0)) + + return await import((await import("./foo")).default); +>(await import("./foo")).default : Symbol(default, Decl(foo.ts, 0, 0)) +>"./foo" : Symbol("tests/cases/conformance/dynamicImport/foo", Decl(foo.ts, 0, 0)) +>default : Symbol(default, Decl(foo.ts, 0, 0)) +} diff --git a/tests/baselines/reference/importCallExpressionNestedSystem2.types b/tests/baselines/reference/importCallExpressionNestedSystem2.types new file mode 100644 index 00000000000..2f74d78b6c8 --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedSystem2.types @@ -0,0 +1,17 @@ +=== tests/cases/conformance/dynamicImport/foo.ts === +export default "./foo"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +async function foo() { +>foo : () => Promise + + return await import((await import("./foo")).default); +>await import((await import("./foo")).default) : any +>import((await import("./foo")).default) : Promise +>(await import("./foo")).default : "./foo" +>(await import("./foo")) : typeof "tests/cases/conformance/dynamicImport/foo" +>await import("./foo") : typeof "tests/cases/conformance/dynamicImport/foo" +>import("./foo") : Promise +>"./foo" : "./foo" +>default : "./foo" +} diff --git a/tests/baselines/reference/importCallExpressionNestedUMD.js b/tests/baselines/reference/importCallExpressionNestedUMD.js new file mode 100644 index 00000000000..0b1d20af8a4 --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedUMD.js @@ -0,0 +1,51 @@ +//// [tests/cases/conformance/dynamicImport/importCallExpressionNestedUMD.ts] //// + +//// [foo.ts] +export default "./foo"; + +//// [index.ts] +async function foo() { + return await import((await import("./foo")).default); +} + +//// [foo.js] +(function (factory) { + if (typeof module === "object" && typeof module.exports === "object") { + var v = factory(require, exports); + if (v !== undefined) module.exports = v; + } + else if (typeof define === "function" && define.amd) { + define(["require", "exports"], factory); + } +})(function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = "./foo"; +}); +//// [index.js] +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +(function (factory) { + if (typeof module === "object" && typeof module.exports === "object") { + var v = factory(require, exports); + if (v !== undefined) module.exports = v; + } + else if (typeof define === "function" && define.amd) { + define(["require", "exports"], factory); + } +})(function (require, exports) { + "use strict"; + var __syncRequire = typeof module === "object" && typeof module.exports === "object"; + function foo() { + return __awaiter(this, void 0, void 0, function* () { + return yield _a = (yield __syncRequire ? Promise.resolve().then(() => require("./foo")) : new Promise((resolve_1, reject_1) => { require(["./foo"], resolve_1, reject_1); })).default, __syncRequire ? Promise.resolve().then(() => require(_a)) : new Promise((resolve_2, reject_2) => { require([_a], resolve_2, reject_2); }); + var _a; + }); + } +}); diff --git a/tests/baselines/reference/importCallExpressionNestedUMD.symbols b/tests/baselines/reference/importCallExpressionNestedUMD.symbols new file mode 100644 index 00000000000..67e2eabd6fd --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedUMD.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/dynamicImport/foo.ts === +export default "./foo"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +async function foo() { +>foo : Symbol(foo, Decl(index.ts, 0, 0)) + + return await import((await import("./foo")).default); +>(await import("./foo")).default : Symbol(default, Decl(foo.ts, 0, 0)) +>"./foo" : Symbol("tests/cases/conformance/dynamicImport/foo", Decl(foo.ts, 0, 0)) +>default : Symbol(default, Decl(foo.ts, 0, 0)) +} diff --git a/tests/baselines/reference/importCallExpressionNestedUMD.types b/tests/baselines/reference/importCallExpressionNestedUMD.types new file mode 100644 index 00000000000..2f74d78b6c8 --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedUMD.types @@ -0,0 +1,17 @@ +=== tests/cases/conformance/dynamicImport/foo.ts === +export default "./foo"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +async function foo() { +>foo : () => Promise + + return await import((await import("./foo")).default); +>await import((await import("./foo")).default) : any +>import((await import("./foo")).default) : Promise +>(await import("./foo")).default : "./foo" +>(await import("./foo")) : typeof "tests/cases/conformance/dynamicImport/foo" +>await import("./foo") : typeof "tests/cases/conformance/dynamicImport/foo" +>import("./foo") : Promise +>"./foo" : "./foo" +>default : "./foo" +} diff --git a/tests/baselines/reference/importCallExpressionNestedUMD2.js b/tests/baselines/reference/importCallExpressionNestedUMD2.js new file mode 100644 index 00000000000..86fd0bfa8f1 --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedUMD2.js @@ -0,0 +1,84 @@ +//// [tests/cases/conformance/dynamicImport/importCallExpressionNestedUMD2.ts] //// + +//// [foo.ts] +export default "./foo"; + +//// [index.ts] +async function foo() { + return await import((await import("./foo")).default); +} + +//// [foo.js] +(function (factory) { + if (typeof module === "object" && typeof module.exports === "object") { + var v = factory(require, exports); + if (v !== undefined) module.exports = v; + } + else if (typeof define === "function" && define.amd) { + define(["require", "exports"], factory); + } +})(function (require, exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.default = "./foo"; +}); +//// [index.js] +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __generator = (this && this.__generator) || function (thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [0, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +}; +(function (factory) { + if (typeof module === "object" && typeof module.exports === "object") { + var v = factory(require, exports); + if (v !== undefined) module.exports = v; + } + else if (typeof define === "function" && define.amd) { + define(["require", "exports"], factory); + } +})(function (require, exports) { + "use strict"; + var __syncRequire = typeof module === "object" && typeof module.exports === "object"; + function foo() { + return __awaiter(this, void 0, void 0, function () { + return __generator(this, function (_a) { + switch (_a.label) { + case 0: return [4 /*yield*/, __syncRequire ? Promise.resolve().then(function () { return require("./foo"); }) : new Promise(function (resolve_1, reject_1) { require(["./foo"], resolve_1, reject_1); })]; + case 1: return [4 /*yield*/, (_b = (_a.sent()).default, __syncRequire ? Promise.resolve().then(function () { return require(_b); }) : new Promise(function (resolve_2, reject_2) { require([_b], resolve_2, reject_2); }))]; + case 2: return [2 /*return*/, _a.sent()]; + } + var _b; + }); + }); + } +}); diff --git a/tests/baselines/reference/importCallExpressionNestedUMD2.symbols b/tests/baselines/reference/importCallExpressionNestedUMD2.symbols new file mode 100644 index 00000000000..67e2eabd6fd --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedUMD2.symbols @@ -0,0 +1,12 @@ +=== tests/cases/conformance/dynamicImport/foo.ts === +export default "./foo"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +async function foo() { +>foo : Symbol(foo, Decl(index.ts, 0, 0)) + + return await import((await import("./foo")).default); +>(await import("./foo")).default : Symbol(default, Decl(foo.ts, 0, 0)) +>"./foo" : Symbol("tests/cases/conformance/dynamicImport/foo", Decl(foo.ts, 0, 0)) +>default : Symbol(default, Decl(foo.ts, 0, 0)) +} diff --git a/tests/baselines/reference/importCallExpressionNestedUMD2.types b/tests/baselines/reference/importCallExpressionNestedUMD2.types new file mode 100644 index 00000000000..2f74d78b6c8 --- /dev/null +++ b/tests/baselines/reference/importCallExpressionNestedUMD2.types @@ -0,0 +1,17 @@ +=== tests/cases/conformance/dynamicImport/foo.ts === +export default "./foo"; +No type information for this code. +No type information for this code.=== tests/cases/conformance/dynamicImport/index.ts === +async function foo() { +>foo : () => Promise + + return await import((await import("./foo")).default); +>await import((await import("./foo")).default) : any +>import((await import("./foo")).default) : Promise +>(await import("./foo")).default : "./foo" +>(await import("./foo")) : typeof "tests/cases/conformance/dynamicImport/foo" +>await import("./foo") : typeof "tests/cases/conformance/dynamicImport/foo" +>import("./foo") : Promise +>"./foo" : "./foo" +>default : "./foo" +} diff --git a/tests/cases/compiler/asyncImportNestedYield.ts b/tests/cases/compiler/asyncImportNestedYield.ts new file mode 100644 index 00000000000..78b022e0797 --- /dev/null +++ b/tests/cases/compiler/asyncImportNestedYield.ts @@ -0,0 +1,4 @@ +// @lib: esnext +async function* foo() { + import((await import(yield "foo")).default); +} \ No newline at end of file diff --git a/tests/cases/conformance/dynamicImport/importCallExpressionNestedAMD.ts b/tests/cases/conformance/dynamicImport/importCallExpressionNestedAMD.ts new file mode 100644 index 00000000000..1dbde4e1956 --- /dev/null +++ b/tests/cases/conformance/dynamicImport/importCallExpressionNestedAMD.ts @@ -0,0 +1,11 @@ +// @module: amd +// @target: es6 +// @skipLibCheck: true +// @lib: es6 +// @filename: foo.ts +export default "./foo"; + +// @filename: index.ts +async function foo() { + return await import((await import("./foo")).default); +} \ No newline at end of file diff --git a/tests/cases/conformance/dynamicImport/importCallExpressionNestedAMD2.ts b/tests/cases/conformance/dynamicImport/importCallExpressionNestedAMD2.ts new file mode 100644 index 00000000000..79540087a58 --- /dev/null +++ b/tests/cases/conformance/dynamicImport/importCallExpressionNestedAMD2.ts @@ -0,0 +1,11 @@ +// @module: amd +// @target: es5 +// @skipLibCheck: true +// @lib: es6 +// @filename: foo.ts +export default "./foo"; + +// @filename: index.ts +async function foo() { + return await import((await import("./foo")).default); +} \ No newline at end of file diff --git a/tests/cases/conformance/dynamicImport/importCallExpressionNestedCJS.ts b/tests/cases/conformance/dynamicImport/importCallExpressionNestedCJS.ts new file mode 100644 index 00000000000..5c99e56ecda --- /dev/null +++ b/tests/cases/conformance/dynamicImport/importCallExpressionNestedCJS.ts @@ -0,0 +1,11 @@ +// @module: commonjs +// @target: es6 +// @skipLibCheck: true +// @lib: es6 +// @filename: foo.ts +export default "./foo"; + +// @filename: index.ts +async function foo() { + return await import((await import("./foo")).default); +} \ No newline at end of file diff --git a/tests/cases/conformance/dynamicImport/importCallExpressionNestedCJS2.ts b/tests/cases/conformance/dynamicImport/importCallExpressionNestedCJS2.ts new file mode 100644 index 00000000000..0776053d668 --- /dev/null +++ b/tests/cases/conformance/dynamicImport/importCallExpressionNestedCJS2.ts @@ -0,0 +1,11 @@ +// @module: commonjs +// @target: es5 +// @skipLibCheck: true +// @lib: es6 +// @filename: foo.ts +export default "./foo"; + +// @filename: index.ts +async function foo() { + return await import((await import("./foo")).default); +} \ No newline at end of file diff --git a/tests/cases/conformance/dynamicImport/importCallExpressionNestedES2015.ts b/tests/cases/conformance/dynamicImport/importCallExpressionNestedES2015.ts new file mode 100644 index 00000000000..9708f466f5e --- /dev/null +++ b/tests/cases/conformance/dynamicImport/importCallExpressionNestedES2015.ts @@ -0,0 +1,11 @@ +// @module: es2015 +// @target: es6 +// @skipLibCheck: true +// @lib: es6 +// @filename: foo.ts +export default "./foo"; + +// @filename: index.ts +async function foo() { + return await import((await import("./foo")).default); +} \ No newline at end of file diff --git a/tests/cases/conformance/dynamicImport/importCallExpressionNestedES20152.ts b/tests/cases/conformance/dynamicImport/importCallExpressionNestedES20152.ts new file mode 100644 index 00000000000..c78b38db193 --- /dev/null +++ b/tests/cases/conformance/dynamicImport/importCallExpressionNestedES20152.ts @@ -0,0 +1,11 @@ +// @module: es2015 +// @target: es5 +// @skipLibCheck: true +// @lib: es6 +// @filename: foo.ts +export default "./foo"; + +// @filename: index.ts +async function foo() { + return await import((await import("./foo")).default); +} \ No newline at end of file diff --git a/tests/cases/conformance/dynamicImport/importCallExpressionNestedESNext.ts b/tests/cases/conformance/dynamicImport/importCallExpressionNestedESNext.ts new file mode 100644 index 00000000000..fffc12a7726 --- /dev/null +++ b/tests/cases/conformance/dynamicImport/importCallExpressionNestedESNext.ts @@ -0,0 +1,11 @@ +// @module: esnext +// @target: es6 +// @skipLibCheck: true +// @lib: es6 +// @filename: foo.ts +export default "./foo"; + +// @filename: index.ts +async function foo() { + return await import((await import("./foo")).default); +} \ No newline at end of file diff --git a/tests/cases/conformance/dynamicImport/importCallExpressionNestedESNext2.ts b/tests/cases/conformance/dynamicImport/importCallExpressionNestedESNext2.ts new file mode 100644 index 00000000000..246e9d931f0 --- /dev/null +++ b/tests/cases/conformance/dynamicImport/importCallExpressionNestedESNext2.ts @@ -0,0 +1,11 @@ +// @module: esnext +// @target: es5 +// @skipLibCheck: true +// @lib: es6 +// @filename: foo.ts +export default "./foo"; + +// @filename: index.ts +async function foo() { + return await import((await import("./foo")).default); +} \ No newline at end of file diff --git a/tests/cases/conformance/dynamicImport/importCallExpressionNestedSystem.ts b/tests/cases/conformance/dynamicImport/importCallExpressionNestedSystem.ts new file mode 100644 index 00000000000..04a11ac8169 --- /dev/null +++ b/tests/cases/conformance/dynamicImport/importCallExpressionNestedSystem.ts @@ -0,0 +1,11 @@ +// @module: system +// @target: es6 +// @skipLibCheck: true +// @lib: es6 +// @filename: foo.ts +export default "./foo"; + +// @filename: index.ts +async function foo() { + return await import((await import("./foo")).default); +} \ No newline at end of file diff --git a/tests/cases/conformance/dynamicImport/importCallExpressionNestedSystem2.ts b/tests/cases/conformance/dynamicImport/importCallExpressionNestedSystem2.ts new file mode 100644 index 00000000000..f8b2d4513ee --- /dev/null +++ b/tests/cases/conformance/dynamicImport/importCallExpressionNestedSystem2.ts @@ -0,0 +1,11 @@ +// @module: system +// @target: es5 +// @skipLibCheck: true +// @lib: es6 +// @filename: foo.ts +export default "./foo"; + +// @filename: index.ts +async function foo() { + return await import((await import("./foo")).default); +} \ No newline at end of file diff --git a/tests/cases/conformance/dynamicImport/importCallExpressionNestedUMD.ts b/tests/cases/conformance/dynamicImport/importCallExpressionNestedUMD.ts new file mode 100644 index 00000000000..8b900a7dbd6 --- /dev/null +++ b/tests/cases/conformance/dynamicImport/importCallExpressionNestedUMD.ts @@ -0,0 +1,11 @@ +// @module: umd +// @target: es6 +// @skipLibCheck: true +// @lib: es6 +// @filename: foo.ts +export default "./foo"; + +// @filename: index.ts +async function foo() { + return await import((await import("./foo")).default); +} \ No newline at end of file diff --git a/tests/cases/conformance/dynamicImport/importCallExpressionNestedUMD2.ts b/tests/cases/conformance/dynamicImport/importCallExpressionNestedUMD2.ts new file mode 100644 index 00000000000..e07dba0d2e5 --- /dev/null +++ b/tests/cases/conformance/dynamicImport/importCallExpressionNestedUMD2.ts @@ -0,0 +1,11 @@ +// @module: umd +// @target: es5 +// @skipLibCheck: true +// @lib: es6 +// @filename: foo.ts +export default "./foo"; + +// @filename: index.ts +async function foo() { + return await import((await import("./foo")).default); +} \ No newline at end of file From 6bfad5222522fbc614ba35b860f09c4736a535a4 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Thu, 12 Oct 2017 13:23:08 -0700 Subject: [PATCH 135/137] Update missed baseline --- src/harness/unittests/tsserverProjectSystem.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index 716c36d1e5d..7dce256e388 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -4412,9 +4412,9 @@ namespace ts.projectSystem { fileName: "/a.ts", textChanges: [ { - start: { line: 2, offset: 1 }, - end: { line: 3, offset: 1 }, - newText: " newFunction();\n", + start: { line: 2, offset: 3 }, + end: { line: 2, offset: 5 }, + newText: "newFunction();", }, { start: { line: 3, offset: 2 }, From 2ea4cfe23bf0648c099a79a8a1d976febb2e2610 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Thu, 12 Oct 2017 11:37:31 -0700 Subject: [PATCH 136/137] Insert a line break before a function at EOF if needed This is a pre-existing issue that became more obvious after refining trivia handling. --- src/harness/unittests/tsserverProjectSystem.ts | 2 +- src/services/refactors/extractSymbol.ts | 5 ++++- .../baselines/reference/extractFunction/extractFunction1.ts | 1 + .../baselines/reference/extractFunction/extractFunction10.ts | 1 + .../baselines/reference/extractFunction/extractFunction11.ts | 1 + .../baselines/reference/extractFunction/extractFunction13.ts | 1 + .../baselines/reference/extractFunction/extractFunction14.ts | 1 + .../baselines/reference/extractFunction/extractFunction15.ts | 1 + .../baselines/reference/extractFunction/extractFunction16.ts | 1 + .../baselines/reference/extractFunction/extractFunction17.ts | 1 + .../baselines/reference/extractFunction/extractFunction18.ts | 1 + .../baselines/reference/extractFunction/extractFunction19.ts | 1 + .../baselines/reference/extractFunction/extractFunction2.ts | 1 + .../baselines/reference/extractFunction/extractFunction20.js | 1 + .../baselines/reference/extractFunction/extractFunction20.ts | 1 + .../baselines/reference/extractFunction/extractFunction21.js | 1 + .../baselines/reference/extractFunction/extractFunction21.ts | 1 + .../baselines/reference/extractFunction/extractFunction22.js | 1 + .../baselines/reference/extractFunction/extractFunction22.ts | 1 + .../baselines/reference/extractFunction/extractFunction23.ts | 1 + .../baselines/reference/extractFunction/extractFunction24.js | 1 + .../baselines/reference/extractFunction/extractFunction24.ts | 1 + .../baselines/reference/extractFunction/extractFunction26.js | 1 + .../baselines/reference/extractFunction/extractFunction26.ts | 1 + .../baselines/reference/extractFunction/extractFunction27.js | 1 + .../baselines/reference/extractFunction/extractFunction27.ts | 1 + .../baselines/reference/extractFunction/extractFunction28.js | 1 + .../baselines/reference/extractFunction/extractFunction28.ts | 1 + .../baselines/reference/extractFunction/extractFunction3.ts | 1 + .../baselines/reference/extractFunction/extractFunction30.ts | 1 + .../baselines/reference/extractFunction/extractFunction31.ts | 1 + .../baselines/reference/extractFunction/extractFunction32.ts | 1 + .../baselines/reference/extractFunction/extractFunction33.js | 1 + .../baselines/reference/extractFunction/extractFunction33.ts | 1 + .../baselines/reference/extractFunction/extractFunction4.ts | 1 + .../baselines/reference/extractFunction/extractFunction5.ts | 1 + .../baselines/reference/extractFunction/extractFunction6.ts | 1 + .../baselines/reference/extractFunction/extractFunction7.ts | 1 + .../baselines/reference/extractFunction/extractFunction9.ts | 1 + .../extractFunction/extractFunction_PreserveTrivia.js | 1 + .../extractFunction/extractFunction_PreserveTrivia.ts | 1 + .../extractFunction/extractFunction_RepeatedSubstitution.ts | 1 + .../extractFunction_VariableDeclaration_ShorthandProperty.js | 1 + .../extractFunction_VariableDeclaration_ShorthandProperty.ts | 1 + ...xtractFunction_VariableDeclaration_Writes_Const_NoType.js | 1 + ...xtractFunction_VariableDeclaration_Writes_Const_NoType.ts | 1 + .../extractFunction_VariableDeclaration_Writes_Const_Type.ts | 1 + ...ctFunction_VariableDeclaration_Writes_Let_LiteralType1.ts | 1 + ...ctFunction_VariableDeclaration_Writes_Let_LiteralType2.ts | 1 + .../extractFunction_VariableDeclaration_Writes_Let_NoType.js | 1 + .../extractFunction_VariableDeclaration_Writes_Let_NoType.ts | 1 + .../extractFunction_VariableDeclaration_Writes_Let_Type.ts | 1 + ...nction_VariableDeclaration_Writes_Let_TypeWithComments.ts | 1 + .../extractFunction_VariableDeclaration_Writes_Mixed1.js | 1 + .../extractFunction_VariableDeclaration_Writes_Mixed1.ts | 1 + .../extractFunction_VariableDeclaration_Writes_Mixed2.js | 1 + .../extractFunction_VariableDeclaration_Writes_Mixed2.ts | 1 + .../extractFunction_VariableDeclaration_Writes_Mixed3.ts | 1 + ...ractFunction_VariableDeclaration_Writes_UnionUndefined.ts | 1 + .../extractFunction_VariableDeclaration_Writes_Var.js | 1 + .../extractFunction_VariableDeclaration_Writes_Var.ts | 1 + tests/cases/fourslash/extract-method-empty-namespace.ts | 1 + tests/cases/fourslash/extract-method-formatting.ts | 1 + tests/cases/fourslash/extract-method-uniqueName.ts | 1 + tests/cases/fourslash/extract-method10.ts | 1 + tests/cases/fourslash/extract-method14.ts | 1 + tests/cases/fourslash/extract-method15.ts | 1 + tests/cases/fourslash/extract-method18.ts | 1 + tests/cases/fourslash/extract-method2.ts | 1 + tests/cases/fourslash/extract-method24.ts | 1 + tests/cases/fourslash/extract-method7.ts | 1 + 71 files changed, 74 insertions(+), 2 deletions(-) diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts index 40be5e02eea..4929cbfbaa5 100644 --- a/src/harness/unittests/tsserverProjectSystem.ts +++ b/src/harness/unittests/tsserverProjectSystem.ts @@ -4526,7 +4526,7 @@ namespace ts.projectSystem { { start: { line: 3, offset: 2 }, end: { line: 3, offset: 2 }, - newText: "\nfunction newFunction() {\n 1;\n}\n", + newText: "\n\nfunction newFunction() {\n 1;\n}\n", }, ] } diff --git a/src/services/refactors/extractSymbol.ts b/src/services/refactors/extractSymbol.ts index 715b42b6bc8..ebe0cb4fa44 100644 --- a/src/services/refactors/extractSymbol.ts +++ b/src/services/refactors/extractSymbol.ts @@ -785,7 +785,10 @@ namespace ts.refactor.extractSymbol { changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newFunction, { suffix: context.newLineCharacter + context.newLineCharacter }); } else { - changeTracker.insertNodeBefore(context.file, scope.getLastToken(), newFunction, { prefix: context.newLineCharacter, suffix: context.newLineCharacter }); + changeTracker.insertNodeBefore(context.file, scope.getLastToken(), newFunction, { + prefix: isLineBreak(file.text.charCodeAt(scope.getLastToken().pos)) ? context.newLineCharacter : context.newLineCharacter + context.newLineCharacter, + suffix: context.newLineCharacter + }); } const newNodes: Node[] = []; diff --git a/tests/baselines/reference/extractFunction/extractFunction1.ts b/tests/baselines/reference/extractFunction/extractFunction1.ts index 8243644e1ef..4b0b7dd9f2e 100644 --- a/tests/baselines/reference/extractFunction/extractFunction1.ts +++ b/tests/baselines/reference/extractFunction/extractFunction1.ts @@ -89,6 +89,7 @@ namespace A { } } } + function newFunction(x: number, a: number, foo: () => void) { let y = 5; let z = x; diff --git a/tests/baselines/reference/extractFunction/extractFunction10.ts b/tests/baselines/reference/extractFunction/extractFunction10.ts index a15381c1a18..99651f03e88 100644 --- a/tests/baselines/reference/extractFunction/extractFunction10.ts +++ b/tests/baselines/reference/extractFunction/extractFunction10.ts @@ -49,6 +49,7 @@ namespace A { } } } + function newFunction() { let a1: A.I = { x: 1 }; return a1.x + 10; diff --git a/tests/baselines/reference/extractFunction/extractFunction11.ts b/tests/baselines/reference/extractFunction/extractFunction11.ts index 4bb88123a2f..baca3914b03 100644 --- a/tests/baselines/reference/extractFunction/extractFunction11.ts +++ b/tests/baselines/reference/extractFunction/extractFunction11.ts @@ -61,6 +61,7 @@ namespace A { } } } + function newFunction(y: number, z: number) { let a1 = { x: 1 }; y = 10; diff --git a/tests/baselines/reference/extractFunction/extractFunction13.ts b/tests/baselines/reference/extractFunction/extractFunction13.ts index 662701ebf41..e39476160c5 100644 --- a/tests/baselines/reference/extractFunction/extractFunction13.ts +++ b/tests/baselines/reference/extractFunction/extractFunction13.ts @@ -66,6 +66,7 @@ } } } + function newFunction(t1a: T1a, t2a: T2a, u1a: U1a, u2a: U2a, u3a: U3a) { t1a.toString(); t2a.toString(); diff --git a/tests/baselines/reference/extractFunction/extractFunction14.ts b/tests/baselines/reference/extractFunction/extractFunction14.ts index 53cabbe600f..86f8c9b5b63 100644 --- a/tests/baselines/reference/extractFunction/extractFunction14.ts +++ b/tests/baselines/reference/extractFunction/extractFunction14.ts @@ -33,6 +33,7 @@ function F(t1: T) { /*RENAME*/newFunction(t1, t2); } } + function newFunction(t1: T, t2: T) { t1.toString(); t2.toString(); diff --git a/tests/baselines/reference/extractFunction/extractFunction15.ts b/tests/baselines/reference/extractFunction/extractFunction15.ts index a09383282aa..3b291f4d86c 100644 --- a/tests/baselines/reference/extractFunction/extractFunction15.ts +++ b/tests/baselines/reference/extractFunction/extractFunction15.ts @@ -30,6 +30,7 @@ function F(t1: T) { /*RENAME*/newFunction(t2); } } + function newFunction(t2: U) { t2.toString(); } diff --git a/tests/baselines/reference/extractFunction/extractFunction16.ts b/tests/baselines/reference/extractFunction/extractFunction16.ts index 79c72f31198..5800fa6945b 100644 --- a/tests/baselines/reference/extractFunction/extractFunction16.ts +++ b/tests/baselines/reference/extractFunction/extractFunction16.ts @@ -14,6 +14,7 @@ function F() { function F() { const array: T[] = /*RENAME*/newFunction(); } + function newFunction(): T[] { return []; } diff --git a/tests/baselines/reference/extractFunction/extractFunction17.ts b/tests/baselines/reference/extractFunction/extractFunction17.ts index 733b1b27623..45d9953fb95 100644 --- a/tests/baselines/reference/extractFunction/extractFunction17.ts +++ b/tests/baselines/reference/extractFunction/extractFunction17.ts @@ -20,6 +20,7 @@ class C { /*RENAME*/newFunction(t1); } } + function newFunction(t1: T1) { t1.toString(); } diff --git a/tests/baselines/reference/extractFunction/extractFunction18.ts b/tests/baselines/reference/extractFunction/extractFunction18.ts index 8c44de12981..bdfcce6bbdc 100644 --- a/tests/baselines/reference/extractFunction/extractFunction18.ts +++ b/tests/baselines/reference/extractFunction/extractFunction18.ts @@ -20,6 +20,7 @@ class C { /*RENAME*/newFunction(t1); } } + function newFunction(t1: T1) { t1.toString(); } diff --git a/tests/baselines/reference/extractFunction/extractFunction19.ts b/tests/baselines/reference/extractFunction/extractFunction19.ts index 3a2723513f4..0b3192a49fb 100644 --- a/tests/baselines/reference/extractFunction/extractFunction19.ts +++ b/tests/baselines/reference/extractFunction/extractFunction19.ts @@ -14,6 +14,7 @@ function F(v: V) { function F(v: V) { /*RENAME*/newFunction(v); } + function newFunction(v: V) { v.toString(); } diff --git a/tests/baselines/reference/extractFunction/extractFunction2.ts b/tests/baselines/reference/extractFunction/extractFunction2.ts index 3872812b312..be72a7fd52f 100644 --- a/tests/baselines/reference/extractFunction/extractFunction2.ts +++ b/tests/baselines/reference/extractFunction/extractFunction2.ts @@ -78,6 +78,7 @@ namespace A { } } } + function newFunction(x: number, foo: () => void) { let y = 5; let z = x; diff --git a/tests/baselines/reference/extractFunction/extractFunction20.js b/tests/baselines/reference/extractFunction/extractFunction20.js index b65d3dae5da..17bef1c6044 100644 --- a/tests/baselines/reference/extractFunction/extractFunction20.js +++ b/tests/baselines/reference/extractFunction/extractFunction20.js @@ -22,6 +22,7 @@ const _ = class { return /*RENAME*/newFunction(); } } + function newFunction() { let a1 = { x: 1 }; return a1.x + 10; diff --git a/tests/baselines/reference/extractFunction/extractFunction20.ts b/tests/baselines/reference/extractFunction/extractFunction20.ts index 1fe72020ad7..ce09d4457d3 100644 --- a/tests/baselines/reference/extractFunction/extractFunction20.ts +++ b/tests/baselines/reference/extractFunction/extractFunction20.ts @@ -22,6 +22,7 @@ const _ = class { return /*RENAME*/newFunction(); } } + function newFunction() { let a1 = { x: 1 }; return a1.x + 10; diff --git a/tests/baselines/reference/extractFunction/extractFunction21.js b/tests/baselines/reference/extractFunction/extractFunction21.js index 4454f36ac62..08c4512fee7 100644 --- a/tests/baselines/reference/extractFunction/extractFunction21.js +++ b/tests/baselines/reference/extractFunction/extractFunction21.js @@ -20,6 +20,7 @@ function foo() { x = /*RENAME*/newFunction(x); return; } + function newFunction(x) { x++; return x; diff --git a/tests/baselines/reference/extractFunction/extractFunction21.ts b/tests/baselines/reference/extractFunction/extractFunction21.ts index 530a10bea95..4adb05f3bf1 100644 --- a/tests/baselines/reference/extractFunction/extractFunction21.ts +++ b/tests/baselines/reference/extractFunction/extractFunction21.ts @@ -20,6 +20,7 @@ function foo() { x = /*RENAME*/newFunction(x); return; } + function newFunction(x: number) { x++; return x; diff --git a/tests/baselines/reference/extractFunction/extractFunction22.js b/tests/baselines/reference/extractFunction/extractFunction22.js index 60891105c6e..0fb69c87b04 100644 --- a/tests/baselines/reference/extractFunction/extractFunction22.js +++ b/tests/baselines/reference/extractFunction/extractFunction22.js @@ -26,6 +26,7 @@ function test() { return /*RENAME*/newFunction(); } } + function newFunction() { return 1; } diff --git a/tests/baselines/reference/extractFunction/extractFunction22.ts b/tests/baselines/reference/extractFunction/extractFunction22.ts index 60891105c6e..0fb69c87b04 100644 --- a/tests/baselines/reference/extractFunction/extractFunction22.ts +++ b/tests/baselines/reference/extractFunction/extractFunction22.ts @@ -26,6 +26,7 @@ function test() { return /*RENAME*/newFunction(); } } + function newFunction() { return 1; } diff --git a/tests/baselines/reference/extractFunction/extractFunction23.ts b/tests/baselines/reference/extractFunction/extractFunction23.ts index 3092d6490ba..b3730a5b54f 100644 --- a/tests/baselines/reference/extractFunction/extractFunction23.ts +++ b/tests/baselines/reference/extractFunction/extractFunction23.ts @@ -38,6 +38,7 @@ namespace NS { } function M3() { } } + function newFunction() { return 1; } diff --git a/tests/baselines/reference/extractFunction/extractFunction24.js b/tests/baselines/reference/extractFunction/extractFunction24.js index dbac567afc6..2c1d353f51a 100644 --- a/tests/baselines/reference/extractFunction/extractFunction24.js +++ b/tests/baselines/reference/extractFunction/extractFunction24.js @@ -38,6 +38,7 @@ function Outer() { } function M3() { } } + function newFunction() { return 1; } diff --git a/tests/baselines/reference/extractFunction/extractFunction24.ts b/tests/baselines/reference/extractFunction/extractFunction24.ts index dbac567afc6..2c1d353f51a 100644 --- a/tests/baselines/reference/extractFunction/extractFunction24.ts +++ b/tests/baselines/reference/extractFunction/extractFunction24.ts @@ -38,6 +38,7 @@ function Outer() { } function M3() { } } + function newFunction() { return 1; } diff --git a/tests/baselines/reference/extractFunction/extractFunction26.js b/tests/baselines/reference/extractFunction/extractFunction26.js index c05af641d4b..2c821c05ad1 100644 --- a/tests/baselines/reference/extractFunction/extractFunction26.js +++ b/tests/baselines/reference/extractFunction/extractFunction26.js @@ -26,6 +26,7 @@ class C { } M3() { } } + function newFunction() { return 1; } diff --git a/tests/baselines/reference/extractFunction/extractFunction26.ts b/tests/baselines/reference/extractFunction/extractFunction26.ts index 37eba24bfde..300686c12ab 100644 --- a/tests/baselines/reference/extractFunction/extractFunction26.ts +++ b/tests/baselines/reference/extractFunction/extractFunction26.ts @@ -26,6 +26,7 @@ class C { } M3() { } } + function newFunction() { return 1; } diff --git a/tests/baselines/reference/extractFunction/extractFunction27.js b/tests/baselines/reference/extractFunction/extractFunction27.js index 96bca6b24c5..702127b9d76 100644 --- a/tests/baselines/reference/extractFunction/extractFunction27.js +++ b/tests/baselines/reference/extractFunction/extractFunction27.js @@ -29,6 +29,7 @@ class C { constructor() { } M3() { } } + function newFunction() { return 1; } diff --git a/tests/baselines/reference/extractFunction/extractFunction27.ts b/tests/baselines/reference/extractFunction/extractFunction27.ts index 335d74e002d..1acbe67707a 100644 --- a/tests/baselines/reference/extractFunction/extractFunction27.ts +++ b/tests/baselines/reference/extractFunction/extractFunction27.ts @@ -29,6 +29,7 @@ class C { constructor() { } M3() { } } + function newFunction() { return 1; } diff --git a/tests/baselines/reference/extractFunction/extractFunction28.js b/tests/baselines/reference/extractFunction/extractFunction28.js index a82b864448d..cf0742626dd 100644 --- a/tests/baselines/reference/extractFunction/extractFunction28.js +++ b/tests/baselines/reference/extractFunction/extractFunction28.js @@ -29,6 +29,7 @@ class C { M3() { } constructor() { } } + function newFunction() { return 1; } diff --git a/tests/baselines/reference/extractFunction/extractFunction28.ts b/tests/baselines/reference/extractFunction/extractFunction28.ts index bde2661f934..f15d7956f1c 100644 --- a/tests/baselines/reference/extractFunction/extractFunction28.ts +++ b/tests/baselines/reference/extractFunction/extractFunction28.ts @@ -29,6 +29,7 @@ class C { M3() { } constructor() { } } + function newFunction() { return 1; } diff --git a/tests/baselines/reference/extractFunction/extractFunction3.ts b/tests/baselines/reference/extractFunction/extractFunction3.ts index 9c4c1aaa9d7..7a481e76cfa 100644 --- a/tests/baselines/reference/extractFunction/extractFunction3.ts +++ b/tests/baselines/reference/extractFunction/extractFunction3.ts @@ -73,6 +73,7 @@ namespace A { } } } + function* newFunction(z: number, foo: () => void) { let y = 5; yield z; diff --git a/tests/baselines/reference/extractFunction/extractFunction30.ts b/tests/baselines/reference/extractFunction/extractFunction30.ts index b57b48c30a9..f90548c333c 100644 --- a/tests/baselines/reference/extractFunction/extractFunction30.ts +++ b/tests/baselines/reference/extractFunction/extractFunction30.ts @@ -14,6 +14,7 @@ function F() { function F() { /*RENAME*/newFunction(); } + function newFunction() { let t: T; } diff --git a/tests/baselines/reference/extractFunction/extractFunction31.ts b/tests/baselines/reference/extractFunction/extractFunction31.ts index d7252a14011..2dea17689b6 100644 --- a/tests/baselines/reference/extractFunction/extractFunction31.ts +++ b/tests/baselines/reference/extractFunction/extractFunction31.ts @@ -37,6 +37,7 @@ namespace N { f = /*RENAME*/newFunction(f); } } + function newFunction(f: () => number) { f = function(): number { return N.value; diff --git a/tests/baselines/reference/extractFunction/extractFunction32.ts b/tests/baselines/reference/extractFunction/extractFunction32.ts index 4070763b79f..720d0b227b0 100644 --- a/tests/baselines/reference/extractFunction/extractFunction32.ts +++ b/tests/baselines/reference/extractFunction/extractFunction32.ts @@ -37,6 +37,7 @@ namespace N { /*RENAME*/newFunction(); } } + function newFunction() { var c = class { M() { diff --git a/tests/baselines/reference/extractFunction/extractFunction33.js b/tests/baselines/reference/extractFunction/extractFunction33.js index 46c0f176b56..cc027a14b6c 100644 --- a/tests/baselines/reference/extractFunction/extractFunction33.js +++ b/tests/baselines/reference/extractFunction/extractFunction33.js @@ -14,6 +14,7 @@ function F() { function F() { /*RENAME*/newFunction(); } + function newFunction() { function G() { } } diff --git a/tests/baselines/reference/extractFunction/extractFunction33.ts b/tests/baselines/reference/extractFunction/extractFunction33.ts index 46c0f176b56..cc027a14b6c 100644 --- a/tests/baselines/reference/extractFunction/extractFunction33.ts +++ b/tests/baselines/reference/extractFunction/extractFunction33.ts @@ -14,6 +14,7 @@ function F() { function F() { /*RENAME*/newFunction(); } + function newFunction() { function G() { } } diff --git a/tests/baselines/reference/extractFunction/extractFunction4.ts b/tests/baselines/reference/extractFunction/extractFunction4.ts index 4108976b6b3..46aad65c68c 100644 --- a/tests/baselines/reference/extractFunction/extractFunction4.ts +++ b/tests/baselines/reference/extractFunction/extractFunction4.ts @@ -81,6 +81,7 @@ namespace A { } } } + async function newFunction(z: number, z1: any, foo: () => void) { let y = 5; if (z) { diff --git a/tests/baselines/reference/extractFunction/extractFunction5.ts b/tests/baselines/reference/extractFunction/extractFunction5.ts index 3122ba24553..085a73fdf93 100644 --- a/tests/baselines/reference/extractFunction/extractFunction5.ts +++ b/tests/baselines/reference/extractFunction/extractFunction5.ts @@ -89,6 +89,7 @@ namespace A { } } } + function newFunction(x: number, a: number) { let y = 5; let z = x; diff --git a/tests/baselines/reference/extractFunction/extractFunction6.ts b/tests/baselines/reference/extractFunction/extractFunction6.ts index a01cb25e061..613635c658a 100644 --- a/tests/baselines/reference/extractFunction/extractFunction6.ts +++ b/tests/baselines/reference/extractFunction/extractFunction6.ts @@ -93,6 +93,7 @@ namespace A { } } } + function newFunction(x: number, a: number) { let y = 5; let z = x; diff --git a/tests/baselines/reference/extractFunction/extractFunction7.ts b/tests/baselines/reference/extractFunction/extractFunction7.ts index 4111558904c..0f57a0cfba8 100644 --- a/tests/baselines/reference/extractFunction/extractFunction7.ts +++ b/tests/baselines/reference/extractFunction/extractFunction7.ts @@ -103,6 +103,7 @@ namespace A { } } } + function newFunction(x: number, a: number) { let y = 5; let z = x; diff --git a/tests/baselines/reference/extractFunction/extractFunction9.ts b/tests/baselines/reference/extractFunction/extractFunction9.ts index 7db12096cbc..3df391c1fae 100644 --- a/tests/baselines/reference/extractFunction/extractFunction9.ts +++ b/tests/baselines/reference/extractFunction/extractFunction9.ts @@ -59,6 +59,7 @@ namespace A { } } } + function newFunction() { let a1: A.I = { x: 1 }; return a1.x + 10; diff --git a/tests/baselines/reference/extractFunction/extractFunction_PreserveTrivia.js b/tests/baselines/reference/extractFunction/extractFunction_PreserveTrivia.js index b5e4bc76c6e..b10a04e9ef0 100644 --- a/tests/baselines/reference/extractFunction/extractFunction_PreserveTrivia.js +++ b/tests/baselines/reference/extractFunction/extractFunction_PreserveTrivia.js @@ -12,6 +12,7 @@ var q = /*b*/ //c var q = /*b*/ //c /*d*/ /*RENAME*/newFunction() /*k*/ //l /*m*/; /*n*/ //o + function newFunction() { return 1 /*e*/ //f /*g*/ + /*h*/ //i diff --git a/tests/baselines/reference/extractFunction/extractFunction_PreserveTrivia.ts b/tests/baselines/reference/extractFunction/extractFunction_PreserveTrivia.ts index b5e4bc76c6e..b10a04e9ef0 100644 --- a/tests/baselines/reference/extractFunction/extractFunction_PreserveTrivia.ts +++ b/tests/baselines/reference/extractFunction/extractFunction_PreserveTrivia.ts @@ -12,6 +12,7 @@ var q = /*b*/ //c var q = /*b*/ //c /*d*/ /*RENAME*/newFunction() /*k*/ //l /*m*/; /*n*/ //o + function newFunction() { return 1 /*e*/ //f /*g*/ + /*h*/ //i diff --git a/tests/baselines/reference/extractFunction/extractFunction_RepeatedSubstitution.ts b/tests/baselines/reference/extractFunction/extractFunction_RepeatedSubstitution.ts index 68cc7d2248a..52ccce68059 100644 --- a/tests/baselines/reference/extractFunction/extractFunction_RepeatedSubstitution.ts +++ b/tests/baselines/reference/extractFunction/extractFunction_RepeatedSubstitution.ts @@ -17,6 +17,7 @@ namespace X { export const j = 10; export const y = /*RENAME*/newFunction(); } + function newFunction() { return X.j * X.j; } diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_ShorthandProperty.js b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_ShorthandProperty.js index 67b4f64290c..e8250613625 100644 --- a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_ShorthandProperty.js +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_ShorthandProperty.js @@ -21,6 +21,7 @@ function f() { let x = /*RENAME*/newFunction(); return { x }; } + function newFunction() { let x; return x; diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_ShorthandProperty.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_ShorthandProperty.ts index 67b4f64290c..e8250613625 100644 --- a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_ShorthandProperty.ts +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_ShorthandProperty.ts @@ -21,6 +21,7 @@ function f() { let x = /*RENAME*/newFunction(); return { x }; } + function newFunction() { let x; return x; diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Const_NoType.js b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Const_NoType.js index 1da5a568333..a8629d2907c 100644 --- a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Const_NoType.js +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Const_NoType.js @@ -27,6 +27,7 @@ function f() { ({ x, a } = /*RENAME*/newFunction(a)); a; x; } + function newFunction(a) { const x = 1; a++; diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Const_NoType.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Const_NoType.ts index f93f43ceebf..c70dbe95c7b 100644 --- a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Const_NoType.ts +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Const_NoType.ts @@ -27,6 +27,7 @@ function f() { ({ x, a } = /*RENAME*/newFunction(a)); a; x; } + function newFunction(a: number) { const x = 1; a++; diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Const_Type.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Const_Type.ts index ec846f7f288..3c0912061aa 100644 --- a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Const_Type.ts +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Const_Type.ts @@ -27,6 +27,7 @@ function f() { ({ x, a } = /*RENAME*/newFunction(a)); a; x; } + function newFunction(a: number) { const x: number = 1; a++; diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_LiteralType1.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_LiteralType1.ts index 50bad34efce..06de0fd4f36 100644 --- a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_LiteralType1.ts +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_LiteralType1.ts @@ -27,6 +27,7 @@ function f() { ({ x, a } = /*RENAME*/newFunction(a)); a; x; } + function newFunction(a: number) { let x: 0o10 | 10 | 0b10 = 10; a++; diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_LiteralType2.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_LiteralType2.ts index 2df8ab67e9f..4679b89f068 100644 --- a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_LiteralType2.ts +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_LiteralType2.ts @@ -27,6 +27,7 @@ function f() { ({ x, a } = /*RENAME*/newFunction(a)); a; x; } + function newFunction(a: number) { let x: "a" | 'b' = 'a'; a++; diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_NoType.js b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_NoType.js index 2f298c8719f..a86870d72a3 100644 --- a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_NoType.js +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_NoType.js @@ -27,6 +27,7 @@ function f() { ({ x, a } = /*RENAME*/newFunction(a)); a; x; } + function newFunction(a) { let x = 1; a++; diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_NoType.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_NoType.ts index e4afefa9da6..9b711765c95 100644 --- a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_NoType.ts +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_NoType.ts @@ -27,6 +27,7 @@ function f() { ({ x, a } = /*RENAME*/newFunction(a)); a; x; } + function newFunction(a: number) { let x = 1; a++; diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_Type.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_Type.ts index 795effbeb7e..652faab4890 100644 --- a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_Type.ts +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_Type.ts @@ -27,6 +27,7 @@ function f() { ({ x, a } = /*RENAME*/newFunction(a)); a; x; } + function newFunction(a: number) { let x: number = 1; a++; diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_TypeWithComments.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_TypeWithComments.ts index 53599c26d08..71c4d9b79ff 100644 --- a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_TypeWithComments.ts +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Let_TypeWithComments.ts @@ -27,6 +27,7 @@ function f() { ({ x, a } = /*RENAME*/newFunction(a)); a; x; } + function newFunction(a: number) { let x: /*A*/ "a" /*B*/ | /*C*/ 'b' /*D*/ = 'a'; a++; diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed1.js b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed1.js index c36557847f7..5de10b2cf76 100644 --- a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed1.js +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed1.js @@ -30,6 +30,7 @@ function f() { ({ x, y, a } = /*RENAME*/newFunction(a)); a; x; y; } + function newFunction(a) { const x = 1; let y = 2; diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed1.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed1.ts index eaeb781bc48..d4da8ffca7b 100644 --- a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed1.ts +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed1.ts @@ -30,6 +30,7 @@ function f() { ({ x, y, a } = /*RENAME*/newFunction(a)); a; x; y; } + function newFunction(a: number) { const x = 1; let y = 2; diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed2.js b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed2.js index 2d1151a549c..e1526a77ffd 100644 --- a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed2.js +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed2.js @@ -30,6 +30,7 @@ function f() { ({ x, y, a } = /*RENAME*/newFunction(a)); a; x; y; } + function newFunction(a) { var x = 1; let y = 2; diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed2.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed2.ts index 9466b5dc37f..ec3d62c039b 100644 --- a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed2.ts +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed2.ts @@ -30,6 +30,7 @@ function f() { ({ x, y, a } = /*RENAME*/newFunction(a)); a; x; y; } + function newFunction(a: number) { var x = 1; let y = 2; diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed3.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed3.ts index 604d2a33c43..b2c53e3f160 100644 --- a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed3.ts +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Mixed3.ts @@ -30,6 +30,7 @@ function f() { ({ x, y, a } = /*RENAME*/newFunction(a)); a; x; y; } + function newFunction(a: number) { let x: number = 1; let y = 2; diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_UnionUndefined.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_UnionUndefined.ts index 0cf71e45e28..b76bf6c4999 100644 --- a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_UnionUndefined.ts +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_UnionUndefined.ts @@ -33,6 +33,7 @@ function f() { ({ x, y, z, a } = /*RENAME*/newFunction(a)); a; x; y; z; } + function newFunction(a: number) { let x: number | undefined = 1; let y: undefined | number = 2; diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Var.js b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Var.js index 25e910713d8..6a7b821e5b1 100644 --- a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Var.js +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Var.js @@ -27,6 +27,7 @@ function f() { ({ x, a } = /*RENAME*/newFunction(a)); a; x; } + function newFunction(a) { var x = 1; a++; diff --git a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Var.ts b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Var.ts index e215e3d0978..e9cbe7ad345 100644 --- a/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Var.ts +++ b/tests/baselines/reference/extractFunction/extractFunction_VariableDeclaration_Writes_Var.ts @@ -27,6 +27,7 @@ function f() { ({ x, a } = /*RENAME*/newFunction(a)); a; x; } + function newFunction(a: number) { var x = 1; a++; diff --git a/tests/cases/fourslash/extract-method-empty-namespace.ts b/tests/cases/fourslash/extract-method-empty-namespace.ts index bef4cdd12fe..1655efccbb8 100644 --- a/tests/cases/fourslash/extract-method-empty-namespace.ts +++ b/tests/cases/fourslash/extract-method-empty-namespace.ts @@ -12,6 +12,7 @@ edit.applyRefactor({ newContent: `function f() { /*RENAME*/newFunction(); } + function newFunction() { namespace N { } } diff --git a/tests/cases/fourslash/extract-method-formatting.ts b/tests/cases/fourslash/extract-method-formatting.ts index d4c2836e815..d1f550f794e 100644 --- a/tests/cases/fourslash/extract-method-formatting.ts +++ b/tests/cases/fourslash/extract-method-formatting.ts @@ -13,6 +13,7 @@ edit.applyRefactor({ newContent: `function f(x: number): number { return /*RENAME*/newFunction(x); } + function newFunction(x: number) { switch (x) { case 0: diff --git a/tests/cases/fourslash/extract-method-uniqueName.ts b/tests/cases/fourslash/extract-method-uniqueName.ts index da4c68cfb7e..a02b2c5ec96 100644 --- a/tests/cases/fourslash/extract-method-uniqueName.ts +++ b/tests/cases/fourslash/extract-method-uniqueName.ts @@ -13,6 +13,7 @@ edit.applyRefactor({ newContent: `// newFunction /*RENAME*/newFunction_1(); + function newFunction_1() { 1 + 1; } diff --git a/tests/cases/fourslash/extract-method10.ts b/tests/cases/fourslash/extract-method10.ts index ed92e6b06ac..d2b9aeb0123 100644 --- a/tests/cases/fourslash/extract-method10.ts +++ b/tests/cases/fourslash/extract-method10.ts @@ -11,6 +11,7 @@ edit.applyRefactor({ newContent: `export {}; // Make this a module (x => x)(/*RENAME*/newFunction())(1); + function newFunction(): (x: any) => any { return x => x; } diff --git a/tests/cases/fourslash/extract-method14.ts b/tests/cases/fourslash/extract-method14.ts index ddfd8cbcbd6..11ea1f1b3fd 100644 --- a/tests/cases/fourslash/extract-method14.ts +++ b/tests/cases/fourslash/extract-method14.ts @@ -22,6 +22,7 @@ edit.applyRefactor({ ({ __return, i } = /*RENAME*/newFunction(i)); return __return; } + function newFunction(i) { return { __return: i++, i }; } diff --git a/tests/cases/fourslash/extract-method15.ts b/tests/cases/fourslash/extract-method15.ts index e46ff39ad6a..1b33a46b9a4 100644 --- a/tests/cases/fourslash/extract-method15.ts +++ b/tests/cases/fourslash/extract-method15.ts @@ -18,6 +18,7 @@ edit.applyRefactor({ var i = 10; i = /*RENAME*/newFunction(i); } + function newFunction(i: number) { i++; return i; diff --git a/tests/cases/fourslash/extract-method18.ts b/tests/cases/fourslash/extract-method18.ts index d53e79f4930..0a488a04106 100644 --- a/tests/cases/fourslash/extract-method18.ts +++ b/tests/cases/fourslash/extract-method18.ts @@ -18,6 +18,7 @@ edit.applyRefactor({ const x = { m: 1 }; /*RENAME*/newFunction(x); } + function newFunction(x: { m: number; }) { x.m = 3; } diff --git a/tests/cases/fourslash/extract-method2.ts b/tests/cases/fourslash/extract-method2.ts index 7f197d4775b..419d6379075 100644 --- a/tests/cases/fourslash/extract-method2.ts +++ b/tests/cases/fourslash/extract-method2.ts @@ -24,6 +24,7 @@ edit.applyRefactor({ } } } + function newFunction(m: number, j: string, k: { x: string; }) { return m + j + k; } diff --git a/tests/cases/fourslash/extract-method24.ts b/tests/cases/fourslash/extract-method24.ts index 8c750edd9f9..66ca5ecb227 100644 --- a/tests/cases/fourslash/extract-method24.ts +++ b/tests/cases/fourslash/extract-method24.ts @@ -17,6 +17,7 @@ edit.applyRefactor({ let x = 0; console.log(/*RENAME*/newFunction(a, x)); } + function newFunction(a: number[], x: number): any { return a[x]; } diff --git a/tests/cases/fourslash/extract-method7.ts b/tests/cases/fourslash/extract-method7.ts index 2998b6bbee3..38bc86cb5dc 100644 --- a/tests/cases/fourslash/extract-method7.ts +++ b/tests/cases/fourslash/extract-method7.ts @@ -14,6 +14,7 @@ edit.applyRefactor({ newContent: `function fn(x = /*RENAME*/newFunction()) { } + function newFunction() { return 3; } From de0e475c64a5dbba72d22c0edf6ce5552a5a0ebe Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 12 Oct 2017 15:05:04 -0700 Subject: [PATCH 137/137] Recreate old decorator metadata behavior (#19089) * Emulate pre 2.4 metadata behavior of eliding null and undefined from unions without strictNullChecks * Accept baseline * Update comment * Update for second old baseline * Respect strict --- src/compiler/transformers/ts.ts | 14 ++++++-- .../decoratorMetadataNoStrictNull.js | 32 +++++++++++++++++++ .../decoratorMetadataNoStrictNull.symbols | 18 +++++++++++ .../decoratorMetadataNoStrictNull.types | 20 ++++++++++++ .../reference/metadataOfClassFromAlias.js | 2 +- .../reference/metadataOfUnionWithNull.js | 16 +++++----- .../compiler/decoratorMetadataNoStrictNull.ts | 8 +++++ 7 files changed, 99 insertions(+), 11 deletions(-) create mode 100644 tests/baselines/reference/decoratorMetadataNoStrictNull.js create mode 100644 tests/baselines/reference/decoratorMetadataNoStrictNull.symbols create mode 100644 tests/baselines/reference/decoratorMetadataNoStrictNull.types create mode 100644 tests/cases/compiler/decoratorMetadataNoStrictNull.ts diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts index e67918fd696..ba4b5fcdf52 100644 --- a/src/compiler/transformers/ts.ts +++ b/src/compiler/transformers/ts.ts @@ -45,6 +45,7 @@ namespace ts { const resolver = context.getEmitResolver(); const compilerOptions = context.getCompilerOptions(); + const strictNullChecks = typeof compilerOptions.strictNullChecks === "undefined" ? compilerOptions.strict : compilerOptions.strictNullChecks; const languageVersion = getEmitScriptTarget(compilerOptions); const moduleKind = getEmitModuleKind(compilerOptions); @@ -1869,7 +1870,16 @@ namespace ts { // Note when updating logic here also update getEntityNameForDecoratorMetadata // so that aliases can be marked as referenced let serializedUnion: SerializedTypeNode; - for (const typeNode of node.types) { + for (let typeNode of node.types) { + while (typeNode.kind === SyntaxKind.ParenthesizedType) { + typeNode = (typeNode as ParenthesizedTypeNode).type; // Skip parens if need be + } + if (typeNode.kind === SyntaxKind.NeverKeyword) { + continue; // Always elide `never` from the union/intersection if possible + } + if (!strictNullChecks && (typeNode.kind === SyntaxKind.NullKeyword || typeNode.kind === SyntaxKind.UndefinedKeyword)) { + continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks + } const serializedIndividual = serializeTypeNode(typeNode); if (isIdentifier(serializedIndividual) && serializedIndividual.escapedText === "Object") { @@ -1893,7 +1903,7 @@ namespace ts { } // If we were able to find common type, use it - return serializedUnion; + return serializedUnion || createVoidZero(); // Fallback is only hit if all union constituients are null/undefined/never } /** diff --git a/tests/baselines/reference/decoratorMetadataNoStrictNull.js b/tests/baselines/reference/decoratorMetadataNoStrictNull.js new file mode 100644 index 00000000000..dada68f0960 --- /dev/null +++ b/tests/baselines/reference/decoratorMetadataNoStrictNull.js @@ -0,0 +1,32 @@ +//// [decoratorMetadataNoStrictNull.ts] +const dec = (obj: {}, prop: string) => undefined + +class Foo { + @dec public foo: string | null; + @dec public bar: string; +} + +//// [decoratorMetadataNoStrictNull.js] +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var dec = function (obj, prop) { return undefined; }; +var Foo = /** @class */ (function () { + function Foo() { + } + __decorate([ + dec, + __metadata("design:type", String) + ], Foo.prototype, "foo"); + __decorate([ + dec, + __metadata("design:type", String) + ], Foo.prototype, "bar"); + return Foo; +}()); diff --git a/tests/baselines/reference/decoratorMetadataNoStrictNull.symbols b/tests/baselines/reference/decoratorMetadataNoStrictNull.symbols new file mode 100644 index 00000000000..32a6d08f024 --- /dev/null +++ b/tests/baselines/reference/decoratorMetadataNoStrictNull.symbols @@ -0,0 +1,18 @@ +=== tests/cases/compiler/decoratorMetadataNoStrictNull.ts === +const dec = (obj: {}, prop: string) => undefined +>dec : Symbol(dec, Decl(decoratorMetadataNoStrictNull.ts, 0, 5)) +>obj : Symbol(obj, Decl(decoratorMetadataNoStrictNull.ts, 0, 13)) +>prop : Symbol(prop, Decl(decoratorMetadataNoStrictNull.ts, 0, 21)) +>undefined : Symbol(undefined) + +class Foo { +>Foo : Symbol(Foo, Decl(decoratorMetadataNoStrictNull.ts, 0, 48)) + + @dec public foo: string | null; +>dec : Symbol(dec, Decl(decoratorMetadataNoStrictNull.ts, 0, 5)) +>foo : Symbol(Foo.foo, Decl(decoratorMetadataNoStrictNull.ts, 2, 11)) + + @dec public bar: string; +>dec : Symbol(dec, Decl(decoratorMetadataNoStrictNull.ts, 0, 5)) +>bar : Symbol(Foo.bar, Decl(decoratorMetadataNoStrictNull.ts, 3, 33)) +} diff --git a/tests/baselines/reference/decoratorMetadataNoStrictNull.types b/tests/baselines/reference/decoratorMetadataNoStrictNull.types new file mode 100644 index 00000000000..981efe6e50b --- /dev/null +++ b/tests/baselines/reference/decoratorMetadataNoStrictNull.types @@ -0,0 +1,20 @@ +=== tests/cases/compiler/decoratorMetadataNoStrictNull.ts === +const dec = (obj: {}, prop: string) => undefined +>dec : (obj: {}, prop: string) => any +>(obj: {}, prop: string) => undefined : (obj: {}, prop: string) => any +>obj : {} +>prop : string +>undefined : undefined + +class Foo { +>Foo : Foo + + @dec public foo: string | null; +>dec : (obj: {}, prop: string) => any +>foo : string +>null : null + + @dec public bar: string; +>dec : (obj: {}, prop: string) => any +>bar : string +} diff --git a/tests/baselines/reference/metadataOfClassFromAlias.js b/tests/baselines/reference/metadataOfClassFromAlias.js index 307702cd7bf..77ae5c33898 100644 --- a/tests/baselines/reference/metadataOfClassFromAlias.js +++ b/tests/baselines/reference/metadataOfClassFromAlias.js @@ -43,7 +43,7 @@ var ClassA = /** @class */ (function () { } __decorate([ annotation(), - __metadata("design:type", Object) + __metadata("design:type", auxiliry_1.SomeClass) ], ClassA.prototype, "array", void 0); return ClassA; }()); diff --git a/tests/baselines/reference/metadataOfUnionWithNull.js b/tests/baselines/reference/metadataOfUnionWithNull.js index 80d24709b73..7bf9aeb8650 100644 --- a/tests/baselines/reference/metadataOfUnionWithNull.js +++ b/tests/baselines/reference/metadataOfUnionWithNull.js @@ -63,15 +63,15 @@ var B = /** @class */ (function () { } __decorate([ PropDeco, - __metadata("design:type", Object) + __metadata("design:type", String) ], B.prototype, "x"); __decorate([ PropDeco, - __metadata("design:type", Object) + __metadata("design:type", Boolean) ], B.prototype, "y"); __decorate([ PropDeco, - __metadata("design:type", Object) + __metadata("design:type", String) ], B.prototype, "z"); __decorate([ PropDeco, @@ -87,11 +87,11 @@ var B = /** @class */ (function () { ], B.prototype, "c"); __decorate([ PropDeco, - __metadata("design:type", Object) + __metadata("design:type", void 0) ], B.prototype, "d"); __decorate([ PropDeco, - __metadata("design:type", Object) + __metadata("design:type", typeof Symbol === "function" ? Symbol : Object) ], B.prototype, "e"); __decorate([ PropDeco, @@ -99,15 +99,15 @@ var B = /** @class */ (function () { ], B.prototype, "f"); __decorate([ PropDeco, - __metadata("design:type", Object) + __metadata("design:type", A) ], B.prototype, "g"); __decorate([ PropDeco, - __metadata("design:type", Object) + __metadata("design:type", B) ], B.prototype, "h"); __decorate([ PropDeco, - __metadata("design:type", Object) + __metadata("design:type", typeof Symbol === "function" ? Symbol : Object) ], B.prototype, "j"); return B; }()); diff --git a/tests/cases/compiler/decoratorMetadataNoStrictNull.ts b/tests/cases/compiler/decoratorMetadataNoStrictNull.ts new file mode 100644 index 00000000000..4ac608ebd74 --- /dev/null +++ b/tests/cases/compiler/decoratorMetadataNoStrictNull.ts @@ -0,0 +1,8 @@ +// @experimentalDecorators: true +// @emitDecoratorMetadata: true +const dec = (obj: {}, prop: string) => undefined + +class Foo { + @dec public foo: string | null; + @dec public bar: string; +} \ No newline at end of file