Chromium Code Reviews| Index: tests/compiler/dart2js_extra/27354_test.dart |
| diff --git a/tests/compiler/dart2js_extra/27354_test.dart b/tests/compiler/dart2js_extra/27354_test.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..942dc49b422169a17067ba1e0cd6ad8ac0f5c770 |
| --- /dev/null |
| +++ b/tests/compiler/dart2js_extra/27354_test.dart |
| @@ -0,0 +1,14 @@ |
| +// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +// Regression test for Issue 27354. |
| + |
| +int total = 1; |
| +void inc() => total++ < 10 ? null : throw "do not loop forever!"; |
|
Siggi Cherem (dart-lang)
2016/09/15 00:07:10
just realized `void` here might be an over stateme
|
| + |
| +void main() { |
| + // Problem was moving the load of 'total' inside the loop. |
| + int count = null ?? total; |
| + for (int i = 0; i < count; i++) inc(); |
| +} |