mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Update PR
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
//// [tests/cases/conformance/es2018/dynamicImport/importCallExpression3ES2018.ts] ////
|
||||
|
||||
//// [0.ts]
|
||||
export class B {
|
||||
print() { return "I am B"}
|
||||
}
|
||||
|
||||
//// [2.ts]
|
||||
async function foo() {
|
||||
class C extends (await import("./0")).B {}
|
||||
var c = new C();
|
||||
c.print();
|
||||
}
|
||||
foo();
|
||||
|
||||
//// [0.js]
|
||||
export class B {
|
||||
print() { return "I am B"; }
|
||||
}
|
||||
//// [2.js]
|
||||
async function foo() {
|
||||
class C extends (await import("./0")).B {
|
||||
}
|
||||
var c = new C();
|
||||
c.print();
|
||||
}
|
||||
foo();
|
||||
@@ -0,0 +1,29 @@
|
||||
=== tests/cases/conformance/es2018/dynamicImport/0.ts ===
|
||||
export class B {
|
||||
>B : Symbol(B, Decl(0.ts, 0, 0))
|
||||
|
||||
print() { return "I am B"}
|
||||
>print : Symbol(B.print, Decl(0.ts, 0, 16))
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/es2018/dynamicImport/2.ts ===
|
||||
async function foo() {
|
||||
>foo : Symbol(foo, Decl(2.ts, 0, 0))
|
||||
|
||||
class C extends (await import("./0")).B {}
|
||||
>C : Symbol(C, Decl(2.ts, 0, 22))
|
||||
>(await import("./0")).B : Symbol(B, Decl(0.ts, 0, 0))
|
||||
>B : Symbol(B, Decl(0.ts, 0, 0))
|
||||
|
||||
var c = new C();
|
||||
>c : Symbol(c, Decl(2.ts, 2, 7))
|
||||
>C : Symbol(C, Decl(2.ts, 0, 22))
|
||||
|
||||
c.print();
|
||||
>c.print : Symbol(B.print, Decl(0.ts, 0, 16))
|
||||
>c : Symbol(c, Decl(2.ts, 2, 7))
|
||||
>print : Symbol(B.print, Decl(0.ts, 0, 16))
|
||||
}
|
||||
foo();
|
||||
>foo : Symbol(foo, Decl(2.ts, 0, 0))
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
=== tests/cases/conformance/es2018/dynamicImport/0.ts ===
|
||||
export class B {
|
||||
>B : B
|
||||
|
||||
print() { return "I am B"}
|
||||
>print : () => string
|
||||
>"I am B" : "I am B"
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/es2018/dynamicImport/2.ts ===
|
||||
async function foo() {
|
||||
>foo : () => Promise<void>
|
||||
|
||||
class C extends (await import("./0")).B {}
|
||||
>C : C
|
||||
>(await import("./0")).B : B
|
||||
>(await import("./0")) : typeof "tests/cases/conformance/es2018/dynamicImport/0"
|
||||
>await import("./0") : typeof "tests/cases/conformance/es2018/dynamicImport/0"
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/es2018/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
>B : typeof B
|
||||
|
||||
var c = new C();
|
||||
>c : C
|
||||
>new C() : C
|
||||
>C : typeof C
|
||||
|
||||
c.print();
|
||||
>c.print() : string
|
||||
>c.print : () => string
|
||||
>c : C
|
||||
>print : () => string
|
||||
}
|
||||
foo();
|
||||
>foo() : Promise<void>
|
||||
>foo : () => Promise<void>
|
||||
|
||||
@@ -7,7 +7,6 @@ tests/cases/conformance/es2018/dynamicImport/1.ts(5,10): error TS2352: Type 'Pro
|
||||
|
||||
|
||||
==== tests/cases/conformance/es2018/dynamicImport/anotherModule.ts (0 errors) ====
|
||||
|
||||
export class D{}
|
||||
|
||||
==== tests/cases/conformance/es2018/dynamicImport/defaultPath.ts (0 errors) ====
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
//// [tests/cases/conformance/es2018/dynamicImport/importCallExpressionCheckReturntype1.ts] ////
|
||||
|
||||
//// [anotherModule.ts]
|
||||
|
||||
export class D{}
|
||||
|
||||
//// [defaultPath.ts]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//// [importCallExpressionDeclarationEmit1.ts]
|
||||
|
||||
declare function getSpecifier(): string;
|
||||
declare var whatToLoad: boolean;
|
||||
declare const directory: string;
|
||||
|
||||
@@ -1,37 +1,36 @@
|
||||
=== tests/cases/conformance/es2018/dynamicImport/importCallExpressionDeclarationEmit1.ts ===
|
||||
|
||||
declare function getSpecifier(): string;
|
||||
>getSpecifier : Symbol(getSpecifier, Decl(importCallExpressionDeclarationEmit1.ts, 0, 0))
|
||||
|
||||
declare var whatToLoad: boolean;
|
||||
>whatToLoad : Symbol(whatToLoad, Decl(importCallExpressionDeclarationEmit1.ts, 2, 11))
|
||||
>whatToLoad : Symbol(whatToLoad, Decl(importCallExpressionDeclarationEmit1.ts, 1, 11))
|
||||
|
||||
declare const directory: string;
|
||||
>directory : Symbol(directory, Decl(importCallExpressionDeclarationEmit1.ts, 3, 13))
|
||||
>directory : Symbol(directory, Decl(importCallExpressionDeclarationEmit1.ts, 2, 13))
|
||||
|
||||
declare const moduleFile: number;
|
||||
>moduleFile : Symbol(moduleFile, Decl(importCallExpressionDeclarationEmit1.ts, 4, 13))
|
||||
>moduleFile : Symbol(moduleFile, Decl(importCallExpressionDeclarationEmit1.ts, 3, 13))
|
||||
|
||||
import(getSpecifier());
|
||||
>getSpecifier : Symbol(getSpecifier, Decl(importCallExpressionDeclarationEmit1.ts, 0, 0))
|
||||
|
||||
var p0 = import(`${directory}\${moduleFile}`);
|
||||
>p0 : Symbol(p0, Decl(importCallExpressionDeclarationEmit1.ts, 8, 3))
|
||||
>directory : Symbol(directory, Decl(importCallExpressionDeclarationEmit1.ts, 3, 13))
|
||||
>p0 : Symbol(p0, Decl(importCallExpressionDeclarationEmit1.ts, 7, 3))
|
||||
>directory : Symbol(directory, Decl(importCallExpressionDeclarationEmit1.ts, 2, 13))
|
||||
|
||||
var p1 = import(getSpecifier());
|
||||
>p1 : Symbol(p1, Decl(importCallExpressionDeclarationEmit1.ts, 9, 3))
|
||||
>p1 : Symbol(p1, Decl(importCallExpressionDeclarationEmit1.ts, 8, 3))
|
||||
>getSpecifier : Symbol(getSpecifier, Decl(importCallExpressionDeclarationEmit1.ts, 0, 0))
|
||||
|
||||
const p2 = import(whatToLoad ? getSpecifier() : "defaulPath")
|
||||
>p2 : Symbol(p2, Decl(importCallExpressionDeclarationEmit1.ts, 10, 5))
|
||||
>whatToLoad : Symbol(whatToLoad, Decl(importCallExpressionDeclarationEmit1.ts, 2, 11))
|
||||
>p2 : Symbol(p2, Decl(importCallExpressionDeclarationEmit1.ts, 9, 5))
|
||||
>whatToLoad : Symbol(whatToLoad, Decl(importCallExpressionDeclarationEmit1.ts, 1, 11))
|
||||
>getSpecifier : Symbol(getSpecifier, Decl(importCallExpressionDeclarationEmit1.ts, 0, 0))
|
||||
|
||||
function returnDynamicLoad(path: string) {
|
||||
>returnDynamicLoad : Symbol(returnDynamicLoad, Decl(importCallExpressionDeclarationEmit1.ts, 10, 61))
|
||||
>path : Symbol(path, Decl(importCallExpressionDeclarationEmit1.ts, 12, 27))
|
||||
>returnDynamicLoad : Symbol(returnDynamicLoad, Decl(importCallExpressionDeclarationEmit1.ts, 9, 61))
|
||||
>path : Symbol(path, Decl(importCallExpressionDeclarationEmit1.ts, 11, 27))
|
||||
|
||||
return import(path);
|
||||
>path : Symbol(path, Decl(importCallExpressionDeclarationEmit1.ts, 12, 27))
|
||||
>path : Symbol(path, Decl(importCallExpressionDeclarationEmit1.ts, 11, 27))
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
=== tests/cases/conformance/es2018/dynamicImport/importCallExpressionDeclarationEmit1.ts ===
|
||||
|
||||
declare function getSpecifier(): string;
|
||||
>getSpecifier : () => string
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ tests/cases/conformance/es2018/dynamicImport/1.ts(1,5): error TS4023: Exported v
|
||||
|
||||
|
||||
==== tests/cases/conformance/es2018/dynamicImport/0.ts (0 errors) ====
|
||||
|
||||
export function foo() { return "foo"; }
|
||||
|
||||
==== tests/cases/conformance/es2018/dynamicImport/1.ts (1 errors) ====
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
//// [tests/cases/conformance/es2018/dynamicImport/importCallExpressionDeclarationEmit2.ts] ////
|
||||
|
||||
//// [0.ts]
|
||||
|
||||
export function foo() { return "foo"; }
|
||||
|
||||
//// [1.ts]
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
//// [tests/cases/conformance/es2018/dynamicImport/importCallExpressionDeclarationEmit3.ts] ////
|
||||
|
||||
//// [0.ts]
|
||||
|
||||
export function foo() { return "foo"; }
|
||||
|
||||
//// [1.ts]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
=== tests/cases/conformance/es2018/dynamicImport/0.ts ===
|
||||
|
||||
export function foo() { return "foo"; }
|
||||
>foo : Symbol(foo, Decl(0.ts, 0, 0))
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
=== tests/cases/conformance/es2018/dynamicImport/0.ts ===
|
||||
|
||||
export function foo() { return "foo"; }
|
||||
>foo : () => string
|
||||
>"foo" : "foo"
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts(6,8): error TS1322: Specifier of dynamic import cannot be spread element.
|
||||
tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts(8,17): error TS1322: Specifier of dynamic import cannot be spread element.
|
||||
tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts(9,12): error TS1321: Dynamic import must have one specifier as an argument.
|
||||
tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts(10,19): error TS1135: Argument expression expected.
|
||||
tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts(11,12): error TS1321: Dynamic import must have one specifier as an argument.
|
||||
tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts(5,8): error TS1322: Specifier of dynamic import cannot be spread element.
|
||||
tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts(7,17): error TS1322: Specifier of dynamic import cannot be spread element.
|
||||
tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts(8,12): error TS1321: Dynamic import must have one specifier as an argument.
|
||||
tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts(9,19): error TS1135: Argument expression expected.
|
||||
tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts(10,12): error TS1321: Dynamic import must have one specifier as an argument.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es2018/dynamicImport/importCallExpressionGrammarError.ts (5 errors) ====
|
||||
|
||||
declare function getSpecifier(): string;
|
||||
declare var whatToLoad: boolean;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//// [importCallExpressionGrammarError.ts]
|
||||
|
||||
declare function getSpecifier(): string;
|
||||
declare var whatToLoad: boolean;
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
//// [tests/cases/conformance/es2018/dynamicImport/importCallExpressionInAMD3.ts] ////
|
||||
|
||||
//// [0.ts]
|
||||
export class B {
|
||||
print() { return "I am B"}
|
||||
}
|
||||
|
||||
//// [2.ts]
|
||||
async function foo() {
|
||||
class C extends (await import("./0")).B {}
|
||||
var c = new C();
|
||||
c.print();
|
||||
}
|
||||
foo();
|
||||
|
||||
//// [0.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
class B {
|
||||
print() { return "I am B"; }
|
||||
}
|
||||
exports.B = B;
|
||||
});
|
||||
//// [2.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
async function foo() {
|
||||
class C extends (await new Promise(resolve => require(["./0"], resolve))).B {
|
||||
}
|
||||
var c = new C();
|
||||
c.print();
|
||||
}
|
||||
foo();
|
||||
});
|
||||
@@ -0,0 +1,29 @@
|
||||
=== tests/cases/conformance/es2018/dynamicImport/0.ts ===
|
||||
export class B {
|
||||
>B : Symbol(B, Decl(0.ts, 0, 0))
|
||||
|
||||
print() { return "I am B"}
|
||||
>print : Symbol(B.print, Decl(0.ts, 0, 16))
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/es2018/dynamicImport/2.ts ===
|
||||
async function foo() {
|
||||
>foo : Symbol(foo, Decl(2.ts, 0, 0))
|
||||
|
||||
class C extends (await import("./0")).B {}
|
||||
>C : Symbol(C, Decl(2.ts, 0, 22))
|
||||
>(await import("./0")).B : Symbol(B, Decl(0.ts, 0, 0))
|
||||
>B : Symbol(B, Decl(0.ts, 0, 0))
|
||||
|
||||
var c = new C();
|
||||
>c : Symbol(c, Decl(2.ts, 2, 7))
|
||||
>C : Symbol(C, Decl(2.ts, 0, 22))
|
||||
|
||||
c.print();
|
||||
>c.print : Symbol(B.print, Decl(0.ts, 0, 16))
|
||||
>c : Symbol(c, Decl(2.ts, 2, 7))
|
||||
>print : Symbol(B.print, Decl(0.ts, 0, 16))
|
||||
}
|
||||
foo();
|
||||
>foo : Symbol(foo, Decl(2.ts, 0, 0))
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
=== tests/cases/conformance/es2018/dynamicImport/0.ts ===
|
||||
export class B {
|
||||
>B : B
|
||||
|
||||
print() { return "I am B"}
|
||||
>print : () => string
|
||||
>"I am B" : "I am B"
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/es2018/dynamicImport/2.ts ===
|
||||
async function foo() {
|
||||
>foo : () => Promise<void>
|
||||
|
||||
class C extends (await import("./0")).B {}
|
||||
>C : C
|
||||
>(await import("./0")).B : B
|
||||
>(await import("./0")) : typeof "tests/cases/conformance/es2018/dynamicImport/0"
|
||||
>await import("./0") : typeof "tests/cases/conformance/es2018/dynamicImport/0"
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/es2018/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
>B : typeof B
|
||||
|
||||
var c = new C();
|
||||
>c : C
|
||||
>new C() : C
|
||||
>C : typeof C
|
||||
|
||||
c.print();
|
||||
>c.print() : string
|
||||
>c.print : () => string
|
||||
>c : C
|
||||
>print : () => string
|
||||
}
|
||||
foo();
|
||||
>foo() : Promise<void>
|
||||
>foo : () => Promise<void>
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
//// [tests/cases/conformance/es2018/dynamicImport/importCallExpressionInCJS4.ts] ////
|
||||
|
||||
//// [0.ts]
|
||||
export class B {
|
||||
print() { return "I am B"}
|
||||
}
|
||||
|
||||
//// [2.ts]
|
||||
async function foo() {
|
||||
class C extends (await import("./0")).B {}
|
||||
var c = new C();
|
||||
c.print();
|
||||
}
|
||||
foo();
|
||||
|
||||
//// [0.js]
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
class B {
|
||||
print() { return "I am B"; }
|
||||
}
|
||||
exports.B = B;
|
||||
//// [2.js]
|
||||
async function foo() {
|
||||
class C extends (await Promise.resolve().then(() => require("./0"))).B {
|
||||
}
|
||||
var c = new C();
|
||||
c.print();
|
||||
}
|
||||
foo();
|
||||
@@ -0,0 +1,29 @@
|
||||
=== tests/cases/conformance/es2018/dynamicImport/0.ts ===
|
||||
export class B {
|
||||
>B : Symbol(B, Decl(0.ts, 0, 0))
|
||||
|
||||
print() { return "I am B"}
|
||||
>print : Symbol(B.print, Decl(0.ts, 0, 16))
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/es2018/dynamicImport/2.ts ===
|
||||
async function foo() {
|
||||
>foo : Symbol(foo, Decl(2.ts, 0, 0))
|
||||
|
||||
class C extends (await import("./0")).B {}
|
||||
>C : Symbol(C, Decl(2.ts, 0, 22))
|
||||
>(await import("./0")).B : Symbol(B, Decl(0.ts, 0, 0))
|
||||
>B : Symbol(B, Decl(0.ts, 0, 0))
|
||||
|
||||
var c = new C();
|
||||
>c : Symbol(c, Decl(2.ts, 2, 7))
|
||||
>C : Symbol(C, Decl(2.ts, 0, 22))
|
||||
|
||||
c.print();
|
||||
>c.print : Symbol(B.print, Decl(0.ts, 0, 16))
|
||||
>c : Symbol(c, Decl(2.ts, 2, 7))
|
||||
>print : Symbol(B.print, Decl(0.ts, 0, 16))
|
||||
}
|
||||
foo();
|
||||
>foo : Symbol(foo, Decl(2.ts, 0, 0))
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
=== tests/cases/conformance/es2018/dynamicImport/0.ts ===
|
||||
export class B {
|
||||
>B : B
|
||||
|
||||
print() { return "I am B"}
|
||||
>print : () => string
|
||||
>"I am B" : "I am B"
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/es2018/dynamicImport/2.ts ===
|
||||
async function foo() {
|
||||
>foo : () => Promise<void>
|
||||
|
||||
class C extends (await import("./0")).B {}
|
||||
>C : C
|
||||
>(await import("./0")).B : B
|
||||
>(await import("./0")) : typeof "tests/cases/conformance/es2018/dynamicImport/0"
|
||||
>await import("./0") : typeof "tests/cases/conformance/es2018/dynamicImport/0"
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/es2018/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
>B : typeof B
|
||||
|
||||
var c = new C();
|
||||
>c : C
|
||||
>new C() : C
|
||||
>C : typeof C
|
||||
|
||||
c.print();
|
||||
>c.print() : string
|
||||
>c.print : () => string
|
||||
>c : C
|
||||
>print : () => string
|
||||
}
|
||||
foo();
|
||||
>foo() : Promise<void>
|
||||
>foo : () => Promise<void>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
//// [tests/cases/conformance/es2018/dynamicImport/importCallExpressionInScriptContext1.ts] ////
|
||||
|
||||
//// [0.ts]
|
||||
|
||||
export function foo() { return "foo"; }
|
||||
|
||||
//// [1.ts]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
=== tests/cases/conformance/es2018/dynamicImport/0.ts ===
|
||||
|
||||
export function foo() { return "foo"; }
|
||||
>foo : Symbol(foo, Decl(0.ts, 0, 0))
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
=== tests/cases/conformance/es2018/dynamicImport/0.ts ===
|
||||
|
||||
export function foo() { return "foo"; }
|
||||
>foo : () => string
|
||||
>"foo" : "foo"
|
||||
|
||||
@@ -2,7 +2,6 @@ tests/cases/conformance/es2018/dynamicImport/1.ts(3,10): error TS1100: Invalid u
|
||||
|
||||
|
||||
==== tests/cases/conformance/es2018/dynamicImport/0.ts (0 errors) ====
|
||||
|
||||
export function foo() { return "foo"; }
|
||||
|
||||
==== tests/cases/conformance/es2018/dynamicImport/1.ts (1 errors) ====
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
//// [tests/cases/conformance/es2018/dynamicImport/importCallExpressionInScriptContext2.ts] ////
|
||||
|
||||
//// [0.ts]
|
||||
|
||||
export function foo() { return "foo"; }
|
||||
|
||||
//// [1.ts]
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
//// [tests/cases/conformance/es2018/dynamicImport/importCallExpressionInSystem3.ts] ////
|
||||
|
||||
//// [0.ts]
|
||||
export class B {
|
||||
print() { return "I am B"}
|
||||
}
|
||||
|
||||
//// [2.ts]
|
||||
async function foo() {
|
||||
class C extends (await import("./0")).B {}
|
||||
var c = new C();
|
||||
c.print();
|
||||
}
|
||||
foo();
|
||||
|
||||
//// [0.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
"use strict";
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
var B;
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
B = class B {
|
||||
print() { return "I am B"; }
|
||||
};
|
||||
exports_1("B", B);
|
||||
}
|
||||
};
|
||||
});
|
||||
//// [2.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
async function foo() {
|
||||
class C extends (await context_1.import("./0")).B {
|
||||
}
|
||||
var c = new C();
|
||||
c.print();
|
||||
}
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
foo();
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,29 @@
|
||||
=== tests/cases/conformance/es2018/dynamicImport/0.ts ===
|
||||
export class B {
|
||||
>B : Symbol(B, Decl(0.ts, 0, 0))
|
||||
|
||||
print() { return "I am B"}
|
||||
>print : Symbol(B.print, Decl(0.ts, 0, 16))
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/es2018/dynamicImport/2.ts ===
|
||||
async function foo() {
|
||||
>foo : Symbol(foo, Decl(2.ts, 0, 0))
|
||||
|
||||
class C extends (await import("./0")).B {}
|
||||
>C : Symbol(C, Decl(2.ts, 0, 22))
|
||||
>(await import("./0")).B : Symbol(B, Decl(0.ts, 0, 0))
|
||||
>B : Symbol(B, Decl(0.ts, 0, 0))
|
||||
|
||||
var c = new C();
|
||||
>c : Symbol(c, Decl(2.ts, 2, 7))
|
||||
>C : Symbol(C, Decl(2.ts, 0, 22))
|
||||
|
||||
c.print();
|
||||
>c.print : Symbol(B.print, Decl(0.ts, 0, 16))
|
||||
>c : Symbol(c, Decl(2.ts, 2, 7))
|
||||
>print : Symbol(B.print, Decl(0.ts, 0, 16))
|
||||
}
|
||||
foo();
|
||||
>foo : Symbol(foo, Decl(2.ts, 0, 0))
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
=== tests/cases/conformance/es2018/dynamicImport/0.ts ===
|
||||
export class B {
|
||||
>B : B
|
||||
|
||||
print() { return "I am B"}
|
||||
>print : () => string
|
||||
>"I am B" : "I am B"
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/es2018/dynamicImport/2.ts ===
|
||||
async function foo() {
|
||||
>foo : () => Promise<void>
|
||||
|
||||
class C extends (await import("./0")).B {}
|
||||
>C : C
|
||||
>(await import("./0")).B : B
|
||||
>(await import("./0")) : typeof "tests/cases/conformance/es2018/dynamicImport/0"
|
||||
>await import("./0") : typeof "tests/cases/conformance/es2018/dynamicImport/0"
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/es2018/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
>B : typeof B
|
||||
|
||||
var c = new C();
|
||||
>c : C
|
||||
>new C() : C
|
||||
>C : typeof C
|
||||
|
||||
c.print();
|
||||
>c.print() : string
|
||||
>c.print : () => string
|
||||
>c : C
|
||||
>print : () => string
|
||||
}
|
||||
foo();
|
||||
>foo() : Promise<void>
|
||||
>foo : () => Promise<void>
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
//// [tests/cases/conformance/es2018/dynamicImport/importCallExpressionInUMD3.ts] ////
|
||||
|
||||
//// [0.ts]
|
||||
export class B {
|
||||
print() { return "I am B"}
|
||||
}
|
||||
|
||||
//// [2.ts]
|
||||
async function foo() {
|
||||
class C extends (await import("./0")).B {}
|
||||
var c = new C();
|
||||
c.print();
|
||||
}
|
||||
foo();
|
||||
|
||||
//// [0.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 });
|
||||
class B {
|
||||
print() { return "I am B"; }
|
||||
}
|
||||
exports.B = B;
|
||||
});
|
||||
//// [2.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";
|
||||
async function foo() {
|
||||
class C extends (await (require.length === 1 ? Promise.resolve().then(() => require("./0")) : new Promise(resolve => require(["./0"], resolve)))).B {
|
||||
}
|
||||
var c = new C();
|
||||
c.print();
|
||||
}
|
||||
foo();
|
||||
});
|
||||
@@ -0,0 +1,29 @@
|
||||
=== tests/cases/conformance/es2018/dynamicImport/0.ts ===
|
||||
export class B {
|
||||
>B : Symbol(B, Decl(0.ts, 0, 0))
|
||||
|
||||
print() { return "I am B"}
|
||||
>print : Symbol(B.print, Decl(0.ts, 0, 16))
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/es2018/dynamicImport/2.ts ===
|
||||
async function foo() {
|
||||
>foo : Symbol(foo, Decl(2.ts, 0, 0))
|
||||
|
||||
class C extends (await import("./0")).B {}
|
||||
>C : Symbol(C, Decl(2.ts, 0, 22))
|
||||
>(await import("./0")).B : Symbol(B, Decl(0.ts, 0, 0))
|
||||
>B : Symbol(B, Decl(0.ts, 0, 0))
|
||||
|
||||
var c = new C();
|
||||
>c : Symbol(c, Decl(2.ts, 2, 7))
|
||||
>C : Symbol(C, Decl(2.ts, 0, 22))
|
||||
|
||||
c.print();
|
||||
>c.print : Symbol(B.print, Decl(0.ts, 0, 16))
|
||||
>c : Symbol(c, Decl(2.ts, 2, 7))
|
||||
>print : Symbol(B.print, Decl(0.ts, 0, 16))
|
||||
}
|
||||
foo();
|
||||
>foo : Symbol(foo, Decl(2.ts, 0, 0))
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
=== tests/cases/conformance/es2018/dynamicImport/0.ts ===
|
||||
export class B {
|
||||
>B : B
|
||||
|
||||
print() { return "I am B"}
|
||||
>print : () => string
|
||||
>"I am B" : "I am B"
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/es2018/dynamicImport/2.ts ===
|
||||
async function foo() {
|
||||
>foo : () => Promise<void>
|
||||
|
||||
class C extends (await import("./0")).B {}
|
||||
>C : C
|
||||
>(await import("./0")).B : B
|
||||
>(await import("./0")) : typeof "tests/cases/conformance/es2018/dynamicImport/0"
|
||||
>await import("./0") : typeof "tests/cases/conformance/es2018/dynamicImport/0"
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/es2018/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
>B : typeof B
|
||||
|
||||
var c = new C();
|
||||
>c : C
|
||||
>new C() : C
|
||||
>C : typeof C
|
||||
|
||||
c.print();
|
||||
>c.print() : string
|
||||
>c.print : () => string
|
||||
>c : C
|
||||
>print : () => string
|
||||
}
|
||||
foo();
|
||||
>foo() : Promise<void>
|
||||
>foo : () => Promise<void>
|
||||
|
||||
+5
-6
@@ -1,12 +1,11 @@
|
||||
tests/cases/conformance/es2018/dynamicImport/importCallExpressionSpecifierNotStringTypeError.ts(6,8): error TS7035: Dynamic import's specifier must be of type 'string', but here has type 'boolean'.
|
||||
tests/cases/conformance/es2018/dynamicImport/importCallExpressionSpecifierNotStringTypeError.ts(7,17): error TS7035: Dynamic import's specifier must be of type 'string', but here has type 'boolean'.
|
||||
tests/cases/conformance/es2018/dynamicImport/importCallExpressionSpecifierNotStringTypeError.ts(8,19): error TS7035: Dynamic import's specifier must be of type 'string', but here has type 'boolean | "defaulPath"'.
|
||||
tests/cases/conformance/es2018/dynamicImport/importCallExpressionSpecifierNotStringTypeError.ts(13,17): error TS7035: Dynamic import's specifier must be of type 'string', but here has type 'string[]'.
|
||||
tests/cases/conformance/es2018/dynamicImport/importCallExpressionSpecifierNotStringTypeError.ts(14,17): error TS7035: Dynamic import's specifier must be of type 'string', but here has type '() => string'.
|
||||
tests/cases/conformance/es2018/dynamicImport/importCallExpressionSpecifierNotStringTypeError.ts(5,8): error TS7035: Dynamic import's specifier must be of type 'string', but here has type 'boolean'.
|
||||
tests/cases/conformance/es2018/dynamicImport/importCallExpressionSpecifierNotStringTypeError.ts(6,17): error TS7035: Dynamic import's specifier must be of type 'string', but here has type 'boolean'.
|
||||
tests/cases/conformance/es2018/dynamicImport/importCallExpressionSpecifierNotStringTypeError.ts(7,19): error TS7035: Dynamic import's specifier must be of type 'string', but here has type 'boolean | "defaulPath"'.
|
||||
tests/cases/conformance/es2018/dynamicImport/importCallExpressionSpecifierNotStringTypeError.ts(12,17): error TS7035: Dynamic import's specifier must be of type 'string', but here has type 'string[]'.
|
||||
tests/cases/conformance/es2018/dynamicImport/importCallExpressionSpecifierNotStringTypeError.ts(13,17): error TS7035: Dynamic import's specifier must be of type 'string', but here has type '() => string'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es2018/dynamicImport/importCallExpressionSpecifierNotStringTypeError.ts (5 errors) ====
|
||||
|
||||
declare function getSpecifier(): boolean;
|
||||
declare var whatToLoad: boolean;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//// [importCallExpressionSpecifierNotStringTypeError.ts]
|
||||
|
||||
declare function getSpecifier(): boolean;
|
||||
declare var whatToLoad: boolean;
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ tests/cases/conformance/es2018/dynamicImport/1.ts(3,10): error TS1323: Dynamic i
|
||||
|
||||
|
||||
==== tests/cases/conformance/es2018/dynamicImport/0.ts (0 errors) ====
|
||||
|
||||
export function foo() { return "foo"; }
|
||||
|
||||
==== tests/cases/conformance/es2018/dynamicImport/1.ts (2 errors) ====
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
//// [tests/cases/conformance/es2018/dynamicImport/importCallExpressionWithTypeArgument.ts] ////
|
||||
|
||||
//// [0.ts]
|
||||
|
||||
export function foo() { return "foo"; }
|
||||
|
||||
//// [1.ts]
|
||||
@@ -21,6 +20,3 @@ exports.foo = foo;
|
||||
"use strict";
|
||||
var p1 = (import)("./0"); // error
|
||||
var p2 = (import)("./0"); // error
|
||||
// p1.then(value => {
|
||||
// value.anyFunction();
|
||||
// })
|
||||
|
||||
Reference in New Issue
Block a user