TypeScript 1.8
现在生成模块代码时会带有"use strict";头
"use strict";头从模块里导出非局部名称
export { Promise }; // Errorconst localPromise = Promise;
export { localPromise as Promise };默认启用代码可达性(Reachability)检查
function test1() { return 1; return 2; // error here } function test2(x) { if (x) { return 1; } else { throw new Error("NYI") } var y = 1; // error here }l: // error will be reported - label `l` is unused while (true) { } (x) => { x:x } // error will be reported - label `x` is unused// error will be reported since function does not return anything explicitly when `x` is falsy. function test(x): number { if (x) return 10; }switch(x) { // OK case 1: case 2: return 1; } switch(x) { case 1: if (y) return 1; case 2: return 2; }
--module不允许与--outFile一起出现,除非 --module被指定为amd或system
--module不允许与--outFile一起出现,除非 --module被指定为amd或system标准库里的DOM API变动
在super-call之前不允许使用this
thisLast updated