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 library test.invoke_closurization_test; | 5 library test.invoke_closurization_test; |
6 | 6 |
| 7 @MirrorsUsed(targets: "test.invoke_closurization_test") |
7 import 'dart:mirrors'; | 8 import 'dart:mirrors'; |
8 | 9 |
9 import 'package:expect/expect.dart'; | 10 import 'package:expect/expect.dart'; |
10 | 11 |
11 class A { | 12 class A { |
12 foo() => "foo"; | 13 foo() => "foo"; |
13 bar([x]) => "bar-$x"; | 14 bar([x]) => "bar-$x"; |
14 gee({named}) => "gee-$named"; | 15 gee({named}) => "gee-$named"; |
15 | 16 |
16 // Methods that must be intercepted. | 17 // Methods that must be intercepted. |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 Expect.equals("indexOf-499", f.invoke(#call, [499], {}).reflectee); | 122 Expect.equals("indexOf-499", f.invoke(#call, [499], {}).reflectee); |
122 f = getAMirror().getField(#matchAsPrefix); | 123 f = getAMirror().getField(#matchAsPrefix); |
123 Expect.equals("matchAsPrefix-FOO,BAR", | 124 Expect.equals("matchAsPrefix-FOO,BAR", |
124 f.invoke(#call, ["FOO", "BAR"]).reflectee); | 125 f.invoke(#call, ["FOO", "BAR"]).reflectee); |
125 f = getAMirror().getField(#toList); | 126 f = getAMirror().getField(#toList); |
126 Expect.equals("toList-1", | 127 Expect.equals("toList-1", |
127 f.invoke(#call, [], {#growable: 1}).reflectee); | 128 f.invoke(#call, [], {#growable: 1}).reflectee); |
128 f = getAMirror().getField(#toSet); | 129 f = getAMirror().getField(#toSet); |
129 Expect.equals("toSet-true", f.invoke(#call, [], {#named: true}).reflectee); | 130 Expect.equals("toSet-true", f.invoke(#call, [], {#named: true}).reflectee); |
130 } | 131 } |
OLD | NEW |