| Index: tests/lib/mirrors/delegate_library_test.dart
|
| diff --git a/tests/lib/mirrors/delegate_test.dart b/tests/lib/mirrors/delegate_library_test.dart
|
| similarity index 68%
|
| copy from tests/lib/mirrors/delegate_test.dart
|
| copy to tests/lib/mirrors/delegate_library_test.dart
|
| index b7ea729dfb8c8e23a79df991a83d10a40f9e46b9..7eb5a84a5db271720bf499732a547c986db2e955 100644
|
| --- a/tests/lib/mirrors/delegate_test.dart
|
| +++ b/tests/lib/mirrors/delegate_library_test.dart
|
| @@ -1,34 +1,32 @@
|
| -// 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_library;
|
|
|
| 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) {
|
| - field = x*2;
|
| - return 'unobservable value';
|
| - }
|
| - var field;
|
| +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) {
|
| + field = x*2;
|
| + return 'unobservable value';
|
| }
|
| +var field;
|
| +
|
|
|
| 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(Proxy).owner);
|
| var result;
|
|
|
| Expect.equals('X-Y-Z', proxy.method('X', 'Y', 'Z'));
|
|
|