Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 ## 1.1.0 | |
| 2 * Introduce `@alwaysThrows` to declare that a function always throws | |
| 3 (SDK issue [17999](https://github.com/dart-lang/sdk/issues/17999)). | |
|
nweiz
2017/07/10 20:47:46
It would be good to mention which SDK version firs
srawlins
2017/07/10 21:39:13
Done.
| |
| 4 | |
| 5 | |
| 6 ```dart | |
| 7 import 'package:meta/meta.dart' show alwaysThrows; | |
|
nweiz
2017/07/10 20:47:46
I wouldn't use "show" here.
srawlins
2017/07/10 21:39:13
I was following the conventions of the previous tw
nweiz
2017/07/10 21:46:41
A few teams do it, but it's not generally a conven
| |
| 8 // Without knowing that [failBigTime] always throws, it looks like this | |
|
nweiz
2017/07/10 20:47:46
Nit: newline between these lines.
srawlins
2017/07/10 21:39:13
Done.
| |
| 9 // function might return without returning a bool. | |
| 10 bool fn(expected, actual) { | |
| 11 if (expected != actual) | |
| 12 failBigTime(expected, actual); | |
| 13 else | |
| 14 return True; | |
| 15 } | |
| 16 | |
| 17 | |
|
nweiz
2017/07/10 20:47:46
Nit: extra newline.
srawlins
2017/07/10 21:39:13
Done.
| |
| 18 @alwaysThrows | |
| 19 void failBigTime(expected, actual) { | |
| 20 throw new StateError('Expected $expected, but was $actual.'); | |
| 21 } | |
| 22 ``` | |
| 23 | |
| 1 ## 1.0.4 | 24 ## 1.0.4 |
| 2 * Introduce `@virtual` to allow field overrides in strong mode | 25 * Introduce `@virtual` to allow field overrides in strong mode |
| 3 (SDK issue [27384](https://github.com/dart-lang/sdk/issues/27384)). | 26 (SDK issue [27384](https://github.com/dart-lang/sdk/issues/27384)). |
| 4 | 27 |
| 5 ```dart | 28 ```dart |
| 6 import 'package:meta/meta.dart' show virtual; | 29 import 'package:meta/meta.dart' show virtual; |
| 7 class Base { | 30 class Base { |
| 8 @virtual int x; | 31 @virtual int x; |
| 9 } | 32 } |
| 10 class Derived extends Base { | 33 class Derived extends Base { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 constructor must use the keyword `const` unless one or more of the | 87 constructor must use the keyword `const` unless one or more of the |
| 65 arguments to the constructor is not a compile-time constant. | 88 arguments to the constructor is not a compile-time constant. |
| 66 | 89 |
| 67 ## 0.9.0 | 90 ## 0.9.0 |
| 68 * Introduce `@protected` annotation for members that must only be called from | 91 * Introduce `@protected` annotation for members that must only be called from |
| 69 instance members of subclasses. | 92 instance members of subclasses. |
| 70 * Introduce `@required` annotation for optional parameters that should be treate d | 93 * Introduce `@required` annotation for optional parameters that should be treate d |
| 71 as required. | 94 as required. |
| 72 * Introduce `@mustCallSuper` annotation for methods that must be invoked by all | 95 * Introduce `@mustCallSuper` annotation for methods that must be invoked by all |
| 73 overriding methods. | 96 overriding methods. |
| OLD | NEW |