| Index: dart/sdk/lib/_internal/lib/js_mirrors.dart
|
| diff --git a/dart/sdk/lib/_internal/lib/js_mirrors.dart b/dart/sdk/lib/_internal/lib/js_mirrors.dart
|
| index ee760b71d1ed365aad5c7fc35cd0644c9a2ab049..bd1c598a9ff5e6c143899efec5a05d72d4203867 100644
|
| --- a/dart/sdk/lib/_internal/lib/js_mirrors.dart
|
| +++ b/dart/sdk/lib/_internal/lib/js_mirrors.dart
|
| @@ -434,7 +434,7 @@ ClassMirror reflectClassByName(Symbol symbol, String mangledName) {
|
| int index = JS('int|Null', 'init.functionAliases[#]', mangledName);
|
| if (index != null) {
|
| mirror = new JsTypedefMirror(
|
| - symbol, mangledName, JS('=Object', 'init.metadata[#]', index));
|
| + symbol, mangledName, JS('', 'init.metadata[#]', index));
|
| JsCache.update(classMirrors, mangledName, mirror);
|
| return mirror;
|
| }
|
| @@ -1452,47 +1452,34 @@ class JsFunctionTypeMirror implements FunctionTypeMirror {
|
|
|
| JsFunctionTypeMirror(this._typeData);
|
|
|
| - bool get _hasReturnType => JS('bool', '"ret" in #', _typeData);
|
| - get _returnType => JS('', '#.ret', _typeData);
|
| -
|
| - bool get _isVoid => JS('bool', '!!#.void', _typeData);
|
| -
|
| - bool get _hasArguments => JS('bool', '"args" in #', _typeData);
|
| - List get _arguments => JS('JSExtendableArray', '#.args', _typeData);
|
| -
|
| - bool get _hasOptionalArguments => JS('bool', '"opt" in #', _typeData);
|
| - List get _optionalArguments => JS('JSExtendableArray', '#.opt', _typeData);
|
| -
|
| - bool get _hasNamedArguments => JS('bool', '"named" in #', _typeData);
|
| - get _namedArguments => JS('=Object', '#.named', _typeData);
|
| -
|
| TypeMirror get returnType {
|
| if (_cachedReturnType != null) return _cachedReturnType;
|
| - if (_isVoid) return _cachedReturnType = JsMirrorSystem._voidType;
|
| - if (!_hasReturnType) return _cachedReturnType = JsMirrorSystem._dynamicType;
|
| + if (_typeData.isVoid) return _cachedReturnType = JsMirrorSystem._voidType;
|
| + if (!_typeData.hasReturnType)
|
| + return _cachedReturnType = JsMirrorSystem._dynamicType;
|
| return _cachedReturnType =
|
| - typeMirrorFromRuntimeTypeRepresentation(_returnType);
|
| + typeMirrorFromRuntimeTypeRepresentation(_typeData.returnType);
|
| }
|
|
|
| List<ParameterMirror> get parameters {
|
| if (_cachedParameters != null) return _cachedParameters;
|
| List result = [];
|
| int parameterCount = 0;
|
| - if (_hasArguments) {
|
| - for (var type in _arguments) {
|
| + if (_typeData.hasArguments) {
|
| + for (var type in _typeData.arguments) {
|
| result.add(
|
| new JsParameterMirror('argument${parameterCount++}', this, type));
|
| }
|
| }
|
| - if (_hasOptionalArguments) {
|
| - for (var type in _optionalArguments) {
|
| + if (_typeData.hasOptionalArguments) {
|
| + for (var type in _typeData.optionalArguments) {
|
| result.add(
|
| new JsParameterMirror('argument${parameterCount++}', this, type));
|
| }
|
| }
|
| - if (_hasNamedArguments) {
|
| - for (var name in extractKeys(_namedArguments)) {
|
| - var type = JS('', '#[#]', _namedArguments, name);
|
| + if (_typeData.hasNamedArguments) {
|
| + for (var name in extractKeys(_typeData.namedArguments)) {
|
| + var type = JS('', '#[#]', _typeData.namedArguments, name);
|
| result.add(new JsParameterMirror(name, this, type));
|
| }
|
| }
|
| @@ -1502,45 +1489,7 @@ class JsFunctionTypeMirror implements FunctionTypeMirror {
|
|
|
| String toString() {
|
| if (_cachedToString != null) return _cachedToString;
|
| - var s = "FunctionTypeMirror on '(";
|
| - var sep = '';
|
| - if (_hasArguments) {
|
| - for (var argument in _arguments) {
|
| - s += runtimeTypeToString(argument);
|
| - s += sep;
|
| - sep = ', ';
|
| - }
|
| - }
|
| - if (_hasOptionalArguments) {
|
| - s += '$sep[';
|
| - sep = '';
|
| - for (var argument in _optionalArguments) {
|
| - s += runtimeTypeToString(argument);
|
| - s += sep;
|
| - sep = ', ';
|
| - }
|
| - s += ']';
|
| - }
|
| - if (_hasNamedArguments) {
|
| - s += '$sep{';
|
| - sep = '';
|
| - for (var name in extractKeys(_namedArguments)) {
|
| - s += '$name: ';
|
| - s += runtimeTypeToString(JS('', '#[#]', _namedArguments, name));
|
| - s += sep;
|
| - sep = ', ';
|
| - }
|
| - s += '}';
|
| - }
|
| - s += ') -> ';
|
| - if (_isVoid) {
|
| - s += 'void';
|
| - } else if (_hasReturnType) {
|
| - s += runtimeTypeToString(_returnType);
|
| - } else {
|
| - s += 'dynamic';
|
| - }
|
| - return _cachedToString = "$s'";
|
| + return _cachedToString = "FunctionTypeMirror on '$_typeData'";
|
| }
|
| }
|
|
|
|
|