mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-09 16:39:46 -05:00
Pair of new tests for the new flag
This commit is contained in:
19
tests/baselines/reference/es5andes6module.errors.txt
Normal file
19
tests/baselines/reference/es5andes6module.errors.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
error TS1204: Cannot compile modules into 'es6' when targeting 'ES5' or lower.
|
||||
|
||||
|
||||
!!! error TS1204: Cannot compile modules into 'es6' when targeting 'ES5' or lower.
|
||||
==== tests/cases/compiler/es5andes6module.ts (0 errors) ====
|
||||
|
||||
export default class A
|
||||
{
|
||||
constructor ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public B()
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
}
|
||||
|
||||
26
tests/baselines/reference/es5andes6module.js
Normal file
26
tests/baselines/reference/es5andes6module.js
Normal file
@@ -0,0 +1,26 @@
|
||||
//// [es5andes6module.ts]
|
||||
|
||||
export default class A
|
||||
{
|
||||
constructor ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public B()
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//// [es5andes6module.js]
|
||||
var A = (function () {
|
||||
function A() {
|
||||
}
|
||||
A.prototype.B = function () {
|
||||
return 42;
|
||||
};
|
||||
return A;
|
||||
})();
|
||||
exports.default = A;
|
||||
23
tests/baselines/reference/es6modulekind.js
Normal file
23
tests/baselines/reference/es6modulekind.js
Normal file
@@ -0,0 +1,23 @@
|
||||
//// [es6modulekind.ts]
|
||||
|
||||
export default class A
|
||||
{
|
||||
constructor ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public B()
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
}
|
||||
|
||||
//// [es6modulekind.js]
|
||||
export default class A {
|
||||
constructor() {
|
||||
}
|
||||
B() {
|
||||
return 42;
|
||||
}
|
||||
}
|
||||
16
tests/baselines/reference/es6modulekind.symbols
Normal file
16
tests/baselines/reference/es6modulekind.symbols
Normal file
@@ -0,0 +1,16 @@
|
||||
=== tests/cases/compiler/es6modulekind.ts ===
|
||||
|
||||
export default class A
|
||||
>A : Symbol(A, Decl(es6modulekind.ts, 0, 0))
|
||||
{
|
||||
constructor ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public B()
|
||||
>B : Symbol(B, Decl(es6modulekind.ts, 6, 5))
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
}
|
||||
17
tests/baselines/reference/es6modulekind.types
Normal file
17
tests/baselines/reference/es6modulekind.types
Normal file
@@ -0,0 +1,17 @@
|
||||
=== tests/cases/compiler/es6modulekind.ts ===
|
||||
|
||||
export default class A
|
||||
>A : A
|
||||
{
|
||||
constructor ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public B()
|
||||
>B : () => number
|
||||
{
|
||||
return 42;
|
||||
>42 : number
|
||||
}
|
||||
}
|
||||
17
tests/cases/compiler/es5andes6module.ts
Normal file
17
tests/cases/compiler/es5andes6module.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
// @target: ES5
|
||||
// @sourcemap: false
|
||||
// @declaration: false
|
||||
// @module: es6
|
||||
|
||||
export default class A
|
||||
{
|
||||
constructor ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public B()
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
}
|
||||
17
tests/cases/compiler/es6modulekind.ts
Normal file
17
tests/cases/compiler/es6modulekind.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
// @target: ES6
|
||||
// @sourcemap: false
|
||||
// @declaration: false
|
||||
// @module: es6
|
||||
|
||||
export default class A
|
||||
{
|
||||
constructor ()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public B()
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user