Chromium Code Reviews| Index: sdk/lib/_internal/lib/js_mirrors.dart |
| diff --git a/sdk/lib/_internal/lib/js_mirrors.dart b/sdk/lib/_internal/lib/js_mirrors.dart |
| index 802563e175aa6574ac54e3b67a2cf59f30ece33b..499dbd3c53ee980b1825277a7ebb63bf49ecedb3 100644 |
| --- a/sdk/lib/_internal/lib/js_mirrors.dart |
| +++ b/sdk/lib/_internal/lib/js_mirrors.dart |
| @@ -271,7 +271,7 @@ class JsLibraryMirror extends JsDeclarationMirror with JsObjectMirror |
| List<JsMethodMirror> get _methods => _functionMirrors; |
| - Map<Symbol, ClassMirror> get classes { |
| + Map<Symbol, ClassMirror> get __classes { |
| if (_cachedClasses != null) return _cachedClasses; |
| var result = new Map(); |
| for (String className in _classes) { |
| @@ -288,8 +288,8 @@ class JsLibraryMirror extends JsDeclarationMirror with JsObjectMirror |
| InstanceMirror setField(Symbol fieldName, Object arg) { |
| String name = n(fieldName); |
| if (name.endsWith('=')) throw new ArgumentError(''); |
| - var mirror = functions[s('$name=')]; |
| - if (mirror == null) mirror = variables[fieldName]; |
| + var mirror = __functions[s('$name=')]; |
| + if (mirror == null) mirror = __variables[fieldName]; |
| if (mirror == null) { |
| // TODO(ahe): What receiver to use? |
| throw new NoSuchMethodError(this, setterSymbol(fieldName), [arg], null); |
| @@ -299,7 +299,7 @@ class JsLibraryMirror extends JsDeclarationMirror with JsObjectMirror |
| } |
| InstanceMirror getField(Symbol fieldName) { |
| - JsMirror mirror = members[fieldName]; |
| + JsMirror mirror = __members[fieldName]; |
| if (mirror == null) { |
| // TODO(ahe): What receiver to use? |
| throw new NoSuchMethodError(this, fieldName, [], null); |
| @@ -313,7 +313,7 @@ class JsLibraryMirror extends JsDeclarationMirror with JsObjectMirror |
| if (namedArguments != null && !namedArguments.isEmpty) { |
| throw new UnsupportedError('Named arguments are not implemented.'); |
| } |
| - JsDeclarationMirror mirror = members[memberName]; |
| + JsDeclarationMirror mirror = __members[memberName]; |
| if (mirror == null) { |
| // TODO(ahe): What receiver to use? |
| throw new NoSuchMethodError( |
| @@ -381,7 +381,7 @@ class JsLibraryMirror extends JsDeclarationMirror with JsObjectMirror |
| return _cachedFields = result; |
| } |
| - Map<Symbol, MethodMirror> get functions { |
| + Map<Symbol, MethodMirror> get __functions { |
| if (_cachedFunctions != null) return _cachedFunctions; |
| var result = new Map(); |
| for (JsMethodMirror mirror in _functionMirrors) { |
| @@ -391,7 +391,7 @@ class JsLibraryMirror extends JsDeclarationMirror with JsObjectMirror |
| new UnmodifiableMapView<Symbol, MethodMirror>(result); |
| } |
| - Map<Symbol, MethodMirror> get getters { |
| + Map<Symbol, MethodMirror> get __getters { |
| if (_cachedGetters != null) return _cachedGetters; |
| var result = new Map(); |
| // TODO(ahe): Implement this. |
| @@ -399,7 +399,7 @@ class JsLibraryMirror extends JsDeclarationMirror with JsObjectMirror |
| new UnmodifiableMapView<Symbol, MethodMirror>(result); |
| } |
| - Map<Symbol, MethodMirror> get setters { |
| + Map<Symbol, MethodMirror> get __setters { |
| if (_cachedSetters != null) return _cachedSetters; |
| var result = new Map(); |
| // TODO(ahe): Implement this. |
| @@ -407,7 +407,7 @@ class JsLibraryMirror extends JsDeclarationMirror with JsObjectMirror |
| new UnmodifiableMapView<Symbol, MethodMirror>(result); |
| } |
| - Map<Symbol, VariableMirror> get variables { |
| + Map<Symbol, VariableMirror> get __variables { |
| if (_cachedVariables != null) return _cachedVariables; |
| var result = new Map(); |
| for (JsVariableMirror mirror in _fields) { |
| @@ -417,16 +417,16 @@ class JsLibraryMirror extends JsDeclarationMirror with JsObjectMirror |
| new UnmodifiableMapView<Symbol, VariableMirror>(result); |
| } |
| - Map<Symbol, Mirror> get members { |
| + Map<Symbol, Mirror> get __members { |
| if (_cachedMembers != null) return _cachedMembers; |
| - Map<Symbol, Mirror> result = new Map.from(classes); |
| + Map<Symbol, Mirror> result = new Map.from(__classes); |
| addToResult(Symbol key, Mirror value) { |
| result[key] = value; |
| } |
| - functions.forEach(addToResult); |
| - getters.forEach(addToResult); |
| - setters.forEach(addToResult); |
| - variables.forEach(addToResult); |
| + __functions.forEach(addToResult); |
| + __getters.forEach(addToResult); |
| + __setters.forEach(addToResult); |
| + __variables.forEach(addToResult); |
| return _cachedMembers = new UnmodifiableMapView<Symbol, Mirror>(result); |
| } |
| @@ -436,7 +436,7 @@ class JsLibraryMirror extends JsDeclarationMirror with JsObjectMirror |
| addToResult(Symbol key, Mirror value) { |
| result[key] = value; |
| } |
| - members.forEach(addToResult); |
| + __members.forEach(addToResult); |
| return _cachedDeclarations = |
| new UnmodifiableMapView<Symbol, DeclarationMirror>(result); |
| } |
| @@ -631,15 +631,15 @@ class JsMixinApplication extends JsTypeMirror with JsObjectMirror |
| // TODO(ahe): Remove this method, only here to silence warning. |
| get _mixin => mixin; |
| - Map<Symbol, Mirror> get members => _mixin.members; |
| + Map<Symbol, Mirror> get __members => _mixin.__members; |
| - Map<Symbol, MethodMirror> get methods => _mixin.methods; |
| + Map<Symbol, MethodMirror> get __methods => _mixin.__methods; |
| - Map<Symbol, MethodMirror> get getters => _mixin.getters; |
| + Map<Symbol, MethodMirror> get __getters => _mixin.__getters; |
| - Map<Symbol, MethodMirror> get setters => _mixin.setters; |
| + Map<Symbol, MethodMirror> get __setters => _mixin.__setters; |
| - Map<Symbol, VariableMirror> get variables => _mixin.variables; |
| + Map<Symbol, VariableMirror> get __variables => _mixin.__variables; |
| Map<Symbol, DeclarationMirror> get declarations => mixin.declarations; |
| @@ -664,7 +664,7 @@ class JsMixinApplication extends JsTypeMirror with JsObjectMirror |
| List<ClassMirror> get superinterfaces => [mixin]; |
| - Map<Symbol, MethodMirror> get constructors => _mixin.constructors; |
| + Map<Symbol, MethodMirror> get __constructors => _mixin.__constructors; |
| InstanceMirror newInstance( |
| Symbol constructorName, |
| @@ -927,32 +927,32 @@ class JsTypeBoundClassMirror extends JsDeclarationMirror implements ClassMirror |
| return _cachedTypeArguments = new UnmodifiableListView(result); |
| } |
| - Map<Symbol, MethodMirror> get constructors => _class.constructors; |
| + Map<Symbol, MethodMirror> get __constructors => _class.__constructors; |
| List<JsMethodMirror> get _methods { |
| if (_cachedMethods != null) return _cachedMethods; |
| return _cachedMethods =_class._getMethodsWithOwner(this); |
| } |
| - Map<Symbol, MethodMirror> get methods { |
| + Map<Symbol, MethodMirror> get __methods { |
| if (_cachedMethodsMap != null) return _cachedMethodsMap; |
| return _cachedMethodsMap = new UnmodifiableMapView<Symbol, MethodMirror>( |
| filterMethods(_methods)); |
| } |
| - Map<Symbol, MethodMirror> get getters { |
| + Map<Symbol, MethodMirror> get __getters { |
| if (_cachedGetters != null) return _cachedGetters; |
| return _cachedGetters = new UnmodifiableMapView<Symbol, MethodMirror>( |
| - filterGetters(_methods, variables)); |
| + filterGetters(_methods, __variables)); |
| } |
| - Map<Symbol, MethodMirror> get setters { |
| + Map<Symbol, MethodMirror> get __setters { |
| if (_cachedSetters != null) return _cachedSetters; |
| return _cachedSetters = new UnmodifiableMapView<Symbol, MethodMirror>( |
| - filterSetters(_methods, variables)); |
| + filterSetters(_methods, __variables)); |
| } |
| - Map<Symbol, VariableMirror> get variables { |
| + Map<Symbol, VariableMirror> get __variables { |
| if (_cachedVariables != null) return _cachedVariables; |
| var result = new Map(); |
| for (JsVariableMirror mirror in _class._getFieldsWithOwner(this)) { |
| @@ -962,7 +962,9 @@ class JsTypeBoundClassMirror extends JsDeclarationMirror implements ClassMirror |
| new UnmodifiableMapView<Symbol, VariableMirror>(result); |
| } |
| - Map<Symbol, Mirror> get members => _class.members; |
| + Map<Symbol, Mirror> get __members => _class.__members; |
| + |
| + Map<Symbol, DeclarationMirror> get declarations => _class.declarations; |
|
rmacnak
2013/11/04 18:19:01
Presumably some substitution should happen here.
|
| InstanceMirror setField(Symbol fieldName, Object arg) { |
| return _class.setField(fieldName, arg); |
| @@ -1066,7 +1068,7 @@ class JsClassMirror extends JsTypeMirror with JsObjectMirror |
| } |
| } |
| - Map<Symbol, MethodMirror> get constructors { |
| + Map<Symbol, MethodMirror> get __constructors { |
| if (_cachedConstructors != null) return _cachedConstructors; |
| var result = new Map(); |
| for (JsMethodMirror method in _methods) { |
| @@ -1159,25 +1161,25 @@ class JsClassMirror extends JsTypeMirror with JsObjectMirror |
| return _cachedFields = _getFieldsWithOwner(this); |
| } |
| - Map<Symbol, MethodMirror> get methods { |
| + Map<Symbol, MethodMirror> get __methods { |
| if (_cachedMethodsMap != null) return _cachedMethodsMap; |
| return _cachedMethodsMap = |
| new UnmodifiableMapView<Symbol, MethodMirror>(filterMethods(_methods)); |
| } |
| - Map<Symbol, MethodMirror> get getters { |
| + Map<Symbol, MethodMirror> get __getters { |
| if (_cachedGetters != null) return _cachedGetters; |
| return _cachedGetters = new UnmodifiableMapView<Symbol, MethodMirror>( |
| - filterGetters(_methods, variables)); |
| + filterGetters(_methods, __variables)); |
| } |
| - Map<Symbol, MethodMirror> get setters { |
| + Map<Symbol, MethodMirror> get __setters { |
| if (_cachedSetters != null) return _cachedSetters; |
| return _cachedSetters = new UnmodifiableMapView<Symbol, MethodMirror>( |
| - filterSetters(_methods, variables)); |
| + filterSetters(_methods, __variables)); |
| } |
| - Map<Symbol, VariableMirror> get variables { |
| + Map<Symbol, VariableMirror> get __variables { |
| if (_cachedVariables != null) return _cachedVariables; |
| var result = new Map(); |
| for (JsVariableMirror mirror in _fields) { |
| @@ -1187,9 +1189,9 @@ class JsClassMirror extends JsTypeMirror with JsObjectMirror |
| new UnmodifiableMapView<Symbol, VariableMirror>(result); |
| } |
| - Map<Symbol, Mirror> get members { |
| + Map<Symbol, Mirror> get __members { |
| if (_cachedMembers != null) return _cachedMembers; |
| - Map<Symbol, Mirror> result = new Map.from(variables); |
| + Map<Symbol, Mirror> result = new Map.from(__variables); |
| for (JsMethodMirror method in _methods) { |
| if (method.isSetter) { |
| String name = n(method.simpleName); |
| @@ -1211,15 +1213,15 @@ class JsClassMirror extends JsTypeMirror with JsObjectMirror |
| addToResult(Symbol key, Mirror value) { |
| result[key] = value; |
| } |
| - members.forEach(addToResult); |
| - constructors.forEach(addToResult); |
| + __members.forEach(addToResult); |
| + __constructors.forEach(addToResult); |
| typeVariables.forEach((tv) => result[tv.simpleName] = tv); |
| return _cachedDeclarations = |
| new UnmodifiableMapView<Symbol, DeclarationMirror>(result); |
| } |
| InstanceMirror setField(Symbol fieldName, Object arg) { |
| - JsVariableMirror mirror = variables[fieldName]; |
| + JsVariableMirror mirror = __variables[fieldName]; |
| if (mirror != null && mirror.isStatic && !mirror.isFinal) { |
| // '$' (JS_CURRENT_ISOLATE()) stores state which is stored directly, so |
| // we shouldn't use [JsLibraryMirror._globalObject] here. |
| @@ -1235,7 +1237,7 @@ class JsClassMirror extends JsTypeMirror with JsObjectMirror |
| } |
| InstanceMirror getField(Symbol fieldName) { |
| - JsVariableMirror mirror = variables[fieldName]; |
| + JsVariableMirror mirror = __variables[fieldName]; |
| if (mirror != null && mirror.isStatic) { |
| String jsName = mirror._jsName; |
| // '$' (JS_CURRENT_ISOLATE()) stores state which is read directly, so |
| @@ -1263,7 +1265,7 @@ class JsClassMirror extends JsTypeMirror with JsObjectMirror |
| JsMethodMirror mirror = |
| JsCache.fetch(_jsConstructorCache, n(constructorName)); |
| if (mirror == null) { |
| - mirror = constructors.values.firstWhere( |
| + mirror = __constructors.values.firstWhere( |
| (m) => m.constructorName == constructorName, |
| orElse: () { |
| // TODO(ahe): What receiver to use? |
| @@ -1285,7 +1287,7 @@ class JsClassMirror extends JsTypeMirror with JsObjectMirror |
| // This will set _owner field on all clasess as a side |
| // effect. This gives us a fast path to reflect on a |
| // class without parsing reflection data. |
| - library.classes; |
| + library.__classes; |
| } |
| } |
| } |
| @@ -1341,7 +1343,7 @@ class JsClassMirror extends JsTypeMirror with JsObjectMirror |
| if (namedArguments != null && !namedArguments.isEmpty) { |
| throw new UnsupportedError('Named arguments are not implemented.'); |
| } |
| - JsMethodMirror mirror = methods[memberName]; |
| + JsMethodMirror mirror = __methods[memberName]; |
| if (mirror == null || !mirror.isStatic) { |
| // TODO(ahe): What receiver to use? |
| throw new NoSuchMethodError( |