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

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

Issue 14251021: Move invokeOn to InstanceMirror. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 8 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
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 "dart:mirrors" show reflect;
5 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
6 7
7 class GetName { 8 class GetName {
8 set flif(_) => "flif="; 9 set flif(_) => "flif=";
9 } 10 }
10 11
11 String getName(im) => im.invokeOn(new GetName()); 12 String getName(im) => reflect(new GetName()).delegate(im);
12 13
13 class C { 14 class C {
14 var im; 15 var im;
15 noSuchMethod(im) => this.im = im; 16 noSuchMethod(im) => this.im = im;
16 flif() {} 17 flif() {}
17 } 18 }
18 19
19 main() { 20 main() {
20 var c = new C(); 21 var c = new C();
21 c.flif = 42; 22 c.flif = 42;
22 Expect.equals('flif=', getName(c.im)); 23 Expect.equals('flif=', getName(c.im));
23 Expect.equals(42, c.im.positionalArguments[0]); 24 Expect.equals(42, c.im.positionalArguments[0]);
24 } 25 }
OLDNEW
« no previous file with comments | « dart/tests/language/field_increment_bailout_test.dart ('k') | dart/tests/language/invocation_mirror_invoke_on2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698