| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 import "package:expect/expect.dart"; |
| 6 |
| 7 // Regression test for issue 17483. |
| 8 |
| 9 confuse(x) { |
| 10 if (new DateTime.now().millisecondsSinceEpoch == 42) return confuse(x); |
| 11 return x; |
| 12 } |
| 13 |
| 14 foo(trace) { |
| 15 trace.add("foo"); |
| 16 return "foo"; |
| 17 } |
| 18 bar(trace) { |
| 19 trace.add("bar"); |
| 20 return "bar"; |
| 21 } |
| 22 |
| 23 main() { |
| 24 var f = confuse(foo); |
| 25 var b = confuse(bar); |
| 26 |
| 27 var trace = []; |
| 28 // Dart2js must keep the order of t1 and t2. |
| 29 var t1 = f(trace); |
| 30 var t2 = b(trace); |
| 31 var t3 = identical(t2, "foo"); |
| 32 var t4 = trace.add(t1); |
| 33 trace.add(t3); |
| 34 trace.add(t3); |
| 35 Expect.listEquals(["foo", "bar", "foo", false, false], trace); |
| 36 } |
| OLD | NEW |