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

Side by Side Diff: pkg/compiler/lib/src/mirrors/dart2js_instance_mirrors.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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 part of dart2js.mirrors; 5 part of dart2js.mirrors;
6 6
7 abstract class ObjectMirrorMixin implements ObjectMirror { 7 abstract class ObjectMirrorMixin implements ObjectMirror {
8 InstanceMirror getField(Symbol fieldName) { 8 InstanceMirror getField(Symbol fieldName) {
9 throw new UnsupportedError('ObjectMirror.getField unsupported.'); 9 throw new UnsupportedError('ObjectMirror.getField unsupported.');
10 } 10 }
11 11
12 InstanceMirror setField(Symbol fieldName, Object value) { 12 InstanceMirror setField(Symbol fieldName, Object value) {
13 throw new UnsupportedError('ObjectMirror.setField unsupported.'); 13 throw new UnsupportedError('ObjectMirror.setField unsupported.');
14 } 14 }
15 15
16 InstanceMirror invoke(Symbol memberName, 16 InstanceMirror invoke(Symbol memberName,
17 List positionalArguments, 17 List positionalArguments,
18 [Map<Symbol, dynamic> namedArguments]) { 18 [Map<Symbol, dynamic> namedArguments]) {
19 throw new UnsupportedError('ObjectMirror.invoke unsupported.'); 19 throw new UnsupportedError('ObjectMirror.invoke unsupported.');
20 } 20 }
21
22 delegate(Invocation invocation) {
23 throw new UnsupportedError('ObjectMirror.delegate unsupported');
24 }
21 } 25 }
22 26
23 abstract class InstanceMirrorMixin implements InstanceMirror { 27 abstract class InstanceMirrorMixin implements InstanceMirror {
24 bool get hasReflectee => false; 28 bool get hasReflectee => false;
25 29
26 get reflectee { 30 get reflectee {
27 throw new UnsupportedError('InstanceMirror.reflectee unsupported.'); 31 throw new UnsupportedError('InstanceMirror.reflectee unsupported.');
28 } 32 }
29
30 delegate(Invocation invocation) {
31 throw new UnsupportedError('InstanceMirror.delegate unsupported');
32 }
33 } 33 }
34 34
35 InstanceMirror _convertConstantToInstanceMirror( 35 InstanceMirror _convertConstantToInstanceMirror(
36 Dart2JsMirrorSystem mirrorSystem, 36 Dart2JsMirrorSystem mirrorSystem,
37 ConstantExpression constant, 37 ConstantExpression constant,
38 ConstantValue value) { 38 ConstantValue value) {
39 39
40 if (value.isBool) { 40 if (value.isBool) {
41 return new Dart2JsBoolConstantMirror(mirrorSystem, constant, value); 41 return new Dart2JsBoolConstantMirror(mirrorSystem, constant, value);
42 } else if (value.isNum) { 42 } else if (value.isNum) {
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 return new Dart2JsBoolConstantMirror.fromBool(mirrorSystem, isDocComment); 289 return new Dart2JsBoolConstantMirror.fromBool(mirrorSystem, isDocComment);
290 } else if (fieldName == #text) { 290 } else if (fieldName == #text) {
291 return new Dart2JsStringConstantMirror.fromString(mirrorSystem, text); 291 return new Dart2JsStringConstantMirror.fromString(mirrorSystem, text);
292 } else if (fieldName == #trimmedText) { 292 } else if (fieldName == #trimmedText) {
293 return new Dart2JsStringConstantMirror.fromString(mirrorSystem, 293 return new Dart2JsStringConstantMirror.fromString(mirrorSystem,
294 trimmedText); 294 trimmedText);
295 } 295 }
296 return super.getField(fieldName); 296 return super.getField(fieldName);
297 } 297 }
298 } 298 }
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/mirrors_impl.dart » ('j') | tests/lib/mirrors/delegate_class_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698