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

Side by Side Diff: tests/compiler/dart2js_extra/mirrors_used_closure_test.dart

Issue 1519563004: Upgrade more confuse() functions (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « tests/compiler/dart2js_extra/hash_code_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 library MirrorsTest; 5 library MirrorsTest;
6 6
7 import 'package:expect/expect.dart'; 7 import 'package:expect/expect.dart';
8 8
9 @MirrorsUsed(targets: const ['A.foo', 'B.bar']) 9 @MirrorsUsed(targets: const ['A.foo', 'B.bar'])
10 import 'dart:mirrors'; 10 import 'dart:mirrors';
11 11
12 class A { 12 class A {
13 foo() => 42; 13 foo() => 42;
14 bar() => 499; 14 bar() => 499;
15 } 15 }
16 16
17 class B { 17 class B {
18 bar() => 33; 18 bar() => 33;
19 } 19 }
20 20
21 // Uses DateTime.now to make it impossible to predict. 21 @NoInline()
22 // Uses recursive call to make it harder to inline. 22 @AssumeDynamic()
23 confuse(x) { 23 confuse(x) => x;
24 if (new DateTime.now().millisecondsSinceEpoch == 42) return confuse(x + 1);
25 return x;
26 }
27 24
28 main() { 25 main() {
29 var f = [new A(), new B()][confuse(0)].bar; 26 var f = [new A(), new B()][confuse(0)].bar;
30 Expect.throws(() => reflect(f).invoke(#call, [], {}), 27 Expect.throws(() => reflect(f).invoke(#call, [], {}),
31 (e) => e is UnsupportedError); 28 (e) => e is UnsupportedError);
32 } 29 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js_extra/hash_code_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698