Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: tests/language/pure_function2_test.dart

Issue 196223017: Fix bad generate-at-use-site. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/ssa/codegen_helpers.dart ('k') | tests/language/pure_function_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698