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

Unified Diff: tests/lib/mirrors/delegate_class_test.dart

Issue 1273983002: Hoist InstanceMirror.delegate to ObjectMirror. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/lib/lib.status ('k') | tests/lib/mirrors/delegate_library_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/mirrors/delegate_class_test.dart
diff --git a/tests/lib/mirrors/delegate_test.dart b/tests/lib/mirrors/delegate_class_test.dart
similarity index 72%
copy from tests/lib/mirrors/delegate_test.dart
copy to tests/lib/mirrors/delegate_class_test.dart
index b7ea729dfb8c8e23a79df991a83d10a40f9e46b9..652ee4487bc154dc6c11be7715c6ca13478a98d6 100644
--- a/tests/lib/mirrors/delegate_test.dart
+++ b/tests/lib/mirrors/delegate_class_test.dart
@@ -1,34 +1,33 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2015, 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.
-library test.invoke_named_test;
+library test.delegate_class;
import 'dart:mirrors';
import 'package:expect/expect.dart';
class C {
- method(a, b, c) => "$a-$b-$c";
- methodWithNamed(a, {b:'B', c}) => "$a-$b-$c";
- methodWithOpt(a, [b, c='C']) => "$a-$b-$c";
- get getter => 'g';
- set setter(x) {
+ static method(a, b, c) => "$a-$b-$c";
+ static methodWithNamed(a, {b:'B', c}) => "$a-$b-$c";
+ static methodWithOpt(a, [b, c='C']) => "$a-$b-$c";
+ static get getter => 'g';
+ static set setter(x) {
field = x*2;
return 'unobservable value';
}
- var field;
+ static var field;
gbracha 2015/08/05 23:58:16 It would be nice to retain the instance level test
rmacnak 2015/08/06 00:01:11 The old test is not removed. Note Rietveld lists t
}
class Proxy {
var targetMirror;
- Proxy(target) : this.targetMirror = reflect(target);
+ Proxy(this.targetMirror);
noSuchMethod(invocation) => targetMirror.delegate(invocation);
}
main() {
- var c = new C();
- var proxy = new Proxy(c);
+ var proxy = new Proxy(reflectClass(C));
var result;
Expect.equals('X-Y-Z', proxy.method('X', 'Y', 'Z'));
« no previous file with comments | « tests/lib/lib.status ('k') | tests/lib/mirrors/delegate_library_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698