Update changelog.md to mention new assert with message feature (#28156)

* Update changelog.md to mention new assert with message feature

Fixes https://github.com/dart-lang/sdk/issues/28134

* Fix typo per review feedback
This commit is contained in:
Michael Thomsen 2016-12-20 14:20:59 +01:00 committed by Florian Loitsch
parent b13bb540e3
commit c95423bc49

View file

@ -1,16 +1,35 @@
## 1.22.0
### Language
* The `assert()` statement has been expanded to support an optional second
`message` argument (SDK issue [27342](https://github.com/dart-lang/sdk/issues/27342)).
The message is displayed if the assert fails. It can be any object, and it
is accessible as `AssertionError.message`. It can be used to provide more
user friendly exception outputs. As an example, the following assert:
```
assert(configFile != null, "Tool config missing. Please see https://goo.gl/k8iAi for details.");
```
would produce the following exception output:
```
Unhandled exception:
'file:///Users/mit/tmp/tool/bin/main.dart': Failed assertion: line 9 pos 10:
'configFile != null': Tool config missing. Please see https://goo.gl/k8iAi for details.
#0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:33)
#1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:29)
#2 main (file:///Users/mit/tmp/tool/bin/main.dart:9:10)
```
### Tool changes
* Dart2Js
* Remove support for (long-time deprecated) mixin typedefs.
* Dart Dev Compiler
* Support messages in `assert()` statements. (SDK issue
[27342](https://github.com/dart-lang/sdk/issues/27342))
* Pub
* Avoid using a barback asset server for executables unless they actually use