OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
6 | 6 |
7 // Regression test for issue 17483. | 7 // Regression test for issue 17483. |
8 | 8 |
9 | 9 @AssumeDynamic() |
10 @AssumeDynamic() @NoInline() | 10 @NoInline() |
11 confuse(x) => x; | 11 confuse(x) => x; |
12 | 12 |
13 foo(trace) { | 13 foo(trace) { |
14 trace.add("foo"); | 14 trace.add("foo"); |
15 return "foo"; | 15 return "foo"; |
16 } | 16 } |
| 17 |
17 bar(trace) { | 18 bar(trace) { |
18 trace.add("bar"); | 19 trace.add("bar"); |
19 return "bar"; | 20 return "bar"; |
20 } | 21 } |
21 | 22 |
22 main() { | 23 main() { |
23 var f = confuse(foo); | 24 var f = confuse(foo); |
24 var b = confuse(bar); | 25 var b = confuse(bar); |
25 | 26 |
26 var trace = []; | 27 var trace = []; |
27 // Dart2js must keep the order of t1 and t2. | 28 // Dart2js must keep the order of t1 and t2. |
28 var t1 = f(trace); | 29 var t1 = f(trace); |
29 var t2 = b(trace); | 30 var t2 = b(trace); |
30 var t3 = identical(t2, "foo"); | 31 var t3 = identical(t2, "foo"); |
31 var t4 = trace.add(t1); | 32 var t4 = trace.add(t1); |
32 trace.add(t3); | 33 trace.add(t3); |
33 trace.add(t3); | 34 trace.add(t3); |
34 Expect.listEquals(["foo", "bar", "foo", false, false], trace); | 35 Expect.listEquals(["foo", "bar", "foo", false, false], trace); |
35 } | 36 } |
OLD | NEW |