Add more tests

This commit is contained in:
Mohamed Hegazy
2015-04-23 10:44:44 -07:00
parent ae4474aa40
commit 5172c172b7
39 changed files with 1281 additions and 228 deletions

View File

@@ -1,4 +1,4 @@
//// [es5-umd.ts]
//// [es5-umd.ts]
class A
{
@@ -12,21 +12,21 @@ class A
return 42;
}
}
//// [es5-umd.js]
var A = (function () {
function A() {
}
A.prototype.B = function () {
return 42;
};
return A;
})();
//# sourceMappingURL=es5-umd.js.map
//// [es5-umd.d.ts]
declare class A {
constructor();
B(): number;
}
//// [es5-umd.js]
var A = (function () {
function A() {
}
A.prototype.B = function () {
return 42;
};
return A;
})();
//# sourceMappingURL=es5-umd.js.map
//// [es5-umd.d.ts]
declare class A {
constructor();
B(): number;
}

View File

@@ -1,2 +1,2 @@
//// [es5-umd.js.map]
//// [es5-umd.js.map]
{"version":3,"file":"es5-umd.js","sourceRoot":"","sources":["es5-umd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA;IAEIA;IAGAC,CAACA;IAEMD,aAACA,GAARA;QAEIE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;IACLF,QAACA;AAADA,CAACA,AAXD,IAWC"}

View File

@@ -1,100 +1,100 @@
===================================================================
JsFile: es5-umd.js
mapUrl: es5-umd.js.map
sourceRoot:
sources: es5-umd.ts
===================================================================
-------------------------------------------------------------------
emittedFile:tests/cases/compiler/es5-umd.js
sourceFile:es5-umd.ts
-------------------------------------------------------------------
>>>var A = (function () {
===================================================================
JsFile: es5-umd.js
mapUrl: es5-umd.js.map
sourceRoot:
sources: es5-umd.ts
===================================================================
-------------------------------------------------------------------
emittedFile:tests/cases/compiler/es5-umd.js
sourceFile:es5-umd.ts
-------------------------------------------------------------------
>>>var A = (function () {
1 >
2 >^^^^^^^^^^^^^^^^^^^->
1 >
2 >^^^^^^^^^^^^^^^^^^^->
1 >
>
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
---
>>> function A() {
1->^^^^
2 > ^^->
>
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
---
>>> function A() {
1->^^^^
2 > ^^->
1->class A
>{
>
1->Emitted(2, 5) Source(4, 5) + SourceIndex(0) name (A)
---
>>> }
1->^^^^
2 > ^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
>
1->Emitted(2, 5) Source(4, 5) + SourceIndex(0) name (A)
---
>>> }
1->^^^^
2 > ^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1->constructor ()
> {
>
>
2 > }
1->Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor)
2 >Emitted(3, 6) Source(7, 6) + SourceIndex(0) name (A.constructor)
---
>>> A.prototype.B = function () {
1->^^^^
2 > ^^^^^^^^^^^^^
3 > ^^^
>
2 > }
1->Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor)
2 >Emitted(3, 6) Source(7, 6) + SourceIndex(0) name (A.constructor)
---
>>> A.prototype.B = function () {
1->^^^^
2 > ^^^^^^^^^^^^^
3 > ^^^
1->
>
> public
2 > B
3 >
1->Emitted(4, 5) Source(9, 12) + SourceIndex(0) name (A)
2 >Emitted(4, 18) Source(9, 13) + SourceIndex(0) name (A)
3 >Emitted(4, 21) Source(9, 5) + SourceIndex(0) name (A)
---
>>> return 42;
1 >^^^^^^^^
2 > ^^^^^^
3 > ^
4 > ^^
5 > ^
> public
2 > B
3 >
1->Emitted(4, 5) Source(9, 12) + SourceIndex(0) name (A)
2 >Emitted(4, 18) Source(9, 13) + SourceIndex(0) name (A)
3 >Emitted(4, 21) Source(9, 5) + SourceIndex(0) name (A)
---
>>> return 42;
1 >^^^^^^^^
2 > ^^^^^^
3 > ^
4 > ^^
5 > ^
1 >public B()
> {
>
2 > return
3 >
4 > 42
5 > ;
1 >Emitted(5, 9) Source(11, 9) + SourceIndex(0) name (A.B)
2 >Emitted(5, 15) Source(11, 15) + SourceIndex(0) name (A.B)
3 >Emitted(5, 16) Source(11, 16) + SourceIndex(0) name (A.B)
4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) name (A.B)
5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) name (A.B)
---
>>> };
1 >^^^^
2 > ^
3 > ^^^^^^^^^->
>
2 > return
3 >
4 > 42
5 > ;
1 >Emitted(5, 9) Source(11, 9) + SourceIndex(0) name (A.B)
2 >Emitted(5, 15) Source(11, 15) + SourceIndex(0) name (A.B)
3 >Emitted(5, 16) Source(11, 16) + SourceIndex(0) name (A.B)
4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) name (A.B)
5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) name (A.B)
---
>>> };
1 >^^^^
2 > ^
3 > ^^^^^^^^^->
1 >
>
2 > }
1 >Emitted(6, 5) Source(12, 5) + SourceIndex(0) name (A.B)
2 >Emitted(6, 6) Source(12, 6) + SourceIndex(0) name (A.B)
---
>>> return A;
1->^^^^
2 > ^^^^^^^^
>
2 > }
1 >Emitted(6, 5) Source(12, 5) + SourceIndex(0) name (A.B)
2 >Emitted(6, 6) Source(12, 6) + SourceIndex(0) name (A.B)
---
>>> return A;
1->^^^^
2 > ^^^^^^^^
1->
>
2 > }
1->Emitted(7, 5) Source(13, 1) + SourceIndex(0) name (A)
2 >Emitted(7, 13) Source(13, 2) + SourceIndex(0) name (A)
---
>>>})();
1 >
2 >^
3 >
4 > ^^^^
5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
2 >}
3 >
>
2 > }
1->Emitted(7, 5) Source(13, 1) + SourceIndex(0) name (A)
2 >Emitted(7, 13) Source(13, 2) + SourceIndex(0) name (A)
---
>>>})();
1 >
2 >^
3 >
4 > ^^^^
5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
2 >}
3 >
4 > class A
> {
> constructor ()
@@ -106,10 +106,10 @@ sourceFile:es5-umd.ts
> {
> return 42;
> }
> }
1 >Emitted(8, 1) Source(13, 1) + SourceIndex(0) name (A)
2 >Emitted(8, 2) Source(13, 2) + SourceIndex(0) name (A)
3 >Emitted(8, 2) Source(2, 1) + SourceIndex(0)
4 >Emitted(8, 6) Source(13, 2) + SourceIndex(0)
---
> }
1 >Emitted(8, 1) Source(13, 1) + SourceIndex(0) name (A)
2 >Emitted(8, 2) Source(13, 2) + SourceIndex(0) name (A)
3 >Emitted(8, 2) Source(2, 1) + SourceIndex(0)
4 >Emitted(8, 6) Source(13, 2) + SourceIndex(0)
---
>>>//# sourceMappingURL=es5-umd.js.map

View File

@@ -1,17 +1,17 @@
=== tests/cases/compiler/es5-umd.ts ===
class A
>A : Symbol(A, Decl(es5-umd.ts, 0, 0))
{
constructor ()
{
}
public B()
>B : Symbol(B, Decl(es5-umd.ts, 6, 5))
{
return 42;
}
}
=== tests/cases/compiler/es5-umd.ts ===
class A
>A : Symbol(A, Decl(es5-umd.ts, 0, 0))
{
constructor ()
{
}
public B()
>B : Symbol(B, Decl(es5-umd.ts, 6, 5))
{
return 42;
}
}

View File

@@ -1,18 +1,18 @@
=== tests/cases/compiler/es5-umd.ts ===
class A
>A : A
{
constructor ()
{
}
public B()
>B : () => number
{
return 42;
>42 : number
}
}
=== tests/cases/compiler/es5-umd.ts ===
class A
>A : A
{
constructor ()
{
}
public B()
>B : () => number
{
return 42;
>42 : number
}
}

View File

@@ -0,0 +1,42 @@
//// [es5-umd2.ts]
export class A
{
constructor ()
{
}
public B()
{
return 42;
}
}
//// [es5-umd2.js]
(function (deps, 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(deps, factory);
}
})(["require", "exports"], function (require, exports) {
var A = (function () {
function A() {
}
A.prototype.B = function () {
return 42;
};
return A;
})();
exports.A = A;
});
//# sourceMappingURL=es5-umd2.js.map
//// [es5-umd2.d.ts]
export declare class A {
constructor();
B(): number;
}

View File

@@ -0,0 +1,2 @@
//// [es5-umd2.js.map]
{"version":3,"file":"es5-umd2.js","sourceRoot":"","sources":["es5-umd2.ts"],"names":["A","A.constructor","A.B"],"mappings":";;;;;;;;IACA;QAEIA;QAGAC,CAACA;QAEMD,aAACA,GAARA;YAEIE,MAAMA,CAACA,EAAEA,CAACA;QACdA,CAACA;QACLF,QAACA;IAADA,CAACA,AAXD,IAWC;IAXY,SAAC,IAWb,CAAA"}

View File

@@ -0,0 +1,149 @@
===================================================================
JsFile: es5-umd2.js
mapUrl: es5-umd2.js.map
sourceRoot:
sources: es5-umd2.ts
===================================================================
-------------------------------------------------------------------
emittedFile:tests/cases/compiler/es5-umd2.js
sourceFile:es5-umd2.ts
-------------------------------------------------------------------
>>>(function (deps, 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(deps, factory);
>>> }
>>>})(["require", "exports"], function (require, exports) {
>>> var A = (function () {
1 >^^^^
2 > ^^^^^^^^^^^^^^^^^^^->
1 >
>
1 >Emitted(9, 5) Source(2, 1) + SourceIndex(0)
---
>>> function A() {
1->^^^^^^^^
2 > ^^->
1->export class A
>{
>
1->Emitted(10, 9) Source(4, 5) + SourceIndex(0) name (A)
---
>>> }
1->^^^^^^^^
2 > ^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1->constructor ()
> {
>
>
2 > }
1->Emitted(11, 9) Source(7, 5) + SourceIndex(0) name (A.constructor)
2 >Emitted(11, 10) Source(7, 6) + SourceIndex(0) name (A.constructor)
---
>>> A.prototype.B = function () {
1->^^^^^^^^
2 > ^^^^^^^^^^^^^
3 > ^^^
1->
>
> public
2 > B
3 >
1->Emitted(12, 9) Source(9, 12) + SourceIndex(0) name (A)
2 >Emitted(12, 22) Source(9, 13) + SourceIndex(0) name (A)
3 >Emitted(12, 25) Source(9, 5) + SourceIndex(0) name (A)
---
>>> return 42;
1 >^^^^^^^^^^^^
2 > ^^^^^^
3 > ^
4 > ^^
5 > ^
1 >public B()
> {
>
2 > return
3 >
4 > 42
5 > ;
1 >Emitted(13, 13) Source(11, 9) + SourceIndex(0) name (A.B)
2 >Emitted(13, 19) Source(11, 15) + SourceIndex(0) name (A.B)
3 >Emitted(13, 20) Source(11, 16) + SourceIndex(0) name (A.B)
4 >Emitted(13, 22) Source(11, 18) + SourceIndex(0) name (A.B)
5 >Emitted(13, 23) Source(11, 19) + SourceIndex(0) name (A.B)
---
>>> };
1 >^^^^^^^^
2 > ^
3 > ^^^^^^^^^->
1 >
>
2 > }
1 >Emitted(14, 9) Source(12, 5) + SourceIndex(0) name (A.B)
2 >Emitted(14, 10) Source(12, 6) + SourceIndex(0) name (A.B)
---
>>> return A;
1->^^^^^^^^
2 > ^^^^^^^^
1->
>
2 > }
1->Emitted(15, 9) Source(13, 1) + SourceIndex(0) name (A)
2 >Emitted(15, 17) Source(13, 2) + SourceIndex(0) name (A)
---
>>> })();
1 >^^^^
2 > ^
3 >
4 > ^^^^
5 > ^^^^^^^^^^->
1 >
2 > }
3 >
4 > export class A
> {
> constructor ()
> {
>
> }
>
> public B()
> {
> return 42;
> }
> }
1 >Emitted(16, 5) Source(13, 1) + SourceIndex(0) name (A)
2 >Emitted(16, 6) Source(13, 2) + SourceIndex(0) name (A)
3 >Emitted(16, 6) Source(2, 1) + SourceIndex(0)
4 >Emitted(16, 10) Source(13, 2) + SourceIndex(0)
---
>>> exports.A = A;
1->^^^^
2 > ^^^^^^^^^
3 > ^^^^
4 > ^
1->
2 > A
3 >
> {
> constructor ()
> {
>
> }
>
> public B()
> {
> return 42;
> }
> }
4 >
1->Emitted(17, 5) Source(2, 14) + SourceIndex(0)
2 >Emitted(17, 14) Source(2, 15) + SourceIndex(0)
3 >Emitted(17, 18) Source(13, 2) + SourceIndex(0)
4 >Emitted(17, 19) Source(13, 2) + SourceIndex(0)
---
>>>});
>>>//# sourceMappingURL=es5-umd2.js.map

View File

@@ -0,0 +1,17 @@
=== tests/cases/compiler/es5-umd2.ts ===
export class A
>A : Symbol(A, Decl(es5-umd2.ts, 0, 0))
{
constructor ()
{
}
public B()
>B : Symbol(B, Decl(es5-umd2.ts, 6, 5))
{
return 42;
}
}

View File

@@ -0,0 +1,18 @@
=== tests/cases/compiler/es5-umd2.ts ===
export class A
>A : A
{
constructor ()
{
}
public B()
>B : () => number
{
return 42;
>42 : number
}
}

View File

@@ -0,0 +1,42 @@
//// [es5-umd3.ts]
export default class A
{
constructor ()
{
}
public B()
{
return 42;
}
}
//// [es5-umd3.js]
(function (deps, 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(deps, factory);
}
})(["require", "exports"], function (require, exports) {
var A = (function () {
function A() {
}
A.prototype.B = function () {
return 42;
};
return A;
})();
exports.default = A;
});
//# sourceMappingURL=es5-umd3.js.map
//// [es5-umd3.d.ts]
export default class A {
constructor();
B(): number;
}

View File

@@ -0,0 +1,2 @@
//// [es5-umd3.js.map]
{"version":3,"file":"es5-umd3.js","sourceRoot":"","sources":["es5-umd3.ts"],"names":["A","A.constructor","A.B"],"mappings":";;;;;;;;IACA;QAEIA;QAGAC,CAACA;QAEMD,aAACA,GAARA;YAEIE,MAAMA,CAACA,EAAEA,CAACA;QACdA,CAACA;QACLF,QAACA;IAADA,CAACA,AAXD,IAWC;IAXD,mBAWC,CAAA"}

View File

@@ -0,0 +1,146 @@
===================================================================
JsFile: es5-umd3.js
mapUrl: es5-umd3.js.map
sourceRoot:
sources: es5-umd3.ts
===================================================================
-------------------------------------------------------------------
emittedFile:tests/cases/compiler/es5-umd3.js
sourceFile:es5-umd3.ts
-------------------------------------------------------------------
>>>(function (deps, 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(deps, factory);
>>> }
>>>})(["require", "exports"], function (require, exports) {
>>> var A = (function () {
1 >^^^^
2 > ^^^^^^^^^^^^^^^^^^^->
1 >
>
1 >Emitted(9, 5) Source(2, 1) + SourceIndex(0)
---
>>> function A() {
1->^^^^^^^^
2 > ^^->
1->export default class A
>{
>
1->Emitted(10, 9) Source(4, 5) + SourceIndex(0) name (A)
---
>>> }
1->^^^^^^^^
2 > ^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1->constructor ()
> {
>
>
2 > }
1->Emitted(11, 9) Source(7, 5) + SourceIndex(0) name (A.constructor)
2 >Emitted(11, 10) Source(7, 6) + SourceIndex(0) name (A.constructor)
---
>>> A.prototype.B = function () {
1->^^^^^^^^
2 > ^^^^^^^^^^^^^
3 > ^^^
1->
>
> public
2 > B
3 >
1->Emitted(12, 9) Source(9, 12) + SourceIndex(0) name (A)
2 >Emitted(12, 22) Source(9, 13) + SourceIndex(0) name (A)
3 >Emitted(12, 25) Source(9, 5) + SourceIndex(0) name (A)
---
>>> return 42;
1 >^^^^^^^^^^^^
2 > ^^^^^^
3 > ^
4 > ^^
5 > ^
1 >public B()
> {
>
2 > return
3 >
4 > 42
5 > ;
1 >Emitted(13, 13) Source(11, 9) + SourceIndex(0) name (A.B)
2 >Emitted(13, 19) Source(11, 15) + SourceIndex(0) name (A.B)
3 >Emitted(13, 20) Source(11, 16) + SourceIndex(0) name (A.B)
4 >Emitted(13, 22) Source(11, 18) + SourceIndex(0) name (A.B)
5 >Emitted(13, 23) Source(11, 19) + SourceIndex(0) name (A.B)
---
>>> };
1 >^^^^^^^^
2 > ^
3 > ^^^^^^^^^->
1 >
>
2 > }
1 >Emitted(14, 9) Source(12, 5) + SourceIndex(0) name (A.B)
2 >Emitted(14, 10) Source(12, 6) + SourceIndex(0) name (A.B)
---
>>> return A;
1->^^^^^^^^
2 > ^^^^^^^^
1->
>
2 > }
1->Emitted(15, 9) Source(13, 1) + SourceIndex(0) name (A)
2 >Emitted(15, 17) Source(13, 2) + SourceIndex(0) name (A)
---
>>> })();
1 >^^^^
2 > ^
3 >
4 > ^^^^
5 > ^^^^^^^^^^^^^^^^->
1 >
2 > }
3 >
4 > export default class A
> {
> constructor ()
> {
>
> }
>
> public B()
> {
> return 42;
> }
> }
1 >Emitted(16, 5) Source(13, 1) + SourceIndex(0) name (A)
2 >Emitted(16, 6) Source(13, 2) + SourceIndex(0) name (A)
3 >Emitted(16, 6) Source(2, 1) + SourceIndex(0)
4 >Emitted(16, 10) Source(13, 2) + SourceIndex(0)
---
>>> exports.default = A;
1->^^^^
2 > ^^^^^^^^^^^^^^^^^^^
3 > ^
1->
2 > export default class A
> {
> constructor ()
> {
>
> }
>
> public B()
> {
> return 42;
> }
> }
3 >
1->Emitted(17, 5) Source(2, 1) + SourceIndex(0)
2 >Emitted(17, 24) Source(13, 2) + SourceIndex(0)
3 >Emitted(17, 25) Source(13, 2) + SourceIndex(0)
---
>>>});
>>>//# sourceMappingURL=es5-umd3.js.map

View File

@@ -0,0 +1,17 @@
=== tests/cases/compiler/es5-umd3.ts ===
export default class A
>A : Symbol(A, Decl(es5-umd3.ts, 0, 0))
{
constructor ()
{
}
public B()
>B : Symbol(B, Decl(es5-umd3.ts, 6, 5))
{
return 42;
}
}

View File

@@ -0,0 +1,18 @@
=== tests/cases/compiler/es5-umd3.ts ===
export default class A
>A : A
{
constructor ()
{
}
public B()
>B : () => number
{
return 42;
>42 : number
}
}

View File

@@ -0,0 +1,45 @@
//// [es5-umd4.ts]
class A
{
constructor ()
{
}
public B()
{
return 42;
}
}
export = A;
//// [es5-umd4.js]
(function (deps, 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(deps, factory);
}
})(["require", "exports"], function (require, exports) {
var A = (function () {
function A() {
}
A.prototype.B = function () {
return 42;
};
return A;
})();
return A;
});
//# sourceMappingURL=es5-umd4.js.map
//// [es5-umd4.d.ts]
declare class A {
constructor();
B(): number;
}
export = A;

View File

@@ -0,0 +1,2 @@
//// [es5-umd4.js.map]
{"version":3,"file":"es5-umd4.js","sourceRoot":"","sources":["es5-umd4.ts"],"names":["A","A.constructor","A.B"],"mappings":";;;;;;;;IACA;QAEIA;QAGAC,CAACA;QAEMD,aAACA,GAARA;YAEIE,MAAMA,CAACA,EAAEA,CAACA;QACdA,CAACA;QACLF,QAACA;IAADA,CAACA,AAXD,IAWC;IAEU,AAAX,OAAS,CAAC,CAAC"}

View File

@@ -0,0 +1,143 @@
===================================================================
JsFile: es5-umd4.js
mapUrl: es5-umd4.js.map
sourceRoot:
sources: es5-umd4.ts
===================================================================
-------------------------------------------------------------------
emittedFile:tests/cases/compiler/es5-umd4.js
sourceFile:es5-umd4.ts
-------------------------------------------------------------------
>>>(function (deps, 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(deps, factory);
>>> }
>>>})(["require", "exports"], function (require, exports) {
>>> var A = (function () {
1 >^^^^
2 > ^^^^^^^^^^^^^^^^^^^->
1 >
>
1 >Emitted(9, 5) Source(2, 1) + SourceIndex(0)
---
>>> function A() {
1->^^^^^^^^
2 > ^^->
1->class A
>{
>
1->Emitted(10, 9) Source(4, 5) + SourceIndex(0) name (A)
---
>>> }
1->^^^^^^^^
2 > ^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1->constructor ()
> {
>
>
2 > }
1->Emitted(11, 9) Source(7, 5) + SourceIndex(0) name (A.constructor)
2 >Emitted(11, 10) Source(7, 6) + SourceIndex(0) name (A.constructor)
---
>>> A.prototype.B = function () {
1->^^^^^^^^
2 > ^^^^^^^^^^^^^
3 > ^^^
1->
>
> public
2 > B
3 >
1->Emitted(12, 9) Source(9, 12) + SourceIndex(0) name (A)
2 >Emitted(12, 22) Source(9, 13) + SourceIndex(0) name (A)
3 >Emitted(12, 25) Source(9, 5) + SourceIndex(0) name (A)
---
>>> return 42;
1 >^^^^^^^^^^^^
2 > ^^^^^^
3 > ^
4 > ^^
5 > ^
1 >public B()
> {
>
2 > return
3 >
4 > 42
5 > ;
1 >Emitted(13, 13) Source(11, 9) + SourceIndex(0) name (A.B)
2 >Emitted(13, 19) Source(11, 15) + SourceIndex(0) name (A.B)
3 >Emitted(13, 20) Source(11, 16) + SourceIndex(0) name (A.B)
4 >Emitted(13, 22) Source(11, 18) + SourceIndex(0) name (A.B)
5 >Emitted(13, 23) Source(11, 19) + SourceIndex(0) name (A.B)
---
>>> };
1 >^^^^^^^^
2 > ^
3 > ^^^^^^^^^->
1 >
>
2 > }
1 >Emitted(14, 9) Source(12, 5) + SourceIndex(0) name (A.B)
2 >Emitted(14, 10) Source(12, 6) + SourceIndex(0) name (A.B)
---
>>> return A;
1->^^^^^^^^
2 > ^^^^^^^^
1->
>
2 > }
1->Emitted(15, 9) Source(13, 1) + SourceIndex(0) name (A)
2 >Emitted(15, 17) Source(13, 2) + SourceIndex(0) name (A)
---
>>> })();
1 >^^^^
2 > ^
3 >
4 > ^^^^
5 > ^^^^^->
1 >
2 > }
3 >
4 > class A
> {
> constructor ()
> {
>
> }
>
> public B()
> {
> return 42;
> }
> }
1 >Emitted(16, 5) Source(13, 1) + SourceIndex(0) name (A)
2 >Emitted(16, 6) Source(13, 2) + SourceIndex(0) name (A)
3 >Emitted(16, 6) Source(2, 1) + SourceIndex(0)
4 >Emitted(16, 10) Source(13, 2) + SourceIndex(0)
---
>>> return A;
1->^^^^
2 >
3 > ^^^^^^^
4 > ^
5 > ^
1->
>
>export = A;
2 >
3 > export =
4 > A
5 > ;
1->Emitted(17, 5) Source(15, 12) + SourceIndex(0)
2 >Emitted(17, 5) Source(15, 1) + SourceIndex(0)
3 >Emitted(17, 12) Source(15, 10) + SourceIndex(0)
4 >Emitted(17, 13) Source(15, 11) + SourceIndex(0)
5 >Emitted(17, 14) Source(15, 12) + SourceIndex(0)
---
>>>});
>>>//# sourceMappingURL=es5-umd4.js.map

View File

@@ -0,0 +1,20 @@
=== tests/cases/compiler/es5-umd4.ts ===
class A
>A : Symbol(A, Decl(es5-umd4.ts, 0, 0))
{
constructor ()
{
}
public B()
>B : Symbol(B, Decl(es5-umd4.ts, 6, 5))
{
return 42;
}
}
export = A;
>A : Symbol(A, Decl(es5-umd4.ts, 0, 0))

View File

@@ -0,0 +1,21 @@
=== tests/cases/compiler/es5-umd4.ts ===
class A
>A : A
{
constructor ()
{
}
public B()
>B : () => number
{
return 42;
>42 : number
}
}
export = A;
>A : A

View File

@@ -0,0 +1,18 @@
error TS1204: Cannot compile external modules into amd or commonjs when targeting es6 or higher.
!!! error TS1204: Cannot compile external modules into amd or commonjs when targeting es6 or higher.
==== tests/cases/compiler/es6-umd.ts (0 errors) ====
class A
{
constructor ()
{
}
public B()
{
return 42;
}
}

View File

@@ -0,0 +1,30 @@
//// [es6-umd.ts]
class A
{
constructor ()
{
}
public B()
{
return 42;
}
}
//// [es6-umd.js]
class A {
constructor() {
}
B() {
return 42;
}
}
//# sourceMappingURL=es6-umd.js.map
//// [es6-umd.d.ts]
declare class A {
constructor();
B(): number;
}

View File

@@ -0,0 +1,2 @@
//// [es6-umd.js.map]
{"version":3,"file":"es6-umd.js","sourceRoot":"","sources":["es6-umd.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA;IAEIA;IAGAC,CAACA;IAEMD,CAACA;QAEJE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;AACLF,CAACA;AAAA"}

View File

@@ -0,0 +1,91 @@
===================================================================
JsFile: es6-umd.js
mapUrl: es6-umd.js.map
sourceRoot:
sources: es6-umd.ts
===================================================================
-------------------------------------------------------------------
emittedFile:tests/cases/compiler/es6-umd.js
sourceFile:es6-umd.ts
-------------------------------------------------------------------
>>>class A {
1 >
2 >^^^^^^^^^^^^^^^^^^^^->
1 >
>
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
---
>>> constructor() {
1->^^^^
2 > ^^->
1->class A
>{
>
1->Emitted(2, 5) Source(4, 5) + SourceIndex(0) name (A)
---
>>> }
1->^^^^
2 > ^
3 > ^^^^^->
1->constructor ()
> {
>
>
2 > }
1->Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor)
2 >Emitted(3, 6) Source(7, 6) + SourceIndex(0) name (A.constructor)
---
>>> B() {
1->^^^^
2 > ^
3 > ^^^^^^^^^^^^^^->
1->
>
> public
2 > B
1->Emitted(4, 5) Source(9, 12) + SourceIndex(0) name (A)
2 >Emitted(4, 6) Source(9, 13) + SourceIndex(0) name (A)
---
>>> return 42;
1->^^^^^^^^
2 > ^^^^^^
3 > ^
4 > ^^
5 > ^
1->()
> {
>
2 > return
3 >
4 > 42
5 > ;
1->Emitted(5, 9) Source(11, 9) + SourceIndex(0) name (A.B)
2 >Emitted(5, 15) Source(11, 15) + SourceIndex(0) name (A.B)
3 >Emitted(5, 16) Source(11, 16) + SourceIndex(0) name (A.B)
4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) name (A.B)
5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) name (A.B)
---
>>> }
1 >^^^^
2 > ^
1 >
>
2 > }
1 >Emitted(6, 5) Source(12, 5) + SourceIndex(0) name (A.B)
2 >Emitted(6, 6) Source(12, 6) + SourceIndex(0) name (A.B)
---
>>>}
1 >
2 >^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>
2 >}
1 >Emitted(7, 1) Source(13, 1) + SourceIndex(0) name (A)
2 >Emitted(7, 2) Source(13, 2) + SourceIndex(0) name (A)
---
>>>//# sourceMappingURL=es6-umd.js.map1->
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1->
1->Emitted(8, 1) Source(13, 2) + SourceIndex(0)
---

View File

@@ -0,0 +1,18 @@
error TS1204: Cannot compile external modules into amd or commonjs when targeting es6 or higher.
!!! error TS1204: Cannot compile external modules into amd or commonjs when targeting es6 or higher.
==== tests/cases/compiler/es6-umd2.ts (0 errors) ====
export class A
{
constructor ()
{
}
public B()
{
return 42;
}
}

View File

@@ -0,0 +1,30 @@
//// [es6-umd2.ts]
export class A
{
constructor ()
{
}
public B()
{
return 42;
}
}
//// [es6-umd2.js]
export class A {
constructor() {
}
B() {
return 42;
}
}
//# sourceMappingURL=es6-umd2.js.map
//// [es6-umd2.d.ts]
export declare class A {
constructor();
B(): number;
}

View File

@@ -0,0 +1,2 @@
//// [es6-umd2.js.map]
{"version":3,"file":"es6-umd2.js","sourceRoot":"","sources":["es6-umd2.ts"],"names":["A","A.constructor","A.B"],"mappings":"AACA;IAEIA;IAGAC,CAACA;IAEMD,CAACA;QAEJE,MAAMA,CAACA,EAAEA,CAACA;IACdA,CAACA;AACLF,CAACA;AAAA"}

View File

@@ -0,0 +1,91 @@
===================================================================
JsFile: es6-umd2.js
mapUrl: es6-umd2.js.map
sourceRoot:
sources: es6-umd2.ts
===================================================================
-------------------------------------------------------------------
emittedFile:tests/cases/compiler/es6-umd2.js
sourceFile:es6-umd2.ts
-------------------------------------------------------------------
>>>export class A {
1 >
2 >^^^^^^^^^^^^^^^^^^^^->
1 >
>
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
---
>>> constructor() {
1->^^^^
2 > ^^->
1->export class A
>{
>
1->Emitted(2, 5) Source(4, 5) + SourceIndex(0) name (A)
---
>>> }
1->^^^^
2 > ^
3 > ^^^^^->
1->constructor ()
> {
>
>
2 > }
1->Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor)
2 >Emitted(3, 6) Source(7, 6) + SourceIndex(0) name (A.constructor)
---
>>> B() {
1->^^^^
2 > ^
3 > ^^^^^^^^^^^^^^->
1->
>
> public
2 > B
1->Emitted(4, 5) Source(9, 12) + SourceIndex(0) name (A)
2 >Emitted(4, 6) Source(9, 13) + SourceIndex(0) name (A)
---
>>> return 42;
1->^^^^^^^^
2 > ^^^^^^
3 > ^
4 > ^^
5 > ^
1->()
> {
>
2 > return
3 >
4 > 42
5 > ;
1->Emitted(5, 9) Source(11, 9) + SourceIndex(0) name (A.B)
2 >Emitted(5, 15) Source(11, 15) + SourceIndex(0) name (A.B)
3 >Emitted(5, 16) Source(11, 16) + SourceIndex(0) name (A.B)
4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) name (A.B)
5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) name (A.B)
---
>>> }
1 >^^^^
2 > ^
1 >
>
2 > }
1 >Emitted(6, 5) Source(12, 5) + SourceIndex(0) name (A.B)
2 >Emitted(6, 6) Source(12, 6) + SourceIndex(0) name (A.B)
---
>>>}
1 >
2 >^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>
2 >}
1 >Emitted(7, 1) Source(13, 1) + SourceIndex(0) name (A)
2 >Emitted(7, 2) Source(13, 2) + SourceIndex(0) name (A)
---
>>>//# sourceMappingURL=es6-umd2.js.map1->
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1->
1->Emitted(8, 1) Source(13, 2) + SourceIndex(0)
---

View File

@@ -1,11 +1,11 @@
tests/cases/compiler/umdDependencyComment2.ts(3,21): error TS2307: Cannot find external module 'm2'.
==== tests/cases/compiler/umdDependencyComment2.ts (1 errors) ====
///<amd-dependency path='bar'/>
import m1 = require("m2")
~~~~
!!! error TS2307: Cannot find external module 'm2'.
m1.f();
tests/cases/compiler/umdDependencyComment2.ts(3,21): error TS2307: Cannot find external module 'm2'.
==== tests/cases/compiler/umdDependencyComment2.ts (1 errors) ====
///<amd-dependency path='bar'/>
import m1 = require("m2")
~~~~
!!! error TS2307: Cannot find external module 'm2'.
m1.f();

View File

@@ -1,20 +1,20 @@
//// [umdDependencyComment2.ts]
//// [umdDependencyComment2.ts]
///<amd-dependency path='bar'/>
import m1 = require("m2")
m1.f();
//// [umdDependencyComment2.js]
///<amd-dependency path='bar'/>
(function (deps, 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(deps, factory);
}
})(["require", "exports", "bar", "m2"], function (require, exports) {
var m1 = require("m2");
m1.f();
});
//// [umdDependencyComment2.js]
///<amd-dependency path='bar'/>
(function (deps, 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(deps, factory);
}
})(["require", "exports", "bar", "m2"], function (require, exports) {
var m1 = require("m2");
m1.f();
});

View File

@@ -1,11 +1,11 @@
tests/cases/compiler/umdDependencyCommentName1.ts(3,21): error TS2307: Cannot find external module 'm2'.
==== tests/cases/compiler/umdDependencyCommentName1.ts (1 errors) ====
///<amd-dependency path='bar' name='b'/>
import m1 = require("m2")
~~~~
!!! error TS2307: Cannot find external module 'm2'.
m1.f();
tests/cases/compiler/umdDependencyCommentName1.ts(3,21): error TS2307: Cannot find external module 'm2'.
==== tests/cases/compiler/umdDependencyCommentName1.ts (1 errors) ====
///<amd-dependency path='bar' name='b'/>
import m1 = require("m2")
~~~~
!!! error TS2307: Cannot find external module 'm2'.
m1.f();

View File

@@ -1,20 +1,20 @@
//// [umdDependencyCommentName1.ts]
//// [umdDependencyCommentName1.ts]
///<amd-dependency path='bar' name='b'/>
import m1 = require("m2")
m1.f();
//// [umdDependencyCommentName1.js]
///<amd-dependency path='bar' name='b'/>
(function (deps, 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(deps, factory);
}
})(["require", "exports", "bar", "m2"], function (require, exports, b) {
var m1 = require("m2");
m1.f();
});
//// [umdDependencyCommentName1.js]
///<amd-dependency path='bar' name='b'/>
(function (deps, 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(deps, factory);
}
})(["require", "exports", "bar", "m2"], function (require, exports, b) {
var m1 = require("m2");
m1.f();
});

View File

@@ -1,13 +1,13 @@
tests/cases/compiler/umdDependencyCommentName2.ts(5,21): error TS2307: Cannot find external module 'm2'.
==== tests/cases/compiler/umdDependencyCommentName2.ts (1 errors) ====
///<amd-dependency path='bar' name='b'/>
///<amd-dependency path='foo'/>
///<amd-dependency path='goo' name='c'/>
import m1 = require("m2")
~~~~
!!! error TS2307: Cannot find external module 'm2'.
m1.f();
tests/cases/compiler/umdDependencyCommentName2.ts(5,21): error TS2307: Cannot find external module 'm2'.
==== tests/cases/compiler/umdDependencyCommentName2.ts (1 errors) ====
///<amd-dependency path='bar' name='b'/>
///<amd-dependency path='foo'/>
///<amd-dependency path='goo' name='c'/>
import m1 = require("m2")
~~~~
!!! error TS2307: Cannot find external module 'm2'.
m1.f();

View File

@@ -1,24 +1,24 @@
//// [umdDependencyCommentName2.ts]
//// [umdDependencyCommentName2.ts]
///<amd-dependency path='bar' name='b'/>
///<amd-dependency path='foo'/>
///<amd-dependency path='goo' name='c'/>
import m1 = require("m2")
m1.f();
//// [umdDependencyCommentName2.js]
///<amd-dependency path='bar' name='b'/>
///<amd-dependency path='foo'/>
///<amd-dependency path='goo' name='c'/>
(function (deps, 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(deps, factory);
}
})(["require", "exports", "bar", "goo", "foo", "m2"], function (require, exports, b, c) {
var m1 = require("m2");
m1.f();
});
//// [umdDependencyCommentName2.js]
///<amd-dependency path='bar' name='b'/>
///<amd-dependency path='foo'/>
///<amd-dependency path='goo' name='c'/>
(function (deps, 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(deps, factory);
}
})(["require", "exports", "bar", "goo", "foo", "m2"], function (require, exports, b, c) {
var m1 = require("m2");
m1.f();
});

View File

@@ -0,0 +1,17 @@
// @target: ES5
// @sourcemap: false
// @declaration: false
// @module: umd
export class A
{
constructor ()
{
}
public B()
{
return 42;
}
}

View File

@@ -0,0 +1,17 @@
// @target: ES5
// @sourcemap: false
// @declaration: false
// @module: umd
export default class A
{
constructor ()
{
}
public B()
{
return 42;
}
}

View File

@@ -0,0 +1,19 @@
// @target: ES5
// @sourcemap: false
// @declaration: false
// @module: umd
class A
{
constructor ()
{
}
public B()
{
return 42;
}
}
export = A;

View File

@@ -0,0 +1,17 @@
// @target: ES6
// @sourcemap: false
// @declaration: false
// @module: umd
class A
{
constructor ()
{
}
public B()
{
return 42;
}
}

View File

@@ -0,0 +1,17 @@
// @target: ES6
// @sourcemap: false
// @declaration: false
// @module: umd
export class A
{
constructor ()
{
}
public B()
{
return 42;
}
}