| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | |
| 2 // for details. All rights reserved. Use of this source code is governed by a | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 import "package:expect/expect.dart"; | |
| 6 import "compiler_annotations.dart"; | |
| 7 | |
| 8 @DontInline() | |
| 9 foo() { | |
| 10 () => 42; | |
| 11 int a; | |
| 12 assert((a = 2) == 2); | |
| 13 return a; | |
| 14 } | |
| 15 | |
| 16 main() { | |
| 17 bool isAssertEnabled = false; | |
| 18 assert(isAssertEnabled = true); | |
| 19 if (isAssertEnabled) { | |
| 20 Expect.equals(44, foo() + 42); | |
| 21 } else { | |
| 22 Expect.throws(() => foo() + 42, (e) => e is NoSuchMethodError); | |
| 23 } | |
| 24 } | |
| OLD | NEW |