Chromium Code Reviews| Index: tests/language/nested_if_test.dart |
| diff --git a/tests/language/nested_if_test.dart b/tests/language/nested_if_test.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..34b486afd54ece5f4b683c2e96ed0e744e8acbf2 |
| --- /dev/null |
| +++ b/tests/language/nested_if_test.dart |
| @@ -0,0 +1,33 @@ |
| +// Copyright (c) 2011, 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. |
| +// Dart2Js had problems with nested ifs inside loops. |
| + |
| +foo(x, a) { |
| + /*---------------------------------------------*/ |
| + /*---------------------------------------------*/ |
| + /*---------------------------------------------*/ |
| + /*---------------------------------------------*/ |
| + /*---------------------------------------------*/ |
| + /*---------------------------------------------*/ |
| + /*------- Avoid inlining ----------------------*/ |
|
ngeoffray
2012/08/30 16:46:10
WebToolkitFramework? Maybe it's time to have a @No
floitsch
2012/08/30 16:51:35
I agree that we need that annotation. In a differe
|
| + /*---------------------------------------------*/ |
| + /*---------------------------------------------*/ |
| + /*---------------------------------------------*/ |
| + /*---------------------------------------------*/ |
| + /*---------------------------------------------*/ |
| + /*---------------------------------------------*/ |
| + for (int i = 0; i < 10; i++) { |
| + if (x) { |
| + if (!x) a = []; |
| + a.add(3); |
| + } |
| + } |
| + return a; |
| +} |
| + |
| +main() { |
| + var a = foo(true, []); |
| + Expect.equals(10, a.length); |
| + Expect.equals(3, a[0]); |
| +} |