This commit is contained in:
JBerger 2015-08-12 15:34:03 -06:00
parent 7c8da42230
commit 500861c4f8
8 changed files with 199 additions and 0 deletions

View File

@ -0,0 +1,35 @@
//// [tests/cases/conformance/classes/classExpressions/extendClassExpressionFromModule.ts] ////
//// [foo1.ts]
class x{}
export = x;
//// [foo2.ts]
import foo1 = require('./foo1');
var x = foo1;
class y extends x {}
//// [foo1.js]
var x = (function () {
function x() {
}
return x;
})();
module.exports = x;
//// [foo2.js]
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var foo1 = require('./foo1');
var x = foo1;
var y = (function (_super) {
__extends(y, _super);
function y() {
_super.apply(this, arguments);
}
return y;
})(x);

View File

@ -0,0 +1,18 @@
=== tests/cases/conformance/classes/classExpressions/foo2.ts ===
import foo1 = require('./foo1');
>foo1 : Symbol(foo1, Decl(foo2.ts, 0, 0))
var x = foo1;
>x : Symbol(x, Decl(foo2.ts, 1, 3))
>foo1 : Symbol(foo1, Decl(foo2.ts, 0, 0))
class y extends x {}
>y : Symbol(y, Decl(foo2.ts, 1, 13))
=== tests/cases/conformance/classes/classExpressions/foo1.ts ===
class x{}
>x : Symbol(x, Decl(foo1.ts, 0, 0))
export = x;
>x : Symbol(x, Decl(foo1.ts, 0, 0))

View File

@ -0,0 +1,19 @@
=== tests/cases/conformance/classes/classExpressions/foo2.ts ===
import foo1 = require('./foo1');
>foo1 : typeof foo1
var x = foo1;
>x : typeof foo1
>foo1 : typeof foo1
class y extends x {}
>y : y
>x : foo1
=== tests/cases/conformance/classes/classExpressions/foo1.ts ===
class x{}
>x : x
export = x;
>x : x

View File

@ -0,0 +1,45 @@
//// [tests/cases/conformance/externalModules/reexportClassDefinition.ts] ////
//// [foo1.ts]
class x{}
export = x;
//// [foo2.ts]
import foo1 = require('./foo1');
export = {
x: foo1
}
//// [foo3.ts]
import foo2 = require('./foo2')
class x extends foo2.x {}
//// [foo1.js]
var x = (function () {
function x() {
}
return x;
})();
module.exports = x;
//// [foo2.js]
var foo1 = require('./foo1');
module.exports = {
x: foo1
};
//// [foo3.js]
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var foo2 = require('./foo2');
var x = (function (_super) {
__extends(x, _super);
function x() {
_super.apply(this, arguments);
}
return x;
})(foo2.x);

View File

@ -0,0 +1,26 @@
=== tests/cases/conformance/externalModules/foo3.ts ===
import foo2 = require('./foo2')
>foo2 : Symbol(foo2, Decl(foo3.ts, 0, 0))
class x extends foo2.x {}
>x : Symbol(x, Decl(foo3.ts, 0, 31))
>foo2 : Symbol(foo2, Decl(foo3.ts, 0, 0))
=== tests/cases/conformance/externalModules/foo1.ts ===
class x{}
>x : Symbol(x, Decl(foo1.ts, 0, 0))
export = x;
>x : Symbol(x, Decl(foo1.ts, 0, 0))
=== tests/cases/conformance/externalModules/foo2.ts ===
import foo1 = require('./foo1');
>foo1 : Symbol(foo1, Decl(foo2.ts, 0, 0))
export = {
x: foo1
>x : Symbol(x, Decl(foo2.ts, 2, 10))
>foo1 : Symbol(foo1, Decl(foo2.ts, 0, 0))
}

View File

@ -0,0 +1,30 @@
=== tests/cases/conformance/externalModules/foo3.ts ===
import foo2 = require('./foo2')
>foo2 : { x: typeof x; }
class x extends foo2.x {}
>x : x
>foo2.x : x
>foo2 : { x: typeof x; }
>x : typeof x
=== tests/cases/conformance/externalModules/foo1.ts ===
class x{}
>x : x
export = x;
>x : x
=== tests/cases/conformance/externalModules/foo2.ts ===
import foo1 = require('./foo1');
>foo1 : typeof foo1
export = {
>{ x: foo1} : { x: typeof foo1; }
x: foo1
>x : typeof foo1
>foo1 : typeof foo1
}

View File

@ -0,0 +1,10 @@
// @module: commonjs
// @Filename: foo1.ts
class x{}
export = x;
// @Filename: foo2.ts
import foo1 = require('./foo1');
var x = foo1;
class y extends x {}

View File

@ -0,0 +1,16 @@
// @module: commonjs
// @Filename: foo1.ts
class x{}
export = x;
// @Filename: foo2.ts
import foo1 = require('./foo1');
export = {
x: foo1
}
// @Filename: foo3.ts
import foo2 = require('./foo2')
class x extends foo2.x {}