8000 use import types in nodebuilder for typeof module symbols · microsoft/TypeScript@850bbe0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 850bbe0

Browse files
committed
use import types in nodebuilder for typeof module symbols
1 parent 0be6ce4 commit 850bbe0

File tree

224 files changed

+980
-980
lines changed
  • Some content is hidden

    Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

    224 files changed

    +980
    -980
    lines changed

    tests/baselines/reference/aliasAssignments.errors.txt

    Lines changed: 4 additions & 4 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1,17 +1,17 @@
    1-
    tests/cases/compiler/aliasAssignments_1.ts(3,1): error TS2322: Type '1' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'.
    2-
    tests/cases/compiler/aliasAssignments_1.ts(5,1): error TS2322: Type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"' is not assignable to type 'number'.
    1+
    tests/cases/compiler/aliasAssignments_1.ts(3,1): error TS2322: Type '1' is not assignable to type 'typeof import("tests/cases/compiler/aliasAssignments_moduleA")'.
    2+
    tests/cases/compiler/aliasAssignments_1.ts(5,1): error TS2322: Type 'typeof import("tests/cases/compiler/aliasAssignments_moduleA")' is not assignable to type 'number'.
    33

    44

    55
    ==== tests/cases/compiler/aliasAssignments_1.ts (2 errors) ====
    66
    import moduleA = require("./aliasAssignments_moduleA");
    77
    var x = moduleA;
    88
    x = 1; // Should be error
    99
    ~
    10-
    !!! error TS2322: Type '1' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'.
    10+
    !!! error TS2322: Type '1' is not assignable to type 'typeof import("tests/cases/compiler/aliasAssignments_moduleA")'.
    1111
    var y = 1;
    1212
    y = moduleA; // should be error
    1313
    ~
    14-
    !!! error TS2322: Type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"' is not assignable to type 'number'.
    14+
    !!! error TS2322: Type 'typeof import("tests/cases/compiler/aliasAssignments_moduleA")' is not assignable to type 'number'.
    1515

    1616
    ==== tests/cases/compiler/aliasAssignments_moduleA.ts (0 errors) ====
    1717
    export class someClass {

    tests/baselines/reference/aliasOnMergedModuleInterface.types

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -26,7 +26,7 @@ var x: foo.A = foo.bar("hello"); // foo.A should be ok but foo.bar should be err
    2626

    2727
    === tests/cases/compiler/aliasOnMergedModuleInterface_0.ts ===
    2828
    declare module "foo"
    29-
    >"foo" : typeof "foo"
    29+
    >"foo" : typeof import("foo")
    3030
    {
    3131
    module B {
    3232
    >B : any

    tests/baselines/reference/allowSyntheticDefaultImports10.errors.txt

    Lines changed: 4 additions & 4 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1,15 +1,15 @@
    1-
    tests/cases/compiler/a.ts(2,5): error TS2339: Property 'default' does not exist on type 'typeof "tests/cases/compiler/b"'.
    2-
    tests/cases/compiler/a.ts(3,5): error TS2339: Property 'default' does not exist on type 'typeof "tests/cases/compiler/b"'.
    1+
    tests/cases/compiler/a.ts(2,5): error TS2339: Property 'default' does not exist on type 'typeof import("tests/cases/compiler/b")'.
    2+
    tests/cases/compiler/a.ts(3,5): error TS2339: Property 'default' does not exist on type 'typeof import("tests/cases/compiler/b")'.
    33

    44

    55
    ==== tests/cases/compiler/a.ts (2 errors) ====
    66
    import Foo = require("./b");
    77
    Foo.default.bar();
    88
    ~~~~~~~
    9-
    !!! error TS2339: Property 'default' does not exist on type 'typeof "tests/cases/compiler/b"'.
    9+
    !!! error TS2339: Property 'default' does not exist on type 'typeof import("tests/cases/compiler/b")'.
    1010
    Foo.default.default.foo();
    1111
    ~~~~~~~
    12-
    !!! error TS2339: Property 'default' does not exist on type 'typeof "tests/cases/compiler/b"'.
    12+
    !!! error TS2339: Property 'default' does not exist on type 'typeof import("tests/cases/compiler/b")'.
    1313
    ==== tests/cases/compiler/b.d.ts (0 errors) ====
    1414
    export function foo();
    1515

    tests/baselines/reference/ambientDeclarationsPatterns.types

    Lines changed: 4 additions & 4 deletions
    Original file line numberDiff line numberDiff line change
    @@ -28,30 +28,30 @@ foo(fileText);
    2828

    2929
    === tests/cases/conformance/ambient/declarations.d.ts ===
    3030
    declare module "foo*baz" {
    31-
    >"foo*baz" : typeof "foo*baz"
    31+
    >"foo*baz" : typeof import("foo*baz")
    3232

    3333
    export function foo(s: string): void;
    3434
    >foo : (s: string) => void
    3535
    >s : string
    3636
    }
    3737
    // Augmentations still work
    3838
    declare module "foo*baz" {
    39-
    >"foo*baz" : typeof "foo*baz"
    39+
    >"foo*baz" : typeof import("foo*baz")
    4040

    4141
    export const baz: string;
    4242
    >baz : string
    4343
    }
    4444

    4545
    // Longest prefix wins
    4646
    declare module "foos*" {
    47-
    >"foos*" : typeof "foos*"
    47+
    >"foos*" : typeof import("foos*")
    4848

    4949
    export const foos: string;
    5050
    >foos : string
    5151
    }
    5252

    5353
    declare module "*!text" {
    54-
    >"*!text" : typeof "*!text"
    54+
    >"*!text" : typeof import("*!text")
    5555

    5656
    const x: string;
    5757
    >x : string
    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -1,4 +1,4 @@
    11
    === tests/cases/conformance/ambient/ambientDeclarationsPatterns_tooManyAsterisks.ts ===
    22
    declare module "too*many*asterisks" { }
    3-
    >"too*many*asterisks" : typeof "too*many*asterisks"
    3+
    >"too*many*asterisks" : typeof import("too*many*asterisks")
    44

    tests/baselines/reference/ambientExportDefaultErrors.types

    Lines changed: 3 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -12,7 +12,7 @@ export default 2 + 2;
    1212
    >2 : 2
    1313

    1414
    export as namespace Foo;
    15-
    >Foo : typeof "tests/cases/compiler/foo"
    15+
    >Foo : typeof import("tests/cases/compiler/foo")
    1616

    1717
    === tests/cases/compiler/foo2.d.ts ===
    1818
    export = 2 + 2;
    @@ -26,7 +26,7 @@ export as namespace Foo2;
    2626
    === tests/cases/compiler/indirection.d.ts ===
    2727
    /// <reference path="./foo.d.ts" />
    2828
    declare module "indirect" {
    29-
    >"indirect" : typeof "indirect"
    29+
    >"indirect" : typeof import("indirect")
    3030

    3131
    export default typeof Foo.default;
    3232
    >typeof Foo.default : "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function"
    @@ -38,7 +38,7 @@ declare module "indirect" {
    3838
    === tests/cases/compiler/indirection2.d.ts ===
    3939
    /// <reference path="./foo2.d.ts" />
    4040
    declare module "indirect2" {
    41-
    >"indirect2" : typeof "indirect2"
    41+
    >"indirect2" : typeof import("indirect2")
    4242

    4343
    export = typeof Foo2;
    4444
    >typeof Foo2 : "string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function"

    tests/baselines/reference/ambientExternalModuleInAnotherExternalModule.types

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -6,7 +6,7 @@ export = D;
    66
    >D : D
    77

    88
    declare module "ext" {
    9-
    >"ext" : typeof "ext"
    9+
    >"ext" : typeof import("ext")
    1010

    1111
    export class C { }
    1212
    >C : C

    tests/baselines/reference/ambientExternalModuleInsideNonAmbient.types

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -3,5 +3,5 @@ module M {
    33
    >M : any
    44

    55
    export declare module "M" { }
    6-
    >"M" : typeof "M"
    6+
    >"M" : typeof import("M")
    77
    }

    tests/baselines/reference/ambientExternalModuleMerging.types

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -17,15 +17,15 @@ var y = M.y;
    1717

    1818
    === tests/cases/conformance/ambient/ambientExternalModuleMerging_declare.ts ===
    1919
    declare module "M" {
    20-
    >"M" : typeof "M"
    20+
    >"M" : typeof import("M")
    2121

    2222
    export var x: string;
    2323
    >x : string
    2424
    }
    2525

    2626
    // Merge
    2727
    declare module "M" {
    28-
    >"M" : typeof "M"
    28+
    >"M" : typeof import("M")
    2929

    3030
    export var y: string;
    3131
    >y : string

    tests/baselines/reference/ambientExternalModuleReopen.types

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1,12 +1,12 @@
    11
    === tests/cases/compiler/ambientExternalModuleReopen.ts ===
    22
    declare module "fs" {
    3-
    >"fs" : typeof "fs"
    3+
    >"fs" : typeof import("fs")
    44

    55
    var x: string;
    66
    >x : string
    77
    }
    88
    declare module 'fs' {
    9-
    >'fs' : typeof "fs"
    9+
    >'fs' : typeof import("fs")
    1010

    1111
    var y: number;
    1212
    >y : number

    0 commit comments

    Comments
     (0)
    0