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

Unified Diff: tests/language/invocation_mirror_invoke_on_test.dart

Issue 11570042: Implement InvocationMirror.invokeOn method in the vm (issue 7227). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/invocation_mirror_invoke_on_test.dart
===================================================================
--- tests/language/invocation_mirror_invoke_on_test.dart (revision 0)
+++ tests/language/invocation_mirror_invoke_on_test.dart (revision 0)
@@ -0,0 +1,37 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// Testing InvocationMirror.invokeOn method; test of issue 7227.
+
+var reachedSetX = 0;
+var reachedGetX = 0;
+var reachedM = 0;
+
+class A {
+
+ set x(val) {
+ reachedSetX = val;
+ }
+
+ get x {
+ reachedGetX = 1;
+ }
+
+ m() { reachedM = 1; }
+}
+
+class B {
+ final a = new A();
+ noSuchMethod(mirror) => mirror.invokeOn(a);
+}
+
+main () {
+ var b = new B();
+ b.x = 10;
+ Expect.equals(10, reachedSetX);
+ b.x;
+ Expect.equals(1, reachedGetX);
+ b.m();
+ Expect.equals(1, reachedM);
+}
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698