breaking changes: TypeScript 1.1. closed #130

This commit is contained in:
zhongsp 2016-10-31 16:16:50 +08:00
parent d90000bc96
commit a86936fb8a
2 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,28 @@
# TypeScript 1.1
完整的破坏性改动列表请到这里查看:[breaking change issues](https://github.com/Microsoft/TypeScript/issues?q=is%3Aissue+milestone%3A%22TypeScript+1.1%22+label%3A%22breaking+change%22+)。
## null和undefined明显的错误使用方式现在会报错
例子:
```TypeScript
var ResultIsNumber17 = +(null + undefined);
// Operator '+' cannot be applied to types 'undefined' and 'undefined'.
var ResultIsNumber18 = +(null + null);
// Operator '+' cannot be applied to types 'null' and 'null'.
var ResultIsNumber19 = +(undefined + undefined);
// Operator '+' cannot be applied to types 'undefined' and 'undefined'.
```
相似地把null和undefined当做具有方法的对象使用时会报错。
例子:
```TypeScript
null.toBAZ();
undefined.toBAZ();
```

View File

@ -6,3 +6,4 @@
* [TypeScript 1.6](./TypeScript 1.6.md)
* [TypeScript 1.5](./TypeScript 1.5.md)
* [TypeScript 1.4](./TypeScript 1.4.md)
* [TypeScript 1.1](./TypeScript 1.1.md)