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

Unified Diff: pkg/dev_compiler/lib/js/common/dart_sdk.js

Side-by-side diff isn't available for this file because of its large size.
Issue 2623053004: Fix noSuchMethod handling of methods that are also extension methods. Fix noSuchMethod handling of … (Closed)
Patch Set: Fix noSuchMethod handling of methods that are also extension methods. Fix noSuchMethod handling of … Created 3 years, 10 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:
Download patch
« no previous file with comments | « pkg/dev_compiler/lib/js/amd/dart_sdk.js ('k') | pkg/dev_compiler/lib/js/es6/dart_sdk.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/dev_compiler/lib/js/common/dart_sdk.js
diff --git a/pkg/dev_compiler/lib/js/common/dart_sdk.js b/pkg/dev_compiler/lib/js/common/dart_sdk.js
index ac83d92049f52dee073bac6d86fba217ee93e461..e3e5b33aa9823b526aeec448f479829712f6074b 100644
--- a/pkg/dev_compiler/lib/js/common/dart_sdk.js
+++ b/pkg/dev_compiler/lib/js/common/dart_sdk.js
@@ -633,6 +633,7 @@
let dynamicTodynamic$ = () => (dynamicTodynamic$ = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic])))();
let StringAndStringToint = () => (StringAndStringToint = dart.constFn(dart.definiteFunctionType(core.int, [core.String, core.String])))();
let VoidTo_MethodStats = () => (VoidTo_MethodStats = dart.constFn(dart.definiteFunctionType(dart._MethodStats, [])))();
+ let VoidToFunctionType = () => (VoidToFunctionType = dart.constFn(dart.definiteFunctionType(dart.FunctionType, [])))();
let dynamicToString = () => (dynamicToString = dart.constFn(dart.definiteFunctionType(core.String, [dart.dynamic])))();
let dynamicToListOfString = () => (dynamicToListOfString = dart.constFn(dart.definiteFunctionType(ListOfString(), [dart.dynamic])))();
let dynamicToList = () => (dynamicToList = dart.constFn(dart.definiteFunctionType(core.List, [dart.dynamic])))();
@@ -972,6 +973,27 @@
dart.copyProperties(s, m[dart._methodSig]);
}
return s;
+ },
+ fields: () => {
+ let s = {};
+ for (let m of mixins) {
+ dart.copyProperties(s, m[dart._fieldSig]);
+ }
+ return s;
+ },
+ getters: () => {
+ let s = {};
+ for (let m of mixins) {
+ dart.copyProperties(s, m[dart._getterSig]);
+ }
+ return s;
+ },
+ setters: () => {
+ let s = {};
+ for (let m of mixins) {
+ dart.copyProperties(s, m[dart._setterSig]);
+ }
+ return s;
}
});
Mixin[dart._mixins] = mixins;
@@ -1074,15 +1096,24 @@
dart.getGenericTypeCtor = function(value) {
return value[dart._genericTypeCtor];
};
- dart.getMethodType = function(obj, name) {
- let type = obj == null ? core.Object : obj.__proto__.constructor;
- return dart.getMethodTypeFromType(type, name);
+ dart.getType = function(obj) {
+ return obj == null ? core.Object : obj.__proto__.constructor;
};
- dart.getMethodTypeFromType = function(type, name) {
+ dart.getMethodType = function(type, name) {
let sigObj = type[dart._methodSig];
if (sigObj === void 0) return void 0;
return sigObj[name];
};
+ dart.getFieldType = function(type, name) {
+ let sigObj = type[dart._fieldSig];
+ if (sigObj === void 0) return void 0;
+ return sigObj[name];
+ };
+ dart.getSetterType = function(type, name) {
+ let sigObj = type[dart._setterSig];
+ if (sigObj === void 0) return void 0;
+ return sigObj[name];
+ };
dart.classGetConstructorType = function(cls, name) {
if (!name) name = 'new';
if (cls === void 0) return void 0;
@@ -1094,7 +1125,7 @@
dart.bind = function(obj, name, f) {
if (f === void 0) f = obj[name];
f = f.bind(obj);
- let sig = dart.getMethodType(obj, name);
+ let sig = dart.getMethodType(dart.getType(obj), name);
dart.assert(sig);
dart.tag(f, sig);
return f;
@@ -1108,7 +1139,8 @@
dart._setInstanceSignature = function(f, sigF, kind) {
dart.defineMemoizedGetter(f, kind, () => {
let sigObj = sigF();
- sigObj.__proto__ = f.__proto__[kind];
+ let proto = f.__proto__;
+ sigObj.__proto__ = kind in proto ? proto[kind] : null;
return sigObj;
});
};
@@ -1169,8 +1201,22 @@
dart._setStaticSetterSignature(f, staticSetters);
dart._setStaticTypes(f, names);
};
- dart.hasMethod = function(obj, name) {
- return dart.getMethodType(obj, name) !== void 0;
+ dart._hasSigEntry = function(type, sigF, name) {
+ let sigObj = type[sigF];
+ if (sigObj === void 0) return false;
+ return name in sigObj;
+ };
+ dart.hasMethod = function(type, name) {
+ return dart._hasSigEntry(type, dart._methodSig, name);
+ };
+ dart.hasGetter = function(type, name) {
+ return dart._hasSigEntry(type, dart._getterSig, name);
+ };
+ dart.hasSetter = function(type, name) {
+ return dart._hasSigEntry(type, dart._setterSig, name);
+ };
+ dart.hasField = function(type, name) {
+ return dart._hasSigEntry(type, dart._fieldSig, name);
};
dart.defineNamedConstructor = function(clazz, name) {
let proto = clazz.prototype;
@@ -1231,9 +1277,15 @@
if (!jsProto) return;
jsProto[dart._extensionType] = dartExtType;
dart._installProperties(jsProto, extProto);
- let originalSigFn = dart.getOwnPropertyDescriptor(dartExtType, dart._methodSig).get;
- dart.assert(originalSigFn);
- dart.defineMemoizedGetter(jsType, dart._methodSig, originalSigFn);
+ function updateSig(sigF) {
+ let originalSigFn = dart.getOwnPropertyDescriptor(dartExtType, sigF).get;
+ dart.assert(originalSigFn);
+ dart.defineMemoizedGetter(jsType, sigF, originalSigFn);
+ }
+ updateSig(dart._methodSig);
+ updateSig(dart._fieldSig);
+ updateSig(dart._getterSig);
+ updateSig(dart._setterSig);
};
dart.defineExtensionMembers = function(type, methodNames) {
let proto = type.prototype;
@@ -1241,14 +1293,23 @@
let method = dart.getOwnPropertyDescriptor(proto, name);
dart.defineProperty(proto, dart.getExtensionSymbol(name), method);
}
- let originalSigFn = dart.getOwnPropertyDescriptor(type, dart._methodSig).get;
- dart.defineMemoizedGetter(type, dart._methodSig, function() {
- let sig = originalSigFn();
- for (let name of methodNames) {
- sig[dart.getExtensionSymbol(name)] = sig[name];
- }
- return sig;
- });
+ function upgradeSig(sigF) {
+ let originalSigFn = dart.getOwnPropertyDescriptor(type, sigF).get;
+ dart.defineMemoizedGetter(type, sigF, function() {
+ let sig = originalSigFn();
+ let propertyNames = Object.getOwnPropertyNames(sig);
+ for (let name of methodNames) {
+ if (name in sig) {
+ sig[dart.getExtensionSymbol(name)] = sig[name];
+ }
+ }
+ return sig;
+ });
+ }
+ upgradeSig(dart._methodSig);
+ upgradeSig(dart._fieldSig);
+ upgradeSig(dart._getterSig);
+ upgradeSig(dart._setterSig);
};
dart.setType = function(obj, type) {
obj.__proto__ = type.prototype;
@@ -1449,6 +1510,65 @@
return dart._asInstanceOfLazyJSType(object, this);
};
};
+ dart._memoizeArray = function(map, arr, create) {
+ let len = arr.length;
+ map = dart._lookupNonTerminal(map, len);
+ for (var i = 0; i < len - 1; ++i) {
+ map = dart._lookupNonTerminal(map, arr[i]);
+ }
+ let result = map.get(arr[len - 1]);
+ if (result !== void 0) return result;
+ map.set(arr[len - 1], result = create());
+ return result;
+ };
+ dart._normalizeParameter = function(a) {
+ if (a instanceof Array) {
+ let result = [];
+ result.push(a[0] == dart.dynamic ? dart.bottom : a[0]);
+ result.push(a.slice(1));
+ return result;
+ }
+ return a == dart.dynamic ? dart.bottom : a;
+ };
+ dart._canonicalizeArray = function(definite, array, map) {
+ let arr = definite ? array : array.map(dart._normalizeParameter);
+ return dart._memoizeArray(map, arr, () => arr);
+ };
+ dart._canonicalizeNamed = function(definite, named, map) {
+ let key = [];
+ let names = dart.getOwnPropertyNames(named);
+ let r = {};
+ for (var i = 0; i < names.length; ++i) {
+ let name = names[i];
+ let type = named[name];
+ if (!definite) r[name] = type = dart._normalizeParameter(type);
+ key.push(name);
+ key.push(type);
+ }
+ if (!definite) named = r;
+ return dart._memoizeArray(map, key, () => named);
+ };
+ dart._lookupNonTerminal = function(map, key) {
+ let result = map.get(key);
+ if (result !== void 0) return result;
+ map.set(key, result = new Map());
+ return result;
+ };
+ dart._createSmall = function(count, definite, returnType, required) {
+ let map = dart._fnTypeSmallMap[count];
+ let args = definite ? required : required.map(dart._normalizeParameter);
+ for (var i = 0; i < count; ++i) {
+ map = dart._lookupNonTerminal(map, args[i]);
+ }
+ let result = map.get(returnType);
+ if (result !== void 0) return result;
+ result = new dart.FunctionType(returnType, args, [], {});
+ map.set(returnType, result);
+ return result;
+ };
+ dart.typedef = function(name, closure) {
+ return new dart.Typedef(name, closure);
+ };
dart._functionType = function(definite, returnType, args, extra) {
if (args === void 0 && extra === void 0) {
const fnTypeParts = returnType;
@@ -1467,9 +1587,6 @@
dart.definiteFunctionType = function(returnType, args, extra) {
return dart._functionType(true, returnType, args, extra);
};
- dart.typedef = function(name, closure) {
- return new dart.Typedef(name, closure);
- };
dart.typeName = function(type) {
if (type === void 0) return "undefined type";
if (type === null) return "null type";
@@ -1505,7 +1622,7 @@
};
dart.getImplicitFunctionType = function(type) {
if (dart.test(dart.isFunctionType(type))) return type;
- return dart.getMethodTypeFromType(type, 'call');
+ return dart.getMethodType(type, 'call');
};
dart.isFunctionType = function(type) {
return type instanceof dart.AbstractFunctionType || type === core.Function;
@@ -1763,18 +1880,32 @@
let f = dart._canonicalMember(obj, field);
dart._trackCall(obj);
if (f != null) {
- if (dart.test(dart.hasMethod(obj, f))) return dart.bind(obj, f, void 0);
- return obj[f];
+ let type = dart.getType(obj);
+ if (dart.test(dart.hasField(type, f)) || dart.test(dart.hasGetter(type, f))) return obj[f];
+ if (dart.test(dart.hasMethod(type, f))) return dart.bind(obj, f, void 0);
}
- return dart.noSuchMethod(obj, new dart.InvocationImpl(core.String._check(field), [], {isGetter: true}));
+ return dart.noSuchMethod(obj, new dart.InvocationImpl(field, [], {isGetter: true}));
};
dart.dput = function(obj, field, value) {
let f = dart._canonicalMember(obj, field);
dart._trackCall(obj);
if (f != null) {
- return obj[f] = value;
+ let objType = dart.getType(obj);
+ let setterType = dart.getSetterType(objType, f);
+ if (setterType != void 0) {
+ if (dart.test(dart.instanceOfOrNull(value, setterType.args[0]))) {
+ return obj[f] = value;
+ }
+ } else {
+ let fieldType = dart.getFieldType(objType, f);
+ if (fieldType != void 0) {
+ if (dart.test(dart.instanceOfOrNull(value, fieldType))) {
+ return obj[f] = value;
+ }
+ }
+ }
}
- return dart.noSuchMethod(obj, new dart.InvocationImpl(core.String._check(field), [value], {isSetter: true}));
+ return dart.noSuchMethod(obj, new dart.InvocationImpl(field, [value], {isSetter: true}));
};
dart._checkApply = function(type, actuals) {
if (actuals.length < type.args.length) return false;
@@ -1805,8 +1936,36 @@
}
return true;
};
+ dart._toSymbolName = function(symbol) {
+ let str = symbol.toString();
+ return str.substring(7, str.length - 1);
+ };
+ dart._toDisplayName = function(name) {
+ if (name[0] === '_') {
+ switch (name) {
+ case '_get':
+ {
+ return '[]';
+ }
+ case '_set':
+ {
+ return '[]=';
+ }
+ case '_negate':
+ {
+ return 'unary-';
+ }
+ case '_constructor':
+ case '_prototype':
+ {
+ return name.substring(1);
+ }
+ }
+ }
+ return name;
+ };
dart._dartSymbol = function(name) {
- return dart.const(core.Symbol.new(name.toString()));
+ return core.Symbol._check(typeof name === "symbol" ? dart.const(new _internal.Symbol.es6(dart._toSymbolName(name), name)) : dart.const(core.Symbol.new(dart._toDisplayName(name))));
};
dart.extractNamedArgs = function(args) {
if (args.length > 0) {
@@ -1825,7 +1984,7 @@
}
if (!(f instanceof Function)) {
if (f != null) {
- ftype = dart.getMethodType(f, 'call');
+ ftype = dart.getMethodType(dart.getType(f), 'call');
f = f.call;
}
if (!(f instanceof Function)) {
@@ -1930,16 +2089,17 @@
}
}
let actualTypeName = dart.typeName(actual);
- let o = dart._callMethodStats[dartx.putIfAbsent](dart.str`${actualTypeName} <${src}>`, dart.fn(() => new dart._MethodStats(core.String._check(actualTypeName), src), VoidTo_MethodStats()));
+ let o = dart._callMethodStats[dartx.putIfAbsent](dart.str`${actualTypeName} <${src}>`, dart.fn(() => new dart._MethodStats(actualTypeName, src), VoidTo_MethodStats()));
o.count = dart.notNull(o.count) + 1;
};
dart._callMethod = function(obj, name, typeArgs, args, displayName) {
let symbol = dart._canonicalMember(obj, name);
if (symbol == null) {
- return dart.noSuchMethod(obj, new dart.InvocationImpl(core.String._check(displayName), core.List._check(args), {isMethod: true}));
+ return dart.noSuchMethod(obj, new dart.InvocationImpl(displayName, core.List._check(args), {isMethod: true}));
}
let f = obj != null ? obj[symbol] : null;
- let ftype = dart.getMethodType(obj, symbol);
+ let type = dart.getType(obj);
+ let ftype = dart.getMethodType(type, symbol);
return dart._checkAndCall(f, ftype, obj, typeArgs, args, displayName);
};
dart.dsend = function(obj, method, ...args) {
@@ -2482,196 +2642,186 @@
this[_wrappedType] = wrappedType;
}
toString() {
- return core.String._check(dart.typeName(this[_wrappedType]));
+ return dart.typeName(this[_wrappedType]);
}
};
dart.setSignature(dart.WrappedType, {
constructors: () => ({new: dart.definiteFunctionType(dart.WrappedType, [dart.dynamic])}),
fields: () => ({[_wrappedType]: dart.dynamic})
});
+ const _stringValue = Symbol('_stringValue');
dart.AbstractFunctionType = class AbstractFunctionType extends dart.TypeRep {
- constructor() {
- super();
- this._stringValue = null;
+ new() {
+ this[_stringValue] = null;
+ super.new();
}
toString() {
return this.name;
}
get name() {
- if (this._stringValue) return this._stringValue;
+ if (this[_stringValue] != null) return this[_stringValue];
let buffer = '(';
for (let i = 0; i < this.args.length; ++i) {
if (i > 0) {
- buffer += ', ';
+ buffer = dart.notNull(buffer) + ', ';
}
- buffer += dart.typeName(this.args[i]);
+ buffer = dart.notNull(buffer) + dart.notNull(dart.typeName(this.args[i]));
}
if (this.optionals.length > 0) {
- if (this.args.length > 0) buffer += ', ';
- buffer += '[';
+ if (this.args.length > 0) {
+ buffer = dart.notNull(buffer) + ', ';
+ }
+ buffer = dart.notNull(buffer) + '[';
for (let i = 0; i < this.optionals.length; ++i) {
if (i > 0) {
- buffer += ', ';
+ buffer = dart.notNull(buffer) + ', ';
}
- buffer += dart.typeName(this.optionals[i]);
+ buffer = dart.notNull(buffer) + dart.notNull(dart.typeName(this.optionals[i]));
}
- buffer += ']';
+ buffer = dart.notNull(buffer) + ']';
} else if (Object.keys(this.named).length > 0) {
- if (this.args.length > 0) buffer += ', ';
- buffer += '{';
- let names = dart.getOwnPropertyNames(this.named).sort();
+ if (this.args.length > 0) {
+ buffer = dart.notNull(buffer) + ', ';
+ }
+ buffer = dart.notNull(buffer) + '{';
+ let names = dart.getOwnPropertyNames(this.named);
+ names.sort();
for (let i = 0; i < names.length; ++i) {
if (i > 0) {
- buffer += ', ';
+ buffer = dart.notNull(buffer) + ', ';
}
- buffer += names[i] + ': ' + dart.typeName(this.named[names[i]]);
+ let typeNameString = dart.typeName(this.named[names[i]]);
+ buffer = dart.notNull(buffer) + dart.str`${names[i]}: ${typeNameString}`;
}
- buffer += '}';
+ buffer = dart.notNull(buffer) + '}';
}
- buffer += ') -> ' + dart.typeName(this.returnType);
- this._stringValue = buffer;
+ let returnTypeName = dart.typeName(this.returnType);
+ buffer = dart.notNull(buffer) + dart.str`) -> ${returnTypeName}`;
+ this[_stringValue] = buffer;
return buffer;
}
};
+ dart.setSignature(dart.AbstractFunctionType, {
+ constructors: () => ({new: dart.definiteFunctionType(dart.AbstractFunctionType, [])}),
+ fields: () => ({[_stringValue]: core.String})
+ });
dart._fnTypeNamedArgMap = new Map();
dart._fnTypeArrayArgMap = new Map();
dart._fnTypeTypeMap = new Map();
dart._fnTypeSmallMap = [new Map(), new Map(), new Map()];
+ const _process = Symbol('_process');
dart.FunctionType = class FunctionType extends dart.AbstractFunctionType {
- static _memoizeArray(map, arr, create) {
- let len = arr.length;
- map = FunctionType._lookupNonTerminal(map, len);
- for (var i = 0; i < len - 1; ++i) {
- map = FunctionType._lookupNonTerminal(map, arr[i]);
- }
- let result = map.get(arr[len - 1]);
- if (result !== void 0) return result;
- map.set(arr[len - 1], result = create());
- return result;
- }
- static _normalizeParameter(a) {
- if (a instanceof Array) {
- let result = [];
- result.push(a[0] == dart.dynamic ? dart.bottom : a[0]);
- result.push(a.slice(1));
- return result;
- }
- return a == dart.dynamic ? dart.bottom : a;
- }
- static _canonicalizeArray(definite, array, map) {
- let arr = definite ? array : array.map(FunctionType._normalizeParameter);
- return FunctionType._memoizeArray(map, arr, () => arr);
- }
- static _canonicalizeNamed(definite, named, map) {
- let key = [];
- let names = dart.getOwnPropertyNames(named);
- let r = {};
- for (var i = 0; i < names.length; ++i) {
- let name = names[i];
- let type = named[name];
- if (!definite) r[name] = type = FunctionType._normalizeParameter(type);
- key.push(name);
- key.push(type);
- }
- if (!definite) named = r;
- return FunctionType._memoizeArray(map, key, () => named);
- }
- static _lookupNonTerminal(map, key) {
- let result = map.get(key);
- if (result !== void 0) return result;
- map.set(key, result = new Map());
- return result;
- }
- static _createSmall(count, definite, returnType, required) {
- let map = dart._fnTypeSmallMap[count];
- let args = definite ? required : required.map(FunctionType._normalizeParameter);
- for (var i = 0; i < count; ++i) {
- map = FunctionType._lookupNonTerminal(map, args[i]);
- }
- let result = map.get(returnType);
- if (result !== void 0) return result;
- result = new FunctionType(returnType, args, [], {});
- map.set(returnType, result);
- return result;
- }
static create(definite, returnType, args, extra) {
if (extra === void 0 && args.length < 3) {
- return FunctionType._createSmall(args.length, definite, returnType, args);
+ return dart._createSmall(args.length, definite, returnType, args);
}
- args = FunctionType._canonicalizeArray(definite, args, dart._fnTypeArrayArgMap);
- let keys;
- let create;
+ args = dart._canonicalizeArray(definite, args, dart._fnTypeArrayArgMap);
+ let keys = null;
+ let create = null;
if (extra === void 0) {
keys = [returnType, args];
- create = () => new FunctionType(returnType, args, [], {});
+ create = dart.fn(() => new dart.FunctionType(returnType, args, [], {}), VoidToFunctionType());
} else if (extra instanceof Array) {
- let optionals = FunctionType._canonicalizeArray(definite, extra, dart._fnTypeArrayArgMap);
+ let optionals = dart._canonicalizeArray(definite, extra, dart._fnTypeArrayArgMap);
keys = [returnType, args, optionals];
- create = () => new FunctionType(returnType, args, optionals, {});
+ create = dart.fn(() => new dart.FunctionType(returnType, args, optionals, {}), VoidToFunctionType());
} else {
- let named = FunctionType._canonicalizeNamed(definite, extra, dart._fnTypeNamedArgMap);
+ let named = dart._canonicalizeNamed(definite, extra, dart._fnTypeNamedArgMap);
keys = [returnType, args, named];
- create = () => new FunctionType(returnType, args, [], named);
+ create = dart.fn(() => new dart.FunctionType(returnType, args, [], named), VoidToFunctionType());
+ }
+ return dart._memoizeArray(dart._fnTypeTypeMap, keys, create);
+ }
+ [_process](array, metadata) {
+ let result = [];
+ for (let i = 0; i < array.length; ++i) {
+ let arg = array[i];
+ if (arg instanceof Array) {
+ dart.dsend(metadata, 'add', arg.slice(1));
+ result[dartx.add](arg[0]);
+ } else {
+ metadata.push([]);
+ result.push(arg);
+ }
}
- return FunctionType._memoizeArray(dart._fnTypeTypeMap, keys, create);
+ return result;
}
- constructor(returnType, args, optionals, named) {
- super();
+ new(returnType, args, optionals, named) {
this.returnType = returnType;
this.args = args;
this.optionals = optionals;
this.named = named;
+ this.metadata = null;
+ super.new();
this.metadata = [];
- function process(array, metadata) {
- var result = [];
- for (var i = 0; i < array.length; ++i) {
- var arg = array[i];
- if (arg instanceof Array) {
- metadata.push(arg.slice(1));
- result.push(arg[0]);
- } else {
- metadata.push([]);
- result.push(arg);
- }
- }
- return result;
- }
- this.args = process(this.args, this.metadata);
- this.optionals = process(this.optionals, this.metadata);
+ this.args = this[_process](this.args, this.metadata);
+ this.optionals = this[_process](this.optionals, this.metadata);
}
};
+ dart.setSignature(dart.FunctionType, {
+ constructors: () => ({new: dart.definiteFunctionType(dart.FunctionType, [dart.dynamic, dart.dynamic, dart.dynamic, dart.dynamic])}),
+ fields: () => ({
+ returnType: dart.dynamic,
+ args: dart.dynamic,
+ optionals: dart.dynamic,
+ named: dart.dynamic,
+ metadata: dart.dynamic
+ }),
+ methods: () => ({[_process]: dart.definiteFunctionType(dart.dynamic, [dart.dynamic, dart.dynamic])}),
+ statics: () => ({create: dart.definiteFunctionType(dart.dynamic, [dart.dynamic, dart.dynamic, dart.dynamic, dart.dynamic])}),
+ names: ['create']
+ });
+ const _name = Symbol('_name');
+ const _closure = Symbol('_closure');
+ const _functionType = Symbol('_functionType');
dart.Typedef = class Typedef extends dart.AbstractFunctionType {
- constructor(name, closure) {
- super();
- this._name = name;
- this._closure = closure;
- this._functionType = null;
+ new(name, closure) {
+ this[_name] = name;
+ this[_closure] = closure;
+ this[_functionType] = null;
+ super.new();
}
get name() {
- return this._name;
+ return core.String._check(this[_name]);
}
get functionType() {
- if (!this._functionType) {
- this._functionType = this._closure();
+ if (this[_functionType] == null) {
+ this[_functionType] = this[_closure]();
}
- return this._functionType;
+ return this[_functionType];
}
get returnType() {
return this.functionType.returnType;
}
get args() {
- return this.functionType.args;
+ return core.List._check(this.functionType.args);
}
get optionals() {
- return this.functionType.optionals;
+ return core.List._check(this.functionType.optionals);
}
get named() {
return this.functionType.named;
}
get metadata() {
- return this.functionType.metadata;
+ return core.List._check(this.functionType.metadata);
}
};
+ dart.setSignature(dart.Typedef, {
+ constructors: () => ({new: dart.definiteFunctionType(dart.Typedef, [dart.dynamic, dart.dynamic])}),
+ fields: () => ({
+ [_name]: dart.dynamic,
+ [_closure]: dart.dynamic,
+ [_functionType]: dart.AbstractFunctionType
+ }),
+ getters: () => ({
+ functionType: dart.definiteFunctionType(dart.AbstractFunctionType, []),
+ returnType: dart.definiteFunctionType(dart.dynamic, []),
+ args: dart.definiteFunctionType(core.List, []),
+ optionals: dart.definiteFunctionType(core.List, []),
+ named: dart.definiteFunctionType(dart.dynamic, []),
+ metadata: dart.definiteFunctionType(core.List, [])
+ })
+ });
dart._typeFormalCount = Symbol("_typeFormalCount");
dart.isSubtype = dart._subtypeMemo((t1, t2) => t1 === t2 || dart._isSubtype(t1, t2, true));
dart._trapRuntimeErrors = true;
@@ -2807,7 +2957,7 @@
}
};
dart.setSignature(dart.InvocationImpl, {
- constructors: () => ({new: dart.definiteFunctionType(dart.InvocationImpl, [core.String, core.List], {namedArguments: dart.dynamic, isMethod: core.bool, isGetter: core.bool, isSetter: core.bool})}),
+ constructors: () => ({new: dart.definiteFunctionType(dart.InvocationImpl, [dart.dynamic, core.List], {namedArguments: dart.dynamic, isMethod: core.bool, isGetter: core.bool, isSetter: core.bool})}),
fields: () => ({
memberName: core.Symbol,
positionalArguments: core.List,
@@ -2951,8 +3101,8 @@
dart.lazyFn(_debugger.getObjectTypeName, () => dynamicToString());
_debugger.getTypeName = function(type) {
let name = dart.typeName(type);
- if (dart.equals(name, 'JSArray<dynamic>') || dart.equals(name, 'JSObject<Array>')) return 'List<dynamic>';
- return core.String._check(name);
+ if (name == 'JSArray<dynamic>' || name == 'JSObject<Array>') return 'List<dynamic>';
+ return name;
};
dart.lazyFn(_debugger.getTypeName, () => TypeToString());
_debugger._getType = function(object) {
@@ -3500,7 +3650,7 @@
return true;
}
preview(object) {
- return core.String._check(dart.typeName(dart.getReifiedType(object)));
+ return dart.typeName(dart.getReifiedType(object));
}
children(object) {
return JSArrayOfNameValuePair().of([new _debugger.NameValuePair({name: 'signature', value: this.preview(object)}), new _debugger.NameValuePair({name: 'JavaScript Function', value: object, config: _debugger.JsonMLConfig.skipDart})]);
@@ -8830,41 +8980,41 @@
names: ['sort', 'sortRange', '_doSort', '_insertionSort', '_dualPivotQuicksort']
});
_internal.Sort._INSERTION_SORT_THRESHOLD = 32;
- const _name = Symbol('_name');
+ const _name$ = Symbol('_name');
const _nativeSymbol = Symbol('_nativeSymbol');
_internal.Symbol = class Symbol extends core.Object {
new(name) {
- this[_name] = name;
+ this[_name$] = name;
this[_nativeSymbol] = null;
}
es6(name, nativeSymbol) {
- this[_name] = name;
+ this[_name$] = name;
this[_nativeSymbol] = nativeSymbol;
}
unvalidated(name) {
- this[_name] = name;
+ this[_name$] = name;
this[_nativeSymbol] = null;
}
validated(name) {
- this[_name] = _internal.Symbol.validatePublicSymbol(name);
+ this[_name$] = _internal.Symbol.validatePublicSymbol(name);
this[_nativeSymbol] = null;
}
['=='](other) {
- return _internal.Symbol.is(other) && this[_name] == other[_name] && dart.equals(this[_nativeSymbol], other[_nativeSymbol]);
+ return _internal.Symbol.is(other) && this[_name$] == other[_name$] && dart.equals(this[_nativeSymbol], other[_nativeSymbol]);
}
get hashCode() {
let hash = this._hashCode;
if (hash != null) return hash;
let arbitraryPrime = 664597;
- hash = 536870911 & arbitraryPrime * dart.notNull(dart.hashCode(this[_name]));
+ hash = 536870911 & arbitraryPrime * dart.notNull(dart.hashCode(this[_name$]));
this._hashCode = hash;
return hash;
}
toString() {
- return dart.str`Symbol("${this[_name]}")`;
+ return dart.str`Symbol("${this[_name$]}")`;
}
static getName(symbol) {
- return symbol[_name];
+ return symbol[_name$];
}
static getNativeSymbol(symbol) {
return symbol[_nativeSymbol];
@@ -8892,7 +9042,7 @@
validated: dart.definiteFunctionType(_internal.Symbol, [core.String])
}),
fields: () => ({
- [_name]: core.String,
+ [_name$]: core.String,
[_nativeSymbol]: dart.dynamic
}),
methods: () => ({'==': dart.definiteFunctionType(core.bool, [core.Object])}),
@@ -13443,7 +13593,31 @@
if (privateSymbol != null) {
return privateSymbol;
}
- return _js_mirrors.getName(symbol);
+ let name = _js_mirrors.getName(symbol);
+ switch (name) {
+ case '[]':
+ {
+ name = '_get';
+ break;
+ }
+ case '[]=':
+ {
+ name = '_set';
+ break;
+ }
+ case 'unary-':
+ {
+ name = '_negate';
+ break;
+ }
+ case 'constructor':
+ case 'prototype':
+ {
+ name = dart.str`_${name}`;
+ break;
+ }
+ }
+ return name;
};
dart.lazyFn(_js_mirrors._getMember, () => SymbolTodynamic());
_js_mirrors._getNameForESSymbol = function(member) {
@@ -13987,21 +14161,21 @@
})
});
const _symbol = Symbol('_symbol');
- const _name$ = Symbol('_name');
+ const _name$0 = Symbol('_name');
_js_mirrors.JsVariableMirror = class JsVariableMirror extends _js_mirrors.JsMirror {
get simpleName() {
return this[_symbol];
}
_(symbol, t, annotations) {
this[_symbol] = symbol;
- this[_name$] = _js_mirrors.getName(symbol);
+ this[_name$0] = _js_mirrors.getName(symbol);
this.type = _js_mirrors.reflectType(t);
this.metadata = ListOfInstanceMirror().unmodifiable(annotations[dartx.map](mirrors.InstanceMirror)(dart.fn(a => _js_mirrors.reflect(a), dynamicToInstanceMirror())));
this.isStatic = false;
this.isFinal = false;
}
toString() {
- return dart.str`VariableMirror on '${this[_name$]}'`;
+ return dart.str`VariableMirror on '${this[_name$0]}'`;
}
get qualifiedName() {
return core.Symbol._check(this.noSuchMethod(new dart.InvocationImpl('qualifiedName', [], {isGetter: true})));
@@ -14028,7 +14202,7 @@
constructors: () => ({_: dart.definiteFunctionType(_js_mirrors.JsVariableMirror, [core.Symbol, core.Type, core.List])}),
fields: () => ({
[_symbol]: core.Symbol,
- [_name$]: core.String,
+ [_name$0]: core.String,
type: mirrors.TypeMirror,
metadata: ListOfInstanceMirror(),
isStatic: core.bool,
@@ -14041,7 +14215,7 @@
super._(member, t, annotations);
}
toString() {
- return dart.str`ParameterMirror on '${this[_name$]}'`;
+ return dart.str`ParameterMirror on '${this[_name$0]}'`;
}
get qualifiedName() {
return core.Symbol._check(this.noSuchMethod(new dart.InvocationImpl('qualifiedName', [], {isGetter: true})));
@@ -14086,17 +14260,17 @@
let const$4;
_js_mirrors.JsMethodMirror = class JsMethodMirror extends _js_mirrors.JsMirror {
get isSetter() {
- return this[_name$][dartx.endsWith]('=');
+ return this[_name$0][dartx.endsWith]('=');
}
get isPrivate() {
- return this[_name$][dartx.startsWith]('_');
+ return this[_name$0][dartx.startsWith]('_');
}
get simpleName() {
return this[_symbol];
}
_constructor(cls, symbol, ftype) {
this[_symbol] = symbol;
- this[_name$] = _js_mirrors.getName(symbol);
+ this[_name$0] = _js_mirrors.getName(symbol);
this.isConstructor = true;
this.isStatic = false;
this[_params] = null;
@@ -14106,7 +14280,7 @@
}
_instanceMethod(cls, symbol, ftype) {
this[_symbol] = symbol;
- this[_name$] = _js_mirrors.getName(symbol);
+ this[_name$0] = _js_mirrors.getName(symbol);
this.isConstructor = false;
this.isStatic = false;
this[_params] = null;
@@ -14116,7 +14290,7 @@
}
_staticMethod(cls, symbol, ftype) {
this[_symbol] = symbol;
- this[_name$] = _js_mirrors.getName(symbol);
+ this[_name$0] = _js_mirrors.getName(symbol);
this.isConstructor = false;
this.isStatic = true;
this[_params] = null;
@@ -14166,7 +14340,7 @@
this[_params] = ListOfParameterMirror().unmodifiable(params);
}
toString() {
- return dart.str`MethodMirror on '${this[_name$]}'`;
+ return dart.str`MethodMirror on '${this[_name$0]}'`;
}
get qualifiedName() {
return core.Symbol._check(this.noSuchMethod(new dart.InvocationImpl('qualifiedName', [], {isGetter: true})));
@@ -14226,7 +14400,7 @@
}),
fields: () => ({
[_symbol]: core.Symbol,
- [_name$]: core.String,
+ [_name$0]: core.String,
[_params]: ListOfParameterMirror(),
[_metadata$]: ListOfInstanceMirror(),
isConstructor: core.bool,
@@ -28689,7 +28863,7 @@
const _data = Symbol('_data');
const _isUpgraded = Symbol('_isUpgraded');
const _upgradedMap = Symbol('_upgradedMap');
- const _process = Symbol('_process');
+ const _process$ = Symbol('_process');
const _upgrade = Symbol('_upgrade');
convert._JsonMap = class _JsonMap extends core.Object {
new(original) {
@@ -28704,7 +28878,7 @@
return null;
} else {
let result = convert._JsonMap._getProperty(this[_processed], core.String._check(key));
- if (dart.test(convert._JsonMap._isUnprocessed(result))) result = this[_process](core.String._check(key));
+ if (dart.test(convert._JsonMap._isUnprocessed(result))) result = this[_process$](core.String._check(key));
return result;
}
}
@@ -28832,7 +29006,7 @@
dart.assert(this[_isUpgraded]);
return result;
}
- [_process](key) {
+ [_process$](key) {
if (!dart.test(convert._JsonMap._hasProperty(this[_original], key))) return null;
let result = convert._convertJsonToDartLazy(convert._JsonMap._getProperty(this[_original], key));
return convert._JsonMap._setProperty(this[_processed], key, result);
@@ -28885,7 +29059,7 @@
forEach: dart.definiteFunctionType(dart.void, [dynamicAnddynamicTovoid()]),
[_computeKeys$]: dart.definiteFunctionType(core.List$(core.String), []),
[_upgrade]: dart.definiteFunctionType(core.Map, []),
- [_process]: dart.definiteFunctionType(dart.dynamic, [core.String])
+ [_process$]: dart.definiteFunctionType(dart.dynamic, [core.String])
}),
statics: () => ({
_hasProperty: dart.definiteFunctionType(core.bool, [dart.dynamic, core.String]),
@@ -30524,7 +30698,7 @@
return _FusedConverter;
});
convert._FusedConverter = _FusedConverter();
- const _name$0 = Symbol('_name');
+ const _name$1 = Symbol('_name');
let const$34;
let const$35;
let const$36;
@@ -30535,7 +30709,7 @@
let const$41;
convert.HtmlEscapeMode = class HtmlEscapeMode extends core.Object {
_(name, escapeLtGt, escapeQuot, escapeApos, escapeSlash) {
- this[_name$0] = name;
+ this[_name$1] = name;
this.escapeLtGt = escapeLtGt;
this.escapeQuot = escapeQuot;
this.escapeApos = escapeApos;
@@ -30551,10 +30725,10 @@
this.escapeQuot = escapeQuot;
this.escapeApos = escapeApos;
this.escapeSlash = escapeSlash;
- this[_name$0] = name;
+ this[_name$1] = name;
}
toString() {
- return this[_name$0];
+ return this[_name$1];
}
};
dart.defineNamedConstructor(convert.HtmlEscapeMode, '_');
@@ -30564,7 +30738,7 @@
new: dart.definiteFunctionType(convert.HtmlEscapeMode, [], {name: core.String, escapeLtGt: core.bool, escapeQuot: core.bool, escapeApos: core.bool, escapeSlash: core.bool})
}),
fields: () => ({
- [_name$0]: core.String,
+ [_name$1]: core.String,
escapeLtGt: core.bool,
escapeQuot: core.bool,
escapeApos: core.bool,
@@ -39069,6 +39243,9 @@
}[this.index];
}
};
+ dart.setSignature(io.FileLock, {
+ fields: () => ({index: core.int})
+ });
dart.defineEnumValues(io.FileLock, [
'SHARED',
'EXCLUSIVE'
@@ -48142,6 +48319,9 @@
}[this.index];
}
};
+ dart.setSignature(io.ProcessStartMode, {
+ fields: () => ({index: core.int})
+ });
dart.defineEnumValues(io.ProcessStartMode, [
'NORMAL',
'DETACHED',
@@ -48210,14 +48390,14 @@
})
});
const _signalNumber = Symbol('_signalNumber');
- const _name$1 = Symbol('_name');
+ const _name$2 = Symbol('_name');
io.ProcessSignal = class ProcessSignal extends core.Object {
_(signalNumber, name) {
this[_signalNumber] = signalNumber;
- this[_name$1] = name;
+ this[_name$2] = name;
}
toString() {
- return this[_name$1];
+ return this[_name$2];
}
watch() {
return io._ProcessUtils._watchSignal(this);
@@ -48228,7 +48408,7 @@
constructors: () => ({_: dart.definiteFunctionType(io.ProcessSignal, [core.int, core.String])}),
fields: () => ({
[_signalNumber]: core.int,
- [_name$1]: core.String
+ [_name$2]: core.String
}),
methods: () => ({watch: dart.definiteFunctionType(async.Stream$(io.ProcessSignal), [])}),
sfields: () => ({
« no previous file with comments | « pkg/dev_compiler/lib/js/amd/dart_sdk.js ('k') | pkg/dev_compiler/lib/js/es6/dart_sdk.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698