mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge pull request #17141 from Microsoft/master-17060
Fix 17060 : incorrect emit for dynamic import inside elements of export class declaration
This commit is contained in:
@@ -924,7 +924,7 @@ namespace ts {
|
||||
getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true),
|
||||
/*typeParameters*/ undefined,
|
||||
visitNodes(node.heritageClauses, importCallExpressionVisitor),
|
||||
node.members
|
||||
visitNodes(node.members, importCallExpressionVisitor)
|
||||
),
|
||||
node
|
||||
),
|
||||
|
||||
@@ -10,6 +10,8 @@ p1.then(zero => {
|
||||
return zero.foo();
|
||||
})
|
||||
|
||||
export var p2 = import("./0");
|
||||
|
||||
function foo() {
|
||||
const p2 = import("./0");
|
||||
}
|
||||
@@ -22,6 +24,7 @@ var p1 = import("./0");
|
||||
p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
export var p2 = import("./0");
|
||||
function foo() {
|
||||
const p2 = import("./0");
|
||||
}
|
||||
|
||||
@@ -23,10 +23,14 @@ p1.then(zero => {
|
||||
|
||||
})
|
||||
|
||||
export var p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 6, 10))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
function foo() {
|
||||
>foo : Symbol(foo, Decl(1.ts, 4, 2))
|
||||
>foo : Symbol(foo, Decl(1.ts, 6, 30))
|
||||
|
||||
const p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 7, 9))
|
||||
>p2 : Symbol(p2, Decl(1.ts, 9, 9))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
|
||||
@@ -29,6 +29,11 @@ p1.then(zero => {
|
||||
|
||||
})
|
||||
|
||||
export var p2 = import("./0");
|
||||
>p2 : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
function foo() {
|
||||
>foo : () => void
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ declare var console: any;
|
||||
class C {
|
||||
private myModule = import("./0");
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
this.myModule.then(Zero => {
|
||||
console.log(Zero.foo());
|
||||
}, async err => {
|
||||
@@ -38,6 +39,7 @@ class C {
|
||||
this.myModule = import("./0");
|
||||
}
|
||||
method() {
|
||||
const loadAsync = import("./0");
|
||||
this.myModule.then(Zero => {
|
||||
console.log(Zero.foo());
|
||||
}, async (err) => {
|
||||
|
||||
@@ -27,35 +27,39 @@ class C {
|
||||
method() {
|
||||
>method : Symbol(C.method, Decl(2.ts, 2, 37))
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Symbol(loadAsync, Decl(2.ts, 4, 13))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
this.myModule.then(Zero => {
|
||||
>this.myModule.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>this.myModule : Symbol(C.myModule, Decl(2.ts, 1, 9))
|
||||
>this : Symbol(C, Decl(2.ts, 0, 25))
|
||||
>myModule : Symbol(C.myModule, Decl(2.ts, 1, 9))
|
||||
>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>Zero : Symbol(Zero, Decl(2.ts, 4, 27))
|
||||
>Zero : Symbol(Zero, Decl(2.ts, 5, 27))
|
||||
|
||||
console.log(Zero.foo());
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
>Zero.foo : Symbol(foo, Decl(0.ts, 2, 1))
|
||||
>Zero : Symbol(Zero, Decl(2.ts, 4, 27))
|
||||
>Zero : Symbol(Zero, Decl(2.ts, 5, 27))
|
||||
>foo : Symbol(foo, Decl(0.ts, 2, 1))
|
||||
|
||||
}, async err => {
|
||||
>err : Symbol(err, Decl(2.ts, 6, 16))
|
||||
>err : Symbol(err, Decl(2.ts, 7, 16))
|
||||
|
||||
console.log(err);
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
>err : Symbol(err, Decl(2.ts, 6, 16))
|
||||
>err : Symbol(err, Decl(2.ts, 7, 16))
|
||||
|
||||
let one = await import("./1");
|
||||
>one : Symbol(one, Decl(2.ts, 8, 15))
|
||||
>one : Symbol(one, Decl(2.ts, 9, 15))
|
||||
>"./1" : Symbol("tests/cases/conformance/dynamicImport/1", Decl(1.ts, 0, 0))
|
||||
|
||||
console.log(one.backup());
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
>one.backup : Symbol(backup, Decl(1.ts, 0, 0))
|
||||
>one : Symbol(one, Decl(2.ts, 8, 15))
|
||||
>one : Symbol(one, Decl(2.ts, 9, 15))
|
||||
>backup : Symbol(backup, Decl(1.ts, 0, 0))
|
||||
|
||||
});
|
||||
|
||||
@@ -31,6 +31,11 @@ class C {
|
||||
method() {
|
||||
>method : () => void
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import ("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
this.myModule.then(Zero => {
|
||||
>this.myModule.then(Zero => { console.log(Zero.foo()); }, async err => { console.log(err); let one = await import("./1"); console.log(one.backup()); }) : Promise<void>
|
||||
>this.myModule.then : <TResult1 = typeof "tests/cases/conformance/dynamicImport/0", TResult2 = never>(onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
|
||||
|
||||
@@ -10,8 +10,22 @@ p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
|
||||
function foo() {
|
||||
const p2 = import("./0");
|
||||
}
|
||||
|
||||
class C {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
|
||||
//// [0.js]
|
||||
@@ -24,12 +38,31 @@ define(["require", "exports"], function (require, exports) {
|
||||
//// [1.js]
|
||||
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); });
|
||||
p1.then(function (zero) {
|
||||
return zero.foo();
|
||||
});
|
||||
exports.p2 = new Promise(function (resolve_3, reject_3) { require(["./0"], resolve_3, reject_3); });
|
||||
function foo() {
|
||||
var p2 = new Promise(function (resolve_3, reject_3) { require(["./0"], resolve_3, reject_3); });
|
||||
var p2 = new Promise(function (resolve_4, reject_4) { require(["./0"], resolve_4, reject_4); });
|
||||
}
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.method = function () {
|
||||
var loadAsync = new Promise(function (resolve_5, reject_5) { require(["./0"], resolve_5, reject_5); });
|
||||
};
|
||||
return C;
|
||||
}());
|
||||
var D = (function () {
|
||||
function D() {
|
||||
}
|
||||
D.prototype.method = function () {
|
||||
var loadAsync = new Promise(function (resolve_6, reject_6) { require(["./0"], resolve_6, reject_6); });
|
||||
};
|
||||
return D;
|
||||
}());
|
||||
exports.D = D;
|
||||
});
|
||||
|
||||
@@ -23,10 +23,38 @@ p1.then(zero => {
|
||||
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 6, 10))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
function foo() {
|
||||
>foo : Symbol(foo, Decl(1.ts, 4, 3))
|
||||
>foo : Symbol(foo, Decl(1.ts, 6, 30))
|
||||
|
||||
const p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 7, 9))
|
||||
>p2 : Symbol(p2, Decl(1.ts, 9, 9))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
|
||||
class C {
|
||||
>C : Symbol(C, Decl(1.ts, 10, 1))
|
||||
|
||||
method() {
|
||||
>method : Symbol(C.method, Decl(1.ts, 12, 9))
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Symbol(loadAsync, Decl(1.ts, 14, 13))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
>D : Symbol(D, Decl(1.ts, 16, 1))
|
||||
|
||||
method() {
|
||||
>method : Symbol(D.method, Decl(1.ts, 18, 16))
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Symbol(loadAsync, Decl(1.ts, 20, 13))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,11 @@ p1.then(zero => {
|
||||
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
>p2 : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
function foo() {
|
||||
>foo : () => void
|
||||
|
||||
@@ -37,3 +42,29 @@ function foo() {
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
}
|
||||
|
||||
class C {
|
||||
>C : C
|
||||
|
||||
method() {
|
||||
>method : () => void
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import ("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
>D : D
|
||||
|
||||
method() {
|
||||
>method : () => void
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import ("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,8 +10,22 @@ p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
|
||||
function foo() {
|
||||
const p2 = import("./0");
|
||||
}
|
||||
|
||||
class C {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
|
||||
//// [0.js]
|
||||
@@ -20,11 +34,31 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||
function foo() { return "foo"; }
|
||||
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"); });
|
||||
p1.then(function (zero) {
|
||||
return zero.foo();
|
||||
});
|
||||
exports.p2 = Promise.resolve().then(function () { return require("./0"); });
|
||||
function foo() {
|
||||
var p2 = Promise.resolve().then(function () { return require("./0"); });
|
||||
}
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.method = function () {
|
||||
var loadAsync = Promise.resolve().then(function () { return require("./0"); });
|
||||
};
|
||||
return C;
|
||||
}());
|
||||
var D = (function () {
|
||||
function D() {
|
||||
}
|
||||
D.prototype.method = function () {
|
||||
var loadAsync = Promise.resolve().then(function () { return require("./0"); });
|
||||
};
|
||||
return D;
|
||||
}());
|
||||
exports.D = D;
|
||||
|
||||
@@ -23,10 +23,38 @@ p1.then(zero => {
|
||||
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 6, 10))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
function foo() {
|
||||
>foo : Symbol(foo, Decl(1.ts, 4, 3))
|
||||
>foo : Symbol(foo, Decl(1.ts, 6, 30))
|
||||
|
||||
const p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 7, 9))
|
||||
>p2 : Symbol(p2, Decl(1.ts, 9, 9))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
|
||||
class C {
|
||||
>C : Symbol(C, Decl(1.ts, 10, 1))
|
||||
|
||||
method() {
|
||||
>method : Symbol(C.method, Decl(1.ts, 12, 9))
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Symbol(loadAsync, Decl(1.ts, 14, 13))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
>D : Symbol(D, Decl(1.ts, 16, 1))
|
||||
|
||||
method() {
|
||||
>method : Symbol(D.method, Decl(1.ts, 18, 16))
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Symbol(loadAsync, Decl(1.ts, 20, 13))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,11 @@ p1.then(zero => {
|
||||
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
>p2 : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
function foo() {
|
||||
>foo : () => void
|
||||
|
||||
@@ -37,3 +42,29 @@ function foo() {
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
}
|
||||
|
||||
class C {
|
||||
>C : C
|
||||
|
||||
method() {
|
||||
>method : () => void
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import ("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
>D : D
|
||||
|
||||
method() {
|
||||
>method : () => void
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import ("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,8 +10,22 @@ p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
|
||||
function foo() {
|
||||
const p2 = import("./0");
|
||||
}
|
||||
|
||||
class C {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
|
||||
//// [0.js]
|
||||
@@ -28,11 +42,12 @@ System.register([], function (exports_1, context_1) {
|
||||
});
|
||||
//// [1.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
"use strict";
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
function foo() {
|
||||
var p2 = context_1.import("./0");
|
||||
}
|
||||
var p1;
|
||||
var p1, p2, C, D;
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
@@ -41,6 +56,24 @@ System.register([], function (exports_1, context_1) {
|
||||
p1.then(function (zero) {
|
||||
return zero.foo();
|
||||
});
|
||||
exports_1("p2", p2 = context_1.import("./0"));
|
||||
C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.method = function () {
|
||||
var loadAsync = context_1.import("./0");
|
||||
};
|
||||
return C;
|
||||
}());
|
||||
D = (function () {
|
||||
function D() {
|
||||
}
|
||||
D.prototype.method = function () {
|
||||
var loadAsync = context_1.import("./0");
|
||||
};
|
||||
return D;
|
||||
}());
|
||||
exports_1("D", D);
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -23,10 +23,38 @@ p1.then(zero => {
|
||||
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 6, 10))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
function foo() {
|
||||
>foo : Symbol(foo, Decl(1.ts, 4, 3))
|
||||
>foo : Symbol(foo, Decl(1.ts, 6, 30))
|
||||
|
||||
const p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 7, 9))
|
||||
>p2 : Symbol(p2, Decl(1.ts, 9, 9))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
|
||||
class C {
|
||||
>C : Symbol(C, Decl(1.ts, 10, 1))
|
||||
|
||||
method() {
|
||||
>method : Symbol(C.method, Decl(1.ts, 12, 9))
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Symbol(loadAsync, Decl(1.ts, 14, 13))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
>D : Symbol(D, Decl(1.ts, 16, 1))
|
||||
|
||||
method() {
|
||||
>method : Symbol(D.method, Decl(1.ts, 18, 16))
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Symbol(loadAsync, Decl(1.ts, 20, 13))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,11 @@ p1.then(zero => {
|
||||
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
>p2 : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
function foo() {
|
||||
>foo : () => void
|
||||
|
||||
@@ -37,3 +42,29 @@ function foo() {
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
}
|
||||
|
||||
class C {
|
||||
>C : C
|
||||
|
||||
method() {
|
||||
>method : () => void
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import ("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
>D : D
|
||||
|
||||
method() {
|
||||
>method : () => void
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import ("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,8 +10,22 @@ p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
|
||||
function foo() {
|
||||
const p2 = import("./0");
|
||||
}
|
||||
|
||||
class C {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
|
||||
//// [0.js]
|
||||
@@ -41,12 +55,31 @@ function foo() {
|
||||
})(function (require, exports) {
|
||||
"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); });
|
||||
p1.then(function (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); });
|
||||
function foo() {
|
||||
var p2 = __syncRequire ? Promise.resolve().then(function () { return require("./0"); }) : new Promise(function (resolve_3, reject_3) { require(["./0"], resolve_3, reject_3); });
|
||||
var p2 = __syncRequire ? Promise.resolve().then(function () { return require("./0"); }) : new Promise(function (resolve_4, reject_4) { require(["./0"], resolve_4, reject_4); });
|
||||
}
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
C.prototype.method = function () {
|
||||
var loadAsync = __syncRequire ? Promise.resolve().then(function () { return require("./0"); }) : new Promise(function (resolve_5, reject_5) { require(["./0"], resolve_5, reject_5); });
|
||||
};
|
||||
return C;
|
||||
}());
|
||||
var D = (function () {
|
||||
function D() {
|
||||
}
|
||||
D.prototype.method = function () {
|
||||
var loadAsync = __syncRequire ? Promise.resolve().then(function () { return require("./0"); }) : new Promise(function (resolve_6, reject_6) { require(["./0"], resolve_6, reject_6); });
|
||||
};
|
||||
return D;
|
||||
}());
|
||||
exports.D = D;
|
||||
});
|
||||
|
||||
@@ -23,10 +23,38 @@ p1.then(zero => {
|
||||
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 6, 10))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
function foo() {
|
||||
>foo : Symbol(foo, Decl(1.ts, 4, 3))
|
||||
>foo : Symbol(foo, Decl(1.ts, 6, 30))
|
||||
|
||||
const p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 7, 9))
|
||||
>p2 : Symbol(p2, Decl(1.ts, 9, 9))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
|
||||
class C {
|
||||
>C : Symbol(C, Decl(1.ts, 10, 1))
|
||||
|
||||
method() {
|
||||
>method : Symbol(C.method, Decl(1.ts, 12, 9))
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Symbol(loadAsync, Decl(1.ts, 14, 13))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
>D : Symbol(D, Decl(1.ts, 16, 1))
|
||||
|
||||
method() {
|
||||
>method : Symbol(D.method, Decl(1.ts, 18, 16))
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Symbol(loadAsync, Decl(1.ts, 20, 13))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,11 @@ p1.then(zero => {
|
||||
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
>p2 : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
function foo() {
|
||||
>foo : () => void
|
||||
|
||||
@@ -37,3 +42,29 @@ function foo() {
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
}
|
||||
|
||||
class C {
|
||||
>C : C
|
||||
|
||||
method() {
|
||||
>method : () => void
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import ("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
>D : D
|
||||
|
||||
method() {
|
||||
>method : () => void
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import ("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
//// [tests/cases/conformance/dynamicImport/importCallExpressionES6AMD.ts] ////
|
||||
|
||||
//// [0.ts]
|
||||
export function foo() { return "foo"; }
|
||||
|
||||
//// [1.ts]
|
||||
import("./0");
|
||||
var p1 = import("./0");
|
||||
p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
|
||||
function foo() {
|
||||
const p2 = import("./0");
|
||||
}
|
||||
|
||||
class C {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
|
||||
//// [0.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
function foo() { return "foo"; }
|
||||
exports.foo = foo;
|
||||
});
|
||||
//// [1.js]
|
||||
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); });
|
||||
p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
exports.p2 = new Promise(function (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); });
|
||||
}
|
||||
class C {
|
||||
method() {
|
||||
const loadAsync = new Promise(function (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); });
|
||||
}
|
||||
}
|
||||
exports.D = D;
|
||||
});
|
||||
@@ -0,0 +1,60 @@
|
||||
=== tests/cases/conformance/dynamicImport/0.ts ===
|
||||
export function foo() { return "foo"; }
|
||||
>foo : Symbol(foo, Decl(0.ts, 0, 0))
|
||||
|
||||
=== tests/cases/conformance/dynamicImport/1.ts ===
|
||||
import("./0");
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
var p1 = import("./0");
|
||||
>p1 : Symbol(p1, Decl(1.ts, 1, 3))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
p1.then(zero => {
|
||||
>p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>p1 : Symbol(p1, Decl(1.ts, 1, 3))
|
||||
>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>zero : Symbol(zero, Decl(1.ts, 2, 8))
|
||||
|
||||
return zero.foo();
|
||||
>zero.foo : Symbol(foo, Decl(0.ts, 0, 0))
|
||||
>zero : Symbol(zero, Decl(1.ts, 2, 8))
|
||||
>foo : Symbol(foo, Decl(0.ts, 0, 0))
|
||||
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 6, 10))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
function foo() {
|
||||
>foo : Symbol(foo, Decl(1.ts, 6, 30))
|
||||
|
||||
const p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 9, 9))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
|
||||
class C {
|
||||
>C : Symbol(C, Decl(1.ts, 10, 1))
|
||||
|
||||
method() {
|
||||
>method : Symbol(C.method, Decl(1.ts, 12, 9))
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Symbol(loadAsync, Decl(1.ts, 14, 13))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
>D : Symbol(D, Decl(1.ts, 16, 1))
|
||||
|
||||
method() {
|
||||
>method : Symbol(D.method, Decl(1.ts, 18, 16))
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Symbol(loadAsync, Decl(1.ts, 20, 13))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
=== tests/cases/conformance/dynamicImport/0.ts ===
|
||||
export function foo() { return "foo"; }
|
||||
>foo : () => string
|
||||
>"foo" : "foo"
|
||||
|
||||
=== tests/cases/conformance/dynamicImport/1.ts ===
|
||||
import("./0");
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
var p1 = import("./0");
|
||||
>p1 : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
p1.then(zero => {
|
||||
>p1.then(zero => { return zero.foo();}) : Promise<string>
|
||||
>p1.then : <TResult1 = typeof "tests/cases/conformance/dynamicImport/0", TResult2 = never>(onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
|
||||
>p1 : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>then : <TResult1 = typeof "tests/cases/conformance/dynamicImport/0", TResult2 = never>(onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
|
||||
>zero => { return zero.foo();} : (zero: typeof "tests/cases/conformance/dynamicImport/0") => string
|
||||
>zero : typeof "tests/cases/conformance/dynamicImport/0"
|
||||
|
||||
return zero.foo();
|
||||
>zero.foo() : string
|
||||
>zero.foo : () => string
|
||||
>zero : typeof "tests/cases/conformance/dynamicImport/0"
|
||||
>foo : () => string
|
||||
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
>p2 : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
function foo() {
|
||||
>foo : () => void
|
||||
|
||||
const p2 = import("./0");
|
||||
>p2 : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
}
|
||||
|
||||
class C {
|
||||
>C : C
|
||||
|
||||
method() {
|
||||
>method : () => void
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import ("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
>D : D
|
||||
|
||||
method() {
|
||||
>method : () => void
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import ("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
//// [tests/cases/conformance/dynamicImport/importCallExpressionES6CJS.ts] ////
|
||||
|
||||
//// [0.ts]
|
||||
export function foo() { return "foo"; }
|
||||
|
||||
//// [1.ts]
|
||||
import("./0");
|
||||
var p1 = import("./0");
|
||||
p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
|
||||
function foo() {
|
||||
const p2 = import("./0");
|
||||
}
|
||||
|
||||
class C {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
|
||||
//// [0.js]
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
function foo() { return "foo"; }
|
||||
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"); });
|
||||
p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
exports.p2 = Promise.resolve().then(function () { return require("./0"); });
|
||||
function foo() {
|
||||
const p2 = Promise.resolve().then(function () { return require("./0"); });
|
||||
}
|
||||
class C {
|
||||
method() {
|
||||
const loadAsync = Promise.resolve().then(function () { return require("./0"); });
|
||||
}
|
||||
}
|
||||
class D {
|
||||
method() {
|
||||
const loadAsync = Promise.resolve().then(function () { return require("./0"); });
|
||||
}
|
||||
}
|
||||
exports.D = D;
|
||||
@@ -0,0 +1,60 @@
|
||||
=== tests/cases/conformance/dynamicImport/0.ts ===
|
||||
export function foo() { return "foo"; }
|
||||
>foo : Symbol(foo, Decl(0.ts, 0, 0))
|
||||
|
||||
=== tests/cases/conformance/dynamicImport/1.ts ===
|
||||
import("./0");
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
var p1 = import("./0");
|
||||
>p1 : Symbol(p1, Decl(1.ts, 1, 3))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
p1.then(zero => {
|
||||
>p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>p1 : Symbol(p1, Decl(1.ts, 1, 3))
|
||||
>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>zero : Symbol(zero, Decl(1.ts, 2, 8))
|
||||
|
||||
return zero.foo();
|
||||
>zero.foo : Symbol(foo, Decl(0.ts, 0, 0))
|
||||
>zero : Symbol(zero, Decl(1.ts, 2, 8))
|
||||
>foo : Symbol(foo, Decl(0.ts, 0, 0))
|
||||
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 6, 10))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
function foo() {
|
||||
>foo : Symbol(foo, Decl(1.ts, 6, 30))
|
||||
|
||||
const p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 9, 9))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
|
||||
class C {
|
||||
>C : Symbol(C, Decl(1.ts, 10, 1))
|
||||
|
||||
method() {
|
||||
>method : Symbol(C.method, Decl(1.ts, 12, 9))
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Symbol(loadAsync, Decl(1.ts, 14, 13))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
>D : Symbol(D, Decl(1.ts, 16, 1))
|
||||
|
||||
method() {
|
||||
>method : Symbol(D.method, Decl(1.ts, 18, 16))
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Symbol(loadAsync, Decl(1.ts, 20, 13))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
=== tests/cases/conformance/dynamicImport/0.ts ===
|
||||
export function foo() { return "foo"; }
|
||||
>foo : () => string
|
||||
>"foo" : "foo"
|
||||
|
||||
=== tests/cases/conformance/dynamicImport/1.ts ===
|
||||
import("./0");
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
var p1 = import("./0");
|
||||
>p1 : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
p1.then(zero => {
|
||||
>p1.then(zero => { return zero.foo();}) : Promise<string>
|
||||
>p1.then : <TResult1 = typeof "tests/cases/conformance/dynamicImport/0", TResult2 = never>(onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
|
||||
>p1 : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>then : <TResult1 = typeof "tests/cases/conformance/dynamicImport/0", TResult2 = never>(onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
|
||||
>zero => { return zero.foo();} : (zero: typeof "tests/cases/conformance/dynamicImport/0") => string
|
||||
>zero : typeof "tests/cases/conformance/dynamicImport/0"
|
||||
|
||||
return zero.foo();
|
||||
>zero.foo() : string
|
||||
>zero.foo : () => string
|
||||
>zero : typeof "tests/cases/conformance/dynamicImport/0"
|
||||
>foo : () => string
|
||||
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
>p2 : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
function foo() {
|
||||
>foo : () => void
|
||||
|
||||
const p2 = import("./0");
|
||||
>p2 : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
}
|
||||
|
||||
class C {
|
||||
>C : C
|
||||
|
||||
method() {
|
||||
>method : () => void
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import ("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
>D : D
|
||||
|
||||
method() {
|
||||
>method : () => void
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import ("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
//// [tests/cases/conformance/dynamicImport/importCallExpressionES6System.ts] ////
|
||||
|
||||
//// [0.ts]
|
||||
export function foo() { return "foo"; }
|
||||
|
||||
//// [1.ts]
|
||||
import("./0");
|
||||
var p1 = import("./0");
|
||||
p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
|
||||
function foo() {
|
||||
const p2 = import("./0");
|
||||
}
|
||||
|
||||
class C {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
|
||||
//// [0.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
"use strict";
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
function foo() { return "foo"; }
|
||||
exports_1("foo", foo);
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
}
|
||||
};
|
||||
});
|
||||
//// [1.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
"use strict";
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
function foo() {
|
||||
const p2 = context_1.import("./0");
|
||||
}
|
||||
var p1, p2, C, D;
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
context_1.import("./0");
|
||||
p1 = context_1.import("./0");
|
||||
p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
exports_1("p2", p2 = context_1.import("./0"));
|
||||
C = class C {
|
||||
method() {
|
||||
const loadAsync = context_1.import("./0");
|
||||
}
|
||||
};
|
||||
D = class D {
|
||||
method() {
|
||||
const loadAsync = context_1.import("./0");
|
||||
}
|
||||
};
|
||||
exports_1("D", D);
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,60 @@
|
||||
=== tests/cases/conformance/dynamicImport/0.ts ===
|
||||
export function foo() { return "foo"; }
|
||||
>foo : Symbol(foo, Decl(0.ts, 0, 0))
|
||||
|
||||
=== tests/cases/conformance/dynamicImport/1.ts ===
|
||||
import("./0");
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
var p1 = import("./0");
|
||||
>p1 : Symbol(p1, Decl(1.ts, 1, 3))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
p1.then(zero => {
|
||||
>p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>p1 : Symbol(p1, Decl(1.ts, 1, 3))
|
||||
>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>zero : Symbol(zero, Decl(1.ts, 2, 8))
|
||||
|
||||
return zero.foo();
|
||||
>zero.foo : Symbol(foo, Decl(0.ts, 0, 0))
|
||||
>zero : Symbol(zero, Decl(1.ts, 2, 8))
|
||||
>foo : Symbol(foo, Decl(0.ts, 0, 0))
|
||||
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 6, 10))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
function foo() {
|
||||
>foo : Symbol(foo, Decl(1.ts, 6, 30))
|
||||
|
||||
const p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 9, 9))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
|
||||
class C {
|
||||
>C : Symbol(C, Decl(1.ts, 10, 1))
|
||||
|
||||
method() {
|
||||
>method : Symbol(C.method, Decl(1.ts, 12, 9))
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Symbol(loadAsync, Decl(1.ts, 14, 13))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
>D : Symbol(D, Decl(1.ts, 16, 1))
|
||||
|
||||
method() {
|
||||
>method : Symbol(D.method, Decl(1.ts, 18, 16))
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Symbol(loadAsync, Decl(1.ts, 20, 13))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
=== tests/cases/conformance/dynamicImport/0.ts ===
|
||||
export function foo() { return "foo"; }
|
||||
>foo : () => string
|
||||
>"foo" : "foo"
|
||||
|
||||
=== tests/cases/conformance/dynamicImport/1.ts ===
|
||||
import("./0");
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
var p1 = import("./0");
|
||||
>p1 : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
p1.then(zero => {
|
||||
>p1.then(zero => { return zero.foo();}) : Promise<string>
|
||||
>p1.then : <TResult1 = typeof "tests/cases/conformance/dynamicImport/0", TResult2 = never>(onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
|
||||
>p1 : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>then : <TResult1 = typeof "tests/cases/conformance/dynamicImport/0", TResult2 = never>(onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
|
||||
>zero => { return zero.foo();} : (zero: typeof "tests/cases/conformance/dynamicImport/0") => string
|
||||
>zero : typeof "tests/cases/conformance/dynamicImport/0"
|
||||
|
||||
return zero.foo();
|
||||
>zero.foo() : string
|
||||
>zero.foo : () => string
|
||||
>zero : typeof "tests/cases/conformance/dynamicImport/0"
|
||||
>foo : () => string
|
||||
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
>p2 : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
function foo() {
|
||||
>foo : () => void
|
||||
|
||||
const p2 = import("./0");
|
||||
>p2 : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
}
|
||||
|
||||
class C {
|
||||
>C : C
|
||||
|
||||
method() {
|
||||
>method : () => void
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import ("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
>D : D
|
||||
|
||||
method() {
|
||||
>method : () => void
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import ("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
//// [tests/cases/conformance/dynamicImport/importCallExpressionES6UMD.ts] ////
|
||||
|
||||
//// [0.ts]
|
||||
export function foo() { return "foo"; }
|
||||
|
||||
//// [1.ts]
|
||||
import("./0");
|
||||
var p1 = import("./0");
|
||||
p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
|
||||
function foo() {
|
||||
const p2 = import("./0");
|
||||
}
|
||||
|
||||
class C {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
|
||||
//// [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 });
|
||||
function foo() { return "foo"; }
|
||||
exports.foo = foo;
|
||||
});
|
||||
//// [1.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";
|
||||
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); });
|
||||
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); });
|
||||
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); });
|
||||
}
|
||||
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); });
|
||||
}
|
||||
}
|
||||
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); });
|
||||
}
|
||||
}
|
||||
exports.D = D;
|
||||
});
|
||||
@@ -0,0 +1,60 @@
|
||||
=== tests/cases/conformance/dynamicImport/0.ts ===
|
||||
export function foo() { return "foo"; }
|
||||
>foo : Symbol(foo, Decl(0.ts, 0, 0))
|
||||
|
||||
=== tests/cases/conformance/dynamicImport/1.ts ===
|
||||
import("./0");
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
var p1 = import("./0");
|
||||
>p1 : Symbol(p1, Decl(1.ts, 1, 3))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
p1.then(zero => {
|
||||
>p1.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>p1 : Symbol(p1, Decl(1.ts, 1, 3))
|
||||
>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>zero : Symbol(zero, Decl(1.ts, 2, 8))
|
||||
|
||||
return zero.foo();
|
||||
>zero.foo : Symbol(foo, Decl(0.ts, 0, 0))
|
||||
>zero : Symbol(zero, Decl(1.ts, 2, 8))
|
||||
>foo : Symbol(foo, Decl(0.ts, 0, 0))
|
||||
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 6, 10))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
function foo() {
|
||||
>foo : Symbol(foo, Decl(1.ts, 6, 30))
|
||||
|
||||
const p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 9, 9))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
|
||||
class C {
|
||||
>C : Symbol(C, Decl(1.ts, 10, 1))
|
||||
|
||||
method() {
|
||||
>method : Symbol(C.method, Decl(1.ts, 12, 9))
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Symbol(loadAsync, Decl(1.ts, 14, 13))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
>D : Symbol(D, Decl(1.ts, 16, 1))
|
||||
|
||||
method() {
|
||||
>method : Symbol(D.method, Decl(1.ts, 18, 16))
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Symbol(loadAsync, Decl(1.ts, 20, 13))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
=== tests/cases/conformance/dynamicImport/0.ts ===
|
||||
export function foo() { return "foo"; }
|
||||
>foo : () => string
|
||||
>"foo" : "foo"
|
||||
|
||||
=== tests/cases/conformance/dynamicImport/1.ts ===
|
||||
import("./0");
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
var p1 = import("./0");
|
||||
>p1 : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
p1.then(zero => {
|
||||
>p1.then(zero => { return zero.foo();}) : Promise<string>
|
||||
>p1.then : <TResult1 = typeof "tests/cases/conformance/dynamicImport/0", TResult2 = never>(onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
|
||||
>p1 : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>then : <TResult1 = typeof "tests/cases/conformance/dynamicImport/0", TResult2 = never>(onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
|
||||
>zero => { return zero.foo();} : (zero: typeof "tests/cases/conformance/dynamicImport/0") => string
|
||||
>zero : typeof "tests/cases/conformance/dynamicImport/0"
|
||||
|
||||
return zero.foo();
|
||||
>zero.foo() : string
|
||||
>zero.foo : () => string
|
||||
>zero : typeof "tests/cases/conformance/dynamicImport/0"
|
||||
>foo : () => string
|
||||
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
>p2 : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
function foo() {
|
||||
>foo : () => void
|
||||
|
||||
const p2 = import("./0");
|
||||
>p2 : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
}
|
||||
|
||||
class C {
|
||||
>C : C
|
||||
|
||||
method() {
|
||||
>method : () => void
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import ("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
>D : D
|
||||
|
||||
method() {
|
||||
>method : () => void
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import ("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,8 @@ p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
|
||||
function foo() {
|
||||
const p2 = import("./0");
|
||||
}
|
||||
@@ -24,12 +26,14 @@ define(["require", "exports"], function (require, exports) {
|
||||
//// [1.js]
|
||||
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); });
|
||||
p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
exports.p2 = new Promise(function (resolve_3, reject_3) { require(["./0"], resolve_3, reject_3); });
|
||||
function foo() {
|
||||
const p2 = new Promise(function (resolve_3, reject_3) { require(["./0"], resolve_3, reject_3); });
|
||||
const p2 = new Promise(function (resolve_4, reject_4) { require(["./0"], resolve_4, reject_4); });
|
||||
}
|
||||
});
|
||||
|
||||
@@ -23,10 +23,14 @@ p1.then(zero => {
|
||||
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 6, 10))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
function foo() {
|
||||
>foo : Symbol(foo, Decl(1.ts, 4, 3))
|
||||
>foo : Symbol(foo, Decl(1.ts, 6, 30))
|
||||
|
||||
const p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 7, 9))
|
||||
>p2 : Symbol(p2, Decl(1.ts, 9, 9))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
|
||||
@@ -29,6 +29,11 @@ p1.then(zero => {
|
||||
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
>p2 : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
function foo() {
|
||||
>foo : () => void
|
||||
|
||||
|
||||
@@ -15,6 +15,21 @@ declare var console: any;
|
||||
class C {
|
||||
private myModule = import("./0");
|
||||
method() {
|
||||
const loadAsync = import("./0");
|
||||
this.myModule.then(Zero => {
|
||||
console.log(Zero.foo());
|
||||
}, async err => {
|
||||
console.log(err);
|
||||
let one = await import("./1");
|
||||
console.log(one.backup());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
private myModule = import("./0");
|
||||
method() {
|
||||
const loadAsync = import("./0");
|
||||
this.myModule.then(Zero => {
|
||||
console.log(Zero.foo());
|
||||
}, async err => {
|
||||
@@ -46,18 +61,36 @@ define(["require", "exports"], function (require, exports) {
|
||||
//// [2.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
class C {
|
||||
constructor() {
|
||||
this.myModule = new Promise(function (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); });
|
||||
this.myModule.then(Zero => {
|
||||
console.log(Zero.foo());
|
||||
}, async (err) => {
|
||||
console.log(err);
|
||||
let one = await new Promise(function (resolve_2, reject_2) { require(["./1"], resolve_2, reject_2); });
|
||||
let one = await new Promise(function (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); });
|
||||
}
|
||||
method() {
|
||||
const loadAsync = new Promise(function (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); });
|
||||
console.log(one.backup());
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.D = D;
|
||||
});
|
||||
|
||||
@@ -27,35 +27,88 @@ class C {
|
||||
method() {
|
||||
>method : Symbol(C.method, Decl(2.ts, 2, 37))
|
||||
|
||||
const loadAsync = import("./0");
|
||||
>loadAsync : Symbol(loadAsync, Decl(2.ts, 4, 13))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
this.myModule.then(Zero => {
|
||||
>this.myModule.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>this.myModule : Symbol(C.myModule, Decl(2.ts, 1, 9))
|
||||
>this : Symbol(C, Decl(2.ts, 0, 25))
|
||||
>myModule : Symbol(C.myModule, Decl(2.ts, 1, 9))
|
||||
>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>Zero : Symbol(Zero, Decl(2.ts, 4, 27))
|
||||
>Zero : Symbol(Zero, Decl(2.ts, 5, 27))
|
||||
|
||||
console.log(Zero.foo());
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
>Zero.foo : Symbol(foo, Decl(0.ts, 2, 1))
|
||||
>Zero : Symbol(Zero, Decl(2.ts, 4, 27))
|
||||
>Zero : Symbol(Zero, Decl(2.ts, 5, 27))
|
||||
>foo : Symbol(foo, Decl(0.ts, 2, 1))
|
||||
|
||||
}, async err => {
|
||||
>err : Symbol(err, Decl(2.ts, 6, 16))
|
||||
>err : Symbol(err, Decl(2.ts, 7, 16))
|
||||
|
||||
console.log(err);
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
>err : Symbol(err, Decl(2.ts, 6, 16))
|
||||
>err : Symbol(err, Decl(2.ts, 7, 16))
|
||||
|
||||
let one = await import("./1");
|
||||
>one : Symbol(one, Decl(2.ts, 8, 15))
|
||||
>one : Symbol(one, Decl(2.ts, 9, 15))
|
||||
>"./1" : Symbol("tests/cases/conformance/dynamicImport/1", Decl(1.ts, 0, 0))
|
||||
|
||||
console.log(one.backup());
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
>one.backup : Symbol(backup, Decl(1.ts, 0, 0))
|
||||
>one : Symbol(one, Decl(2.ts, 8, 15))
|
||||
>one : Symbol(one, Decl(2.ts, 9, 15))
|
||||
>backup : Symbol(backup, Decl(1.ts, 0, 0))
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
>D : Symbol(D, Decl(2.ts, 13, 1))
|
||||
|
||||
private myModule = import("./0");
|
||||
>myModule : Symbol(D.myModule, Decl(2.ts, 15, 16))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
method() {
|
||||
>method : Symbol(D.method, Decl(2.ts, 16, 37))
|
||||
|
||||
const loadAsync = import("./0");
|
||||
>loadAsync : Symbol(loadAsync, Decl(2.ts, 18, 13))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
this.myModule.then(Zero => {
|
||||
>this.myModule.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>this.myModule : Symbol(D.myModule, Decl(2.ts, 15, 16))
|
||||
>this : Symbol(D, Decl(2.ts, 13, 1))
|
||||
>myModule : Symbol(D.myModule, Decl(2.ts, 15, 16))
|
||||
>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>Zero : Symbol(Zero, Decl(2.ts, 19, 27))
|
||||
|
||||
console.log(Zero.foo());
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
>Zero.foo : Symbol(foo, Decl(0.ts, 2, 1))
|
||||
>Zero : Symbol(Zero, Decl(2.ts, 19, 27))
|
||||
>foo : Symbol(foo, Decl(0.ts, 2, 1))
|
||||
|
||||
}, async err => {
|
||||
>err : Symbol(err, Decl(2.ts, 21, 16))
|
||||
|
||||
console.log(err);
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
>err : Symbol(err, Decl(2.ts, 21, 16))
|
||||
|
||||
let one = await import("./1");
|
||||
>one : Symbol(one, Decl(2.ts, 23, 15))
|
||||
>"./1" : Symbol("tests/cases/conformance/dynamicImport/1", Decl(1.ts, 0, 0))
|
||||
|
||||
console.log(one.backup());
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
>one.backup : Symbol(backup, Decl(1.ts, 0, 0))
|
||||
>one : Symbol(one, Decl(2.ts, 23, 15))
|
||||
>backup : Symbol(backup, Decl(1.ts, 0, 0))
|
||||
|
||||
});
|
||||
|
||||
@@ -31,6 +31,78 @@ class C {
|
||||
method() {
|
||||
>method : () => void
|
||||
|
||||
const loadAsync = import("./0");
|
||||
>loadAsync : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
this.myModule.then(Zero => {
|
||||
>this.myModule.then(Zero => { console.log(Zero.foo()); }, async err => { console.log(err); let one = await import("./1"); console.log(one.backup()); }) : Promise<void>
|
||||
>this.myModule.then : <TResult1 = typeof "tests/cases/conformance/dynamicImport/0", TResult2 = never>(onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
|
||||
>this.myModule : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>this : this
|
||||
>myModule : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>then : <TResult1 = typeof "tests/cases/conformance/dynamicImport/0", TResult2 = never>(onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
|
||||
>Zero => { console.log(Zero.foo()); } : (Zero: typeof "tests/cases/conformance/dynamicImport/0") => void
|
||||
>Zero : typeof "tests/cases/conformance/dynamicImport/0"
|
||||
|
||||
console.log(Zero.foo());
|
||||
>console.log(Zero.foo()) : any
|
||||
>console.log : any
|
||||
>console : any
|
||||
>log : any
|
||||
>Zero.foo() : string
|
||||
>Zero.foo : () => string
|
||||
>Zero : typeof "tests/cases/conformance/dynamicImport/0"
|
||||
>foo : () => string
|
||||
|
||||
}, async err => {
|
||||
>async err => { console.log(err); let one = await import("./1"); console.log(one.backup()); } : (err: any) => Promise<void>
|
||||
>err : any
|
||||
|
||||
console.log(err);
|
||||
>console.log(err) : any
|
||||
>console.log : any
|
||||
>console : any
|
||||
>log : any
|
||||
>err : any
|
||||
|
||||
let one = await import("./1");
|
||||
>one : typeof "tests/cases/conformance/dynamicImport/1"
|
||||
>await import("./1") : typeof "tests/cases/conformance/dynamicImport/1"
|
||||
>import("./1") : Promise<typeof "tests/cases/conformance/dynamicImport/1">
|
||||
>"./1" : "./1"
|
||||
|
||||
console.log(one.backup());
|
||||
>console.log(one.backup()) : any
|
||||
>console.log : any
|
||||
>console : any
|
||||
>log : any
|
||||
>one.backup() : string
|
||||
>one.backup : () => string
|
||||
>one : typeof "tests/cases/conformance/dynamicImport/1"
|
||||
>backup : () => string
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
>D : D
|
||||
|
||||
private myModule = import("./0");
|
||||
>myModule : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
method() {
|
||||
>method : () => void
|
||||
|
||||
const loadAsync = import("./0");
|
||||
>loadAsync : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
this.myModule.then(Zero => {
|
||||
>this.myModule.then(Zero => { console.log(Zero.foo()); }, async err => { console.log(err); let one = await import("./1"); console.log(one.backup()); }) : Promise<void>
|
||||
>this.myModule.then : <TResult1 = typeof "tests/cases/conformance/dynamicImport/0", TResult2 = never>(onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
|
||||
|
||||
@@ -10,6 +10,8 @@ p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
|
||||
function foo() {
|
||||
const p2 = import("./0");
|
||||
}
|
||||
@@ -20,11 +22,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||
function foo() { return "foo"; }
|
||||
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"); });
|
||||
p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
exports.p2 = Promise.resolve().then(function () { return require("./0"); });
|
||||
function foo() {
|
||||
const p2 = Promise.resolve().then(function () { return require("./0"); });
|
||||
}
|
||||
|
||||
@@ -23,10 +23,14 @@ p1.then(zero => {
|
||||
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 6, 10))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
function foo() {
|
||||
>foo : Symbol(foo, Decl(1.ts, 4, 3))
|
||||
>foo : Symbol(foo, Decl(1.ts, 6, 30))
|
||||
|
||||
const p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 7, 9))
|
||||
>p2 : Symbol(p2, Decl(1.ts, 9, 9))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
|
||||
@@ -29,6 +29,11 @@ p1.then(zero => {
|
||||
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
>p2 : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
function foo() {
|
||||
>foo : () => void
|
||||
|
||||
|
||||
@@ -15,6 +15,21 @@ declare var console: any;
|
||||
class C {
|
||||
private myModule = import("./0");
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
this.myModule.then(Zero => {
|
||||
console.log(Zero.foo());
|
||||
}, async err => {
|
||||
console.log(err);
|
||||
let one = await import("./1");
|
||||
console.log(one.backup());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
private myModule = import("./0");
|
||||
method() {
|
||||
const loadAsync = import("./0");
|
||||
this.myModule.then(Zero => {
|
||||
console.log(Zero.foo());
|
||||
}, async err => {
|
||||
@@ -40,11 +55,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||
function backup() { return "backup"; }
|
||||
exports.backup = backup;
|
||||
//// [2.js]
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
class C {
|
||||
constructor() {
|
||||
this.myModule = Promise.resolve().then(function () { return require("./0"); });
|
||||
}
|
||||
method() {
|
||||
const loadAsync = Promise.resolve().then(function () { return require("./0"); });
|
||||
this.myModule.then(Zero => {
|
||||
console.log(Zero.foo());
|
||||
}, async (err) => {
|
||||
@@ -54,3 +72,19 @@ class C {
|
||||
});
|
||||
}
|
||||
}
|
||||
class D {
|
||||
constructor() {
|
||||
this.myModule = Promise.resolve().then(function () { return require("./0"); });
|
||||
}
|
||||
method() {
|
||||
const loadAsync = Promise.resolve().then(function () { return 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"); });
|
||||
console.log(one.backup());
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.D = D;
|
||||
|
||||
@@ -27,35 +27,88 @@ class C {
|
||||
method() {
|
||||
>method : Symbol(C.method, Decl(2.ts, 2, 37))
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Symbol(loadAsync, Decl(2.ts, 4, 13))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
this.myModule.then(Zero => {
|
||||
>this.myModule.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>this.myModule : Symbol(C.myModule, Decl(2.ts, 1, 9))
|
||||
>this : Symbol(C, Decl(2.ts, 0, 25))
|
||||
>myModule : Symbol(C.myModule, Decl(2.ts, 1, 9))
|
||||
>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>Zero : Symbol(Zero, Decl(2.ts, 4, 27))
|
||||
>Zero : Symbol(Zero, Decl(2.ts, 5, 27))
|
||||
|
||||
console.log(Zero.foo());
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
>Zero.foo : Symbol(foo, Decl(0.ts, 2, 1))
|
||||
>Zero : Symbol(Zero, Decl(2.ts, 4, 27))
|
||||
>Zero : Symbol(Zero, Decl(2.ts, 5, 27))
|
||||
>foo : Symbol(foo, Decl(0.ts, 2, 1))
|
||||
|
||||
}, async err => {
|
||||
>err : Symbol(err, Decl(2.ts, 6, 16))
|
||||
>err : Symbol(err, Decl(2.ts, 7, 16))
|
||||
|
||||
console.log(err);
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
>err : Symbol(err, Decl(2.ts, 6, 16))
|
||||
>err : Symbol(err, Decl(2.ts, 7, 16))
|
||||
|
||||
let one = await import("./1");
|
||||
>one : Symbol(one, Decl(2.ts, 8, 15))
|
||||
>one : Symbol(one, Decl(2.ts, 9, 15))
|
||||
>"./1" : Symbol("tests/cases/conformance/dynamicImport/1", Decl(1.ts, 0, 0))
|
||||
|
||||
console.log(one.backup());
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
>one.backup : Symbol(backup, Decl(1.ts, 0, 0))
|
||||
>one : Symbol(one, Decl(2.ts, 8, 15))
|
||||
>one : Symbol(one, Decl(2.ts, 9, 15))
|
||||
>backup : Symbol(backup, Decl(1.ts, 0, 0))
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
>D : Symbol(D, Decl(2.ts, 13, 1))
|
||||
|
||||
private myModule = import("./0");
|
||||
>myModule : Symbol(D.myModule, Decl(2.ts, 15, 16))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
method() {
|
||||
>method : Symbol(D.method, Decl(2.ts, 16, 37))
|
||||
|
||||
const loadAsync = import("./0");
|
||||
>loadAsync : Symbol(loadAsync, Decl(2.ts, 18, 13))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
this.myModule.then(Zero => {
|
||||
>this.myModule.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>this.myModule : Symbol(D.myModule, Decl(2.ts, 15, 16))
|
||||
>this : Symbol(D, Decl(2.ts, 13, 1))
|
||||
>myModule : Symbol(D.myModule, Decl(2.ts, 15, 16))
|
||||
>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>Zero : Symbol(Zero, Decl(2.ts, 19, 27))
|
||||
|
||||
console.log(Zero.foo());
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
>Zero.foo : Symbol(foo, Decl(0.ts, 2, 1))
|
||||
>Zero : Symbol(Zero, Decl(2.ts, 19, 27))
|
||||
>foo : Symbol(foo, Decl(0.ts, 2, 1))
|
||||
|
||||
}, async err => {
|
||||
>err : Symbol(err, Decl(2.ts, 21, 16))
|
||||
|
||||
console.log(err);
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
>err : Symbol(err, Decl(2.ts, 21, 16))
|
||||
|
||||
let one = await import("./1");
|
||||
>one : Symbol(one, Decl(2.ts, 23, 15))
|
||||
>"./1" : Symbol("tests/cases/conformance/dynamicImport/1", Decl(1.ts, 0, 0))
|
||||
|
||||
console.log(one.backup());
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
>one.backup : Symbol(backup, Decl(1.ts, 0, 0))
|
||||
>one : Symbol(one, Decl(2.ts, 23, 15))
|
||||
>backup : Symbol(backup, Decl(1.ts, 0, 0))
|
||||
|
||||
});
|
||||
|
||||
@@ -31,6 +31,78 @@ class C {
|
||||
method() {
|
||||
>method : () => void
|
||||
|
||||
const loadAsync = import ("./0");
|
||||
>loadAsync : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import ("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
this.myModule.then(Zero => {
|
||||
>this.myModule.then(Zero => { console.log(Zero.foo()); }, async err => { console.log(err); let one = await import("./1"); console.log(one.backup()); }) : Promise<void>
|
||||
>this.myModule.then : <TResult1 = typeof "tests/cases/conformance/dynamicImport/0", TResult2 = never>(onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
|
||||
>this.myModule : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>this : this
|
||||
>myModule : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>then : <TResult1 = typeof "tests/cases/conformance/dynamicImport/0", TResult2 = never>(onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
|
||||
>Zero => { console.log(Zero.foo()); } : (Zero: typeof "tests/cases/conformance/dynamicImport/0") => void
|
||||
>Zero : typeof "tests/cases/conformance/dynamicImport/0"
|
||||
|
||||
console.log(Zero.foo());
|
||||
>console.log(Zero.foo()) : any
|
||||
>console.log : any
|
||||
>console : any
|
||||
>log : any
|
||||
>Zero.foo() : string
|
||||
>Zero.foo : () => string
|
||||
>Zero : typeof "tests/cases/conformance/dynamicImport/0"
|
||||
>foo : () => string
|
||||
|
||||
}, async err => {
|
||||
>async err => { console.log(err); let one = await import("./1"); console.log(one.backup()); } : (err: any) => Promise<void>
|
||||
>err : any
|
||||
|
||||
console.log(err);
|
||||
>console.log(err) : any
|
||||
>console.log : any
|
||||
>console : any
|
||||
>log : any
|
||||
>err : any
|
||||
|
||||
let one = await import("./1");
|
||||
>one : typeof "tests/cases/conformance/dynamicImport/1"
|
||||
>await import("./1") : typeof "tests/cases/conformance/dynamicImport/1"
|
||||
>import("./1") : Promise<typeof "tests/cases/conformance/dynamicImport/1">
|
||||
>"./1" : "./1"
|
||||
|
||||
console.log(one.backup());
|
||||
>console.log(one.backup()) : any
|
||||
>console.log : any
|
||||
>console : any
|
||||
>log : any
|
||||
>one.backup() : string
|
||||
>one.backup : () => string
|
||||
>one : typeof "tests/cases/conformance/dynamicImport/1"
|
||||
>backup : () => string
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
>D : D
|
||||
|
||||
private myModule = import("./0");
|
||||
>myModule : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
method() {
|
||||
>method : () => void
|
||||
|
||||
const loadAsync = import("./0");
|
||||
>loadAsync : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
this.myModule.then(Zero => {
|
||||
>this.myModule.then(Zero => { console.log(Zero.foo()); }, async err => { console.log(err); let one = await import("./1"); console.log(one.backup()); }) : Promise<void>
|
||||
>this.myModule.then : <TResult1 = typeof "tests/cases/conformance/dynamicImport/0", TResult2 = never>(onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
|
||||
|
||||
@@ -10,6 +10,8 @@ p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
|
||||
function foo() {
|
||||
const p2 = import("./0");
|
||||
}
|
||||
@@ -28,11 +30,12 @@ System.register([], function (exports_1, context_1) {
|
||||
});
|
||||
//// [1.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
"use strict";
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
function foo() {
|
||||
const p2 = context_1.import("./0");
|
||||
}
|
||||
var p1;
|
||||
var p1, p2;
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
@@ -41,6 +44,7 @@ System.register([], function (exports_1, context_1) {
|
||||
p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
exports_1("p2", p2 = context_1.import("./0"));
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -23,10 +23,14 @@ p1.then(zero => {
|
||||
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 6, 10))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
function foo() {
|
||||
>foo : Symbol(foo, Decl(1.ts, 4, 3))
|
||||
>foo : Symbol(foo, Decl(1.ts, 6, 30))
|
||||
|
||||
const p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 7, 9))
|
||||
>p2 : Symbol(p2, Decl(1.ts, 9, 9))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
|
||||
@@ -29,6 +29,11 @@ p1.then(zero => {
|
||||
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
>p2 : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
function foo() {
|
||||
>foo : () => void
|
||||
|
||||
|
||||
@@ -15,6 +15,21 @@ declare var console: any;
|
||||
class C {
|
||||
private myModule = import("./0");
|
||||
method() {
|
||||
const loadAsync = import("./0");
|
||||
this.myModule.then(Zero => {
|
||||
console.log(Zero.foo());
|
||||
}, async err => {
|
||||
console.log(err);
|
||||
let one = await import("./1");
|
||||
console.log(one.backup());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
private myModule = import("./0");
|
||||
method() {
|
||||
const loadAsync = import("./0");
|
||||
this.myModule.then(Zero => {
|
||||
console.log(Zero.foo());
|
||||
}, async err => {
|
||||
@@ -56,8 +71,9 @@ System.register([], function (exports_1, context_1) {
|
||||
});
|
||||
//// [2.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
"use strict";
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
var C;
|
||||
var C, D;
|
||||
return {
|
||||
setters: [],
|
||||
execute: function () {
|
||||
@@ -66,6 +82,7 @@ System.register([], function (exports_1, context_1) {
|
||||
this.myModule = context_1.import("./0");
|
||||
}
|
||||
method() {
|
||||
const loadAsync = context_1.import("./0");
|
||||
this.myModule.then(Zero => {
|
||||
console.log(Zero.foo());
|
||||
}, async (err) => {
|
||||
@@ -75,6 +92,22 @@ System.register([], function (exports_1, context_1) {
|
||||
});
|
||||
}
|
||||
};
|
||||
D = class D {
|
||||
constructor() {
|
||||
this.myModule = context_1.import("./0");
|
||||
}
|
||||
method() {
|
||||
const loadAsync = context_1.import("./0");
|
||||
this.myModule.then(Zero => {
|
||||
console.log(Zero.foo());
|
||||
}, async (err) => {
|
||||
console.log(err);
|
||||
let one = await context_1.import("./1");
|
||||
console.log(one.backup());
|
||||
});
|
||||
}
|
||||
};
|
||||
exports_1("D", D);
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -27,35 +27,88 @@ class C {
|
||||
method() {
|
||||
>method : Symbol(C.method, Decl(2.ts, 2, 37))
|
||||
|
||||
const loadAsync = import("./0");
|
||||
>loadAsync : Symbol(loadAsync, Decl(2.ts, 4, 13))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
this.myModule.then(Zero => {
|
||||
>this.myModule.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>this.myModule : Symbol(C.myModule, Decl(2.ts, 1, 9))
|
||||
>this : Symbol(C, Decl(2.ts, 0, 25))
|
||||
>myModule : Symbol(C.myModule, Decl(2.ts, 1, 9))
|
||||
>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>Zero : Symbol(Zero, Decl(2.ts, 4, 27))
|
||||
>Zero : Symbol(Zero, Decl(2.ts, 5, 27))
|
||||
|
||||
console.log(Zero.foo());
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
>Zero.foo : Symbol(foo, Decl(0.ts, 2, 1))
|
||||
>Zero : Symbol(Zero, Decl(2.ts, 4, 27))
|
||||
>Zero : Symbol(Zero, Decl(2.ts, 5, 27))
|
||||
>foo : Symbol(foo, Decl(0.ts, 2, 1))
|
||||
|
||||
}, async err => {
|
||||
>err : Symbol(err, Decl(2.ts, 6, 16))
|
||||
>err : Symbol(err, Decl(2.ts, 7, 16))
|
||||
|
||||
console.log(err);
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
>err : Symbol(err, Decl(2.ts, 6, 16))
|
||||
>err : Symbol(err, Decl(2.ts, 7, 16))
|
||||
|
||||
let one = await import("./1");
|
||||
>one : Symbol(one, Decl(2.ts, 8, 15))
|
||||
>one : Symbol(one, Decl(2.ts, 9, 15))
|
||||
>"./1" : Symbol("tests/cases/conformance/dynamicImport/1", Decl(1.ts, 0, 0))
|
||||
|
||||
console.log(one.backup());
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
>one.backup : Symbol(backup, Decl(1.ts, 0, 0))
|
||||
>one : Symbol(one, Decl(2.ts, 8, 15))
|
||||
>one : Symbol(one, Decl(2.ts, 9, 15))
|
||||
>backup : Symbol(backup, Decl(1.ts, 0, 0))
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
>D : Symbol(D, Decl(2.ts, 13, 1))
|
||||
|
||||
private myModule = import("./0");
|
||||
>myModule : Symbol(D.myModule, Decl(2.ts, 15, 16))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
method() {
|
||||
>method : Symbol(D.method, Decl(2.ts, 16, 37))
|
||||
|
||||
const loadAsync = import("./0");
|
||||
>loadAsync : Symbol(loadAsync, Decl(2.ts, 18, 13))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
this.myModule.then(Zero => {
|
||||
>this.myModule.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>this.myModule : Symbol(D.myModule, Decl(2.ts, 15, 16))
|
||||
>this : Symbol(D, Decl(2.ts, 13, 1))
|
||||
>myModule : Symbol(D.myModule, Decl(2.ts, 15, 16))
|
||||
>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>Zero : Symbol(Zero, Decl(2.ts, 19, 27))
|
||||
|
||||
console.log(Zero.foo());
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
>Zero.foo : Symbol(foo, Decl(0.ts, 2, 1))
|
||||
>Zero : Symbol(Zero, Decl(2.ts, 19, 27))
|
||||
>foo : Symbol(foo, Decl(0.ts, 2, 1))
|
||||
|
||||
}, async err => {
|
||||
>err : Symbol(err, Decl(2.ts, 21, 16))
|
||||
|
||||
console.log(err);
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
>err : Symbol(err, Decl(2.ts, 21, 16))
|
||||
|
||||
let one = await import("./1");
|
||||
>one : Symbol(one, Decl(2.ts, 23, 15))
|
||||
>"./1" : Symbol("tests/cases/conformance/dynamicImport/1", Decl(1.ts, 0, 0))
|
||||
|
||||
console.log(one.backup());
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
>one.backup : Symbol(backup, Decl(1.ts, 0, 0))
|
||||
>one : Symbol(one, Decl(2.ts, 23, 15))
|
||||
>backup : Symbol(backup, Decl(1.ts, 0, 0))
|
||||
|
||||
});
|
||||
|
||||
@@ -31,6 +31,78 @@ class C {
|
||||
method() {
|
||||
>method : () => void
|
||||
|
||||
const loadAsync = import("./0");
|
||||
>loadAsync : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
this.myModule.then(Zero => {
|
||||
>this.myModule.then(Zero => { console.log(Zero.foo()); }, async err => { console.log(err); let one = await import("./1"); console.log(one.backup()); }) : Promise<void>
|
||||
>this.myModule.then : <TResult1 = typeof "tests/cases/conformance/dynamicImport/0", TResult2 = never>(onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
|
||||
>this.myModule : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>this : this
|
||||
>myModule : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>then : <TResult1 = typeof "tests/cases/conformance/dynamicImport/0", TResult2 = never>(onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
|
||||
>Zero => { console.log(Zero.foo()); } : (Zero: typeof "tests/cases/conformance/dynamicImport/0") => void
|
||||
>Zero : typeof "tests/cases/conformance/dynamicImport/0"
|
||||
|
||||
console.log(Zero.foo());
|
||||
>console.log(Zero.foo()) : any
|
||||
>console.log : any
|
||||
>console : any
|
||||
>log : any
|
||||
>Zero.foo() : string
|
||||
>Zero.foo : () => string
|
||||
>Zero : typeof "tests/cases/conformance/dynamicImport/0"
|
||||
>foo : () => string
|
||||
|
||||
}, async err => {
|
||||
>async err => { console.log(err); let one = await import("./1"); console.log(one.backup()); } : (err: any) => Promise<void>
|
||||
>err : any
|
||||
|
||||
console.log(err);
|
||||
>console.log(err) : any
|
||||
>console.log : any
|
||||
>console : any
|
||||
>log : any
|
||||
>err : any
|
||||
|
||||
let one = await import("./1");
|
||||
>one : typeof "tests/cases/conformance/dynamicImport/1"
|
||||
>await import("./1") : typeof "tests/cases/conformance/dynamicImport/1"
|
||||
>import("./1") : Promise<typeof "tests/cases/conformance/dynamicImport/1">
|
||||
>"./1" : "./1"
|
||||
|
||||
console.log(one.backup());
|
||||
>console.log(one.backup()) : any
|
||||
>console.log : any
|
||||
>console : any
|
||||
>log : any
|
||||
>one.backup() : string
|
||||
>one.backup : () => string
|
||||
>one : typeof "tests/cases/conformance/dynamicImport/1"
|
||||
>backup : () => string
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
>D : D
|
||||
|
||||
private myModule = import("./0");
|
||||
>myModule : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
method() {
|
||||
>method : () => void
|
||||
|
||||
const loadAsync = import("./0");
|
||||
>loadAsync : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
this.myModule.then(Zero => {
|
||||
>this.myModule.then(Zero => { console.log(Zero.foo()); }, async err => { console.log(err); let one = await import("./1"); console.log(one.backup()); }) : Promise<void>
|
||||
>this.myModule.then : <TResult1 = typeof "tests/cases/conformance/dynamicImport/0", TResult2 = never>(onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
|
||||
|
||||
@@ -10,6 +10,8 @@ p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
|
||||
function foo() {
|
||||
const p2 = import("./0");
|
||||
}
|
||||
@@ -41,12 +43,14 @@ function foo() {
|
||||
})(function (require, exports) {
|
||||
"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); });
|
||||
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); });
|
||||
function foo() {
|
||||
const p2 = __syncRequire ? Promise.resolve().then(function () { return require("./0"); }) : new Promise(function (resolve_3, reject_3) { require(["./0"], resolve_3, reject_3); });
|
||||
const p2 = __syncRequire ? Promise.resolve().then(function () { return require("./0"); }) : new Promise(function (resolve_4, reject_4) { require(["./0"], resolve_4, reject_4); });
|
||||
}
|
||||
});
|
||||
|
||||
@@ -23,10 +23,14 @@ p1.then(zero => {
|
||||
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 6, 10))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
function foo() {
|
||||
>foo : Symbol(foo, Decl(1.ts, 4, 3))
|
||||
>foo : Symbol(foo, Decl(1.ts, 6, 30))
|
||||
|
||||
const p2 = import("./0");
|
||||
>p2 : Symbol(p2, Decl(1.ts, 7, 9))
|
||||
>p2 : Symbol(p2, Decl(1.ts, 9, 9))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
}
|
||||
|
||||
@@ -29,6 +29,11 @@ p1.then(zero => {
|
||||
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
>p2 : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
function foo() {
|
||||
>foo : () => void
|
||||
|
||||
|
||||
@@ -15,6 +15,21 @@ declare var console: any;
|
||||
class C {
|
||||
private myModule = import("./0");
|
||||
method() {
|
||||
const loadAsync = import("./0");
|
||||
this.myModule.then(Zero => {
|
||||
console.log(Zero.foo());
|
||||
}, async err => {
|
||||
console.log(err);
|
||||
let one = await import("./1");
|
||||
console.log(one.backup());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
private myModule = import("./0");
|
||||
method() {
|
||||
const loadAsync = import("./0");
|
||||
this.myModule.then(Zero => {
|
||||
console.log(Zero.foo());
|
||||
}, async err => {
|
||||
@@ -71,18 +86,36 @@ class C {
|
||||
})(function (require, exports) {
|
||||
"use strict";
|
||||
var __syncRequire = typeof module === "object" && typeof module.exports === "object";
|
||||
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); });
|
||||
}
|
||||
method() {
|
||||
const loadAsync = __syncRequire ? Promise.resolve().then(function () { return require("./0"); }) : new Promise(function (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_2, reject_2) { require(["./1"], resolve_2, reject_2); }));
|
||||
let one = await (__syncRequire ? Promise.resolve().then(function () { return require("./1"); }) : new Promise(function (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); });
|
||||
}
|
||||
method() {
|
||||
const loadAsync = __syncRequire ? Promise.resolve().then(function () { return require("./0"); }) : new Promise(function (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); }));
|
||||
console.log(one.backup());
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.D = D;
|
||||
});
|
||||
|
||||
@@ -27,35 +27,88 @@ class C {
|
||||
method() {
|
||||
>method : Symbol(C.method, Decl(2.ts, 2, 37))
|
||||
|
||||
const loadAsync = import("./0");
|
||||
>loadAsync : Symbol(loadAsync, Decl(2.ts, 4, 13))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
this.myModule.then(Zero => {
|
||||
>this.myModule.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>this.myModule : Symbol(C.myModule, Decl(2.ts, 1, 9))
|
||||
>this : Symbol(C, Decl(2.ts, 0, 25))
|
||||
>myModule : Symbol(C.myModule, Decl(2.ts, 1, 9))
|
||||
>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>Zero : Symbol(Zero, Decl(2.ts, 4, 27))
|
||||
>Zero : Symbol(Zero, Decl(2.ts, 5, 27))
|
||||
|
||||
console.log(Zero.foo());
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
>Zero.foo : Symbol(foo, Decl(0.ts, 2, 1))
|
||||
>Zero : Symbol(Zero, Decl(2.ts, 4, 27))
|
||||
>Zero : Symbol(Zero, Decl(2.ts, 5, 27))
|
||||
>foo : Symbol(foo, Decl(0.ts, 2, 1))
|
||||
|
||||
}, async err => {
|
||||
>err : Symbol(err, Decl(2.ts, 6, 16))
|
||||
>err : Symbol(err, Decl(2.ts, 7, 16))
|
||||
|
||||
console.log(err);
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
>err : Symbol(err, Decl(2.ts, 6, 16))
|
||||
>err : Symbol(err, Decl(2.ts, 7, 16))
|
||||
|
||||
let one = await import("./1");
|
||||
>one : Symbol(one, Decl(2.ts, 8, 15))
|
||||
>one : Symbol(one, Decl(2.ts, 9, 15))
|
||||
>"./1" : Symbol("tests/cases/conformance/dynamicImport/1", Decl(1.ts, 0, 0))
|
||||
|
||||
console.log(one.backup());
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
>one.backup : Symbol(backup, Decl(1.ts, 0, 0))
|
||||
>one : Symbol(one, Decl(2.ts, 8, 15))
|
||||
>one : Symbol(one, Decl(2.ts, 9, 15))
|
||||
>backup : Symbol(backup, Decl(1.ts, 0, 0))
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
>D : Symbol(D, Decl(2.ts, 13, 1))
|
||||
|
||||
private myModule = import("./0");
|
||||
>myModule : Symbol(D.myModule, Decl(2.ts, 15, 16))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
method() {
|
||||
>method : Symbol(D.method, Decl(2.ts, 16, 37))
|
||||
|
||||
const loadAsync = import("./0");
|
||||
>loadAsync : Symbol(loadAsync, Decl(2.ts, 18, 13))
|
||||
>"./0" : Symbol("tests/cases/conformance/dynamicImport/0", Decl(0.ts, 0, 0))
|
||||
|
||||
this.myModule.then(Zero => {
|
||||
>this.myModule.then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>this.myModule : Symbol(D.myModule, Decl(2.ts, 15, 16))
|
||||
>this : Symbol(D, Decl(2.ts, 13, 1))
|
||||
>myModule : Symbol(D.myModule, Decl(2.ts, 15, 16))
|
||||
>then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
|
||||
>Zero : Symbol(Zero, Decl(2.ts, 19, 27))
|
||||
|
||||
console.log(Zero.foo());
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
>Zero.foo : Symbol(foo, Decl(0.ts, 2, 1))
|
||||
>Zero : Symbol(Zero, Decl(2.ts, 19, 27))
|
||||
>foo : Symbol(foo, Decl(0.ts, 2, 1))
|
||||
|
||||
}, async err => {
|
||||
>err : Symbol(err, Decl(2.ts, 21, 16))
|
||||
|
||||
console.log(err);
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
>err : Symbol(err, Decl(2.ts, 21, 16))
|
||||
|
||||
let one = await import("./1");
|
||||
>one : Symbol(one, Decl(2.ts, 23, 15))
|
||||
>"./1" : Symbol("tests/cases/conformance/dynamicImport/1", Decl(1.ts, 0, 0))
|
||||
|
||||
console.log(one.backup());
|
||||
>console : Symbol(console, Decl(2.ts, 0, 11))
|
||||
>one.backup : Symbol(backup, Decl(1.ts, 0, 0))
|
||||
>one : Symbol(one, Decl(2.ts, 23, 15))
|
||||
>backup : Symbol(backup, Decl(1.ts, 0, 0))
|
||||
|
||||
});
|
||||
|
||||
@@ -31,6 +31,78 @@ class C {
|
||||
method() {
|
||||
>method : () => void
|
||||
|
||||
const loadAsync = import("./0");
|
||||
>loadAsync : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
this.myModule.then(Zero => {
|
||||
>this.myModule.then(Zero => { console.log(Zero.foo()); }, async err => { console.log(err); let one = await import("./1"); console.log(one.backup()); }) : Promise<void>
|
||||
>this.myModule.then : <TResult1 = typeof "tests/cases/conformance/dynamicImport/0", TResult2 = never>(onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
|
||||
>this.myModule : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>this : this
|
||||
>myModule : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>then : <TResult1 = typeof "tests/cases/conformance/dynamicImport/0", TResult2 = never>(onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
|
||||
>Zero => { console.log(Zero.foo()); } : (Zero: typeof "tests/cases/conformance/dynamicImport/0") => void
|
||||
>Zero : typeof "tests/cases/conformance/dynamicImport/0"
|
||||
|
||||
console.log(Zero.foo());
|
||||
>console.log(Zero.foo()) : any
|
||||
>console.log : any
|
||||
>console : any
|
||||
>log : any
|
||||
>Zero.foo() : string
|
||||
>Zero.foo : () => string
|
||||
>Zero : typeof "tests/cases/conformance/dynamicImport/0"
|
||||
>foo : () => string
|
||||
|
||||
}, async err => {
|
||||
>async err => { console.log(err); let one = await import("./1"); console.log(one.backup()); } : (err: any) => Promise<void>
|
||||
>err : any
|
||||
|
||||
console.log(err);
|
||||
>console.log(err) : any
|
||||
>console.log : any
|
||||
>console : any
|
||||
>log : any
|
||||
>err : any
|
||||
|
||||
let one = await import("./1");
|
||||
>one : typeof "tests/cases/conformance/dynamicImport/1"
|
||||
>await import("./1") : typeof "tests/cases/conformance/dynamicImport/1"
|
||||
>import("./1") : Promise<typeof "tests/cases/conformance/dynamicImport/1">
|
||||
>"./1" : "./1"
|
||||
|
||||
console.log(one.backup());
|
||||
>console.log(one.backup()) : any
|
||||
>console.log : any
|
||||
>console : any
|
||||
>log : any
|
||||
>one.backup() : string
|
||||
>one.backup : () => string
|
||||
>one : typeof "tests/cases/conformance/dynamicImport/1"
|
||||
>backup : () => string
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
>D : D
|
||||
|
||||
private myModule = import("./0");
|
||||
>myModule : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
method() {
|
||||
>method : () => void
|
||||
|
||||
const loadAsync = import("./0");
|
||||
>loadAsync : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>import("./0") : Promise<typeof "tests/cases/conformance/dynamicImport/0">
|
||||
>"./0" : "./0"
|
||||
|
||||
this.myModule.then(Zero => {
|
||||
>this.myModule.then(Zero => { console.log(Zero.foo()); }, async err => { console.log(err); let one = await import("./1"); console.log(one.backup()); }) : Promise<void>
|
||||
>this.myModule.then : <TResult1 = typeof "tests/cases/conformance/dynamicImport/0", TResult2 = never>(onfulfilled?: (value: typeof "tests/cases/conformance/dynamicImport/0") => TResult1 | PromiseLike<TResult1>, onrejected?: (reason: any) => TResult2 | PromiseLike<TResult2>) => Promise<TResult1 | TResult2>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
error TS2468: Cannot find global value 'Promise'.
|
||||
tests/cases/conformance/dynamicImport/2.ts(3,24): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
|
||||
tests/cases/conformance/dynamicImport/2.ts(7,12): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
|
||||
tests/cases/conformance/dynamicImport/2.ts(9,29): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
|
||||
tests/cases/conformance/dynamicImport/2.ts(5,27): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
|
||||
tests/cases/conformance/dynamicImport/2.ts(8,12): error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
|
||||
tests/cases/conformance/dynamicImport/2.ts(10,29): error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
|
||||
|
||||
|
||||
!!! error TS2468: Cannot find global value 'Promise'.
|
||||
@@ -15,13 +16,16 @@ tests/cases/conformance/dynamicImport/2.ts(9,29): error TS2712: A dynamic import
|
||||
==== tests/cases/conformance/dynamicImport/1.ts (0 errors) ====
|
||||
export function backup() { return "backup"; }
|
||||
|
||||
==== tests/cases/conformance/dynamicImport/2.ts (3 errors) ====
|
||||
==== tests/cases/conformance/dynamicImport/2.ts (4 errors) ====
|
||||
declare var console: any;
|
||||
class C {
|
||||
private myModule = import("./0");
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
|
||||
method() {
|
||||
const loadAsync = import("./0");
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2712: A dynamic import call in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
|
||||
this.myModule.then(Zero => {
|
||||
console.log(Zero.foo());
|
||||
}, async err => {
|
||||
|
||||
@@ -15,6 +15,7 @@ declare var console: any;
|
||||
class C {
|
||||
private myModule = import("./0");
|
||||
method() {
|
||||
const loadAsync = import("./0");
|
||||
this.myModule.then(Zero => {
|
||||
console.log(Zero.foo());
|
||||
}, async err => {
|
||||
@@ -84,6 +85,7 @@ var C = (function () {
|
||||
}
|
||||
C.prototype.method = function () {
|
||||
var _this = this;
|
||||
var loadAsync = Promise.resolve().then(function () { return require("./0"); });
|
||||
this.myModule.then(function (Zero) {
|
||||
console.log(Zero.foo());
|
||||
}, function (err) { return __awaiter(_this, void 0, void 0, function () {
|
||||
|
||||
@@ -12,7 +12,4 @@ tests/cases/conformance/dynamicImport/1.ts(3,10): error TS1326: Dynamic import c
|
||||
!!! error TS1326: Dynamic import cannot have type arguments
|
||||
var p2 = import<>("./0"); // error
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS1326: Dynamic import cannot have type arguments
|
||||
// p1.then(value => {
|
||||
// value.anyFunction();
|
||||
// })
|
||||
!!! error TS1326: Dynamic import cannot have type arguments
|
||||
@@ -6,10 +6,7 @@ export function foo() { return "foo"; }
|
||||
//// [1.ts]
|
||||
"use strict"
|
||||
var p1 = import<Promise<any>>("./0"); // error
|
||||
var p2 = import<>("./0"); // error
|
||||
// p1.then(value => {
|
||||
// value.anyFunction();
|
||||
// })
|
||||
var p2 = import<>("./0"); // error
|
||||
|
||||
//// [0.js]
|
||||
"use strict";
|
||||
|
||||
@@ -10,6 +10,8 @@ p1.then(zero => {
|
||||
return zero.foo();
|
||||
})
|
||||
|
||||
export var p2 = import("./0");
|
||||
|
||||
function foo() {
|
||||
const p2 = import("./0");
|
||||
}
|
||||
@@ -15,6 +15,7 @@ declare var console: any;
|
||||
class C {
|
||||
private myModule = import("./0");
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
this.myModule.then(Zero => {
|
||||
console.log(Zero.foo());
|
||||
}, async err => {
|
||||
|
||||
@@ -11,6 +11,20 @@ p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
|
||||
function foo() {
|
||||
const p2 = import("./0");
|
||||
}
|
||||
|
||||
class C {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,20 @@ p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
|
||||
function foo() {
|
||||
const p2 = import("./0");
|
||||
}
|
||||
|
||||
class C {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,20 @@ p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
|
||||
function foo() {
|
||||
const p2 = import("./0");
|
||||
}
|
||||
|
||||
class C {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,20 @@ p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
|
||||
function foo() {
|
||||
const p2 = import("./0");
|
||||
}
|
||||
|
||||
class C {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// @module: amd
|
||||
// @target: es6
|
||||
// @filename: 0.ts
|
||||
export function foo() { return "foo"; }
|
||||
|
||||
// @filename: 1.ts
|
||||
import("./0");
|
||||
var p1 = import("./0");
|
||||
p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
|
||||
function foo() {
|
||||
const p2 = import("./0");
|
||||
}
|
||||
|
||||
class C {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// @module: commonjs
|
||||
// @target: es6
|
||||
// @filename: 0.ts
|
||||
export function foo() { return "foo"; }
|
||||
|
||||
// @filename: 1.ts
|
||||
import("./0");
|
||||
var p1 = import("./0");
|
||||
p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
|
||||
function foo() {
|
||||
const p2 = import("./0");
|
||||
}
|
||||
|
||||
class C {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// @module: system
|
||||
// @target: es6
|
||||
// @filename: 0.ts
|
||||
export function foo() { return "foo"; }
|
||||
|
||||
// @filename: 1.ts
|
||||
import("./0");
|
||||
var p1 = import("./0");
|
||||
p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
|
||||
function foo() {
|
||||
const p2 = import("./0");
|
||||
}
|
||||
|
||||
class C {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// @module: umd
|
||||
// @target: es6
|
||||
// @filename: 0.ts
|
||||
export function foo() { return "foo"; }
|
||||
|
||||
// @filename: 1.ts
|
||||
import("./0");
|
||||
var p1 = import("./0");
|
||||
p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
|
||||
function foo() {
|
||||
const p2 = import("./0");
|
||||
}
|
||||
|
||||
class C {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,8 @@ p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
|
||||
function foo() {
|
||||
const p2 = import("./0");
|
||||
}
|
||||
@@ -15,6 +15,21 @@ declare var console: any;
|
||||
class C {
|
||||
private myModule = import("./0");
|
||||
method() {
|
||||
const loadAsync = import("./0");
|
||||
this.myModule.then(Zero => {
|
||||
console.log(Zero.foo());
|
||||
}, async err => {
|
||||
console.log(err);
|
||||
let one = await import("./1");
|
||||
console.log(one.backup());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
private myModule = import("./0");
|
||||
method() {
|
||||
const loadAsync = import("./0");
|
||||
this.myModule.then(Zero => {
|
||||
console.log(Zero.foo());
|
||||
}, async err => {
|
||||
|
||||
@@ -10,6 +10,8 @@ p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
|
||||
function foo() {
|
||||
const p2 = import("./0");
|
||||
}
|
||||
@@ -15,6 +15,21 @@ declare var console: any;
|
||||
class C {
|
||||
private myModule = import("./0");
|
||||
method() {
|
||||
const loadAsync = import ("./0");
|
||||
this.myModule.then(Zero => {
|
||||
console.log(Zero.foo());
|
||||
}, async err => {
|
||||
console.log(err);
|
||||
let one = await import("./1");
|
||||
console.log(one.backup());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
private myModule = import("./0");
|
||||
method() {
|
||||
const loadAsync = import("./0");
|
||||
this.myModule.then(Zero => {
|
||||
console.log(Zero.foo());
|
||||
}, async err => {
|
||||
|
||||
@@ -10,6 +10,8 @@ p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
|
||||
function foo() {
|
||||
const p2 = import("./0");
|
||||
}
|
||||
@@ -15,6 +15,21 @@ declare var console: any;
|
||||
class C {
|
||||
private myModule = import("./0");
|
||||
method() {
|
||||
const loadAsync = import("./0");
|
||||
this.myModule.then(Zero => {
|
||||
console.log(Zero.foo());
|
||||
}, async err => {
|
||||
console.log(err);
|
||||
let one = await import("./1");
|
||||
console.log(one.backup());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
private myModule = import("./0");
|
||||
method() {
|
||||
const loadAsync = import("./0");
|
||||
this.myModule.then(Zero => {
|
||||
console.log(Zero.foo());
|
||||
}, async err => {
|
||||
|
||||
@@ -10,6 +10,8 @@ p1.then(zero => {
|
||||
return zero.foo();
|
||||
});
|
||||
|
||||
export var p2 = import("./0");
|
||||
|
||||
function foo() {
|
||||
const p2 = import("./0");
|
||||
}
|
||||
@@ -15,6 +15,21 @@ declare var console: any;
|
||||
class C {
|
||||
private myModule = import("./0");
|
||||
method() {
|
||||
const loadAsync = import("./0");
|
||||
this.myModule.then(Zero => {
|
||||
console.log(Zero.foo());
|
||||
}, async err => {
|
||||
console.log(err);
|
||||
let one = await import("./1");
|
||||
console.log(one.backup());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export class D {
|
||||
private myModule = import("./0");
|
||||
method() {
|
||||
const loadAsync = import("./0");
|
||||
this.myModule.then(Zero => {
|
||||
console.log(Zero.foo());
|
||||
}, async err => {
|
||||
|
||||
@@ -13,6 +13,7 @@ declare var console: any;
|
||||
class C {
|
||||
private myModule = import("./0");
|
||||
method() {
|
||||
const loadAsync = import("./0");
|
||||
this.myModule.then(Zero => {
|
||||
console.log(Zero.foo());
|
||||
}, async err => {
|
||||
|
||||
@@ -8,7 +8,4 @@ export function foo() { return "foo"; }
|
||||
// @filename: 1.ts
|
||||
"use strict"
|
||||
var p1 = import<Promise<any>>("./0"); // error
|
||||
var p2 = import<>("./0"); // error
|
||||
// p1.then(value => {
|
||||
// value.anyFunction();
|
||||
// })
|
||||
var p2 = import<>("./0"); // error
|
||||
Reference in New Issue
Block a user