Added test.
This commit is contained in:
parent
b66a32f9a1
commit
9abfc3bd1a
3 changed files with 81 additions and 0 deletions
|
@ -0,0 +1,29 @@
|
||||||
|
tests/cases/conformance/es6/modules/t2.ts(1,13): error TS1212: Identifier expected. 'set' is a reserved word in strict mode
|
||||||
|
tests/cases/conformance/es6/modules/t3.ts(1,17): error TS1212: Identifier expected. 'yield' is a reserved word in strict mode
|
||||||
|
tests/cases/conformance/es6/modules/t4.ts(1,10): error TS1212: Identifier expected. 'get' is a reserved word in strict mode
|
||||||
|
|
||||||
|
|
||||||
|
==== tests/cases/conformance/es6/modules/t1.ts (0 errors) ====
|
||||||
|
|
||||||
|
let set = {
|
||||||
|
set foo(x: number) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let get = 10;
|
||||||
|
|
||||||
|
export { set, get };
|
||||||
|
|
||||||
|
==== tests/cases/conformance/es6/modules/t2.ts (1 errors) ====
|
||||||
|
import * as set from "./t1";
|
||||||
|
~~~
|
||||||
|
!!! error TS1212: Identifier expected. 'set' is a reserved word in strict mode
|
||||||
|
|
||||||
|
==== tests/cases/conformance/es6/modules/t3.ts (1 errors) ====
|
||||||
|
import { set as yield } from "./t1";
|
||||||
|
~~~~~
|
||||||
|
!!! error TS1212: Identifier expected. 'yield' is a reserved word in strict mode
|
||||||
|
|
||||||
|
==== tests/cases/conformance/es6/modules/t4.ts (1 errors) ====
|
||||||
|
import { get } from "./t1";
|
||||||
|
~~~
|
||||||
|
!!! error TS1212: Identifier expected. 'get' is a reserved word in strict mode
|
|
@ -0,0 +1,32 @@
|
||||||
|
//// [tests/cases/conformance/es6/modules/exportsAndImportsWithContextualKeywordNames01.ts] ////
|
||||||
|
|
||||||
|
//// [t1.ts]
|
||||||
|
|
||||||
|
let set = {
|
||||||
|
set foo(x: number) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let get = 10;
|
||||||
|
|
||||||
|
export { set, get };
|
||||||
|
|
||||||
|
//// [t2.ts]
|
||||||
|
import * as set from "./t1";
|
||||||
|
|
||||||
|
//// [t3.ts]
|
||||||
|
import { set as yield } from "./t1";
|
||||||
|
|
||||||
|
//// [t4.ts]
|
||||||
|
import { get } from "./t1";
|
||||||
|
|
||||||
|
//// [t1.js]
|
||||||
|
var set = {
|
||||||
|
set foo(x) {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
exports.set = set;
|
||||||
|
var get = 10;
|
||||||
|
exports.get = get;
|
||||||
|
//// [t2.js]
|
||||||
|
//// [t3.js]
|
||||||
|
//// [t4.js]
|
|
@ -0,0 +1,20 @@
|
||||||
|
// @module: commonjs
|
||||||
|
// @target: es5
|
||||||
|
|
||||||
|
// @filename: t1.ts
|
||||||
|
let set = {
|
||||||
|
set foo(x: number) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let get = 10;
|
||||||
|
|
||||||
|
export { set, get };
|
||||||
|
|
||||||
|
// @filename: t2.ts
|
||||||
|
import * as set from "./t1";
|
||||||
|
|
||||||
|
// @filename: t3.ts
|
||||||
|
import { set as yield } from "./t1";
|
||||||
|
|
||||||
|
// @filename: t4.ts
|
||||||
|
import { get } from "./t1";
|
Loading…
Reference in a new issue