diff --git a/API-Breaking-Changes.md b/API-Breaking-Changes.md index 9ca2b49..1a845d1 100644 --- a/API-Breaking-Changes.md +++ b/API-Breaking-Changes.md @@ -2,6 +2,12 @@ - The type `EnumLiteralType` was removed and `LiteralType` is used instead. `LiteralType` also replaces `.text` with a `.value` which may be either a number or string. See [String valued members in enums](https://github.com/Microsoft/TypeScript/pull/15486). +# TypeScript 2.3 + +- `Declaration` does not have a `name` property. TypeScript now recognize assignments in .js files as declarations in certain contexts, e.g. `func.prototype.method = function() {..}` will be a declaration of member `method` on `func`. As a result `Declaration` is not guaranteed to have a `name` property as before. A new type was introduced `NamedDeclaration` to take the place of `Declaration`, and `Declaration` moved to be the base type of both `NamedDeclaration` and `BinaryExpression`. +Casting to `NamedDeclaration` should be safe for non .js declarations. +See https://github.com/Microsoft/TypeScript/pull/15594 for more details. + # TypeScript 2.2 - `ts.Map` is now a native `Map` or a shim. This affects the `SymbolTable` type, exposed by `Symbol.members`, `Symbol.exports`, and `Symbol.globalExports`.