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

Unified Diff: runtime/lib/mirrors_impl.dart

Issue 165773002: Remove ObjectMirror.[]. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: sync Created 6 years, 9 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 | « no previous file | sdk/lib/_internal/lib/js_mirrors.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/mirrors_impl.dart
diff --git a/runtime/lib/mirrors_impl.dart b/runtime/lib/mirrors_impl.dart
index 4449187d65b7052dd672c0c390918ebb9ff61cb8..bb8b56ee864e6a2a9ee083a5916ab9c368db07f7 100644
--- a/runtime/lib/mirrors_impl.dart
+++ b/runtime/lib/mirrors_impl.dart
@@ -155,18 +155,6 @@ class _LocalIsolateMirror extends _LocalMirror implements IsolateMirror {
String toString() => "IsolateMirror on '$debugName'";
}
-class _InvocationTrampoline implements Function {
- final ObjectMirror _receiver;
- final Symbol _selector;
- _InvocationTrampoline(this._receiver, this._selector);
- noSuchMethod(Invocation msg) {
- if (msg.memberName != #call) return super.noSuchMethod(msg);
- return _receiver.invoke(_selector,
- msg.positionalArguments,
- msg.namedArguments);
- }
-}
-
class _SyntheticAccessor implements MethodMirror {
final DeclarationMirror owner;
final Symbol simpleName;
@@ -321,23 +309,6 @@ class _LocalInstanceMirror extends _LocalObjectMirror
return identityHashCode(_reflectee) ^ 0x36363636;
}
- Function operator [](Symbol selector) {
- bool found = false;
- for (ClassMirror c = type; c != null; c = c.superclass) {
- var target = c._methods[selector];
- if (target != null && !target.isStatic && target.isRegularMethod) {
- found = true;
- break;
- }
- }
- if (!found) {
- throw new ArgumentError(
- "${MirrorSystem.getName(type.simpleName)} has no instance method "
- "${MirrorSystem.getName(selector)}");
- }
- return new _InvocationTrampoline(this, selector);
- }
-
// TODO(16539): Make these weak or soft.
static var _getFieldClosures = new HashMap();
static var _setFieldClosures = new HashMap();
@@ -814,16 +785,6 @@ class _LocalClassMirror extends _LocalObjectMirror
String toString() => "ClassMirror on '${MirrorSystem.getName(simpleName)}'";
- Function operator [](Symbol selector) {
- var target = _methods[selector];
- if (target == null || !target.isStatic || !target.isRegularMethod) {
- throw new ArgumentError(
- "${MirrorSystem.getName(simpleName)} has no static method "
- "${MirrorSystem.getName(selector)}");
- }
- return new _InvocationTrampoline(this, selector);
- }
-
InstanceMirror newInstance(Symbol constructorName,
List positionalArguments,
[Map<Symbol, dynamic> namedArguments]) {
@@ -1257,14 +1218,6 @@ class _LocalLibraryMirror extends _LocalObjectMirror implements LibraryMirror {
return _cachedMembers;
}
- Map<Symbol, MethodMirror> _cachedFunctions;
- Map<Symbol, MethodMirror> get _functions {
- if (_cachedFunctions == null) {
- _cachedFunctions = _filterMap(_members, (key, value) => (value is MethodMirror));
- }
- return _cachedFunctions;
- }
-
List<InstanceMirror> get metadata {
// Get the metadata objects, convert them into InstanceMirrors using
// reflect() and then make them into a Dart list.
@@ -1280,16 +1233,6 @@ class _LocalLibraryMirror extends _LocalObjectMirror implements LibraryMirror {
String toString() => "LibraryMirror on '${_n(simpleName)}'";
- Function operator [](Symbol selector) {
- var target = _functions[selector];
- if (target == null || !target.isRegularMethod) {
- throw new ArgumentError(
- "${MirrorSystem.getName(simpleName)} has no top-level method "
- "${MirrorSystem.getName(selector)}");
- }
- return new _InvocationTrampoline(this, selector);
- }
-
var _cachedLibraryDependencies;
get libraryDependencies {
if (_cachedLibraryDependencies == null) {
« no previous file with comments | « no previous file | sdk/lib/_internal/lib/js_mirrors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698