| OLD | NEW |
| 1 var _js_helper = dart.defineLibrary(_js_helper, {}); | 1 var _js_helper = dart.defineLibrary(_js_helper, {}); |
| 2 var core = dart.import(core); | 2 var core = dart.import(core); |
| 3 var collection = dart.import(collection); | 3 var collection = dart.import(collection); |
| 4 var _internal = dart.import(_internal); | 4 var _interceptors = dart.lazyImport(_interceptors); |
| 5 var _foreign_helper = dart.import(_foreign_helper); | 5 var _foreign_helper = dart.import(_foreign_helper); |
| 6 var _interceptors = dart.lazyImport(_interceptors); | 6 (function(exports, core, collection, _interceptors, _foreign_helper) { |
| 7 var _js_names = dart.import(_js_names); | |
| 8 var _js_embedded_names = dart.import(_js_embedded_names); | |
| 9 var async = dart.import(async); | |
| 10 var _isolate_helper = dart.lazyImport(_isolate_helper); | |
| 11 (function(exports, core, collection, _internal, _foreign_helper, _interceptors,
_js_names, _js_embedded_names, async, _isolate_helper) { | |
| 12 'use strict'; | 7 'use strict'; |
| 13 class NoSideEffects extends core.Object { | |
| 14 NoSideEffects() { | |
| 15 } | |
| 16 } | |
| 17 dart.setSignature(NoSideEffects, { | |
| 18 constructors: () => ({NoSideEffects: [NoSideEffects, []]}) | |
| 19 }); | |
| 20 class NoThrows extends core.Object { | 8 class NoThrows extends core.Object { |
| 21 NoThrows() { | 9 NoThrows() { |
| 22 } | 10 } |
| 23 } | 11 } |
| 24 dart.setSignature(NoThrows, { | 12 dart.setSignature(NoThrows, { |
| 25 constructors: () => ({NoThrows: [NoThrows, []]}) | 13 constructors: () => ({NoThrows: [NoThrows, []]}) |
| 26 }); | 14 }); |
| 27 class NoInline extends core.Object { | 15 class NoInline extends core.Object { |
| 28 NoInline() { | 16 NoInline() { |
| 29 } | 17 } |
| 30 } | 18 } |
| 31 dart.setSignature(NoInline, { | 19 dart.setSignature(NoInline, { |
| 32 constructors: () => ({NoInline: [NoInline, []]}) | 20 constructors: () => ({NoInline: [NoInline, []]}) |
| 33 }); | 21 }); |
| 34 class IrRepresentation extends core.Object { | |
| 35 IrRepresentation(value) { | |
| 36 this.value = value; | |
| 37 } | |
| 38 } | |
| 39 dart.setSignature(IrRepresentation, { | |
| 40 constructors: () => ({IrRepresentation: [IrRepresentation, [core.bool]]}) | |
| 41 }); | |
| 42 class Native extends core.Object { | 22 class Native extends core.Object { |
| 43 Native(name) { | 23 Native(name) { |
| 44 this.name = name; | 24 this.name = name; |
| 45 } | 25 } |
| 46 } | 26 } |
| 47 dart.setSignature(Native, { | 27 dart.setSignature(Native, { |
| 48 constructors: () => ({Native: [Native, [core.String]]}) | 28 constructors: () => ({Native: [Native, [core.String]]}) |
| 49 }); | 29 }); |
| 50 class JsName extends core.Object { | 30 class JsName extends core.Object { |
| 51 JsName(opts) { | 31 JsName(opts) { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 65 dart.setSignature(JsPeerInterface, { | 45 dart.setSignature(JsPeerInterface, { |
| 66 constructors: () => ({JsPeerInterface: [JsPeerInterface, [], {name: core.Str
ing}]}) | 46 constructors: () => ({JsPeerInterface: [JsPeerInterface, [], {name: core.Str
ing}]}) |
| 67 }); | 47 }); |
| 68 class SupportJsExtensionMethods extends core.Object { | 48 class SupportJsExtensionMethods extends core.Object { |
| 69 SupportJsExtensionMethods() { | 49 SupportJsExtensionMethods() { |
| 70 } | 50 } |
| 71 } | 51 } |
| 72 dart.setSignature(SupportJsExtensionMethods, { | 52 dart.setSignature(SupportJsExtensionMethods, { |
| 73 constructors: () => ({SupportJsExtensionMethods: [SupportJsExtensionMethods,
[]]}) | 53 constructors: () => ({SupportJsExtensionMethods: [SupportJsExtensionMethods,
[]]}) |
| 74 }); | 54 }); |
| 75 let _throwUnmodifiable = Symbol('_throwUnmodifiable'); | |
| 76 let ConstantMap$ = dart.generic(function(K, V) { | |
| 77 class ConstantMap extends core.Object { | |
| 78 _() { | |
| 79 } | |
| 80 get isEmpty() { | |
| 81 return this.length == 0; | |
| 82 } | |
| 83 get isNotEmpty() { | |
| 84 return !dart.notNull(this.isEmpty); | |
| 85 } | |
| 86 toString() { | |
| 87 return collection.Maps.mapToString(this); | |
| 88 } | |
| 89 [_throwUnmodifiable]() { | |
| 90 throw new core.UnsupportedError("Cannot modify unmodifiable Map"); | |
| 91 } | |
| 92 set(key, val) { | |
| 93 dart.as(key, K); | |
| 94 dart.as(val, V); | |
| 95 return this[_throwUnmodifiable](); | |
| 96 } | |
| 97 putIfAbsent(key, ifAbsent) { | |
| 98 dart.as(key, K); | |
| 99 dart.as(ifAbsent, dart.functionType(V, [])); | |
| 100 return dart.as(this[_throwUnmodifiable](), V); | |
| 101 } | |
| 102 remove(key) { | |
| 103 return dart.as(this[_throwUnmodifiable](), V); | |
| 104 } | |
| 105 clear() { | |
| 106 return this[_throwUnmodifiable](); | |
| 107 } | |
| 108 addAll(other) { | |
| 109 dart.as(other, core.Map$(K, V)); | |
| 110 return this[_throwUnmodifiable](); | |
| 111 } | |
| 112 } | |
| 113 ConstantMap[dart.implements] = () => [core.Map$(K, V)]; | |
| 114 dart.defineNamedConstructor(ConstantMap, '_'); | |
| 115 dart.setSignature(ConstantMap, { | |
| 116 constructors: () => ({_: [ConstantMap$(K, V), []]}), | |
| 117 methods: () => ({ | |
| 118 [_throwUnmodifiable]: [core.Object, []], | |
| 119 set: [dart.void, [K, V]], | |
| 120 putIfAbsent: [V, [K, dart.functionType(V, [])]], | |
| 121 remove: [V, [core.Object]], | |
| 122 clear: [dart.void, []], | |
| 123 addAll: [dart.void, [core.Map$(K, V)]] | |
| 124 }) | |
| 125 }); | |
| 126 return ConstantMap; | |
| 127 }); | |
| 128 let ConstantMap = ConstantMap$(); | |
| 129 let _jsObject = Symbol('_jsObject'); | |
| 130 let _keys = Symbol('_keys'); | |
| 131 let _fetch = Symbol('_fetch'); | |
| 132 let ConstantStringMap$ = dart.generic(function(K, V) { | |
| 133 class ConstantStringMap extends ConstantMap$(K, V) { | |
| 134 _(length, jsObject, keys) { | |
| 135 this.length = length; | |
| 136 this[_jsObject] = jsObject; | |
| 137 this[_keys] = keys; | |
| 138 super._(); | |
| 139 } | |
| 140 containsValue(needle) { | |
| 141 return this.values[dartx.any](dart.fn(value => dart.equals(value, needle
), core.bool, [V])); | |
| 142 } | |
| 143 containsKey(key) { | |
| 144 if (!(typeof key == 'string')) | |
| 145 return false; | |
| 146 if (dart.equals('__proto__', key)) | |
| 147 return false; | |
| 148 return jsHasOwnProperty(this[_jsObject], dart.as(key, core.String)); | |
| 149 } | |
| 150 get(key) { | |
| 151 if (!dart.notNull(this.containsKey(key))) | |
| 152 return null; | |
| 153 return dart.as(this[_fetch](key), V); | |
| 154 } | |
| 155 [_fetch](key) { | |
| 156 return jsPropertyAccess(this[_jsObject], dart.as(key, core.String)); | |
| 157 } | |
| 158 forEach(f) { | |
| 159 dart.as(f, dart.functionType(dart.void, [K, V])); | |
| 160 let keys = this[_keys]; | |
| 161 for (let i = 0; dart.notNull(i) < dart.notNull(dart.as(dart.dload(keys,
'length'), core.num)); i = dart.notNull(i) + 1) { | |
| 162 let key = dart.dindex(keys, i); | |
| 163 f(dart.as(key, K), dart.as(this[_fetch](key), V)); | |
| 164 } | |
| 165 } | |
| 166 get keys() { | |
| 167 return new (_ConstantMapKeyIterable$(K))(this); | |
| 168 } | |
| 169 get values() { | |
| 170 return _internal.MappedIterable$(K, V).new(this[_keys], dart.fn(key => d
art.as(this[_fetch](key), V), V, [core.Object])); | |
| 171 } | |
| 172 } | |
| 173 ConstantStringMap[dart.implements] = () => [_internal.EfficientLength]; | |
| 174 dart.defineNamedConstructor(ConstantStringMap, '_'); | |
| 175 dart.setSignature(ConstantStringMap, { | |
| 176 constructors: () => ({_: [ConstantStringMap$(K, V), [core.int, core.Object
, core.List$(K)]]}), | |
| 177 methods: () => ({ | |
| 178 containsValue: [core.bool, [core.Object]], | |
| 179 containsKey: [core.bool, [core.Object]], | |
| 180 get: [V, [core.Object]], | |
| 181 [_fetch]: [core.Object, [core.Object]], | |
| 182 forEach: [dart.void, [dart.functionType(dart.void, [K, V])]] | |
| 183 }) | |
| 184 }); | |
| 185 return ConstantStringMap; | |
| 186 }); | |
| 187 let ConstantStringMap = ConstantStringMap$(); | |
| 188 let _protoValue = Symbol('_protoValue'); | |
| 189 let ConstantProtoMap$ = dart.generic(function(K, V) { | |
| 190 class ConstantProtoMap extends ConstantStringMap$(K, V) { | |
| 191 _(length, jsObject, keys, protoValue) { | |
| 192 this[_protoValue] = protoValue; | |
| 193 super._(dart.as(length, core.int), jsObject, dart.as(keys, core.List$(K)
)); | |
| 194 } | |
| 195 containsKey(key) { | |
| 196 if (!(typeof key == 'string')) | |
| 197 return false; | |
| 198 if (dart.equals('__proto__', key)) | |
| 199 return true; | |
| 200 return jsHasOwnProperty(this[_jsObject], dart.as(key, core.String)); | |
| 201 } | |
| 202 [_fetch](key) { | |
| 203 return dart.equals('__proto__', key) ? this[_protoValue] : jsPropertyAcc
ess(this[_jsObject], dart.as(key, core.String)); | |
| 204 } | |
| 205 } | |
| 206 dart.defineNamedConstructor(ConstantProtoMap, '_'); | |
| 207 dart.setSignature(ConstantProtoMap, { | |
| 208 constructors: () => ({_: [ConstantProtoMap$(K, V), [core.Object, core.Obje
ct, core.Object, V]]}) | |
| 209 }); | |
| 210 return ConstantProtoMap; | |
| 211 }); | |
| 212 let ConstantProtoMap = ConstantProtoMap$(); | |
| 213 let _map = Symbol('_map'); | |
| 214 let _ConstantMapKeyIterable$ = dart.generic(function(K) { | |
| 215 class _ConstantMapKeyIterable extends collection.IterableBase$(K) { | |
| 216 _ConstantMapKeyIterable(map) { | |
| 217 this[_map] = map; | |
| 218 super.IterableBase(); | |
| 219 } | |
| 220 get iterator() { | |
| 221 return this[_map][_keys][dartx.iterator]; | |
| 222 } | |
| 223 get length() { | |
| 224 return this[_map][_keys].length; | |
| 225 } | |
| 226 } | |
| 227 dart.setSignature(_ConstantMapKeyIterable, { | |
| 228 constructors: () => ({_ConstantMapKeyIterable: [_ConstantMapKeyIterable$(K
), [ConstantStringMap$(K, core.Object)]]}) | |
| 229 }); | |
| 230 return _ConstantMapKeyIterable; | |
| 231 }); | |
| 232 let _ConstantMapKeyIterable = _ConstantMapKeyIterable$(); | |
| 233 let _jsData = Symbol('_jsData'); | |
| 234 let _getMap = Symbol('_getMap'); | |
| 235 let GeneralConstantMap$ = dart.generic(function(K, V) { | |
| 236 class GeneralConstantMap extends ConstantMap$(K, V) { | |
| 237 GeneralConstantMap(jsData) { | |
| 238 this[_jsData] = jsData; | |
| 239 super._(); | |
| 240 } | |
| 241 [_getMap]() { | |
| 242 if (!this.$map) { | |
| 243 let backingMap = collection.LinkedHashMap$(K, V).new(); | |
| 244 this.$map = fillLiteralMap(this[_jsData], backingMap); | |
| 245 } | |
| 246 return dart.as(this.$map, core.Map$(K, V)); | |
| 247 } | |
| 248 containsValue(needle) { | |
| 249 return this[_getMap]().containsValue(needle); | |
| 250 } | |
| 251 containsKey(key) { | |
| 252 return this[_getMap]().containsKey(key); | |
| 253 } | |
| 254 get(key) { | |
| 255 return this[_getMap]().get(key); | |
| 256 } | |
| 257 forEach(f) { | |
| 258 dart.as(f, dart.functionType(dart.void, [K, V])); | |
| 259 this[_getMap]().forEach(f); | |
| 260 } | |
| 261 get keys() { | |
| 262 return this[_getMap]().keys; | |
| 263 } | |
| 264 get values() { | |
| 265 return this[_getMap]().values; | |
| 266 } | |
| 267 get length() { | |
| 268 return this[_getMap]().length; | |
| 269 } | |
| 270 } | |
| 271 dart.setSignature(GeneralConstantMap, { | |
| 272 constructors: () => ({GeneralConstantMap: [GeneralConstantMap$(K, V), [cor
e.Object]]}), | |
| 273 methods: () => ({ | |
| 274 [_getMap]: [core.Map$(K, V), []], | |
| 275 containsValue: [core.bool, [core.Object]], | |
| 276 containsKey: [core.bool, [core.Object]], | |
| 277 get: [V, [core.Object]], | |
| 278 forEach: [dart.void, [dart.functionType(dart.void, [K, V])]] | |
| 279 }) | |
| 280 }); | |
| 281 return GeneralConstantMap; | |
| 282 }); | |
| 283 let GeneralConstantMap = GeneralConstantMap$(); | |
| 284 function contains(userAgent, name) { | |
| 285 return userAgent.indexOf(name) != -1; | |
| 286 } | |
| 287 dart.fn(contains, core.bool, [core.String, core.String]); | |
| 288 function arrayLength(array) { | |
| 289 return array.length; | |
| 290 } | |
| 291 dart.fn(arrayLength, core.int, [core.List]); | |
| 292 function arrayGet(array, index) { | |
| 293 return array[index]; | |
| 294 } | |
| 295 dart.fn(arrayGet, core.Object, [core.List, core.int]); | |
| 296 function arraySet(array, index, value) { | |
| 297 array[index] = value; | |
| 298 } | |
| 299 dart.fn(arraySet, dart.void, [core.List, core.int, core.Object]); | |
| 300 function propertyGet(object, property) { | |
| 301 return object[property]; | |
| 302 } | |
| 303 dart.fn(propertyGet, core.Object, [core.Object, core.String]); | |
| 304 function callHasOwnProperty(func, object, property) { | |
| 305 return func.call(object, property); | |
| 306 } | |
| 307 dart.fn(callHasOwnProperty, core.bool, [core.Object, core.Object, core.String]
); | |
| 308 function propertySet(object, property, value) { | |
| 309 object[property] = value; | |
| 310 } | |
| 311 dart.fn(propertySet, dart.void, [core.Object, core.String, core.Object]); | |
| 312 function getPropertyFromPrototype(object, name) { | |
| 313 return Object.getPrototypeOf(object)[name]; | |
| 314 } | |
| 315 dart.fn(getPropertyFromPrototype, core.Object, [core.Object, core.String]); | |
| 316 function defineProperty(obj, property, value) { | 55 function defineProperty(obj, property, value) { |
| 317 Object.defineProperty(obj, property, {value: value, enumerable: false, writa
ble: true, configurable: true}); | 56 Object.defineProperty(obj, property, {value: value, enumerable: false, writa
ble: true, configurable: true}); |
| 318 } | 57 } |
| 319 dart.fn(defineProperty, dart.void, [core.Object, core.String, core.Object]); | 58 dart.fn(defineProperty, dart.void, [core.Object, core.String, core.Object]); |
| 320 let _nativeRegExp = Symbol('_nativeRegExp'); | 59 let _nativeRegExp = Symbol('_nativeRegExp'); |
| 321 function regExpGetNative(regexp) { | 60 function regExpGetNative(regexp) { |
| 322 return regexp[_nativeRegExp]; | 61 return regexp[_nativeRegExp]; |
| 323 } | 62 } |
| 324 dart.fn(regExpGetNative, () => dart.functionType(core.Object, [JSSyntaxRegExp]
)); | 63 dart.fn(regExpGetNative, () => dart.functionType(core.Object, [JSSyntaxRegExp]
)); |
| 325 let _nativeGlobalVersion = Symbol('_nativeGlobalVersion'); | 64 let _nativeGlobalVersion = Symbol('_nativeGlobalVersion'); |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 } else { | 509 } else { |
| 771 checkNull(from); | 510 checkNull(from); |
| 772 throw "String.replace(Pattern) UNIMPLEMENTED"; | 511 throw "String.replace(Pattern) UNIMPLEMENTED"; |
| 773 } | 512 } |
| 774 } | 513 } |
| 775 dart.fn(stringReplaceFirstUnchecked, core.Object, [core.Object, core.Object, c
ore.Object], [core.int]); | 514 dart.fn(stringReplaceFirstUnchecked, core.Object, [core.Object, core.Object, c
ore.Object], [core.int]); |
| 776 function stringJoinUnchecked(array, separator) { | 515 function stringJoinUnchecked(array, separator) { |
| 777 return array.join(separator); | 516 return array.join(separator); |
| 778 } | 517 } |
| 779 dart.fn(stringJoinUnchecked); | 518 dart.fn(stringJoinUnchecked); |
| 780 function createRuntimeType(name) { | |
| 781 return new TypeImpl(name); | |
| 782 } | |
| 783 dart.fn(createRuntimeType, core.Type, [core.String]); | |
| 784 let _typeName = Symbol('_typeName'); | |
| 785 let _unmangledName = Symbol('_unmangledName'); | |
| 786 class TypeImpl extends core.Object { | |
| 787 TypeImpl(typeName) { | |
| 788 this[_typeName] = typeName; | |
| 789 this[_unmangledName] = null; | |
| 790 } | |
| 791 toString() { | |
| 792 if (this[_unmangledName] != null) | |
| 793 return this[_unmangledName]; | |
| 794 let unmangledName = unmangleAllIdentifiersIfPreservedAnyways(this[_typeNam
e]); | |
| 795 return this[_unmangledName] = unmangledName; | |
| 796 } | |
| 797 get hashCode() { | |
| 798 return dart[dartx.hashCode](this[_typeName]); | |
| 799 } | |
| 800 ['=='](other) { | |
| 801 return dart.is(other, TypeImpl) && dart.equals(this[_typeName], dart.dload
(other, _typeName)); | |
| 802 } | |
| 803 } | |
| 804 TypeImpl[dart.implements] = () => [core.Type]; | |
| 805 dart.setSignature(TypeImpl, { | |
| 806 constructors: () => ({TypeImpl: [TypeImpl, [core.String]]}) | |
| 807 }); | |
| 808 class TypeVariable extends core.Object { | |
| 809 TypeVariable(owner, name, bound) { | |
| 810 this.owner = owner; | |
| 811 this.name = name; | |
| 812 this.bound = bound; | |
| 813 } | |
| 814 } | |
| 815 dart.setSignature(TypeVariable, { | |
| 816 constructors: () => ({TypeVariable: [TypeVariable, [core.Type, core.String,
core.int]]}) | |
| 817 }); | |
| 818 function getMangledTypeName(type) { | |
| 819 return type[_typeName]; | |
| 820 } | |
| 821 dart.fn(getMangledTypeName, core.Object, [TypeImpl]); | |
| 822 function setRuntimeTypeInfo(target, typeInfo) { | |
| 823 dart.assert(dart.notNull(typeInfo == null) || dart.notNull(isJsArray(typeInf
o))); | |
| 824 if (target != null) | |
| 825 target.$builtinTypeInfo = typeInfo; | |
| 826 return target; | |
| 827 } | |
| 828 dart.fn(setRuntimeTypeInfo, core.Object, [core.Object, core.Object]); | |
| 829 function getRuntimeTypeInfo(target) { | |
| 830 if (target == null) | |
| 831 return null; | |
| 832 return target.$builtinTypeInfo; | |
| 833 } | |
| 834 dart.fn(getRuntimeTypeInfo, core.Object, [core.Object]); | |
| 835 function getRuntimeTypeArguments(target, substitutionName) { | |
| 836 let substitution = getField(target, `${_foreign_helper.JS_OPERATOR_AS_PREFIX
()}${substitutionName}`); | |
| 837 return substitute(substitution, getRuntimeTypeInfo(target)); | |
| 838 } | |
| 839 dart.fn(getRuntimeTypeArguments); | |
| 840 function getRuntimeTypeArgument(target, substitutionName, index) { | |
| 841 let arguments$ = getRuntimeTypeArguments(target, substitutionName); | |
| 842 return arguments$ == null ? null : getIndex(arguments$, index); | |
| 843 } | |
| 844 dart.fn(getRuntimeTypeArgument, core.Object, [core.Object, core.String, core.i
nt]); | |
| 845 function getTypeArgumentByIndex(target, index) { | |
| 846 let rti = getRuntimeTypeInfo(target); | |
| 847 return rti == null ? null : getIndex(rti, index); | |
| 848 } | |
| 849 dart.fn(getTypeArgumentByIndex, core.Object, [core.Object, core.int]); | |
| 850 function copyTypeArguments(source, target) { | |
| 851 target.$builtinTypeInfo = source.$builtinTypeInfo; | |
| 852 } | |
| 853 dart.fn(copyTypeArguments, dart.void, [core.Object, core.Object]); | |
| 854 function getClassName(object) { | |
| 855 return _interceptors.getInterceptor(object).constructor.builtin$cls; | |
| 856 } | |
| 857 dart.fn(getClassName, core.String, [core.Object]); | |
| 858 function getRuntimeTypeAsString(runtimeType, opts) { | |
| 859 let onTypeVariable = opts && 'onTypeVariable' in opts ? opts.onTypeVariable
: null; | |
| 860 dart.assert(isJsArray(runtimeType)); | |
| 861 let className = getConstructorName(getIndex(runtimeType, 0)); | |
| 862 return `${className}` + `${joinArguments(runtimeType, 1, {onTypeVariable: on
TypeVariable})}`; | |
| 863 } | |
| 864 dart.fn(getRuntimeTypeAsString, core.String, [core.Object], {onTypeVariable: d
art.functionType(core.String, [core.int])}); | |
| 865 function getConstructorName(type) { | |
| 866 return type.builtin$cls; | |
| 867 } | |
| 868 dart.fn(getConstructorName, core.String, [core.Object]); | |
| 869 function runtimeTypeToString(type, opts) { | |
| 870 let onTypeVariable = opts && 'onTypeVariable' in opts ? opts.onTypeVariable
: null; | |
| 871 if (type == null) { | |
| 872 return 'dynamic'; | |
| 873 } else if (isJsArray(type)) { | |
| 874 return getRuntimeTypeAsString(type, {onTypeVariable: onTypeVariable}); | |
| 875 } else if (isJsFunction(type)) { | |
| 876 return getConstructorName(type); | |
| 877 } else if (typeof type == 'number') { | |
| 878 if (onTypeVariable == null) { | |
| 879 return dart.toString(type); | |
| 880 } else { | |
| 881 return onTypeVariable(dart.as(type, core.int)); | |
| 882 } | |
| 883 } else { | |
| 884 return null; | |
| 885 } | |
| 886 } | |
| 887 dart.fn(runtimeTypeToString, core.String, [core.Object], {onTypeVariable: dart
.functionType(core.String, [core.int])}); | |
| 888 function joinArguments(types, startIndex, opts) { | |
| 889 let onTypeVariable = opts && 'onTypeVariable' in opts ? opts.onTypeVariable
: null; | |
| 890 if (types == null) | |
| 891 return ''; | |
| 892 dart.assert(isJsArray(types)); | |
| 893 let firstArgument = true; | |
| 894 let allDynamic = true; | |
| 895 let buffer = new core.StringBuffer(); | |
| 896 for (let index = startIndex; dart.notNull(index) < dart.notNull(getLength(ty
pes)); index = dart.notNull(index) + 1) { | |
| 897 if (firstArgument) { | |
| 898 firstArgument = false; | |
| 899 } else { | |
| 900 buffer.write(', '); | |
| 901 } | |
| 902 let argument = getIndex(types, index); | |
| 903 if (argument != null) { | |
| 904 allDynamic = false; | |
| 905 } | |
| 906 buffer.write(runtimeTypeToString(argument, {onTypeVariable: onTypeVariable
})); | |
| 907 } | |
| 908 return allDynamic ? '' : `<${buffer}>`; | |
| 909 } | |
| 910 dart.fn(joinArguments, core.String, [core.Object, core.int], {onTypeVariable:
dart.functionType(core.String, [core.int])}); | |
| 911 function getRuntimeTypeString(object) { | |
| 912 let className = getClassName(object); | |
| 913 if (object == null) | |
| 914 return className; | |
| 915 let typeInfo = object.$builtinTypeInfo; | |
| 916 return `${className}${joinArguments(typeInfo, 0)}`; | |
| 917 } | |
| 918 dart.fn(getRuntimeTypeString, core.String, [core.Object]); | |
| 919 function getRuntimeType(object) { | 519 function getRuntimeType(object) { |
| 920 let type = getRuntimeTypeString(object); | 520 return dart.as(dart.realRuntimeType(object), core.Type); |
| 921 return new TypeImpl(type); | |
| 922 } | 521 } |
| 923 dart.fn(getRuntimeType, core.Type, [core.Object]); | 522 dart.fn(getRuntimeType, core.Type, [core.Object]); |
| 924 function substitute(substitution, arguments$) { | |
| 925 dart.assert(dart.notNull(substitution == null) || dart.notNull(isJsFunction(
substitution))); | |
| 926 dart.assert(dart.notNull(arguments$ == null) || dart.notNull(isJsArray(argum
ents$))); | |
| 927 if (isJsFunction(substitution)) { | |
| 928 substitution = invoke(substitution, arguments$); | |
| 929 if (isJsArray(substitution)) { | |
| 930 arguments$ = substitution; | |
| 931 } else if (isJsFunction(substitution)) { | |
| 932 arguments$ = invoke(substitution, arguments$); | |
| 933 } | |
| 934 } | |
| 935 return arguments$; | |
| 936 } | |
| 937 dart.fn(substitute); | |
| 938 function checkSubtype(object, isField, checks, asField) { | |
| 939 if (object == null) | |
| 940 return false; | |
| 941 let arguments$ = getRuntimeTypeInfo(object); | |
| 942 let interceptor = _interceptors.getInterceptor(object); | |
| 943 let isSubclass = getField(interceptor, isField); | |
| 944 if (isSubclass == null) | |
| 945 return false; | |
| 946 let substitution = getField(interceptor, asField); | |
| 947 return checkArguments(substitution, arguments$, checks); | |
| 948 } | |
| 949 dart.fn(checkSubtype, core.bool, [core.Object, core.String, core.List, core.St
ring]); | |
| 950 function computeTypeName(isField, arguments$) { | |
| 951 let prefixLength = _foreign_helper.JS_OPERATOR_IS_PREFIX().length; | |
| 952 return Primitives.formatType(isField[dartx.substring](prefixLength, isField.
length), arguments$); | |
| 953 } | |
| 954 dart.fn(computeTypeName, core.String, [core.String, core.List]); | |
| 955 function subtypeCast(object, isField, checks, asField) { | |
| 956 if (dart.notNull(object != null) && !dart.notNull(checkSubtype(object, isFie
ld, checks, asField))) { | |
| 957 let actualType = Primitives.objectTypeName(object); | |
| 958 let typeName = computeTypeName(isField, checks); | |
| 959 throw new CastErrorImplementation(actualType, typeName); | |
| 960 } | |
| 961 return object; | |
| 962 } | |
| 963 dart.fn(subtypeCast, core.Object, [core.Object, core.String, core.List, core.S
tring]); | |
| 964 function assertSubtype(object, isField, checks, asField) { | |
| 965 if (dart.notNull(object != null) && !dart.notNull(checkSubtype(object, isFie
ld, checks, asField))) { | |
| 966 let typeName = computeTypeName(isField, checks); | |
| 967 throw new TypeErrorImplementation(object, typeName); | |
| 968 } | |
| 969 return object; | |
| 970 } | |
| 971 dart.fn(assertSubtype, core.Object, [core.Object, core.String, core.List, core
.String]); | |
| 972 function assertIsSubtype(subtype, supertype, message) { | |
| 973 if (!dart.notNull(isSubtype(subtype, supertype))) { | |
| 974 throwTypeError(message); | |
| 975 } | |
| 976 } | |
| 977 dart.fn(assertIsSubtype, core.Object, [core.Object, core.Object, core.String])
; | |
| 978 function throwTypeError(message) { | |
| 979 throw new TypeErrorImplementation.fromMessage(dart.as(message, core.String))
; | |
| 980 } | |
| 981 dart.fn(throwTypeError); | |
| 982 function checkArguments(substitution, arguments$, checks) { | |
| 983 return areSubtypes(substitute(substitution, arguments$), checks); | |
| 984 } | |
| 985 dart.fn(checkArguments, core.bool, [core.Object, core.Object, core.Object]); | |
| 986 function areSubtypes(s, t) { | |
| 987 if (dart.notNull(s == null) || dart.notNull(t == null)) | |
| 988 return true; | |
| 989 dart.assert(isJsArray(s)); | |
| 990 dart.assert(isJsArray(t)); | |
| 991 dart.assert(getLength(s) == getLength(t)); | |
| 992 let len = getLength(s); | |
| 993 for (let i = 0; dart.notNull(i) < dart.notNull(len); i = dart.notNull(i) + 1
) { | |
| 994 if (!dart.notNull(isSubtype(getIndex(s, i), getIndex(t, i)))) { | |
| 995 return false; | |
| 996 } | |
| 997 } | |
| 998 return true; | |
| 999 } | |
| 1000 dart.fn(areSubtypes, core.bool, [core.Object, core.Object]); | |
| 1001 function computeSignature(signature, context, contextName) { | |
| 1002 let typeArguments = getRuntimeTypeArguments(context, contextName); | |
| 1003 return invokeOn(signature, context, typeArguments); | |
| 1004 } | |
| 1005 dart.fn(computeSignature); | |
| 1006 function isSupertypeOfNull(type) { | |
| 1007 return dart.notNull(type == null) || getConstructorName(type) == _foreign_he
lper.JS_OBJECT_CLASS_NAME() || getConstructorName(type) == _foreign_helper.JS_NU
LL_CLASS_NAME(); | |
| 1008 } | |
| 1009 dart.fn(isSupertypeOfNull, core.bool, [core.Object]); | |
| 1010 function checkSubtypeOfRuntimeType(o, t) { | |
| 1011 if (o == null) | |
| 1012 return isSupertypeOfNull(t); | |
| 1013 if (t == null) | |
| 1014 return true; | |
| 1015 let rti = getRuntimeTypeInfo(o); | |
| 1016 o = _interceptors.getInterceptor(o); | |
| 1017 let type = o.constructor; | |
| 1018 if (rti != null) { | |
| 1019 rti = rti.slice(); | |
| 1020 rti.splice(0, 0, type); | |
| 1021 type = rti; | |
| 1022 } else if (hasField(t, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`)) { | |
| 1023 let signatureName = `${_foreign_helper.JS_OPERATOR_IS_PREFIX()}_${getField
(t, _foreign_helper.JS_FUNCTION_TYPE_TAG())}`; | |
| 1024 if (hasField(o, signatureName)) | |
| 1025 return true; | |
| 1026 let targetSignatureFunction = getField(o, `${_foreign_helper.JS_SIGNATURE_
NAME()}`); | |
| 1027 if (targetSignatureFunction == null) | |
| 1028 return false; | |
| 1029 type = invokeOn(targetSignatureFunction, o, null); | |
| 1030 return isFunctionSubtype(type, t); | |
| 1031 } | |
| 1032 return isSubtype(type, t); | |
| 1033 } | |
| 1034 dart.fn(checkSubtypeOfRuntimeType, core.bool, [core.Object, core.Object]); | |
| 1035 function subtypeOfRuntimeTypeCast(object, type) { | |
| 1036 if (dart.notNull(object != null) && !dart.notNull(checkSubtypeOfRuntimeType(
object, type))) { | |
| 1037 let actualType = Primitives.objectTypeName(object); | |
| 1038 throw new CastErrorImplementation(actualType, runtimeTypeToString(type)); | |
| 1039 } | |
| 1040 return object; | |
| 1041 } | |
| 1042 dart.fn(subtypeOfRuntimeTypeCast, core.Object, [core.Object, core.Object]); | |
| 1043 function assertSubtypeOfRuntimeType(object, type) { | |
| 1044 if (dart.notNull(object != null) && !dart.notNull(checkSubtypeOfRuntimeType(
object, type))) { | |
| 1045 throw new TypeErrorImplementation(object, runtimeTypeToString(type)); | |
| 1046 } | |
| 1047 return object; | |
| 1048 } | |
| 1049 dart.fn(assertSubtypeOfRuntimeType, core.Object, [core.Object, core.Object]); | |
| 1050 function getArguments(type) { | |
| 1051 return isJsArray(type) ? type.slice(1) : null; | |
| 1052 } | |
| 1053 dart.fn(getArguments); | |
| 1054 function isSubtype(s, t) { | |
| 1055 if (isIdentical(s, t)) | |
| 1056 return true; | |
| 1057 if (dart.notNull(s == null) || dart.notNull(t == null)) | |
| 1058 return true; | |
| 1059 if (hasField(t, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`)) { | |
| 1060 return isFunctionSubtype(s, t); | |
| 1061 } | |
| 1062 if (hasField(s, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`)) { | |
| 1063 return getConstructorName(t) == _foreign_helper.JS_FUNCTION_CLASS_NAME(); | |
| 1064 } | |
| 1065 let typeOfS = isJsArray(s) ? getIndex(s, 0) : s; | |
| 1066 let typeOfT = isJsArray(t) ? getIndex(t, 0) : t; | |
| 1067 let name = runtimeTypeToString(typeOfT); | |
| 1068 let substitution = null; | |
| 1069 if (isNotIdentical(typeOfT, typeOfS)) { | |
| 1070 let test = `${_foreign_helper.JS_OPERATOR_IS_PREFIX()}${name}`; | |
| 1071 let typeOfSPrototype = typeOfS.prototype; | |
| 1072 if (hasNoField(typeOfSPrototype, test)) | |
| 1073 return false; | |
| 1074 let field = `${_foreign_helper.JS_OPERATOR_AS_PREFIX()}${runtimeTypeToStri
ng(typeOfT)}`; | |
| 1075 substitution = getField(typeOfSPrototype, field); | |
| 1076 } | |
| 1077 if (!dart.notNull(isJsArray(s)) && dart.notNull(substitution == null) || !da
rt.notNull(isJsArray(t))) { | |
| 1078 return true; | |
| 1079 } | |
| 1080 return checkArguments(substitution, getArguments(s), getArguments(t)); | |
| 1081 } | |
| 1082 dart.fn(isSubtype, core.bool, [core.Object, core.Object]); | |
| 1083 function isAssignable(s, t) { | |
| 1084 return dart.notNull(isSubtype(s, t)) || dart.notNull(isSubtype(t, s)); | |
| 1085 } | |
| 1086 dart.fn(isAssignable, core.bool, [core.Object, core.Object]); | |
| 1087 function areAssignable(s, t, allowShorter) { | |
| 1088 if (dart.notNull(t == null) && dart.notNull(s == null)) | |
| 1089 return true; | |
| 1090 if (t == null) | |
| 1091 return allowShorter; | |
| 1092 if (s == null) | |
| 1093 return false; | |
| 1094 dart.assert(isJsArray(s)); | |
| 1095 dart.assert(isJsArray(t)); | |
| 1096 let sLength = getLength(s); | |
| 1097 let tLength = getLength(t); | |
| 1098 if (allowShorter) { | |
| 1099 if (dart.notNull(sLength) < dart.notNull(tLength)) | |
| 1100 return false; | |
| 1101 } else { | |
| 1102 if (sLength != tLength) | |
| 1103 return false; | |
| 1104 } | |
| 1105 for (let i = 0; dart.notNull(i) < dart.notNull(tLength); i = dart.notNull(i)
+ 1) { | |
| 1106 if (!dart.notNull(isAssignable(getIndex(s, i), getIndex(t, i)))) { | |
| 1107 return false; | |
| 1108 } | |
| 1109 } | |
| 1110 return true; | |
| 1111 } | |
| 1112 dart.fn(areAssignable, core.bool, [core.List, core.List, core.bool]); | |
| 1113 function areAssignableMaps(s, t) { | |
| 1114 if (t == null) | |
| 1115 return true; | |
| 1116 if (s == null) | |
| 1117 return false; | |
| 1118 dart.assert(isJsObject(s)); | |
| 1119 dart.assert(isJsObject(t)); | |
| 1120 let names = _interceptors.JSArray.markFixedList(dart.as(Object.getOwnPropert
yNames(t), core.List)); | |
| 1121 for (let i = 0; dart.notNull(i) < dart.notNull(names.length); i = dart.notNu
ll(i) + 1) { | |
| 1122 let name = names[dartx.get](i); | |
| 1123 if (!Object.hasOwnProperty.call(s, name)) { | |
| 1124 return false; | |
| 1125 } | |
| 1126 let tType = t[name]; | |
| 1127 let sType = s[name]; | |
| 1128 if (!dart.notNull(isAssignable(tType, sType))) | |
| 1129 return false; | |
| 1130 } | |
| 1131 return true; | |
| 1132 } | |
| 1133 dart.fn(areAssignableMaps, core.bool, [core.Object, core.Object]); | |
| 1134 function isFunctionSubtype(s, t) { | |
| 1135 dart.assert(hasField(t, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`)); | |
| 1136 if (hasNoField(s, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`)) | |
| 1137 return false; | |
| 1138 if (hasField(s, `${_foreign_helper.JS_FUNCTION_TYPE_VOID_RETURN_TAG()}`)) { | |
| 1139 if (dart.notNull(dart.as(hasNoField(t, `${_foreign_helper.JS_FUNCTION_TYPE
_VOID_RETURN_TAG()}`), core.bool)) && dart.notNull(dart.as(hasField(t, `${_forei
gn_helper.JS_FUNCTION_TYPE_RETURN_TYPE_TAG()}`), core.bool))) { | |
| 1140 return false; | |
| 1141 } | |
| 1142 } else if (hasNoField(t, `${_foreign_helper.JS_FUNCTION_TYPE_VOID_RETURN_TAG
()}`)) { | |
| 1143 let sReturnType = getField(s, `${_foreign_helper.JS_FUNCTION_TYPE_RETURN_T
YPE_TAG()}`); | |
| 1144 let tReturnType = getField(t, `${_foreign_helper.JS_FUNCTION_TYPE_RETURN_T
YPE_TAG()}`); | |
| 1145 if (!dart.notNull(isAssignable(sReturnType, tReturnType))) | |
| 1146 return false; | |
| 1147 } | |
| 1148 let sParameterTypes = getField(s, `${_foreign_helper.JS_FUNCTION_TYPE_REQUIR
ED_PARAMETERS_TAG()}`); | |
| 1149 let tParameterTypes = getField(t, `${_foreign_helper.JS_FUNCTION_TYPE_REQUIR
ED_PARAMETERS_TAG()}`); | |
| 1150 let sOptionalParameterTypes = getField(s, `${_foreign_helper.JS_FUNCTION_TYP
E_OPTIONAL_PARAMETERS_TAG()}`); | |
| 1151 let tOptionalParameterTypes = getField(t, `${_foreign_helper.JS_FUNCTION_TYP
E_OPTIONAL_PARAMETERS_TAG()}`); | |
| 1152 let sParametersLen = sParameterTypes != null ? getLength(sParameterTypes) :
0; | |
| 1153 let tParametersLen = tParameterTypes != null ? getLength(tParameterTypes) :
0; | |
| 1154 let sOptionalParametersLen = sOptionalParameterTypes != null ? getLength(sOp
tionalParameterTypes) : 0; | |
| 1155 let tOptionalParametersLen = tOptionalParameterTypes != null ? getLength(tOp
tionalParameterTypes) : 0; | |
| 1156 if (dart.notNull(sParametersLen) > dart.notNull(tParametersLen)) { | |
| 1157 return false; | |
| 1158 } | |
| 1159 if (dart.notNull(sParametersLen) + dart.notNull(sOptionalParametersLen) < da
rt.notNull(tParametersLen) + dart.notNull(tOptionalParametersLen)) { | |
| 1160 return false; | |
| 1161 } | |
| 1162 if (sParametersLen == tParametersLen) { | |
| 1163 if (!dart.notNull(areAssignable(dart.as(sParameterTypes, core.List), dart.
as(tParameterTypes, core.List), false))) | |
| 1164 return false; | |
| 1165 if (!dart.notNull(areAssignable(dart.as(sOptionalParameterTypes, core.List
), dart.as(tOptionalParameterTypes, core.List), true))) { | |
| 1166 return false; | |
| 1167 } | |
| 1168 } else { | |
| 1169 let pos = 0; | |
| 1170 for (; dart.notNull(pos) < dart.notNull(sParametersLen); pos = dart.notNul
l(pos) + 1) { | |
| 1171 if (!dart.notNull(isAssignable(getIndex(sParameterTypes, pos), getIndex(
tParameterTypes, pos)))) { | |
| 1172 return false; | |
| 1173 } | |
| 1174 } | |
| 1175 let sPos = 0; | |
| 1176 let tPos = pos; | |
| 1177 for (; dart.notNull(tPos) < dart.notNull(tParametersLen); sPos = dart.notN
ull(sPos) + 1, tPos = dart.notNull(tPos) + 1) { | |
| 1178 if (!dart.notNull(isAssignable(getIndex(sOptionalParameterTypes, sPos),
getIndex(tParameterTypes, tPos)))) { | |
| 1179 return false; | |
| 1180 } | |
| 1181 } | |
| 1182 tPos = 0; | |
| 1183 for (; dart.notNull(tPos) < dart.notNull(tOptionalParametersLen); sPos = d
art.notNull(sPos) + 1, tPos = dart.notNull(tPos) + 1) { | |
| 1184 if (!dart.notNull(isAssignable(getIndex(sOptionalParameterTypes, sPos),
getIndex(tOptionalParameterTypes, tPos)))) { | |
| 1185 return false; | |
| 1186 } | |
| 1187 } | |
| 1188 } | |
| 1189 let sNamedParameters = getField(s, `${_foreign_helper.JS_FUNCTION_TYPE_NAMED
_PARAMETERS_TAG()}`); | |
| 1190 let tNamedParameters = getField(t, `${_foreign_helper.JS_FUNCTION_TYPE_NAMED
_PARAMETERS_TAG()}`); | |
| 1191 return areAssignableMaps(sNamedParameters, tNamedParameters); | |
| 1192 } | |
| 1193 dart.fn(isFunctionSubtype, core.bool, [core.Object, core.Object]); | |
| 1194 function invoke(func, arguments$) { | |
| 1195 return invokeOn(func, null, arguments$); | |
| 1196 } | |
| 1197 dart.fn(invoke); | |
| 1198 function invokeOn(func, receiver, arguments$) { | |
| 1199 dart.assert(isJsFunction(func)); | |
| 1200 dart.assert(dart.notNull(arguments$ == null) || dart.notNull(isJsArray(argum
ents$))); | |
| 1201 return func.apply(receiver, arguments$); | |
| 1202 } | |
| 1203 dart.fn(invokeOn, core.Object, [core.Object, core.Object, core.Object]); | |
| 1204 function call(object, name) { | |
| 1205 return object[name](); | |
| 1206 } | |
| 1207 dart.fn(call, core.Object, [core.Object, core.String]); | |
| 1208 function getField(object, name) { | |
| 1209 return object[name]; | |
| 1210 } | |
| 1211 dart.fn(getField, core.Object, [core.Object, core.String]); | |
| 1212 function getIndex(array, index) { | 523 function getIndex(array, index) { |
| 1213 dart.assert(isJsArray(array)); | 524 dart.assert(isJsArray(array)); |
| 1214 return array[index]; | 525 return array[index]; |
| 1215 } | 526 } |
| 1216 dart.fn(getIndex, core.Object, [core.Object, core.int]); | 527 dart.fn(getIndex, core.Object, [core.Object, core.int]); |
| 1217 function getLength(array) { | 528 function getLength(array) { |
| 1218 dart.assert(isJsArray(array)); | 529 dart.assert(isJsArray(array)); |
| 1219 return array.length; | 530 return array.length; |
| 1220 } | 531 } |
| 1221 dart.fn(getLength, core.int, [core.Object]); | 532 dart.fn(getLength, core.int, [core.Object]); |
| 1222 function isJsArray(value) { | 533 function isJsArray(value) { |
| 1223 return dart.is(value, _interceptors.JSArray); | 534 return dart.is(value, _interceptors.JSArray); |
| 1224 } | 535 } |
| 1225 dart.fn(isJsArray, core.bool, [core.Object]); | 536 dart.fn(isJsArray, core.bool, [core.Object]); |
| 1226 function hasField(object, name) { | |
| 1227 return name in object; | |
| 1228 } | |
| 1229 dart.fn(hasField); | |
| 1230 function hasNoField(object, name) { | |
| 1231 return dart.dsend(hasField(object, name), '!'); | |
| 1232 } | |
| 1233 dart.fn(hasNoField); | |
| 1234 function isJsFunction(o) { | |
| 1235 return typeof o == "function"; | |
| 1236 } | |
| 1237 dart.fn(isJsFunction, core.bool, [core.Object]); | |
| 1238 function isJsObject(o) { | |
| 1239 return typeof o == 'object'; | |
| 1240 } | |
| 1241 dart.fn(isJsObject, core.bool, [core.Object]); | |
| 1242 function isIdentical(s, t) { | |
| 1243 return s === t; | |
| 1244 } | |
| 1245 dart.fn(isIdentical, core.bool, [core.Object, core.Object]); | |
| 1246 function isNotIdentical(s, t) { | |
| 1247 return s !== t; | |
| 1248 } | |
| 1249 dart.fn(isNotIdentical, core.bool, [core.Object, core.Object]); | |
| 1250 function unmangleGlobalNameIfPreservedAnyways(str) { | |
| 1251 return str; | |
| 1252 } | |
| 1253 dart.fn(unmangleGlobalNameIfPreservedAnyways, core.String, [core.String]); | |
| 1254 function unmangleAllIdentifiersIfPreservedAnyways(str) { | |
| 1255 return str; | |
| 1256 } | |
| 1257 dart.fn(unmangleAllIdentifiersIfPreservedAnyways, core.String, [core.String]); | |
| 1258 class _Patch extends core.Object { | 537 class _Patch extends core.Object { |
| 1259 _Patch() { | 538 _Patch() { |
| 1260 } | 539 } |
| 1261 } | 540 } |
| 1262 dart.setSignature(_Patch, { | 541 dart.setSignature(_Patch, { |
| 1263 constructors: () => ({_Patch: [_Patch, []]}) | 542 constructors: () => ({_Patch: [_Patch, []]}) |
| 1264 }); | 543 }); |
| 1265 let patch = dart.const(new _Patch()); | 544 let patch = dart.const(new _Patch()); |
| 1266 class InternalMap extends core.Object {} | 545 class InternalMap extends core.Object {} |
| 1267 function requiresPreamble() { | |
| 1268 } | |
| 1269 dart.fn(requiresPreamble); | |
| 1270 function S(value) { | |
| 1271 if (typeof value == 'string') | |
| 1272 return dart.as(value, core.String); | |
| 1273 if (dart.is(value, core.num)) { | |
| 1274 if (!dart.equals(value, 0)) { | |
| 1275 return "" + value; | |
| 1276 } | |
| 1277 } else if (dart.equals(true, value)) { | |
| 1278 return 'true'; | |
| 1279 } else if (dart.equals(false, value)) { | |
| 1280 return 'false'; | |
| 1281 } else if (value == null) { | |
| 1282 return 'null'; | |
| 1283 } | |
| 1284 let res = dart.toString(value); | |
| 1285 if (!(typeof res == 'string')) | |
| 1286 throw new core.ArgumentError(value); | |
| 1287 return res; | |
| 1288 } | |
| 1289 dart.fn(S, core.String, [core.Object]); | |
| 1290 function createInvocationMirror(name, internalName, kind, arguments$, argument
Names) { | |
| 1291 return new JSInvocationMirror(name, dart.as(internalName, core.String), dart
.as(kind, core.int), dart.as(arguments$, core.List), dart.as(argumentNames, core
.List)); | |
| 1292 } | |
| 1293 dart.fn(createInvocationMirror, core.Object, [core.String, core.Object, core.O
bject, core.Object, core.Object]); | |
| 1294 function createUnmangledInvocationMirror(symbol, internalName, kind, arguments
$, argumentNames) { | |
| 1295 return new JSInvocationMirror(symbol, dart.as(internalName, core.String), da
rt.as(kind, core.int), dart.as(arguments$, core.List), dart.as(argumentNames, co
re.List)); | |
| 1296 } | |
| 1297 dart.fn(createUnmangledInvocationMirror, core.Object, [core.Symbol, core.Objec
t, core.Object, core.Object, core.Object]); | |
| 1298 function throwInvalidReflectionError(memberName) { | |
| 1299 throw new core.UnsupportedError(`Can't use '${memberName}' in reflection ` +
"because it is not included in a @MirrorsUsed annotation."); | |
| 1300 } | |
| 1301 dart.fn(throwInvalidReflectionError, dart.void, [core.String]); | |
| 1302 function traceHelper(method) { | |
| 1303 if (!this.cache) { | |
| 1304 this.cache = Object.create(null); | |
| 1305 } | |
| 1306 if (!this.cache[method]) { | |
| 1307 console.log(method); | |
| 1308 this.cache[method] = true; | |
| 1309 } | |
| 1310 } | |
| 1311 dart.fn(traceHelper, dart.void, [core.String]); | |
| 1312 let _memberName = Symbol('_memberName'); | |
| 1313 let _internalName = Symbol('_internalName'); | |
| 1314 let _kind = Symbol('_kind'); | |
| 1315 let _arguments = Symbol('_arguments'); | |
| 1316 let _namedArgumentNames = Symbol('_namedArgumentNames'); | |
| 1317 let _namedIndices = Symbol('_namedIndices'); | |
| 1318 let _getCachedInvocation = Symbol('_getCachedInvocation'); | |
| 1319 class JSInvocationMirror extends core.Object { | |
| 1320 JSInvocationMirror(memberName, internalName, kind, arguments$, namedArgument
Names) { | |
| 1321 this[_memberName] = memberName; | |
| 1322 this[_internalName] = internalName; | |
| 1323 this[_kind] = kind; | |
| 1324 this[_arguments] = arguments$; | |
| 1325 this[_namedArgumentNames] = namedArgumentNames; | |
| 1326 this[_namedIndices] = null; | |
| 1327 } | |
| 1328 get memberName() { | |
| 1329 if (dart.is(this[_memberName], core.Symbol)) | |
| 1330 return dart.as(this[_memberName], core.Symbol); | |
| 1331 let name = dart.as(this[_memberName], core.String); | |
| 1332 let unmangledName = _js_names.mangledNames.get(name); | |
| 1333 if (unmangledName != null) { | |
| 1334 name = unmangledName[dartx.split](':')[dartx.get](0); | |
| 1335 } else { | |
| 1336 if (_js_names.mangledNames.get(this[_internalName]) == null) { | |
| 1337 core.print(`Warning: '${name}' is used reflectively but not in Mirrors
Used. ` + "This will break minified code."); | |
| 1338 } | |
| 1339 } | |
| 1340 this[_memberName] = new _internal.Symbol.unvalidated(name); | |
| 1341 return dart.as(this[_memberName], core.Symbol); | |
| 1342 } | |
| 1343 get isMethod() { | |
| 1344 return this[_kind] == JSInvocationMirror.METHOD; | |
| 1345 } | |
| 1346 get isGetter() { | |
| 1347 return this[_kind] == JSInvocationMirror.GETTER; | |
| 1348 } | |
| 1349 get isSetter() { | |
| 1350 return this[_kind] == JSInvocationMirror.SETTER; | |
| 1351 } | |
| 1352 get isAccessor() { | |
| 1353 return this[_kind] != JSInvocationMirror.METHOD; | |
| 1354 } | |
| 1355 get positionalArguments() { | |
| 1356 if (this.isGetter) | |
| 1357 return dart.const([]); | |
| 1358 let argumentCount = dart.notNull(this[_arguments].length) - dart.notNull(t
his[_namedArgumentNames].length); | |
| 1359 if (argumentCount == 0) | |
| 1360 return dart.const([]); | |
| 1361 let list = []; | |
| 1362 for (let index = 0; dart.notNull(index) < dart.notNull(argumentCount); ind
ex = dart.notNull(index) + 1) { | |
| 1363 list[dartx.add](this[_arguments][dartx.get](index)); | |
| 1364 } | |
| 1365 return dart.as(makeLiteralListConst(list), core.List); | |
| 1366 } | |
| 1367 get namedArguments() { | |
| 1368 if (this.isAccessor) | |
| 1369 return dart.map(); | |
| 1370 let namedArgumentCount = this[_namedArgumentNames].length; | |
| 1371 let namedArgumentsStartIndex = dart.notNull(this[_arguments].length) - dar
t.notNull(namedArgumentCount); | |
| 1372 if (namedArgumentCount == 0) | |
| 1373 return dart.map(); | |
| 1374 let map = core.Map$(core.Symbol, core.Object).new(); | |
| 1375 for (let i = 0; dart.notNull(i) < dart.notNull(namedArgumentCount); i = da
rt.notNull(i) + 1) { | |
| 1376 map.set(new _internal.Symbol.unvalidated(dart.as(this[_namedArgumentName
s][dartx.get](i), core.String)), this[_arguments][dartx.get](dart.notNull(namedA
rgumentsStartIndex) + dart.notNull(i))); | |
| 1377 } | |
| 1378 return map; | |
| 1379 } | |
| 1380 [_getCachedInvocation](object) { | |
| 1381 let interceptor = _interceptors.getInterceptor(object); | |
| 1382 let receiver = object; | |
| 1383 let name = this[_internalName]; | |
| 1384 let arguments$ = this[_arguments]; | |
| 1385 let interceptedNames = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded
_names.INTERCEPTED_NAMES); | |
| 1386 let isIntercepted = Object.prototype.hasOwnProperty.call(interceptedNames,
name); | |
| 1387 if (isIntercepted) { | |
| 1388 receiver = interceptor; | |
| 1389 if (object === interceptor) { | |
| 1390 interceptor = null; | |
| 1391 } | |
| 1392 } else { | |
| 1393 interceptor = null; | |
| 1394 } | |
| 1395 let isCatchAll = false; | |
| 1396 let method = receiver[name]; | |
| 1397 if (typeof method != "function") { | |
| 1398 let baseName = _internal.Symbol.getName(dart.as(this.memberName, _intern
al.Symbol)); | |
| 1399 method = receiver[baseName + "*"]; | |
| 1400 if (method == null) { | |
| 1401 interceptor = _interceptors.getInterceptor(object); | |
| 1402 method = interceptor[baseName + "*"]; | |
| 1403 if (method != null) { | |
| 1404 isIntercepted = true; | |
| 1405 receiver = interceptor; | |
| 1406 } else { | |
| 1407 interceptor = null; | |
| 1408 } | |
| 1409 } | |
| 1410 isCatchAll = true; | |
| 1411 } | |
| 1412 if (typeof method == "function") { | |
| 1413 if (isCatchAll) { | |
| 1414 return new CachedCatchAllInvocation(name, method, isIntercepted, dart.
as(interceptor, _interceptors.Interceptor)); | |
| 1415 } else { | |
| 1416 return new CachedInvocation(name, method, isIntercepted, dart.as(inter
ceptor, _interceptors.Interceptor)); | |
| 1417 } | |
| 1418 } else { | |
| 1419 return new CachedNoSuchMethodInvocation(interceptor); | |
| 1420 } | |
| 1421 } | |
| 1422 static invokeFromMirror(invocation, victim) { | |
| 1423 let cached = invocation[_getCachedInvocation](victim); | |
| 1424 if (dart.dload(cached, 'isNoSuchMethod')) { | |
| 1425 return dart.dsend(cached, 'invokeOn', victim, invocation); | |
| 1426 } else { | |
| 1427 return dart.dsend(cached, 'invokeOn', victim, invocation[_arguments]); | |
| 1428 } | |
| 1429 } | |
| 1430 static getCachedInvocation(invocation, victim) { | |
| 1431 return invocation[_getCachedInvocation](victim); | |
| 1432 } | |
| 1433 } | |
| 1434 JSInvocationMirror[dart.implements] = () => [core.Invocation]; | |
| 1435 dart.setSignature(JSInvocationMirror, { | |
| 1436 constructors: () => ({JSInvocationMirror: [JSInvocationMirror, [core.Object,
core.String, core.int, core.List, core.List]]}), | |
| 1437 methods: () => ({[_getCachedInvocation]: [core.Object, [core.Object]]}), | |
| 1438 statics: () => ({ | |
| 1439 invokeFromMirror: [core.Object, [JSInvocationMirror, core.Object]], | |
| 1440 getCachedInvocation: [core.Object, [JSInvocationMirror, core.Object]] | |
| 1441 }), | |
| 1442 names: ['invokeFromMirror', 'getCachedInvocation'] | |
| 1443 }); | |
| 1444 JSInvocationMirror.METHOD = 0; | |
| 1445 JSInvocationMirror.GETTER = 1; | |
| 1446 JSInvocationMirror.SETTER = 2; | |
| 1447 class CachedInvocation extends core.Object { | |
| 1448 CachedInvocation(mangledName, jsFunction, isIntercepted, cachedInterceptor)
{ | |
| 1449 this.mangledName = mangledName; | |
| 1450 this.jsFunction = jsFunction; | |
| 1451 this.isIntercepted = isIntercepted; | |
| 1452 this.cachedInterceptor = cachedInterceptor; | |
| 1453 } | |
| 1454 get isNoSuchMethod() { | |
| 1455 return false; | |
| 1456 } | |
| 1457 get isGetterStub() { | |
| 1458 return !!this.jsFunction.$getterStub; | |
| 1459 } | |
| 1460 invokeOn(victim, arguments$) { | |
| 1461 let receiver = victim; | |
| 1462 if (!dart.notNull(this.isIntercepted)) { | |
| 1463 if (!dart.is(arguments$, _interceptors.JSArray)) | |
| 1464 arguments$ = core.List.from(arguments$); | |
| 1465 } else { | |
| 1466 let _ = [victim]; | |
| 1467 _[dartx.addAll](arguments$); | |
| 1468 arguments$ = _; | |
| 1469 if (this.cachedInterceptor != null) | |
| 1470 receiver = this.cachedInterceptor; | |
| 1471 } | |
| 1472 return this.jsFunction.apply(receiver, arguments$); | |
| 1473 } | |
| 1474 } | |
| 1475 dart.setSignature(CachedInvocation, { | |
| 1476 constructors: () => ({CachedInvocation: [CachedInvocation, [core.String, cor
e.Object, core.bool, _interceptors.Interceptor]]}), | |
| 1477 methods: () => ({invokeOn: [core.Object, [core.Object, core.List]]}) | |
| 1478 }); | |
| 1479 class CachedCatchAllInvocation extends CachedInvocation { | |
| 1480 CachedCatchAllInvocation(name, jsFunction, isIntercepted, cachedInterceptor)
{ | |
| 1481 this.info = ReflectionInfo.new(jsFunction); | |
| 1482 super.CachedInvocation(name, jsFunction, isIntercepted, cachedInterceptor)
; | |
| 1483 } | |
| 1484 get isGetterStub() { | |
| 1485 return false; | |
| 1486 } | |
| 1487 invokeOn(victim, arguments$) { | |
| 1488 let receiver = victim; | |
| 1489 let providedArgumentCount = null; | |
| 1490 let fullParameterCount = dart.notNull(this.info.requiredParameterCount) +
dart.notNull(this.info.optionalParameterCount); | |
| 1491 if (!dart.notNull(this.isIntercepted)) { | |
| 1492 if (dart.is(arguments$, _interceptors.JSArray)) { | |
| 1493 providedArgumentCount = arguments$.length; | |
| 1494 if (dart.notNull(providedArgumentCount) < dart.notNull(fullParameterCo
unt)) { | |
| 1495 arguments$ = core.List.from(arguments$); | |
| 1496 } | |
| 1497 } else { | |
| 1498 arguments$ = core.List.from(arguments$); | |
| 1499 providedArgumentCount = arguments$.length; | |
| 1500 } | |
| 1501 } else { | |
| 1502 let _ = [victim]; | |
| 1503 _[dartx.addAll](arguments$); | |
| 1504 arguments$ = _; | |
| 1505 if (this.cachedInterceptor != null) | |
| 1506 receiver = this.cachedInterceptor; | |
| 1507 providedArgumentCount = dart.notNull(arguments$.length) - 1; | |
| 1508 } | |
| 1509 if (dart.notNull(this.info.areOptionalParametersNamed) && dart.notNull(pro
videdArgumentCount) > dart.notNull(this.info.requiredParameterCount)) { | |
| 1510 throw new UnimplementedNoSuchMethodError(`Invocation of unstubbed method
'${this.info.reflectionName}'` + ` with ${arguments$.length} arguments.`); | |
| 1511 } else if (dart.notNull(providedArgumentCount) < dart.notNull(this.info.re
quiredParameterCount)) { | |
| 1512 throw new UnimplementedNoSuchMethodError(`Invocation of unstubbed method
'${this.info.reflectionName}'` + ` with ${providedArgumentCount} arguments (too
few).`); | |
| 1513 } else if (dart.notNull(providedArgumentCount) > dart.notNull(fullParamete
rCount)) { | |
| 1514 throw new UnimplementedNoSuchMethodError(`Invocation of unstubbed method
'${this.info.reflectionName}'` + ` with ${providedArgumentCount} arguments (too
many).`); | |
| 1515 } | |
| 1516 for (let i = providedArgumentCount; dart.notNull(i) < dart.notNull(fullPar
ameterCount); i = dart.notNull(i) + 1) { | |
| 1517 arguments$[dartx.add](getMetadata(this.info.defaultValue(i))); | |
| 1518 } | |
| 1519 return this.jsFunction.apply(receiver, arguments$); | |
| 1520 } | |
| 1521 } | |
| 1522 dart.setSignature(CachedCatchAllInvocation, { | |
| 1523 constructors: () => ({CachedCatchAllInvocation: [CachedCatchAllInvocation, [
core.String, core.Object, core.bool, _interceptors.Interceptor]]}) | |
| 1524 }); | |
| 1525 class CachedNoSuchMethodInvocation extends core.Object { | |
| 1526 CachedNoSuchMethodInvocation(interceptor) { | |
| 1527 this.interceptor = interceptor; | |
| 1528 } | |
| 1529 get isNoSuchMethod() { | |
| 1530 return true; | |
| 1531 } | |
| 1532 get isGetterStub() { | |
| 1533 return false; | |
| 1534 } | |
| 1535 invokeOn(victim, invocation) { | |
| 1536 let receiver = this.interceptor == null ? victim : this.interceptor; | |
| 1537 return dart.dsend(receiver, 'noSuchMethod', invocation); | |
| 1538 } | |
| 1539 } | |
| 1540 dart.setSignature(CachedNoSuchMethodInvocation, { | |
| 1541 constructors: () => ({CachedNoSuchMethodInvocation: [CachedNoSuchMethodInvoc
ation, [core.Object]]}), | |
| 1542 methods: () => ({invokeOn: [core.Object, [core.Object, core.Invocation]]}) | |
| 1543 }); | |
| 1544 class ReflectionInfo extends core.Object { | |
| 1545 internal(jsFunction, data, isAccessor, requiredParameterCount, optionalParam
eterCount, areOptionalParametersNamed, functionType) { | |
| 1546 this.jsFunction = jsFunction; | |
| 1547 this.data = data; | |
| 1548 this.isAccessor = isAccessor; | |
| 1549 this.requiredParameterCount = requiredParameterCount; | |
| 1550 this.optionalParameterCount = optionalParameterCount; | |
| 1551 this.areOptionalParametersNamed = areOptionalParametersNamed; | |
| 1552 this.functionType = functionType; | |
| 1553 this.cachedSortedIndices = null; | |
| 1554 } | |
| 1555 static new(jsFunction) { | |
| 1556 let data = dart.as(jsFunction.$reflectionInfo, core.List); | |
| 1557 if (data == null) | |
| 1558 return null; | |
| 1559 data = _interceptors.JSArray.markFixedList(data); | |
| 1560 let requiredParametersInfo = data[ReflectionInfo.REQUIRED_PARAMETERS_INFO]
; | |
| 1561 let requiredParameterCount = requiredParametersInfo >> 1; | |
| 1562 let isAccessor = (dart.notNull(requiredParametersInfo) & 1) == 1; | |
| 1563 let optionalParametersInfo = data[ReflectionInfo.OPTIONAL_PARAMETERS_INFO]
; | |
| 1564 let optionalParameterCount = optionalParametersInfo >> 1; | |
| 1565 let areOptionalParametersNamed = (dart.notNull(optionalParametersInfo) & 1
) == 1; | |
| 1566 let functionType = data[ReflectionInfo.FUNCTION_TYPE_INDEX]; | |
| 1567 return new ReflectionInfo.internal(jsFunction, data, isAccessor, requiredP
arameterCount, optionalParameterCount, areOptionalParametersNamed, functionType)
; | |
| 1568 } | |
| 1569 parameterName(parameter) { | |
| 1570 let metadataIndex = null; | |
| 1571 if (_foreign_helper.JS_GET_FLAG('MUST_RETAIN_METADATA')) { | |
| 1572 metadataIndex = this.data[2 * parameter + this.optionalParameterCount +
ReflectionInfo.FIRST_DEFAULT_ARGUMENT]; | |
| 1573 } else { | |
| 1574 metadataIndex = this.data[parameter + this.optionalParameterCount + Refl
ectionInfo.FIRST_DEFAULT_ARGUMENT]; | |
| 1575 } | |
| 1576 let metadata = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names.M
ETADATA); | |
| 1577 return metadata[metadataIndex]; | |
| 1578 } | |
| 1579 parameterMetadataAnnotations(parameter) { | |
| 1580 if (!dart.notNull(_foreign_helper.JS_GET_FLAG('MUST_RETAIN_METADATA'))) { | |
| 1581 throw new core.StateError('metadata has not been preserved'); | |
| 1582 } else { | |
| 1583 return dart.as(this.data[2 * parameter + this.optionalParameterCount + R
eflectionInfo.FIRST_DEFAULT_ARGUMENT + 1], core.List$(core.int)); | |
| 1584 } | |
| 1585 } | |
| 1586 defaultValue(parameter) { | |
| 1587 if (dart.notNull(parameter) < dart.notNull(this.requiredParameterCount)) | |
| 1588 return null; | |
| 1589 return this.data[ReflectionInfo.FIRST_DEFAULT_ARGUMENT + parameter - this.
requiredParameterCount]; | |
| 1590 } | |
| 1591 defaultValueInOrder(parameter) { | |
| 1592 if (dart.notNull(parameter) < dart.notNull(this.requiredParameterCount)) | |
| 1593 return null; | |
| 1594 if (!dart.notNull(this.areOptionalParametersNamed) || this.optionalParamet
erCount == 1) { | |
| 1595 return this.defaultValue(parameter); | |
| 1596 } | |
| 1597 let index = this.sortedIndex(dart.notNull(parameter) - dart.notNull(this.r
equiredParameterCount)); | |
| 1598 return this.defaultValue(index); | |
| 1599 } | |
| 1600 parameterNameInOrder(parameter) { | |
| 1601 if (dart.notNull(parameter) < dart.notNull(this.requiredParameterCount)) | |
| 1602 return null; | |
| 1603 if (!dart.notNull(this.areOptionalParametersNamed) || this.optionalParamet
erCount == 1) { | |
| 1604 return this.parameterName(parameter); | |
| 1605 } | |
| 1606 let index = this.sortedIndex(dart.notNull(parameter) - dart.notNull(this.r
equiredParameterCount)); | |
| 1607 return this.parameterName(index); | |
| 1608 } | |
| 1609 sortedIndex(unsortedIndex) { | |
| 1610 if (this.cachedSortedIndices == null) { | |
| 1611 this.cachedSortedIndices = core.List.new(this.optionalParameterCount); | |
| 1612 let positions = dart.map(); | |
| 1613 for (let i = 0; dart.notNull(i) < dart.notNull(this.optionalParameterCou
nt); i = dart.notNull(i) + 1) { | |
| 1614 let index = dart.notNull(this.requiredParameterCount) + dart.notNull(i
); | |
| 1615 positions.set(this.parameterName(index), index); | |
| 1616 } | |
| 1617 let index = 0; | |
| 1618 (() => { | |
| 1619 let _ = positions.keys[dartx.toList](); | |
| 1620 _[dartx.sort](); | |
| 1621 return _; | |
| 1622 })()[dartx.forEach](dart.fn(name => { | |
| 1623 this.cachedSortedIndices[dartx.set]((() => { | |
| 1624 let x = index; | |
| 1625 index = dart.notNull(x) + 1; | |
| 1626 return x; | |
| 1627 })(), positions.get(name)); | |
| 1628 }, core.Object, [core.String])); | |
| 1629 } | |
| 1630 return dart.as(this.cachedSortedIndices[dartx.get](unsortedIndex), core.in
t); | |
| 1631 } | |
| 1632 computeFunctionRti(jsConstructor) { | |
| 1633 if (typeof this.functionType == "number") { | |
| 1634 return getMetadata(dart.as(this.functionType, core.int)); | |
| 1635 } else if (typeof this.functionType == "function") { | |
| 1636 let fakeInstance = new jsConstructor(); | |
| 1637 setRuntimeTypeInfo(fakeInstance, fakeInstance["<>"]); | |
| 1638 return this.functionType.apply({$receiver: fakeInstance}); | |
| 1639 } else { | |
| 1640 throw new RuntimeError('Unexpected function type'); | |
| 1641 } | |
| 1642 } | |
| 1643 get reflectionName() { | |
| 1644 return this.jsFunction.$reflectionName; | |
| 1645 } | |
| 1646 } | |
| 1647 dart.defineNamedConstructor(ReflectionInfo, 'internal'); | |
| 1648 dart.setSignature(ReflectionInfo, { | |
| 1649 constructors: () => ({ | |
| 1650 internal: [ReflectionInfo, [core.Object, core.List, core.bool, core.int, c
ore.int, core.bool, core.Object]], | |
| 1651 new: [ReflectionInfo, [core.Object]] | |
| 1652 }), | |
| 1653 methods: () => ({ | |
| 1654 parameterName: [core.String, [core.int]], | |
| 1655 parameterMetadataAnnotations: [core.List$(core.int), [core.int]], | |
| 1656 defaultValue: [core.int, [core.int]], | |
| 1657 defaultValueInOrder: [core.int, [core.int]], | |
| 1658 parameterNameInOrder: [core.String, [core.int]], | |
| 1659 sortedIndex: [core.int, [core.int]], | |
| 1660 computeFunctionRti: [core.Object, [core.Object]] | |
| 1661 }) | |
| 1662 }); | |
| 1663 ReflectionInfo.REQUIRED_PARAMETERS_INFO = 0; | |
| 1664 ReflectionInfo.OPTIONAL_PARAMETERS_INFO = 1; | |
| 1665 ReflectionInfo.FUNCTION_TYPE_INDEX = 2; | |
| 1666 ReflectionInfo.FIRST_DEFAULT_ARGUMENT = 3; | |
| 1667 function getMetadata(index) { | |
| 1668 let metadata = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names.MET
ADATA); | |
| 1669 return metadata[index]; | |
| 1670 } | |
| 1671 dart.fn(getMetadata, core.Object, [core.int]); | |
| 1672 class Primitives extends core.Object { | 546 class Primitives extends core.Object { |
| 1673 static initializeStatics(id) { | 547 static initializeStatics(id) { |
| 1674 Primitives.mirrorFunctionCacheName = dart.notNull(Primitives.mirrorFunctio
nCacheName) + `_${id}`; | 548 Primitives.mirrorFunctionCacheName = dart.notNull(Primitives.mirrorFunctio
nCacheName) + `_${id}`; |
| 1675 Primitives.mirrorInvokeCacheName = dart.notNull(Primitives.mirrorInvokeCac
heName) + `_${id}`; | 549 Primitives.mirrorInvokeCacheName = dart.notNull(Primitives.mirrorInvokeCac
heName) + `_${id}`; |
| 1676 } | 550 } |
| 1677 static objectHashCode(object) { | 551 static objectHashCode(object) { |
| 1678 let hash = dart.as(object.$identityHash, core.int); | 552 let hash = dart.as(object.$identityHash, core.int); |
| 1679 if (hash == null) { | 553 if (hash == null) { |
| 1680 hash = Math.random() * 0x3fffffff | 0; | 554 hash = Math.random() * 0x3fffffff | 0; |
| 1681 object.$identityHash = hash; | 555 object.$identityHash = hash; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1746 let result = parseFloat(source); | 620 let result = parseFloat(source); |
| 1747 if (result[dartx.isNaN]) { | 621 if (result[dartx.isNaN]) { |
| 1748 let trimmed = source[dartx.trim](); | 622 let trimmed = source[dartx.trim](); |
| 1749 if (trimmed == 'NaN' || trimmed == '+NaN' || trimmed == '-NaN') { | 623 if (trimmed == 'NaN' || trimmed == '+NaN' || trimmed == '-NaN') { |
| 1750 return result; | 624 return result; |
| 1751 } | 625 } |
| 1752 return handleError(source); | 626 return handleError(source); |
| 1753 } | 627 } |
| 1754 return result; | 628 return result; |
| 1755 } | 629 } |
| 1756 static formatType(className, typeArguments) { | |
| 1757 return unmangleAllIdentifiersIfPreservedAnyways(`${className}${joinArgumen
ts(typeArguments, 0)}`); | |
| 1758 } | |
| 1759 static objectTypeName(object) { | 630 static objectTypeName(object) { |
| 1760 let name = Primitives.constructorNameFallback(object); | 631 return dart.toString(getRuntimeType(object)); |
| 1761 if (name == 'Object') { | |
| 1762 let decompiled = String(object.constructor).match(/^\s*function\s*(\S*)\
s*\(/)[1]; | |
| 1763 if (typeof decompiled == 'string') | |
| 1764 if (/^\w+$/.test(decompiled)) | |
| 1765 name = dart.as(decompiled, core.String); | |
| 1766 } | |
| 1767 return Primitives.formatType(name, dart.as(getRuntimeTypeInfo(object), cor
e.List)); | |
| 1768 } | 632 } |
| 1769 static objectToString(object) { | 633 static objectToString(object) { |
| 1770 let name = dart.typeName(dart.realRuntimeType(object)); | 634 let name = dart.typeName(dart.realRuntimeType(object)); |
| 1771 return `Instance of '${name}'`; | 635 return `Instance of '${name}'`; |
| 1772 } | 636 } |
| 1773 static dateNow() { | 637 static dateNow() { |
| 1774 return Date.now(); | 638 return Date.now(); |
| 1775 } | 639 } |
| 1776 static initTicker() { | 640 static initTicker() { |
| 1777 if (Primitives.timerFrequency != null) | 641 if (Primitives.timerFrequency != null) |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1791 Primitives.timerFrequency = 1000000; | 655 Primitives.timerFrequency = 1000000; |
| 1792 Primitives.timerTicks = dart.fn(() => (1000 * performance.now())[dartx.flo
or](), core.int, []); | 656 Primitives.timerTicks = dart.fn(() => (1000 * performance.now())[dartx.flo
or](), core.int, []); |
| 1793 } | 657 } |
| 1794 static get isD8() { | 658 static get isD8() { |
| 1795 return typeof version == "function" && typeof os == "object" && "system" i
n os; | 659 return typeof version == "function" && typeof os == "object" && "system" i
n os; |
| 1796 } | 660 } |
| 1797 static get isJsshell() { | 661 static get isJsshell() { |
| 1798 return typeof version == "function" && typeof system == "function"; | 662 return typeof version == "function" && typeof system == "function"; |
| 1799 } | 663 } |
| 1800 static currentUri() { | 664 static currentUri() { |
| 1801 requiresPreamble(); | |
| 1802 if (!!self.location) { | 665 if (!!self.location) { |
| 1803 return self.location.href; | 666 return self.location.href; |
| 1804 } | 667 } |
| 1805 return null; | 668 return null; |
| 1806 } | 669 } |
| 1807 static _fromCharCodeApply(array) { | 670 static _fromCharCodeApply(array) { |
| 1808 let result = ""; | 671 let result = ""; |
| 1809 let kMaxApply = 500; | 672 let kMaxApply = 500; |
| 1810 let end = array.length; | 673 let end = array.length; |
| 1811 for (let i = 0; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) +
dart.notNull(kMaxApply)) { | 674 for (let i = 0; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) +
dart.notNull(kMaxApply)) { |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1959 throw new core.ArgumentError(object); | 822 throw new core.ArgumentError(object); |
| 1960 } | 823 } |
| 1961 return object[key]; | 824 return object[key]; |
| 1962 } | 825 } |
| 1963 static setProperty(object, key, value) { | 826 static setProperty(object, key, value) { |
| 1964 if (dart.notNull(object == null) || typeof object == 'boolean' || dart.is(
object, core.num) || typeof object == 'string') { | 827 if (dart.notNull(object == null) || typeof object == 'boolean' || dart.is(
object, core.num) || typeof object == 'string') { |
| 1965 throw new core.ArgumentError(object); | 828 throw new core.ArgumentError(object); |
| 1966 } | 829 } |
| 1967 object[key] = value; | 830 object[key] = value; |
| 1968 } | 831 } |
| 1969 static functionNoSuchMethod(func, positionalArguments, namedArguments) { | |
| 1970 let argumentCount = 0; | |
| 1971 let arguments$ = []; | |
| 1972 let namedArgumentList = []; | |
| 1973 if (positionalArguments != null) { | |
| 1974 argumentCount = dart.notNull(argumentCount) + dart.notNull(positionalArg
uments.length); | |
| 1975 arguments$[dartx.addAll](positionalArguments); | |
| 1976 } | |
| 1977 let names = ''; | |
| 1978 if (dart.notNull(namedArguments != null) && !dart.notNull(namedArguments.i
sEmpty)) { | |
| 1979 namedArguments.forEach(dart.fn((name, argument) => { | |
| 1980 names = `${names}$${name}`; | |
| 1981 namedArgumentList[dartx.add](name); | |
| 1982 arguments$[dartx.add](argument); | |
| 1983 argumentCount = dart.notNull(argumentCount) + 1; | |
| 1984 }, core.Object, [core.String, core.Object])); | |
| 1985 } | |
| 1986 let selectorName = `${_foreign_helper.JS_GET_NAME("CALL_PREFIX")}$${argume
ntCount}${names}`; | |
| 1987 return dart.dsend(func, 'noSuchMethod', createUnmangledInvocationMirror(da
rt.const(new core.Symbol('call')), selectorName, JSInvocationMirror.METHOD, argu
ments$, namedArgumentList)); | |
| 1988 } | |
| 1989 static applyFunction(func, positionalArguments, namedArguments) { | |
| 1990 return namedArguments == null ? Primitives.applyFunctionWithPositionalArgu
ments(func, positionalArguments) : Primitives.applyFunctionWithNamedArguments(fu
nc, positionalArguments, namedArguments); | |
| 1991 } | |
| 1992 static applyFunctionWithPositionalArguments(func, positionalArguments) { | |
| 1993 let argumentCount = 0; | |
| 1994 let arguments$ = null; | |
| 1995 if (positionalArguments != null) { | |
| 1996 if (positionalArguments instanceof Array) { | |
| 1997 arguments$ = positionalArguments; | |
| 1998 } else { | |
| 1999 arguments$ = core.List.from(positionalArguments); | |
| 2000 } | |
| 2001 argumentCount = arguments$.length; | |
| 2002 } else { | |
| 2003 arguments$ = []; | |
| 2004 } | |
| 2005 let selectorName = `${_foreign_helper.JS_GET_NAME("CALL_PREFIX")}$${argume
ntCount}`; | |
| 2006 let jsFunction = func[selectorName]; | |
| 2007 if (jsFunction == null) { | |
| 2008 return Primitives.functionNoSuchMethod(func, positionalArguments, null); | |
| 2009 } | |
| 2010 return jsFunction.apply(func, arguments$); | |
| 2011 } | |
| 2012 static applyFunctionWithNamedArguments(func, positionalArguments, namedArgum
ents) { | |
| 2013 if (namedArguments.isEmpty) { | |
| 2014 return Primitives.applyFunctionWithPositionalArguments(func, positionalA
rguments); | |
| 2015 } | |
| 2016 let interceptor = _interceptors.getInterceptor(func); | |
| 2017 let jsFunction = interceptor["call*"]; | |
| 2018 if (jsFunction == null) { | |
| 2019 return Primitives.functionNoSuchMethod(func, positionalArguments, namedA
rguments); | |
| 2020 } | |
| 2021 let info = ReflectionInfo.new(jsFunction); | |
| 2022 if (dart.notNull(info == null) || !dart.notNull(info.areOptionalParameters
Named)) { | |
| 2023 return Primitives.functionNoSuchMethod(func, positionalArguments, namedA
rguments); | |
| 2024 } | |
| 2025 if (positionalArguments != null) { | |
| 2026 positionalArguments = core.List.from(positionalArguments); | |
| 2027 } else { | |
| 2028 positionalArguments = []; | |
| 2029 } | |
| 2030 if (info.requiredParameterCount != positionalArguments.length) { | |
| 2031 return Primitives.functionNoSuchMethod(func, positionalArguments, namedA
rguments); | |
| 2032 } | |
| 2033 let defaultArguments = core.Map.new(); | |
| 2034 for (let i = 0; dart.notNull(i) < dart.notNull(info.optionalParameterCount
); i = dart.notNull(i) + 1) { | |
| 2035 let index = dart.notNull(i) + dart.notNull(info.requiredParameterCount); | |
| 2036 let parameterName = info.parameterNameInOrder(index); | |
| 2037 let value = info.defaultValueInOrder(index); | |
| 2038 let defaultValue = getMetadata(value); | |
| 2039 defaultArguments.set(parameterName, defaultValue); | |
| 2040 } | |
| 2041 let bad = false; | |
| 2042 namedArguments.forEach(dart.fn((parameter, value) => { | |
| 2043 if (defaultArguments.containsKey(parameter)) { | |
| 2044 defaultArguments.set(parameter, value); | |
| 2045 } else { | |
| 2046 bad = true; | |
| 2047 } | |
| 2048 }, core.Object, [core.String, core.Object])); | |
| 2049 if (bad) { | |
| 2050 return Primitives.functionNoSuchMethod(func, positionalArguments, namedA
rguments); | |
| 2051 } | |
| 2052 positionalArguments[dartx.addAll](defaultArguments.values); | |
| 2053 return jsFunction.apply(func, positionalArguments); | |
| 2054 } | |
| 2055 static _mangledNameMatchesType(mangledName, type) { | |
| 2056 return mangledName == type[_typeName]; | |
| 2057 } | |
| 2058 static identicalImplementation(a, b) { | 832 static identicalImplementation(a, b) { |
| 2059 return a == null ? b == null : a === b; | 833 return a == null ? b == null : a === b; |
| 2060 } | 834 } |
| 2061 static extractStackTrace(error) { | 835 static extractStackTrace(error) { |
| 2062 return getTraceFromException(error.$thrownJsError); | 836 return getTraceFromException(error.$thrownJsError); |
| 2063 } | 837 } |
| 2064 } | 838 } |
| 2065 dart.setSignature(Primitives, { | 839 dart.setSignature(Primitives, { |
| 2066 statics: () => ({ | 840 statics: () => ({ |
| 2067 initializeStatics: [dart.void, [core.int]], | 841 initializeStatics: [dart.void, [core.int]], |
| 2068 objectHashCode: [core.int, [core.Object]], | 842 objectHashCode: [core.int, [core.Object]], |
| 2069 _throwFormatException: [core.Object, [core.String]], | 843 _throwFormatException: [core.Object, [core.String]], |
| 2070 parseInt: [core.int, [core.String, core.int, dart.functionType(core.int, [
core.String])]], | 844 parseInt: [core.int, [core.String, core.int, dart.functionType(core.int, [
core.String])]], |
| 2071 parseDouble: [core.double, [core.String, dart.functionType(core.double, [c
ore.String])]], | 845 parseDouble: [core.double, [core.String, dart.functionType(core.double, [c
ore.String])]], |
| 2072 formatType: [core.String, [core.String, core.List]], | |
| 2073 objectTypeName: [core.String, [core.Object]], | 846 objectTypeName: [core.String, [core.Object]], |
| 2074 objectToString: [core.String, [core.Object]], | 847 objectToString: [core.String, [core.Object]], |
| 2075 dateNow: [core.num, []], | 848 dateNow: [core.num, []], |
| 2076 initTicker: [dart.void, []], | 849 initTicker: [dart.void, []], |
| 2077 currentUri: [core.String, []], | 850 currentUri: [core.String, []], |
| 2078 _fromCharCodeApply: [core.String, [core.List$(core.int)]], | 851 _fromCharCodeApply: [core.String, [core.List$(core.int)]], |
| 2079 stringFromCodePoints: [core.String, [core.Object]], | 852 stringFromCodePoints: [core.String, [core.Object]], |
| 2080 stringFromCharCodes: [core.String, [core.Object]], | 853 stringFromCharCodes: [core.String, [core.Object]], |
| 2081 stringFromCharCode: [core.String, [core.Object]], | 854 stringFromCharCode: [core.String, [core.Object]], |
| 2082 stringConcatUnchecked: [core.String, [core.String, core.String]], | 855 stringConcatUnchecked: [core.String, [core.String, core.String]], |
| 2083 flattenString: [core.String, [core.String]], | 856 flattenString: [core.String, [core.String]], |
| 2084 getTimeZoneName: [core.String, [core.Object]], | 857 getTimeZoneName: [core.String, [core.Object]], |
| 2085 getTimeZoneOffsetInMinutes: [core.int, [core.Object]], | 858 getTimeZoneOffsetInMinutes: [core.int, [core.Object]], |
| 2086 valueFromDecomposedDate: [core.Object, [core.Object, core.Object, core.Obj
ect, core.Object, core.Object, core.Object, core.Object, core.Object]], | 859 valueFromDecomposedDate: [core.Object, [core.Object, core.Object, core.Obj
ect, core.Object, core.Object, core.Object, core.Object, core.Object]], |
| 2087 patchUpY2K: [core.Object, [core.Object, core.Object, core.Object]], | 860 patchUpY2K: [core.Object, [core.Object, core.Object, core.Object]], |
| 2088 lazyAsJsDate: [core.Object, [core.Object]], | 861 lazyAsJsDate: [core.Object, [core.Object]], |
| 2089 getYear: [core.Object, [core.Object]], | 862 getYear: [core.Object, [core.Object]], |
| 2090 getMonth: [core.Object, [core.Object]], | 863 getMonth: [core.Object, [core.Object]], |
| 2091 getDay: [core.Object, [core.Object]], | 864 getDay: [core.Object, [core.Object]], |
| 2092 getHours: [core.Object, [core.Object]], | 865 getHours: [core.Object, [core.Object]], |
| 2093 getMinutes: [core.Object, [core.Object]], | 866 getMinutes: [core.Object, [core.Object]], |
| 2094 getSeconds: [core.Object, [core.Object]], | 867 getSeconds: [core.Object, [core.Object]], |
| 2095 getMilliseconds: [core.Object, [core.Object]], | 868 getMilliseconds: [core.Object, [core.Object]], |
| 2096 getWeekday: [core.Object, [core.Object]], | 869 getWeekday: [core.Object, [core.Object]], |
| 2097 valueFromDateString: [core.Object, [core.Object]], | 870 valueFromDateString: [core.Object, [core.Object]], |
| 2098 getProperty: [core.Object, [core.Object, core.Object]], | 871 getProperty: [core.Object, [core.Object, core.Object]], |
| 2099 setProperty: [dart.void, [core.Object, core.Object, core.Object]], | 872 setProperty: [dart.void, [core.Object, core.Object, core.Object]], |
| 2100 functionNoSuchMethod: [core.Object, [core.Object, core.List, core.Map$(cor
e.String, core.Object)]], | |
| 2101 applyFunction: [core.Object, [core.Function, core.List, core.Map$(core.Str
ing, core.Object)]], | |
| 2102 applyFunctionWithPositionalArguments: [core.Object, [core.Function, core.L
ist]], | |
| 2103 applyFunctionWithNamedArguments: [core.Object, [core.Function, core.List,
core.Map$(core.String, core.Object)]], | |
| 2104 _mangledNameMatchesType: [core.Object, [core.String, TypeImpl]], | |
| 2105 identicalImplementation: [core.bool, [core.Object, core.Object]], | 873 identicalImplementation: [core.bool, [core.Object, core.Object]], |
| 2106 extractStackTrace: [core.StackTrace, [core.Error]] | 874 extractStackTrace: [core.StackTrace, [core.Error]] |
| 2107 }), | 875 }), |
| 2108 names: ['initializeStatics', 'objectHashCode', '_throwFormatException', 'par
seInt', 'parseDouble', 'formatType', 'objectTypeName', 'objectToString', 'dateNo
w', 'initTicker', 'currentUri', '_fromCharCodeApply', 'stringFromCodePoints', 's
tringFromCharCodes', 'stringFromCharCode', 'stringConcatUnchecked', 'flattenStri
ng', 'getTimeZoneName', 'getTimeZoneOffsetInMinutes', 'valueFromDecomposedDate',
'patchUpY2K', 'lazyAsJsDate', 'getYear', 'getMonth', 'getDay', 'getHours', 'get
Minutes', 'getSeconds', 'getMilliseconds', 'getWeekday', 'valueFromDateString',
'getProperty', 'setProperty', 'functionNoSuchMethod', 'applyFunction', 'applyFun
ctionWithPositionalArguments', 'applyFunctionWithNamedArguments', '_mangledNameM
atchesType', 'identicalImplementation', 'extractStackTrace'] | 876 names: ['initializeStatics', 'objectHashCode', '_throwFormatException', 'par
seInt', 'parseDouble', 'objectTypeName', 'objectToString', 'dateNow', 'initTicke
r', 'currentUri', '_fromCharCodeApply', 'stringFromCodePoints', 'stringFromCharC
odes', 'stringFromCharCode', 'stringConcatUnchecked', 'flattenString', 'getTimeZ
oneName', 'getTimeZoneOffsetInMinutes', 'valueFromDecomposedDate', 'patchUpY2K',
'lazyAsJsDate', 'getYear', 'getMonth', 'getDay', 'getHours', 'getMinutes', 'get
Seconds', 'getMilliseconds', 'getWeekday', 'valueFromDateString', 'getProperty',
'setProperty', 'identicalImplementation', 'extractStackTrace'] |
| 2109 }); | 877 }); |
| 2110 Primitives.mirrorFunctionCacheName = '$cachedFunction'; | 878 Primitives.mirrorFunctionCacheName = '$cachedFunction'; |
| 2111 Primitives.mirrorInvokeCacheName = '$cachedInvocation'; | 879 Primitives.mirrorInvokeCacheName = '$cachedInvocation'; |
| 2112 Primitives.DOLLAR_CHAR_VALUE = 36; | 880 Primitives.DOLLAR_CHAR_VALUE = 36; |
| 2113 Primitives.timerFrequency = null; | 881 Primitives.timerFrequency = null; |
| 2114 Primitives.timerTicks = null; | 882 Primitives.timerTicks = null; |
| 2115 dart.defineLazyProperties(Primitives, { | |
| 2116 get constructorNameFallback() { | |
| 2117 return function getTagFallback(o) { | |
| 2118 var constructor = o.constructor; | |
| 2119 if (typeof constructor == "function") { | |
| 2120 var name = constructor.name; | |
| 2121 if (typeof name == "string" && name.length > 2 && name !== "Object" &&
name !== "Function.prototype") { | |
| 2122 return name; | |
| 2123 } | |
| 2124 } | |
| 2125 var s = Object.prototype.toString.call(o); | |
| 2126 return s.substring(8, s.length - 1); | |
| 2127 }; | |
| 2128 }, | |
| 2129 set constructorNameFallback(_) {} | |
| 2130 }); | |
| 2131 class JsCache extends core.Object { | |
| 2132 static allocate() { | |
| 2133 let result = Object.create(null); | |
| 2134 result.x = 0; | |
| 2135 delete result.x; | |
| 2136 return result; | |
| 2137 } | |
| 2138 static fetch(cache, key) { | |
| 2139 return cache[key]; | |
| 2140 } | |
| 2141 static update(cache, key, value) { | |
| 2142 cache[key] = value; | |
| 2143 } | |
| 2144 } | |
| 2145 dart.setSignature(JsCache, { | |
| 2146 statics: () => ({ | |
| 2147 allocate: [core.Object, []], | |
| 2148 fetch: [core.Object, [core.Object, core.String]], | |
| 2149 update: [dart.void, [core.Object, core.String, core.Object]] | |
| 2150 }), | |
| 2151 names: ['allocate', 'fetch', 'update'] | |
| 2152 }); | |
| 2153 function iae(argument) { | |
| 2154 throw new core.ArgumentError(argument); | |
| 2155 } | |
| 2156 dart.fn(iae); | |
| 2157 function ioore(receiver, index) { | |
| 2158 if (receiver == null) | |
| 2159 dart.dload(receiver, 'length'); | |
| 2160 if (!(typeof index == 'number')) | |
| 2161 iae(index); | |
| 2162 throw new core.RangeError.value(dart.as(index, core.num)); | |
| 2163 } | |
| 2164 dart.fn(ioore); | |
| 2165 function stringLastIndexOfUnchecked(receiver, element, start) { | 883 function stringLastIndexOfUnchecked(receiver, element, start) { |
| 2166 return receiver.lastIndexOf(element, start); | 884 return receiver.lastIndexOf(element, start); |
| 2167 } | 885 } |
| 2168 dart.fn(stringLastIndexOfUnchecked); | 886 dart.fn(stringLastIndexOfUnchecked); |
| 2169 function checkNull(object) { | 887 function checkNull(object) { |
| 2170 if (object == null) | 888 if (object == null) |
| 2171 throw new core.ArgumentError(null); | 889 throw new core.ArgumentError(null); |
| 2172 return object; | 890 return object; |
| 2173 } | 891 } |
| 2174 dart.fn(checkNull); | 892 dart.fn(checkNull); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 2193 return value; | 911 return value; |
| 2194 } | 912 } |
| 2195 dart.fn(checkBool); | 913 dart.fn(checkBool); |
| 2196 function checkString(value) { | 914 function checkString(value) { |
| 2197 if (!(typeof value == 'string')) { | 915 if (!(typeof value == 'string')) { |
| 2198 throw new core.ArgumentError(value); | 916 throw new core.ArgumentError(value); |
| 2199 } | 917 } |
| 2200 return value; | 918 return value; |
| 2201 } | 919 } |
| 2202 dart.fn(checkString); | 920 dart.fn(checkString); |
| 2203 function wrapException(ex) { | |
| 2204 if (ex == null) | |
| 2205 ex = new core.NullThrownError(); | |
| 2206 let wrapper = new Error(); | |
| 2207 wrapper.dartException = ex; | |
| 2208 if ("defineProperty" in Object) { | |
| 2209 Object.defineProperty(wrapper, "message", {get: _foreign_helper.DART_CLOSU
RE_TO_JS(toStringWrapper)}); | |
| 2210 wrapper.name = ""; | |
| 2211 } else { | |
| 2212 wrapper.toString = _foreign_helper.DART_CLOSURE_TO_JS(toStringWrapper); | |
| 2213 } | |
| 2214 return wrapper; | |
| 2215 } | |
| 2216 dart.fn(wrapException); | |
| 2217 function toStringWrapper() { | |
| 2218 return dart.toString(this.dartException); | |
| 2219 } | |
| 2220 dart.fn(toStringWrapper); | |
| 2221 function throwExpression(ex) { | |
| 2222 throw wrapException(ex); | |
| 2223 } | |
| 2224 dart.fn(throwExpression); | |
| 2225 function makeLiteralListConst(list) { | |
| 2226 list.immutable$list = true; | |
| 2227 list.fixed$length = true; | |
| 2228 return list; | |
| 2229 } | |
| 2230 dart.fn(makeLiteralListConst); | |
| 2231 function throwRuntimeError(message) { | 921 function throwRuntimeError(message) { |
| 2232 throw new RuntimeError(message); | 922 throw new RuntimeError(message); |
| 2233 } | 923 } |
| 2234 dart.fn(throwRuntimeError); | 924 dart.fn(throwRuntimeError); |
| 2235 function throwAbstractClassInstantiationError(className) { | 925 function throwAbstractClassInstantiationError(className) { |
| 2236 throw new core.AbstractClassInstantiationError(dart.as(className, core.Strin
g)); | 926 throw new core.AbstractClassInstantiationError(dart.as(className, core.Strin
g)); |
| 2237 } | 927 } |
| 2238 dart.fn(throwAbstractClassInstantiationError); | 928 dart.fn(throwAbstractClassInstantiationError); |
| 2239 let _argumentsExpr = Symbol('_argumentsExpr'); | 929 let _message = Symbol('_message'); |
| 2240 let _expr = Symbol('_expr'); | |
| 2241 let _method = Symbol('_method'); | 930 let _method = Symbol('_method'); |
| 2242 let _receiver = Symbol('_receiver'); | |
| 2243 let _pattern = Symbol('_pattern'); | |
| 2244 class TypeErrorDecoder extends core.Object { | |
| 2245 TypeErrorDecoder(arguments$, argumentsExpr, expr, method, receiver, pattern)
{ | |
| 2246 this[_arguments] = arguments$; | |
| 2247 this[_argumentsExpr] = argumentsExpr; | |
| 2248 this[_expr] = expr; | |
| 2249 this[_method] = method; | |
| 2250 this[_receiver] = receiver; | |
| 2251 this[_pattern] = pattern; | |
| 2252 } | |
| 2253 matchTypeError(message) { | |
| 2254 let match = new RegExp(this[_pattern]).exec(message); | |
| 2255 if (match == null) | |
| 2256 return null; | |
| 2257 let result = Object.create(null); | |
| 2258 if (this[_arguments] != -1) { | |
| 2259 result.arguments = match[this[_arguments] + 1]; | |
| 2260 } | |
| 2261 if (this[_argumentsExpr] != -1) { | |
| 2262 result.argumentsExpr = match[this[_argumentsExpr] + 1]; | |
| 2263 } | |
| 2264 if (this[_expr] != -1) { | |
| 2265 result.expr = match[this[_expr] + 1]; | |
| 2266 } | |
| 2267 if (this[_method] != -1) { | |
| 2268 result.method = match[this[_method] + 1]; | |
| 2269 } | |
| 2270 if (this[_receiver] != -1) { | |
| 2271 result.receiver = match[this[_receiver] + 1]; | |
| 2272 } | |
| 2273 return result; | |
| 2274 } | |
| 2275 static buildJavaScriptObject() { | |
| 2276 return { | |
| 2277 toString: function() { | |
| 2278 return "$receiver$"; | |
| 2279 } | |
| 2280 }; | |
| 2281 } | |
| 2282 static buildJavaScriptObjectWithNonClosure() { | |
| 2283 return { | |
| 2284 $method$: null, | |
| 2285 toString: function() { | |
| 2286 return "$receiver$"; | |
| 2287 } | |
| 2288 }; | |
| 2289 } | |
| 2290 static extractPattern(message) { | |
| 2291 message = message.replace(String({}), '$receiver$'); | |
| 2292 message = message.replace(new RegExp(ESCAPE_REGEXP, 'g'), '\\$&'); | |
| 2293 let match = dart.as(message.match(/\\\$[a-zA-Z]+\\\$/g), core.List$(core.S
tring)); | |
| 2294 if (match == null) | |
| 2295 match = dart.list([], core.String); | |
| 2296 let arguments$ = match.indexOf('\\$arguments\\$'); | |
| 2297 let argumentsExpr = match.indexOf('\\$argumentsExpr\\$'); | |
| 2298 let expr = match.indexOf('\\$expr\\$'); | |
| 2299 let method = match.indexOf('\\$method\\$'); | |
| 2300 let receiver = match.indexOf('\\$receiver\\$'); | |
| 2301 let pattern = message.replace('\\$arguments\\$', '((?:x|[^x])*)').replace(
'\\$argumentsExpr\\$', '((?:x|[^x])*)').replace('\\$expr\\$', '((?:x|[^x])*)').r
eplace('\\$method\\$', '((?:x|[^x])*)').replace('\\$receiver\\$', '((?:x|[^x])*)
'); | |
| 2302 return new TypeErrorDecoder(arguments$, argumentsExpr, expr, method, recei
ver, pattern); | |
| 2303 } | |
| 2304 static provokeCallErrorOn(expression) { | |
| 2305 let func = function($expr$) { | |
| 2306 var $argumentsExpr$ = '$arguments$'; | |
| 2307 try { | |
| 2308 $expr$.$method$($argumentsExpr$); | |
| 2309 } catch (e) { | |
| 2310 return e.message; | |
| 2311 } | |
| 2312 | |
| 2313 }; | |
| 2314 return func(expression); | |
| 2315 } | |
| 2316 static provokeCallErrorOnNull() { | |
| 2317 let func = function() { | |
| 2318 var $argumentsExpr$ = '$arguments$'; | |
| 2319 try { | |
| 2320 null.$method$($argumentsExpr$); | |
| 2321 } catch (e) { | |
| 2322 return e.message; | |
| 2323 } | |
| 2324 | |
| 2325 }; | |
| 2326 return func(); | |
| 2327 } | |
| 2328 static provokeCallErrorOnUndefined() { | |
| 2329 let func = function() { | |
| 2330 var $argumentsExpr$ = '$arguments$'; | |
| 2331 try { | |
| 2332 (void 0).$method$($argumentsExpr$); | |
| 2333 } catch (e) { | |
| 2334 return e.message; | |
| 2335 } | |
| 2336 | |
| 2337 }; | |
| 2338 return func(); | |
| 2339 } | |
| 2340 static provokePropertyErrorOn(expression) { | |
| 2341 let func = function($expr$) { | |
| 2342 try { | |
| 2343 $expr$.$method$; | |
| 2344 } catch (e) { | |
| 2345 return e.message; | |
| 2346 } | |
| 2347 | |
| 2348 }; | |
| 2349 return func(expression); | |
| 2350 } | |
| 2351 static provokePropertyErrorOnNull() { | |
| 2352 let func = function() { | |
| 2353 try { | |
| 2354 null.$method$; | |
| 2355 } catch (e) { | |
| 2356 return e.message; | |
| 2357 } | |
| 2358 | |
| 2359 }; | |
| 2360 return func(); | |
| 2361 } | |
| 2362 static provokePropertyErrorOnUndefined() { | |
| 2363 let func = function() { | |
| 2364 try { | |
| 2365 (void 0).$method$; | |
| 2366 } catch (e) { | |
| 2367 return e.message; | |
| 2368 } | |
| 2369 | |
| 2370 }; | |
| 2371 return func(); | |
| 2372 } | |
| 2373 } | |
| 2374 dart.setSignature(TypeErrorDecoder, { | |
| 2375 constructors: () => ({TypeErrorDecoder: [TypeErrorDecoder, [core.int, core.i
nt, core.int, core.int, core.int, core.String]]}), | |
| 2376 methods: () => ({matchTypeError: [core.Object, [core.Object]]}), | |
| 2377 statics: () => ({ | |
| 2378 buildJavaScriptObject: [core.Object, []], | |
| 2379 buildJavaScriptObjectWithNonClosure: [core.Object, []], | |
| 2380 extractPattern: [core.Object, [core.String]], | |
| 2381 provokeCallErrorOn: [core.String, [core.Object]], | |
| 2382 provokeCallErrorOnNull: [core.String, []], | |
| 2383 provokeCallErrorOnUndefined: [core.String, []], | |
| 2384 provokePropertyErrorOn: [core.String, [core.Object]], | |
| 2385 provokePropertyErrorOnNull: [core.String, []], | |
| 2386 provokePropertyErrorOnUndefined: [core.String, []] | |
| 2387 }), | |
| 2388 names: ['buildJavaScriptObject', 'buildJavaScriptObjectWithNonClosure', 'ext
ractPattern', 'provokeCallErrorOn', 'provokeCallErrorOnNull', 'provokeCallErrorO
nUndefined', 'provokePropertyErrorOn', 'provokePropertyErrorOnNull', 'provokePro
pertyErrorOnUndefined'] | |
| 2389 }); | |
| 2390 dart.defineLazyProperties(TypeErrorDecoder, { | |
| 2391 get noSuchMethodPattern() { | |
| 2392 return dart.as(TypeErrorDecoder.extractPattern(TypeErrorDecoder.provokeCal
lErrorOn(TypeErrorDecoder.buildJavaScriptObject())), TypeErrorDecoder); | |
| 2393 }, | |
| 2394 get notClosurePattern() { | |
| 2395 return dart.as(TypeErrorDecoder.extractPattern(TypeErrorDecoder.provokeCal
lErrorOn(TypeErrorDecoder.buildJavaScriptObjectWithNonClosure())), TypeErrorDeco
der); | |
| 2396 }, | |
| 2397 get nullCallPattern() { | |
| 2398 return dart.as(TypeErrorDecoder.extractPattern(TypeErrorDecoder.provokeCal
lErrorOn(null)), TypeErrorDecoder); | |
| 2399 }, | |
| 2400 get nullLiteralCallPattern() { | |
| 2401 return dart.as(TypeErrorDecoder.extractPattern(TypeErrorDecoder.provokeCal
lErrorOnNull()), TypeErrorDecoder); | |
| 2402 }, | |
| 2403 get undefinedCallPattern() { | |
| 2404 return dart.as(TypeErrorDecoder.extractPattern(TypeErrorDecoder.provokeCal
lErrorOn(void 0)), TypeErrorDecoder); | |
| 2405 }, | |
| 2406 get undefinedLiteralCallPattern() { | |
| 2407 return dart.as(TypeErrorDecoder.extractPattern(TypeErrorDecoder.provokeCal
lErrorOnUndefined()), TypeErrorDecoder); | |
| 2408 }, | |
| 2409 get nullPropertyPattern() { | |
| 2410 return dart.as(TypeErrorDecoder.extractPattern(TypeErrorDecoder.provokePro
pertyErrorOn(null)), TypeErrorDecoder); | |
| 2411 }, | |
| 2412 get nullLiteralPropertyPattern() { | |
| 2413 return dart.as(TypeErrorDecoder.extractPattern(TypeErrorDecoder.provokePro
pertyErrorOnNull()), TypeErrorDecoder); | |
| 2414 }, | |
| 2415 get undefinedPropertyPattern() { | |
| 2416 return dart.as(TypeErrorDecoder.extractPattern(TypeErrorDecoder.provokePro
pertyErrorOn(void 0)), TypeErrorDecoder); | |
| 2417 }, | |
| 2418 get undefinedLiteralPropertyPattern() { | |
| 2419 return dart.as(TypeErrorDecoder.extractPattern(TypeErrorDecoder.provokePro
pertyErrorOnUndefined()), TypeErrorDecoder); | |
| 2420 } | |
| 2421 }); | |
| 2422 let _message = Symbol('_message'); | |
| 2423 class NullError extends core.Error { | 931 class NullError extends core.Error { |
| 2424 NullError(message, match) { | 932 NullError(message, match) { |
| 2425 this[_message] = message; | 933 this[_message] = message; |
| 2426 this[_method] = match == null ? null : dart.as(match.method, core.String); | 934 this[_method] = match == null ? null : dart.as(match.method, core.String); |
| 2427 super.Error(); | 935 super.Error(); |
| 2428 } | 936 } |
| 2429 toString() { | 937 toString() { |
| 2430 if (this[_method] == null) | 938 if (this[_method] == null) |
| 2431 return `NullError: ${this[_message]}`; | 939 return `NullError: ${this[_message]}`; |
| 2432 return `NullError: Cannot call "${this[_method]}" on null`; | 940 return `NullError: Cannot call "${this[_method]}" on null`; |
| 2433 } | 941 } |
| 2434 } | 942 } |
| 2435 NullError[dart.implements] = () => [core.NoSuchMethodError]; | 943 NullError[dart.implements] = () => [core.NoSuchMethodError]; |
| 2436 dart.setSignature(NullError, { | 944 dart.setSignature(NullError, { |
| 2437 constructors: () => ({NullError: [NullError, [core.String, core.Object]]}) | 945 constructors: () => ({NullError: [NullError, [core.String, core.Object]]}) |
| 2438 }); | 946 }); |
| 947 let _receiver = Symbol('_receiver'); |
| 2439 class JsNoSuchMethodError extends core.Error { | 948 class JsNoSuchMethodError extends core.Error { |
| 2440 JsNoSuchMethodError(message, match) { | 949 JsNoSuchMethodError(message, match) { |
| 2441 this[_message] = message; | 950 this[_message] = message; |
| 2442 this[_method] = match == null ? null : dart.as(match.method, core.String); | 951 this[_method] = match == null ? null : dart.as(match.method, core.String); |
| 2443 this[_receiver] = match == null ? null : dart.as(match.receiver, core.Stri
ng); | 952 this[_receiver] = match == null ? null : dart.as(match.receiver, core.Stri
ng); |
| 2444 super.Error(); | 953 super.Error(); |
| 2445 } | 954 } |
| 2446 toString() { | 955 toString() { |
| 2447 if (this[_method] == null) | 956 if (this[_method] == null) |
| 2448 return `NoSuchMethodError: ${this[_message]}`; | 957 return `NoSuchMethodError: ${this[_message]}`; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 2461 this[_message] = message; | 970 this[_message] = message; |
| 2462 super.Error(); | 971 super.Error(); |
| 2463 } | 972 } |
| 2464 toString() { | 973 toString() { |
| 2465 return this[_message][dartx.isEmpty] ? 'Error' : `Error: ${this[_message]}
`; | 974 return this[_message][dartx.isEmpty] ? 'Error' : `Error: ${this[_message]}
`; |
| 2466 } | 975 } |
| 2467 } | 976 } |
| 2468 dart.setSignature(UnknownJsTypeError, { | 977 dart.setSignature(UnknownJsTypeError, { |
| 2469 constructors: () => ({UnknownJsTypeError: [UnknownJsTypeError, [core.String]
]}) | 978 constructors: () => ({UnknownJsTypeError: [UnknownJsTypeError, [core.String]
]}) |
| 2470 }); | 979 }); |
| 2471 function unwrapException(ex) { | |
| 2472 let saveStackTrace = error => { | |
| 2473 if (dart.is(error, core.Error)) { | |
| 2474 let thrownStackTrace = error.$thrownJsError; | |
| 2475 if (thrownStackTrace == null) { | |
| 2476 error.$thrownJsError = ex; | |
| 2477 } | |
| 2478 } | |
| 2479 return error; | |
| 2480 }; | |
| 2481 dart.fn(saveStackTrace); | |
| 2482 if (ex == null) | |
| 2483 return null; | |
| 2484 if (typeof ex !== "object") | |
| 2485 return ex; | |
| 2486 if ("dartException" in ex) { | |
| 2487 return saveStackTrace(ex.dartException); | |
| 2488 } else if (!("message" in ex)) { | |
| 2489 return ex; | |
| 2490 } | |
| 2491 let message = ex.message; | |
| 2492 if ("number" in ex && typeof ex.number == "number") { | |
| 2493 let number = ex.number; | |
| 2494 let ieErrorCode = dart.notNull(number) & 65535; | |
| 2495 let ieFacilityNumber = dart.notNull(number) >> 16 & 8191; | |
| 2496 if (ieFacilityNumber == 10) { | |
| 2497 switch (ieErrorCode) { | |
| 2498 case 438: | |
| 2499 { | |
| 2500 return saveStackTrace(new JsNoSuchMethodError(`${message} (Error ${i
eErrorCode})`, null)); | |
| 2501 } | |
| 2502 case 445: | |
| 2503 case 5007: | |
| 2504 { | |
| 2505 return saveStackTrace(new NullError(`${message} (Error ${ieErrorCode
})`, null)); | |
| 2506 } | |
| 2507 } | |
| 2508 } | |
| 2509 } | |
| 2510 if (ex instanceof TypeError) { | |
| 2511 let match = null; | |
| 2512 let nsme = TypeErrorDecoder.noSuchMethodPattern; | |
| 2513 let notClosure = TypeErrorDecoder.notClosurePattern; | |
| 2514 let nullCall = TypeErrorDecoder.nullCallPattern; | |
| 2515 let nullLiteralCall = TypeErrorDecoder.nullLiteralCallPattern; | |
| 2516 let undefCall = TypeErrorDecoder.undefinedCallPattern; | |
| 2517 let undefLiteralCall = TypeErrorDecoder.undefinedLiteralCallPattern; | |
| 2518 let nullProperty = TypeErrorDecoder.nullPropertyPattern; | |
| 2519 let nullLiteralProperty = TypeErrorDecoder.nullLiteralPropertyPattern; | |
| 2520 let undefProperty = TypeErrorDecoder.undefinedPropertyPattern; | |
| 2521 let undefLiteralProperty = TypeErrorDecoder.undefinedLiteralPropertyPatter
n; | |
| 2522 if ((match = dart.dsend(nsme, 'matchTypeError', message)) != null) { | |
| 2523 return saveStackTrace(new JsNoSuchMethodError(dart.as(message, core.Stri
ng), match)); | |
| 2524 } else if ((match = dart.dsend(notClosure, 'matchTypeError', message)) !=
null) { | |
| 2525 match.method = "call"; | |
| 2526 return saveStackTrace(new JsNoSuchMethodError(dart.as(message, core.Stri
ng), match)); | |
| 2527 } else if (dart.notNull((match = dart.dsend(nullCall, 'matchTypeError', me
ssage)) != null) || dart.notNull((match = dart.dsend(nullLiteralCall, 'matchType
Error', message)) != null) || dart.notNull((match = dart.dsend(undefCall, 'match
TypeError', message)) != null) || dart.notNull((match = dart.dsend(undefLiteralC
all, 'matchTypeError', message)) != null) || dart.notNull((match = dart.dsend(nu
llProperty, 'matchTypeError', message)) != null) || dart.notNull((match = dart.d
send(nullLiteralCall, 'matchTypeError', message)) != null) || dart.notNull((matc
h = dart.dsend(undefProperty, 'matchTypeError', message)) != null) || dart.notNu
ll((match = dart.dsend(undefLiteralProperty, 'matchTypeError', message)) != null
)) { | |
| 2528 return saveStackTrace(new NullError(dart.as(message, core.String), match
)); | |
| 2529 } | |
| 2530 return saveStackTrace(new UnknownJsTypeError(typeof message == 'string' ?
dart.as(message, core.String) : '')); | |
| 2531 } | |
| 2532 if (ex instanceof RangeError) { | |
| 2533 if (typeof message == 'string' && dart.notNull(contains(dart.as(message, c
ore.String), 'call stack'))) { | |
| 2534 return new core.StackOverflowError(); | |
| 2535 } | |
| 2536 return saveStackTrace(new core.ArgumentError()); | |
| 2537 } | |
| 2538 if (typeof InternalError == "function" && ex instanceof InternalError) { | |
| 2539 if (typeof message == 'string' && dart.notNull(dart.equals(message, 'too m
uch recursion'))) { | |
| 2540 return new core.StackOverflowError(); | |
| 2541 } | |
| 2542 } | |
| 2543 return ex; | |
| 2544 } | |
| 2545 dart.fn(unwrapException); | |
| 2546 function getTraceFromException(exception) { | 980 function getTraceFromException(exception) { |
| 2547 return new _StackTrace(exception); | 981 return new _StackTrace(exception); |
| 2548 } | 982 } |
| 2549 dart.fn(getTraceFromException, core.StackTrace, [core.Object]); | 983 dart.fn(getTraceFromException, core.StackTrace, [core.Object]); |
| 2550 let _exception = Symbol('_exception'); | 984 let _exception = Symbol('_exception'); |
| 2551 let _trace = Symbol('_trace'); | 985 let _trace = Symbol('_trace'); |
| 2552 class _StackTrace extends core.Object { | 986 class _StackTrace extends core.Object { |
| 2553 _StackTrace(exception) { | 987 _StackTrace(exception) { |
| 2554 this[_exception] = exception; | 988 this[_exception] = exception; |
| 2555 this[_trace] = null; | 989 this[_trace] = null; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2588 let value = getIndex(keyValuePairs, (() => { | 1022 let value = getIndex(keyValuePairs, (() => { |
| 2589 let x = index; | 1023 let x = index; |
| 2590 index = dart.notNull(x) + 1; | 1024 index = dart.notNull(x) + 1; |
| 2591 return x; | 1025 return x; |
| 2592 })()); | 1026 })()); |
| 2593 result.set(key, value); | 1027 result.set(key, value); |
| 2594 } | 1028 } |
| 2595 return result; | 1029 return result; |
| 2596 } | 1030 } |
| 2597 dart.fn(fillLiteralMap, core.Object, [core.Object, core.Map]); | 1031 dart.fn(fillLiteralMap, core.Object, [core.Object, core.Map]); |
| 2598 function invokeClosure(closure, isolate, numberOfArguments, arg1, arg2, arg3,
arg4) { | |
| 2599 if (numberOfArguments == 0) { | |
| 2600 return _foreign_helper.JS_CALL_IN_ISOLATE(isolate, dart.fn(() => dart.dcal
l(closure))); | |
| 2601 } else if (numberOfArguments == 1) { | |
| 2602 return _foreign_helper.JS_CALL_IN_ISOLATE(isolate, dart.fn(() => dart.dcal
l(closure, arg1))); | |
| 2603 } else if (numberOfArguments == 2) { | |
| 2604 return _foreign_helper.JS_CALL_IN_ISOLATE(isolate, dart.fn(() => dart.dcal
l(closure, arg1, arg2))); | |
| 2605 } else if (numberOfArguments == 3) { | |
| 2606 return _foreign_helper.JS_CALL_IN_ISOLATE(isolate, dart.fn(() => dart.dcal
l(closure, arg1, arg2, arg3))); | |
| 2607 } else if (numberOfArguments == 4) { | |
| 2608 return _foreign_helper.JS_CALL_IN_ISOLATE(isolate, dart.fn(() => dart.dcal
l(closure, arg1, arg2, arg3, arg4))); | |
| 2609 } else { | |
| 2610 throw core.Exception.new('Unsupported number of arguments for wrapped clos
ure'); | |
| 2611 } | |
| 2612 } | |
| 2613 dart.fn(invokeClosure, core.Object, [core.Function, core.Object, core.int, cor
e.Object, core.Object, core.Object, core.Object]); | |
| 2614 function convertDartClosureToJS(closure, arity) { | 1032 function convertDartClosureToJS(closure, arity) { |
| 2615 return closure; | 1033 return closure; |
| 2616 } | 1034 } |
| 2617 dart.fn(convertDartClosureToJS, core.Object, [core.Object, core.int]); | 1035 dart.fn(convertDartClosureToJS, core.Object, [core.Object, core.int]); |
| 2618 class Closure extends core.Object { | |
| 2619 Closure() { | |
| 2620 } | |
| 2621 static fromTearOff(receiver, functions, reflectionInfo, isStatic, jsArgument
s, propertyName) { | |
| 2622 _foreign_helper.JS_EFFECT(dart.fn(() => { | |
| 2623 BoundClosure.receiverOf(dart.as(void 0, BoundClosure)); | |
| 2624 BoundClosure.selfOf(dart.as(void 0, BoundClosure)); | |
| 2625 })); | |
| 2626 let func = functions[0]; | |
| 2627 let name = dart.as(func.$stubName, core.String); | |
| 2628 let callName = dart.as(func.$callName, core.String); | |
| 2629 func.$reflectionInfo = reflectionInfo; | |
| 2630 let info = ReflectionInfo.new(func); | |
| 2631 let functionType = info.functionType; | |
| 2632 let prototype = isStatic ? Object.create(new TearOffClosure().constructor.
prototype) : Object.create(new BoundClosure(null, null, null, null).constructor.
prototype); | |
| 2633 prototype.$initialize = prototype.constructor; | |
| 2634 let constructor = isStatic ? function() { | |
| 2635 this.$initialize(); | |
| 2636 } : Closure.isCsp ? function(a, b, c, d) { | |
| 2637 this.$initialize(a, b, c, d); | |
| 2638 } : new Function("a", "b", "c", "d", "this.$initialize(a,b,c,d);" + (() =>
{ | |
| 2639 let x = Closure.functionCounter; | |
| 2640 Closure.functionCounter = dart.notNull(x) + 1; | |
| 2641 return x; | |
| 2642 })()); | |
| 2643 prototype.constructor = constructor; | |
| 2644 constructor.prototype = prototype; | |
| 2645 let trampoline = func; | |
| 2646 let isIntercepted = false; | |
| 2647 if (!dart.notNull(isStatic)) { | |
| 2648 if (jsArguments.length == 1) { | |
| 2649 isIntercepted = true; | |
| 2650 } | |
| 2651 trampoline = Closure.forwardCallTo(receiver, func, isIntercepted); | |
| 2652 trampoline.$reflectionInfo = reflectionInfo; | |
| 2653 } else { | |
| 2654 prototype.$name = propertyName; | |
| 2655 } | |
| 2656 let signatureFunction = null; | |
| 2657 if (typeof functionType == "number") { | |
| 2658 let metadata = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names
.METADATA); | |
| 2659 signatureFunction = function(s) { | |
| 2660 return function() { | |
| 2661 return metadata[s]; | |
| 2662 }; | |
| 2663 }(functionType); | |
| 2664 } else if (!dart.notNull(isStatic) && typeof functionType == "function") { | |
| 2665 let getReceiver = isIntercepted ? _foreign_helper.RAW_DART_FUNCTION_REF(
BoundClosure.receiverOf) : _foreign_helper.RAW_DART_FUNCTION_REF(BoundClosure.se
lfOf); | |
| 2666 signatureFunction = function(f, r) { | |
| 2667 return function() { | |
| 2668 return f.apply({$receiver: r(this)}, arguments$); | |
| 2669 }; | |
| 2670 }(functionType, getReceiver); | |
| 2671 } else { | |
| 2672 throw 'Error in reflectionInfo.'; | |
| 2673 } | |
| 2674 prototype[_foreign_helper.JS_SIGNATURE_NAME()] = signatureFunction; | |
| 2675 prototype[callName] = trampoline; | |
| 2676 for (let i = 1; dart.notNull(i) < dart.notNull(functions.length); i = dart
.notNull(i) + 1) { | |
| 2677 let stub = functions[dartx.get](i); | |
| 2678 let stubCallName = stub.$callName; | |
| 2679 if (stubCallName != null) { | |
| 2680 prototype[stubCallName] = isStatic ? stub : Closure.forwardCallTo(rece
iver, stub, isIntercepted); | |
| 2681 } | |
| 2682 } | |
| 2683 prototype["call*"] = trampoline; | |
| 2684 return constructor; | |
| 2685 } | |
| 2686 static cspForwardCall(arity, isSuperCall, stubName, func) { | |
| 2687 let getSelf = _foreign_helper.RAW_DART_FUNCTION_REF(BoundClosure.selfOf); | |
| 2688 if (isSuperCall) | |
| 2689 arity = -1; | |
| 2690 switch (arity) { | |
| 2691 case 0: | |
| 2692 { | |
| 2693 return function(n, S) { | |
| 2694 return function() { | |
| 2695 return S(this)[n](); | |
| 2696 }; | |
| 2697 }(stubName, getSelf); | |
| 2698 } | |
| 2699 case 1: | |
| 2700 { | |
| 2701 return function(n, S) { | |
| 2702 return function(a) { | |
| 2703 return S(this)[n](a); | |
| 2704 }; | |
| 2705 }(stubName, getSelf); | |
| 2706 } | |
| 2707 case 2: | |
| 2708 { | |
| 2709 return function(n, S) { | |
| 2710 return function(a, b) { | |
| 2711 return S(this)[n](a, b); | |
| 2712 }; | |
| 2713 }(stubName, getSelf); | |
| 2714 } | |
| 2715 case 3: | |
| 2716 { | |
| 2717 return function(n, S) { | |
| 2718 return function(a, b, c) { | |
| 2719 return S(this)[n](a, b, c); | |
| 2720 }; | |
| 2721 }(stubName, getSelf); | |
| 2722 } | |
| 2723 case 4: | |
| 2724 { | |
| 2725 return function(n, S) { | |
| 2726 return function(a, b, c, d) { | |
| 2727 return S(this)[n](a, b, c, d); | |
| 2728 }; | |
| 2729 }(stubName, getSelf); | |
| 2730 } | |
| 2731 case 5: | |
| 2732 { | |
| 2733 return function(n, S) { | |
| 2734 return function(a, b, c, d, e) { | |
| 2735 return S(this)[n](a, b, c, d, e); | |
| 2736 }; | |
| 2737 }(stubName, getSelf); | |
| 2738 } | |
| 2739 default: | |
| 2740 { | |
| 2741 return function(f, s) { | |
| 2742 return function() { | |
| 2743 return f.apply(s(this), arguments$); | |
| 2744 }; | |
| 2745 }(func, getSelf); | |
| 2746 } | |
| 2747 } | |
| 2748 } | |
| 2749 static get isCsp() { | |
| 2750 return typeof dart_precompiled == "function"; | |
| 2751 } | |
| 2752 static forwardCallTo(receiver, func, isIntercepted) { | |
| 2753 if (isIntercepted) | |
| 2754 return Closure.forwardInterceptedCallTo(receiver, func); | |
| 2755 let stubName = dart.as(func.$stubName, core.String); | |
| 2756 let arity = func.length; | |
| 2757 let lookedUpFunction = receiver[stubName]; | |
| 2758 let isSuperCall = !dart.notNull(core.identical(func, lookedUpFunction)); | |
| 2759 if (dart.notNull(Closure.isCsp) || dart.notNull(isSuperCall) || dart.notNu
ll(arity) >= 27) { | |
| 2760 return Closure.cspForwardCall(arity, isSuperCall, stubName, func); | |
| 2761 } | |
| 2762 if (arity == 0) { | |
| 2763 return new Function('return function(){' + `return this.${BoundClosure.s
elfFieldName()}.${stubName}();` + `${(() => { | |
| 2764 let x = Closure.functionCounter; | |
| 2765 Closure.functionCounter = dart.notNull(x) + 1; | |
| 2766 return x; | |
| 2767 })()}` + '}')(); | |
| 2768 } | |
| 2769 dart.assert(1 <= dart.notNull(arity) && dart.notNull(arity) < 27); | |
| 2770 let arguments$ = "abcdefghijklmnopqrstuvwxyz".split("").splice(0, arity).j
oin(","); | |
| 2771 return new Function(`return function(${arguments$}){` + `return this.${Bou
ndClosure.selfFieldName()}.${stubName}(${arguments$});` + `${(() => { | |
| 2772 let x = Closure.functionCounter; | |
| 2773 Closure.functionCounter = dart.notNull(x) + 1; | |
| 2774 return x; | |
| 2775 })()}` + '}')(); | |
| 2776 } | |
| 2777 static cspForwardInterceptedCall(arity, isSuperCall, name, func) { | |
| 2778 let getSelf = _foreign_helper.RAW_DART_FUNCTION_REF(BoundClosure.selfOf); | |
| 2779 let getReceiver = _foreign_helper.RAW_DART_FUNCTION_REF(BoundClosure.recei
verOf); | |
| 2780 if (isSuperCall) | |
| 2781 arity = -1; | |
| 2782 switch (arity) { | |
| 2783 case 0: | |
| 2784 { | |
| 2785 throw new RuntimeError('Intercepted function with no arguments.'); | |
| 2786 } | |
| 2787 case 1: | |
| 2788 { | |
| 2789 return function(n, s, r) { | |
| 2790 return function() { | |
| 2791 return s(this)[n](r(this)); | |
| 2792 }; | |
| 2793 }(name, getSelf, getReceiver); | |
| 2794 } | |
| 2795 case 2: | |
| 2796 { | |
| 2797 return function(n, s, r) { | |
| 2798 return function(a) { | |
| 2799 return s(this)[n](r(this), a); | |
| 2800 }; | |
| 2801 }(name, getSelf, getReceiver); | |
| 2802 } | |
| 2803 case 3: | |
| 2804 { | |
| 2805 return function(n, s, r) { | |
| 2806 return function(a, b) { | |
| 2807 return s(this)[n](r(this), a, b); | |
| 2808 }; | |
| 2809 }(name, getSelf, getReceiver); | |
| 2810 } | |
| 2811 case 4: | |
| 2812 { | |
| 2813 return function(n, s, r) { | |
| 2814 return function(a, b, c) { | |
| 2815 return s(this)[n](r(this), a, b, c); | |
| 2816 }; | |
| 2817 }(name, getSelf, getReceiver); | |
| 2818 } | |
| 2819 case 5: | |
| 2820 { | |
| 2821 return function(n, s, r) { | |
| 2822 return function(a, b, c, d) { | |
| 2823 return s(this)[n](r(this), a, b, c, d); | |
| 2824 }; | |
| 2825 }(name, getSelf, getReceiver); | |
| 2826 } | |
| 2827 case 6: | |
| 2828 { | |
| 2829 return function(n, s, r) { | |
| 2830 return function(a, b, c, d, e) { | |
| 2831 return s(this)[n](r(this), a, b, c, d, e); | |
| 2832 }; | |
| 2833 }(name, getSelf, getReceiver); | |
| 2834 } | |
| 2835 default: | |
| 2836 { | |
| 2837 return function(f, s, r, a) { | |
| 2838 return function() { | |
| 2839 a = [r(this)]; | |
| 2840 Array.prototype.push.apply(a, arguments$); | |
| 2841 return f.apply(s(this), a); | |
| 2842 }; | |
| 2843 }(func, getSelf, getReceiver); | |
| 2844 } | |
| 2845 } | |
| 2846 } | |
| 2847 static forwardInterceptedCallTo(receiver, func) { | |
| 2848 let selfField = BoundClosure.selfFieldName(); | |
| 2849 let receiverField = BoundClosure.receiverFieldName(); | |
| 2850 let stubName = dart.as(func.$stubName, core.String); | |
| 2851 let arity = func.length; | |
| 2852 let isCsp = typeof dart_precompiled == "function"; | |
| 2853 let lookedUpFunction = receiver[stubName]; | |
| 2854 let isSuperCall = !dart.notNull(core.identical(func, lookedUpFunction)); | |
| 2855 if (dart.notNull(isCsp) || dart.notNull(isSuperCall) || dart.notNull(arity
) >= 28) { | |
| 2856 return Closure.cspForwardInterceptedCall(arity, isSuperCall, stubName, f
unc); | |
| 2857 } | |
| 2858 if (arity == 1) { | |
| 2859 return new Function('return function(){' + `return this.${selfField}.${s
tubName}(this.${receiverField});` + `${(() => { | |
| 2860 let x = Closure.functionCounter; | |
| 2861 Closure.functionCounter = dart.notNull(x) + 1; | |
| 2862 return x; | |
| 2863 })()}` + '}')(); | |
| 2864 } | |
| 2865 dart.assert(1 < dart.notNull(arity) && dart.notNull(arity) < 28); | |
| 2866 let arguments$ = "abcdefghijklmnopqrstuvwxyz".split("").splice(0, dart.not
Null(arity) - 1).join(","); | |
| 2867 return new Function(`return function(${arguments$}){` + `return this.${sel
fField}.${stubName}(this.${receiverField}, ${arguments$});` + `${(() => { | |
| 2868 let x = Closure.functionCounter; | |
| 2869 Closure.functionCounter = dart.notNull(x) + 1; | |
| 2870 return x; | |
| 2871 })()}` + '}')(); | |
| 2872 } | |
| 2873 toString() { | |
| 2874 return "Closure"; | |
| 2875 } | |
| 2876 } | |
| 2877 Closure[dart.implements] = () => [core.Function]; | |
| 2878 dart.setSignature(Closure, { | |
| 2879 constructors: () => ({Closure: [Closure, []]}), | |
| 2880 statics: () => ({ | |
| 2881 fromTearOff: [core.Object, [core.Object, core.List, core.List, core.bool,
core.Object, core.String]], | |
| 2882 cspForwardCall: [core.Object, [core.int, core.bool, core.String, core.Obje
ct]], | |
| 2883 forwardCallTo: [core.Object, [core.Object, core.Object, core.bool]], | |
| 2884 cspForwardInterceptedCall: [core.Object, [core.int, core.bool, core.String
, core.Object]], | |
| 2885 forwardInterceptedCallTo: [core.Object, [core.Object, core.Object]] | |
| 2886 }), | |
| 2887 names: ['fromTearOff', 'cspForwardCall', 'forwardCallTo', 'cspForwardInterce
ptedCall', 'forwardInterceptedCallTo'] | |
| 2888 }); | |
| 2889 Closure.FUNCTION_INDEX = 0; | |
| 2890 Closure.NAME_INDEX = 1; | |
| 2891 Closure.CALL_NAME_INDEX = 2; | |
| 2892 Closure.REQUIRED_PARAMETER_INDEX = 3; | |
| 2893 Closure.OPTIONAL_PARAMETER_INDEX = 4; | |
| 2894 Closure.DEFAULT_ARGUMENTS_INDEX = 5; | |
| 2895 Closure.functionCounter = 0; | |
| 2896 function closureFromTearOff(receiver, functions, reflectionInfo, isStatic, jsA
rguments, name) { | |
| 2897 return Closure.fromTearOff(receiver, _interceptors.JSArray.markFixedList(dar
t.as(functions, core.List)), _interceptors.JSArray.markFixedList(dart.as(reflect
ionInfo, core.List)), !!isStatic, jsArguments, name); | |
| 2898 } | |
| 2899 dart.fn(closureFromTearOff); | |
| 2900 class TearOffClosure extends Closure { | |
| 2901 TearOffClosure() { | |
| 2902 super.Closure(); | |
| 2903 } | |
| 2904 } | |
| 2905 let _self = Symbol('_self'); | |
| 2906 let _target = Symbol('_target'); | |
| 2907 let _name = Symbol('_name'); | |
| 2908 class BoundClosure extends TearOffClosure { | |
| 2909 BoundClosure(self, target, receiver, name) { | |
| 2910 this[_self] = self; | |
| 2911 this[_target] = target; | |
| 2912 this[_receiver] = receiver; | |
| 2913 this[_name] = name; | |
| 2914 } | |
| 2915 ['=='](other) { | |
| 2916 if (core.identical(this, other)) | |
| 2917 return true; | |
| 2918 if (!dart.is(other, BoundClosure)) | |
| 2919 return false; | |
| 2920 return this[_self] === dart.dload(other, _self) && this[_target] === dart.
dload(other, _target) && this[_receiver] === dart.dload(other, _receiver); | |
| 2921 } | |
| 2922 get hashCode() { | |
| 2923 let receiverHashCode = null; | |
| 2924 if (this[_receiver] == null) { | |
| 2925 receiverHashCode = Primitives.objectHashCode(this[_self]); | |
| 2926 } else if (typeof this[_receiver] != 'object') { | |
| 2927 receiverHashCode = dart.hashCode(this[_receiver]); | |
| 2928 } else { | |
| 2929 receiverHashCode = Primitives.objectHashCode(this[_receiver]); | |
| 2930 } | |
| 2931 return dart.notNull(receiverHashCode) ^ dart.notNull(Primitives.objectHash
Code(this[_target])); | |
| 2932 } | |
| 2933 static selfOf(closure) { | |
| 2934 return closure[_self]; | |
| 2935 } | |
| 2936 static targetOf(closure) { | |
| 2937 return closure[_target]; | |
| 2938 } | |
| 2939 static receiverOf(closure) { | |
| 2940 return closure[_receiver]; | |
| 2941 } | |
| 2942 static nameOf(closure) { | |
| 2943 return closure[_name]; | |
| 2944 } | |
| 2945 static selfFieldName() { | |
| 2946 if (BoundClosure.selfFieldNameCache == null) { | |
| 2947 BoundClosure.selfFieldNameCache = BoundClosure.computeFieldNamed('self')
; | |
| 2948 } | |
| 2949 return BoundClosure.selfFieldNameCache; | |
| 2950 } | |
| 2951 static receiverFieldName() { | |
| 2952 if (BoundClosure.receiverFieldNameCache == null) { | |
| 2953 BoundClosure.receiverFieldNameCache = BoundClosure.computeFieldNamed('re
ceiver'); | |
| 2954 } | |
| 2955 return BoundClosure.receiverFieldNameCache; | |
| 2956 } | |
| 2957 static computeFieldNamed(fieldName) { | |
| 2958 let template = new BoundClosure('self', 'target', 'receiver', 'name'); | |
| 2959 let names = _interceptors.JSArray.markFixedList(dart.as(Object.getOwnPrope
rtyNames(template), core.List)); | |
| 2960 for (let i = 0; dart.notNull(i) < dart.notNull(names.length); i = dart.not
Null(i) + 1) { | |
| 2961 let name = names[dartx.get](i); | |
| 2962 if (template[name] === fieldName) { | |
| 2963 return name; | |
| 2964 } | |
| 2965 } | |
| 2966 } | |
| 2967 } | |
| 2968 dart.setSignature(BoundClosure, { | |
| 2969 constructors: () => ({BoundClosure: [BoundClosure, [core.Object, core.Object
, core.Object, core.String]]}), | |
| 2970 statics: () => ({ | |
| 2971 selfOf: [core.Object, [BoundClosure]], | |
| 2972 targetOf: [core.Object, [BoundClosure]], | |
| 2973 receiverOf: [core.Object, [BoundClosure]], | |
| 2974 nameOf: [core.Object, [BoundClosure]], | |
| 2975 selfFieldName: [core.String, []], | |
| 2976 receiverFieldName: [core.String, []], | |
| 2977 computeFieldNamed: [core.String, [core.String]] | |
| 2978 }), | |
| 2979 names: ['selfOf', 'targetOf', 'receiverOf', 'nameOf', 'selfFieldName', 'rece
iverFieldName', 'computeFieldNamed'] | |
| 2980 }); | |
| 2981 BoundClosure.selfFieldNameCache = null; | |
| 2982 BoundClosure.receiverFieldNameCache = null; | |
| 2983 function jsHasOwnProperty(jsObject, property) { | 1036 function jsHasOwnProperty(jsObject, property) { |
| 2984 return jsObject.hasOwnProperty(property); | 1037 return jsObject.hasOwnProperty(property); |
| 2985 } | 1038 } |
| 2986 dart.fn(jsHasOwnProperty, core.bool, [core.Object, core.String]); | 1039 dart.fn(jsHasOwnProperty, core.bool, [core.Object, core.String]); |
| 2987 function jsPropertyAccess(jsObject, property) { | 1040 function jsPropertyAccess(jsObject, property) { |
| 2988 return jsObject[property]; | 1041 return jsObject[property]; |
| 2989 } | 1042 } |
| 2990 dart.fn(jsPropertyAccess, core.Object, [core.Object, core.String]); | 1043 dart.fn(jsPropertyAccess, core.Object, [core.Object, core.String]); |
| 2991 function getFallThroughError() { | 1044 function getFallThroughError() { |
| 2992 return new FallThroughErrorImplementation(); | 1045 return new FallThroughErrorImplementation(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 3009 constructors: () => ({Returns: [Returns, [core.String]]}) | 1062 constructors: () => ({Returns: [Returns, [core.String]]}) |
| 3010 }); | 1063 }); |
| 3011 class JSName extends core.Object { | 1064 class JSName extends core.Object { |
| 3012 JSName(name) { | 1065 JSName(name) { |
| 3013 this.name = name; | 1066 this.name = name; |
| 3014 } | 1067 } |
| 3015 } | 1068 } |
| 3016 dart.setSignature(JSName, { | 1069 dart.setSignature(JSName, { |
| 3017 constructors: () => ({JSName: [JSName, [core.String]]}) | 1070 constructors: () => ({JSName: [JSName, [core.String]]}) |
| 3018 }); | 1071 }); |
| 3019 function boolConversionCheck(value) { | |
| 3020 if (typeof value == 'boolean') | |
| 3021 return value; | |
| 3022 boolTypeCheck(value); | |
| 3023 dart.assert(value != null); | |
| 3024 return false; | |
| 3025 } | |
| 3026 dart.fn(boolConversionCheck); | |
| 3027 function stringTypeCheck(value) { | |
| 3028 if (value == null) | |
| 3029 return value; | |
| 3030 if (typeof value == 'string') | |
| 3031 return value; | |
| 3032 throw new TypeErrorImplementation(value, 'String'); | |
| 3033 } | |
| 3034 dart.fn(stringTypeCheck); | |
| 3035 function stringTypeCast(value) { | |
| 3036 if (typeof value == 'string' || dart.notNull(value == null)) | |
| 3037 return value; | |
| 3038 throw new CastErrorImplementation(Primitives.objectTypeName(value), 'String'
); | |
| 3039 } | |
| 3040 dart.fn(stringTypeCast); | |
| 3041 function doubleTypeCheck(value) { | |
| 3042 if (value == null) | |
| 3043 return value; | |
| 3044 if (typeof value == 'number') | |
| 3045 return value; | |
| 3046 throw new TypeErrorImplementation(value, 'double'); | |
| 3047 } | |
| 3048 dart.fn(doubleTypeCheck); | |
| 3049 function doubleTypeCast(value) { | |
| 3050 if (typeof value == 'number' || dart.notNull(value == null)) | |
| 3051 return value; | |
| 3052 throw new CastErrorImplementation(Primitives.objectTypeName(value), 'double'
); | |
| 3053 } | |
| 3054 dart.fn(doubleTypeCast); | |
| 3055 function numTypeCheck(value) { | |
| 3056 if (value == null) | |
| 3057 return value; | |
| 3058 if (dart.is(value, core.num)) | |
| 3059 return value; | |
| 3060 throw new TypeErrorImplementation(value, 'num'); | |
| 3061 } | |
| 3062 dart.fn(numTypeCheck); | |
| 3063 function numTypeCast(value) { | |
| 3064 if (dart.is(value, core.num) || dart.notNull(value == null)) | |
| 3065 return value; | |
| 3066 throw new CastErrorImplementation(Primitives.objectTypeName(value), 'num'); | |
| 3067 } | |
| 3068 dart.fn(numTypeCast); | |
| 3069 function boolTypeCheck(value) { | |
| 3070 if (value == null) | |
| 3071 return value; | |
| 3072 if (typeof value == 'boolean') | |
| 3073 return value; | |
| 3074 throw new TypeErrorImplementation(value, 'bool'); | |
| 3075 } | |
| 3076 dart.fn(boolTypeCheck); | |
| 3077 function boolTypeCast(value) { | |
| 3078 if (typeof value == 'boolean' || dart.notNull(value == null)) | |
| 3079 return value; | |
| 3080 throw new CastErrorImplementation(Primitives.objectTypeName(value), 'bool'); | |
| 3081 } | |
| 3082 dart.fn(boolTypeCast); | |
| 3083 function intTypeCheck(value) { | |
| 3084 if (value == null) | |
| 3085 return value; | |
| 3086 if (typeof value == 'number') | |
| 3087 return value; | |
| 3088 throw new TypeErrorImplementation(value, 'int'); | |
| 3089 } | |
| 3090 dart.fn(intTypeCheck); | |
| 3091 function intTypeCast(value) { | |
| 3092 if (typeof value == 'number' || dart.notNull(value == null)) | |
| 3093 return value; | |
| 3094 throw new CastErrorImplementation(Primitives.objectTypeName(value), 'int'); | |
| 3095 } | |
| 3096 dart.fn(intTypeCast); | |
| 3097 function propertyTypeError(value, property) { | |
| 3098 let name = dart.as(dart.dsend(property, 'substring', 3, dart.dload(property,
'length')), core.String); | |
| 3099 throw new TypeErrorImplementation(value, name); | |
| 3100 } | |
| 3101 dart.fn(propertyTypeError, dart.void, [core.Object, core.Object]); | |
| 3102 function propertyTypeCastError(value, property) { | |
| 3103 let actualType = Primitives.objectTypeName(value); | |
| 3104 let expectedType = dart.as(dart.dsend(property, 'substring', 3, dart.dload(p
roperty, 'length')), core.String); | |
| 3105 throw new CastErrorImplementation(actualType, expectedType); | |
| 3106 } | |
| 3107 dart.fn(propertyTypeCastError, dart.void, [core.Object, core.Object]); | |
| 3108 function propertyTypeCheck(value, property) { | |
| 3109 if (value == null) | |
| 3110 return value; | |
| 3111 if (!!value[property]) | |
| 3112 return value; | |
| 3113 propertyTypeError(value, property); | |
| 3114 } | |
| 3115 dart.fn(propertyTypeCheck); | |
| 3116 function propertyTypeCast(value, property) { | |
| 3117 if (dart.notNull(value == null) || !!value[property]) | |
| 3118 return value; | |
| 3119 propertyTypeCastError(value, property); | |
| 3120 } | |
| 3121 dart.fn(propertyTypeCast); | |
| 3122 function interceptedTypeCheck(value, property) { | |
| 3123 if (value == null) | |
| 3124 return value; | |
| 3125 if (dart.notNull(core.identical(typeof value, 'object')) && _interceptors.ge
tInterceptor(value)[property]) { | |
| 3126 return value; | |
| 3127 } | |
| 3128 propertyTypeError(value, property); | |
| 3129 } | |
| 3130 dart.fn(interceptedTypeCheck); | |
| 3131 function interceptedTypeCast(value, property) { | |
| 3132 if (dart.notNull(value == null) || typeof value === "object" && _interceptor
s.getInterceptor(value)[property]) { | |
| 3133 return value; | |
| 3134 } | |
| 3135 propertyTypeCastError(value, property); | |
| 3136 } | |
| 3137 dart.fn(interceptedTypeCast); | |
| 3138 function numberOrStringSuperTypeCheck(value, property) { | |
| 3139 if (value == null) | |
| 3140 return value; | |
| 3141 if (typeof value == 'string') | |
| 3142 return value; | |
| 3143 if (dart.is(value, core.num)) | |
| 3144 return value; | |
| 3145 if (!!value[property]) | |
| 3146 return value; | |
| 3147 propertyTypeError(value, property); | |
| 3148 } | |
| 3149 dart.fn(numberOrStringSuperTypeCheck); | |
| 3150 function numberOrStringSuperTypeCast(value, property) { | |
| 3151 if (typeof value == 'string') | |
| 3152 return value; | |
| 3153 if (dart.is(value, core.num)) | |
| 3154 return value; | |
| 3155 return propertyTypeCast(value, property); | |
| 3156 } | |
| 3157 dart.fn(numberOrStringSuperTypeCast); | |
| 3158 function numberOrStringSuperNativeTypeCheck(value, property) { | |
| 3159 if (value == null) | |
| 3160 return value; | |
| 3161 if (typeof value == 'string') | |
| 3162 return value; | |
| 3163 if (dart.is(value, core.num)) | |
| 3164 return value; | |
| 3165 if (_interceptors.getInterceptor(value)[property]) | |
| 3166 return value; | |
| 3167 propertyTypeError(value, property); | |
| 3168 } | |
| 3169 dart.fn(numberOrStringSuperNativeTypeCheck); | |
| 3170 function numberOrStringSuperNativeTypeCast(value, property) { | |
| 3171 if (value == null) | |
| 3172 return value; | |
| 3173 if (typeof value == 'string') | |
| 3174 return value; | |
| 3175 if (dart.is(value, core.num)) | |
| 3176 return value; | |
| 3177 if (_interceptors.getInterceptor(value)[property]) | |
| 3178 return value; | |
| 3179 propertyTypeCastError(value, property); | |
| 3180 } | |
| 3181 dart.fn(numberOrStringSuperNativeTypeCast); | |
| 3182 function stringSuperTypeCheck(value, property) { | |
| 3183 if (value == null) | |
| 3184 return value; | |
| 3185 if (typeof value == 'string') | |
| 3186 return value; | |
| 3187 if (!!value[property]) | |
| 3188 return value; | |
| 3189 propertyTypeError(value, property); | |
| 3190 } | |
| 3191 dart.fn(stringSuperTypeCheck); | |
| 3192 function stringSuperTypeCast(value, property) { | |
| 3193 if (typeof value == 'string') | |
| 3194 return value; | |
| 3195 return propertyTypeCast(value, property); | |
| 3196 } | |
| 3197 dart.fn(stringSuperTypeCast); | |
| 3198 function stringSuperNativeTypeCheck(value, property) { | |
| 3199 if (value == null) | |
| 3200 return value; | |
| 3201 if (typeof value == 'string') | |
| 3202 return value; | |
| 3203 if (_interceptors.getInterceptor(value)[property]) | |
| 3204 return value; | |
| 3205 propertyTypeError(value, property); | |
| 3206 } | |
| 3207 dart.fn(stringSuperNativeTypeCheck); | |
| 3208 function stringSuperNativeTypeCast(value, property) { | |
| 3209 if (typeof value == 'string' || dart.notNull(value == null)) | |
| 3210 return value; | |
| 3211 if (_interceptors.getInterceptor(value)[property]) | |
| 3212 return value; | |
| 3213 propertyTypeCastError(value, property); | |
| 3214 } | |
| 3215 dart.fn(stringSuperNativeTypeCast); | |
| 3216 function listTypeCheck(value) { | |
| 3217 if (value == null) | |
| 3218 return value; | |
| 3219 if (dart.is(value, core.List)) | |
| 3220 return value; | |
| 3221 throw new TypeErrorImplementation(value, 'List'); | |
| 3222 } | |
| 3223 dart.fn(listTypeCheck); | |
| 3224 function listTypeCast(value) { | |
| 3225 if (dart.is(value, core.List) || dart.notNull(value == null)) | |
| 3226 return value; | |
| 3227 throw new CastErrorImplementation(Primitives.objectTypeName(value), 'List'); | |
| 3228 } | |
| 3229 dart.fn(listTypeCast); | |
| 3230 function listSuperTypeCheck(value, property) { | |
| 3231 if (value == null) | |
| 3232 return value; | |
| 3233 if (dart.is(value, core.List)) | |
| 3234 return value; | |
| 3235 if (!!value[property]) | |
| 3236 return value; | |
| 3237 propertyTypeError(value, property); | |
| 3238 } | |
| 3239 dart.fn(listSuperTypeCheck); | |
| 3240 function listSuperTypeCast(value, property) { | |
| 3241 if (dart.is(value, core.List)) | |
| 3242 return value; | |
| 3243 return propertyTypeCast(value, property); | |
| 3244 } | |
| 3245 dart.fn(listSuperTypeCast); | |
| 3246 function listSuperNativeTypeCheck(value, property) { | |
| 3247 if (value == null) | |
| 3248 return value; | |
| 3249 if (dart.is(value, core.List)) | |
| 3250 return value; | |
| 3251 if (_interceptors.getInterceptor(value)[property]) | |
| 3252 return value; | |
| 3253 propertyTypeError(value, property); | |
| 3254 } | |
| 3255 dart.fn(listSuperNativeTypeCheck); | |
| 3256 function listSuperNativeTypeCast(value, property) { | |
| 3257 if (dart.is(value, core.List) || dart.notNull(value == null)) | |
| 3258 return value; | |
| 3259 if (_interceptors.getInterceptor(value)[property]) | |
| 3260 return value; | |
| 3261 propertyTypeCastError(value, property); | |
| 3262 } | |
| 3263 dart.fn(listSuperNativeTypeCast); | |
| 3264 function voidTypeCheck(value) { | |
| 3265 if (value == null) | |
| 3266 return value; | |
| 3267 throw new TypeErrorImplementation(value, 'void'); | |
| 3268 } | |
| 3269 dart.fn(voidTypeCheck); | |
| 3270 function checkMalformedType(value, message) { | |
| 3271 if (value == null) | |
| 3272 return value; | |
| 3273 throw new TypeErrorImplementation.fromMessage(dart.as(message, core.String))
; | |
| 3274 } | |
| 3275 dart.fn(checkMalformedType); | |
| 3276 function checkDeferredIsLoaded(loadId, uri) { | |
| 3277 if (!dart.notNull(exports._loadedLibraries.contains(loadId))) { | |
| 3278 throw new DeferredNotLoadedError(uri); | |
| 3279 } | |
| 3280 } | |
| 3281 dart.fn(checkDeferredIsLoaded, dart.void, [core.String, core.String]); | |
| 3282 dart.defineLazyClass(exports, { | 1072 dart.defineLazyClass(exports, { |
| 3283 get JavaScriptIndexingBehavior() { | 1073 get JavaScriptIndexingBehavior() { |
| 3284 class JavaScriptIndexingBehavior extends _interceptors.JSMutableIndexable
{} | 1074 class JavaScriptIndexingBehavior extends _interceptors.JSMutableIndexable
{} |
| 3285 return JavaScriptIndexingBehavior; | 1075 return JavaScriptIndexingBehavior; |
| 3286 } | 1076 } |
| 3287 }); | 1077 }); |
| 3288 class TypeErrorImplementation extends core.Error { | 1078 class TypeErrorImplementation extends core.Error { |
| 3289 TypeErrorImplementation(value, type) { | 1079 TypeErrorImplementation(value, type) { |
| 3290 this.message = `type '${Primitives.objectTypeName(value)}' is not a subtyp
e ` + `of type '${type}'`; | 1080 this.message = `type '${Primitives.objectTypeName(value)}' is not a subtyp
e ` + `of type '${type}'`; |
| 3291 super.Error(); | 1081 super.Error(); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3323 FallThroughErrorImplementation() { | 1113 FallThroughErrorImplementation() { |
| 3324 super.FallThroughError(); | 1114 super.FallThroughError(); |
| 3325 } | 1115 } |
| 3326 toString() { | 1116 toString() { |
| 3327 return "Switch case fall-through."; | 1117 return "Switch case fall-through."; |
| 3328 } | 1118 } |
| 3329 } | 1119 } |
| 3330 dart.setSignature(FallThroughErrorImplementation, { | 1120 dart.setSignature(FallThroughErrorImplementation, { |
| 3331 constructors: () => ({FallThroughErrorImplementation: [FallThroughErrorImple
mentation, []]}) | 1121 constructors: () => ({FallThroughErrorImplementation: [FallThroughErrorImple
mentation, []]}) |
| 3332 }); | 1122 }); |
| 3333 function assertHelper(condition) { | |
| 3334 if (!(typeof condition == 'boolean')) { | |
| 3335 if (dart.is(condition, core.Function)) | |
| 3336 condition = dart.dcall(condition); | |
| 3337 if (!(typeof condition == 'boolean')) { | |
| 3338 throw new TypeErrorImplementation(condition, 'bool'); | |
| 3339 } | |
| 3340 } | |
| 3341 if (!dart.equals(true, condition)) | |
| 3342 throw new core.AssertionError(); | |
| 3343 } | |
| 3344 dart.fn(assertHelper, dart.void, [core.Object]); | |
| 3345 function throwNoSuchMethod(obj, name, arguments$, expectedArgumentNames) { | |
| 3346 let memberName = new _internal.Symbol.unvalidated(dart.as(name, core.String)
); | |
| 3347 throw new core.NoSuchMethodError(obj, memberName, dart.as(arguments$, core.L
ist), core.Map$(core.Symbol, core.Object).new(), dart.as(expectedArgumentNames,
core.List)); | |
| 3348 } | |
| 3349 dart.fn(throwNoSuchMethod, dart.void, [core.Object, core.Object, core.Object,
core.Object]); | |
| 3350 function throwCyclicInit(staticName) { | |
| 3351 throw new core.CyclicInitializationError(`Cyclic initialization for static $
{staticName}`); | |
| 3352 } | |
| 3353 dart.fn(throwCyclicInit, dart.void, [core.String]); | |
| 3354 class RuntimeError extends core.Error { | 1123 class RuntimeError extends core.Error { |
| 3355 RuntimeError(message) { | 1124 RuntimeError(message) { |
| 3356 this.message = message; | 1125 this.message = message; |
| 3357 super.Error(); | 1126 super.Error(); |
| 3358 } | 1127 } |
| 3359 toString() { | 1128 toString() { |
| 3360 return `RuntimeError: ${this.message}`; | 1129 return `RuntimeError: ${this.message}`; |
| 3361 } | 1130 } |
| 3362 } | 1131 } |
| 3363 dart.setSignature(RuntimeError, { | 1132 dart.setSignature(RuntimeError, { |
| 3364 constructors: () => ({RuntimeError: [RuntimeError, [core.Object]]}) | 1133 constructors: () => ({RuntimeError: [RuntimeError, [core.Object]]}) |
| 3365 }); | 1134 }); |
| 3366 class DeferredNotLoadedError extends core.Error { | |
| 3367 DeferredNotLoadedError(libraryName) { | |
| 3368 this.libraryName = libraryName; | |
| 3369 super.Error(); | |
| 3370 } | |
| 3371 toString() { | |
| 3372 return `Deferred library ${this.libraryName} was not loaded.`; | |
| 3373 } | |
| 3374 } | |
| 3375 DeferredNotLoadedError[dart.implements] = () => [core.NoSuchMethodError]; | |
| 3376 dart.setSignature(DeferredNotLoadedError, { | |
| 3377 constructors: () => ({DeferredNotLoadedError: [DeferredNotLoadedError, [core
.String]]}) | |
| 3378 }); | |
| 3379 class RuntimeType extends core.Object { | |
| 3380 RuntimeType() { | |
| 3381 } | |
| 3382 } | |
| 3383 dart.setSignature(RuntimeType, { | |
| 3384 constructors: () => ({RuntimeType: [RuntimeType, []]}) | |
| 3385 }); | |
| 3386 let _isTest = Symbol('_isTest'); | |
| 3387 let _extractFunctionTypeObjectFrom = Symbol('_extractFunctionTypeObjectFrom'); | |
| 3388 let _asCheck = Symbol('_asCheck'); | |
| 3389 let _check = Symbol('_check'); | |
| 3390 let _assertCheck = Symbol('_assertCheck'); | |
| 3391 class RuntimeFunctionType extends RuntimeType { | |
| 3392 RuntimeFunctionType(returnType, parameterTypes, optionalParameterTypes, name
dParameters) { | |
| 3393 this.returnType = returnType; | |
| 3394 this.parameterTypes = parameterTypes; | |
| 3395 this.optionalParameterTypes = optionalParameterTypes; | |
| 3396 this.namedParameters = namedParameters; | |
| 3397 super.RuntimeType(); | |
| 3398 } | |
| 3399 get isVoid() { | |
| 3400 return dart.is(this.returnType, VoidRuntimeType); | |
| 3401 } | |
| 3402 [_isTest](expression) { | |
| 3403 let functionTypeObject = this[_extractFunctionTypeObjectFrom](expression); | |
| 3404 return functionTypeObject == null ? false : isFunctionSubtype(functionType
Object, this.toRti()); | |
| 3405 } | |
| 3406 [_asCheck](expression) { | |
| 3407 return this[_check](expression, true); | |
| 3408 } | |
| 3409 [_assertCheck](expression) { | |
| 3410 if (RuntimeFunctionType.inAssert) | |
| 3411 return null; | |
| 3412 RuntimeFunctionType.inAssert = true; | |
| 3413 try { | |
| 3414 return this[_check](expression, false); | |
| 3415 } finally { | |
| 3416 RuntimeFunctionType.inAssert = false; | |
| 3417 } | |
| 3418 } | |
| 3419 [_check](expression, isCast) { | |
| 3420 if (expression == null) | |
| 3421 return null; | |
| 3422 if (this[_isTest](expression)) | |
| 3423 return expression; | |
| 3424 let self = dart.toString(new FunctionTypeInfoDecoderRing(this.toRti())); | |
| 3425 if (isCast) { | |
| 3426 let functionTypeObject = this[_extractFunctionTypeObjectFrom](expression
); | |
| 3427 let pretty = null; | |
| 3428 if (functionTypeObject != null) { | |
| 3429 pretty = dart.toString(new FunctionTypeInfoDecoderRing(functionTypeObj
ect)); | |
| 3430 } else { | |
| 3431 pretty = Primitives.objectTypeName(expression); | |
| 3432 } | |
| 3433 throw new CastErrorImplementation(pretty, self); | |
| 3434 } else { | |
| 3435 throw new TypeErrorImplementation(expression, self); | |
| 3436 } | |
| 3437 } | |
| 3438 [_extractFunctionTypeObjectFrom](o) { | |
| 3439 let interceptor = _interceptors.getInterceptor(o); | |
| 3440 return _foreign_helper.JS_SIGNATURE_NAME() in interceptor ? interceptor[_f
oreign_helper.JS_SIGNATURE_NAME()]() : null; | |
| 3441 } | |
| 3442 toRti() { | |
| 3443 let result = {[_foreign_helper.JS_FUNCTION_TYPE_TAG()]: "dynafunc"}; | |
| 3444 if (this.isVoid) { | |
| 3445 result[_foreign_helper.JS_FUNCTION_TYPE_VOID_RETURN_TAG()] = true; | |
| 3446 } else { | |
| 3447 if (!dart.is(this.returnType, DynamicRuntimeType)) { | |
| 3448 result[_foreign_helper.JS_FUNCTION_TYPE_RETURN_TYPE_TAG()] = this.retu
rnType.toRti(); | |
| 3449 } | |
| 3450 } | |
| 3451 if (dart.notNull(this.parameterTypes != null) && !dart.notNull(this.parame
terTypes[dartx.isEmpty])) { | |
| 3452 result[_foreign_helper.JS_FUNCTION_TYPE_REQUIRED_PARAMETERS_TAG()] = Run
timeFunctionType.listToRti(this.parameterTypes); | |
| 3453 } | |
| 3454 if (dart.notNull(this.optionalParameterTypes != null) && !dart.notNull(thi
s.optionalParameterTypes[dartx.isEmpty])) { | |
| 3455 result[_foreign_helper.JS_FUNCTION_TYPE_OPTIONAL_PARAMETERS_TAG()] = Run
timeFunctionType.listToRti(this.optionalParameterTypes); | |
| 3456 } | |
| 3457 if (this.namedParameters != null) { | |
| 3458 let namedRti = Object.create(null); | |
| 3459 let keys = _js_names.extractKeys(this.namedParameters); | |
| 3460 for (let i = 0; dart.notNull(i) < dart.notNull(keys.length); i = dart.no
tNull(i) + 1) { | |
| 3461 let name = keys[dartx.get](i); | |
| 3462 let rti = dart.dsend(this.namedParameters[name], 'toRti'); | |
| 3463 namedRti[name] = rti; | |
| 3464 } | |
| 3465 result[_foreign_helper.JS_FUNCTION_TYPE_NAMED_PARAMETERS_TAG()] = namedR
ti; | |
| 3466 } | |
| 3467 return result; | |
| 3468 } | |
| 3469 static listToRti(list) { | |
| 3470 list = list; | |
| 3471 let result = []; | |
| 3472 for (let i = 0; dart.notNull(i) < dart.notNull(dart.as(dart.dload(list, 'l
ength'), core.num)); i = dart.notNull(i) + 1) { | |
| 3473 result.push(dart.dsend(dart.dindex(list, i), 'toRti')); | |
| 3474 } | |
| 3475 return result; | |
| 3476 } | |
| 3477 toString() { | |
| 3478 let result = '('; | |
| 3479 let needsComma = false; | |
| 3480 if (this.parameterTypes != null) { | |
| 3481 for (let i = 0; dart.notNull(i) < dart.notNull(this.parameterTypes.lengt
h); i = dart.notNull(i) + 1) { | |
| 3482 let type = this.parameterTypes[dartx.get](i); | |
| 3483 if (needsComma) { | |
| 3484 result = dart.notNull(result) + ', '; | |
| 3485 } | |
| 3486 result = dart.notNull(result) + `${type}`; | |
| 3487 needsComma = true; | |
| 3488 } | |
| 3489 } | |
| 3490 if (dart.notNull(this.optionalParameterTypes != null) && !dart.notNull(thi
s.optionalParameterTypes[dartx.isEmpty])) { | |
| 3491 if (needsComma) { | |
| 3492 result = dart.notNull(result) + ', '; | |
| 3493 } | |
| 3494 needsComma = false; | |
| 3495 result = dart.notNull(result) + '['; | |
| 3496 for (let i = 0; dart.notNull(i) < dart.notNull(this.optionalParameterTyp
es.length); i = dart.notNull(i) + 1) { | |
| 3497 let type = this.optionalParameterTypes[dartx.get](i); | |
| 3498 if (needsComma) { | |
| 3499 result = dart.notNull(result) + ', '; | |
| 3500 } | |
| 3501 result = dart.notNull(result) + `${type}`; | |
| 3502 needsComma = true; | |
| 3503 } | |
| 3504 result = dart.notNull(result) + ']'; | |
| 3505 } else if (this.namedParameters != null) { | |
| 3506 if (needsComma) { | |
| 3507 result = dart.notNull(result) + ', '; | |
| 3508 } | |
| 3509 needsComma = false; | |
| 3510 result = dart.notNull(result) + '{'; | |
| 3511 let keys = _js_names.extractKeys(this.namedParameters); | |
| 3512 for (let i = 0; dart.notNull(i) < dart.notNull(keys.length); i = dart.no
tNull(i) + 1) { | |
| 3513 let name = keys[dartx.get](i); | |
| 3514 if (needsComma) { | |
| 3515 result = dart.notNull(result) + ', '; | |
| 3516 } | |
| 3517 let rti = dart.dsend(this.namedParameters[name], 'toRti'); | |
| 3518 result = dart.notNull(result) + `${rti} ${name}`; | |
| 3519 needsComma = true; | |
| 3520 } | |
| 3521 result = dart.notNull(result) + '}'; | |
| 3522 } | |
| 3523 result = dart.notNull(result) + `) -> ${this.returnType}`; | |
| 3524 return result; | |
| 3525 } | |
| 3526 } | |
| 3527 dart.setSignature(RuntimeFunctionType, { | |
| 3528 constructors: () => ({RuntimeFunctionType: [RuntimeFunctionType, [RuntimeTyp
e, core.List$(RuntimeType), core.List$(RuntimeType), core.Object]]}), | |
| 3529 methods: () => ({ | |
| 3530 [_isTest]: [core.bool, [core.Object]], | |
| 3531 [_asCheck]: [core.Object, [core.Object]], | |
| 3532 [_assertCheck]: [core.Object, [core.Object]], | |
| 3533 [_check]: [core.Object, [core.Object, core.bool]], | |
| 3534 [_extractFunctionTypeObjectFrom]: [core.Object, [core.Object]], | |
| 3535 toRti: [core.Object, []] | |
| 3536 }), | |
| 3537 statics: () => ({listToRti: [core.Object, [core.Object]]}), | |
| 3538 names: ['listToRti'] | |
| 3539 }); | |
| 3540 RuntimeFunctionType.inAssert = false; | |
| 3541 function buildFunctionType(returnType, parameterTypes, optionalParameterTypes)
{ | |
| 3542 return new RuntimeFunctionType(dart.as(returnType, RuntimeType), dart.as(par
ameterTypes, core.List$(RuntimeType)), dart.as(optionalParameterTypes, core.List
$(RuntimeType)), null); | |
| 3543 } | |
| 3544 dart.fn(buildFunctionType, RuntimeFunctionType, [core.Object, core.Object, cor
e.Object]); | |
| 3545 function buildNamedFunctionType(returnType, parameterTypes, namedParameters) { | |
| 3546 return new RuntimeFunctionType(dart.as(returnType, RuntimeType), dart.as(par
ameterTypes, core.List$(RuntimeType)), null, namedParameters); | |
| 3547 } | |
| 3548 dart.fn(buildNamedFunctionType, RuntimeFunctionType, [core.Object, core.Object
, core.Object]); | |
| 3549 function buildInterfaceType(rti, typeArguments) { | |
| 3550 let name = dart.as(rti.name, core.String); | |
| 3551 if (dart.notNull(typeArguments == null) || dart.notNull(dart.as(dart.dload(t
ypeArguments, 'isEmpty'), core.bool))) { | |
| 3552 return new RuntimeTypePlain(name); | |
| 3553 } | |
| 3554 return new RuntimeTypeGeneric(name, dart.as(typeArguments, core.List$(Runtim
eType)), null); | |
| 3555 } | |
| 3556 dart.fn(buildInterfaceType, RuntimeType, [core.Object, core.Object]); | |
| 3557 class DynamicRuntimeType extends RuntimeType { | |
| 3558 DynamicRuntimeType() { | |
| 3559 super.RuntimeType(); | |
| 3560 } | |
| 3561 toString() { | |
| 3562 return 'dynamic'; | |
| 3563 } | |
| 3564 toRti() { | |
| 3565 return null; | |
| 3566 } | |
| 3567 } | |
| 3568 dart.setSignature(DynamicRuntimeType, { | |
| 3569 constructors: () => ({DynamicRuntimeType: [DynamicRuntimeType, []]}), | |
| 3570 methods: () => ({toRti: [core.Object, []]}) | |
| 3571 }); | |
| 3572 function getDynamicRuntimeType() { | |
| 3573 return dart.const(new DynamicRuntimeType()); | |
| 3574 } | |
| 3575 dart.fn(getDynamicRuntimeType, RuntimeType, []); | |
| 3576 class VoidRuntimeType extends RuntimeType { | |
| 3577 VoidRuntimeType() { | |
| 3578 super.RuntimeType(); | |
| 3579 } | |
| 3580 toString() { | |
| 3581 return 'void'; | |
| 3582 } | |
| 3583 toRti() { | |
| 3584 return dart.throw_('internal error'); | |
| 3585 } | |
| 3586 } | |
| 3587 dart.setSignature(VoidRuntimeType, { | |
| 3588 constructors: () => ({VoidRuntimeType: [VoidRuntimeType, []]}), | |
| 3589 methods: () => ({toRti: [core.Object, []]}) | |
| 3590 }); | |
| 3591 function getVoidRuntimeType() { | |
| 3592 return dart.const(new VoidRuntimeType()); | |
| 3593 } | |
| 3594 dart.fn(getVoidRuntimeType, RuntimeType, []); | |
| 3595 function functionTypeTestMetaHelper() { | |
| 3596 let dyn = x; | |
| 3597 let dyn2 = x; | |
| 3598 let fixedListOrNull = dart.as(x, core.List); | |
| 3599 let fixedListOrNull2 = dart.as(x, core.List); | |
| 3600 let fixedList = dart.as(x, core.List); | |
| 3601 let jsObject = x; | |
| 3602 buildFunctionType(dyn, fixedListOrNull, fixedListOrNull2); | |
| 3603 buildNamedFunctionType(dyn, fixedList, jsObject); | |
| 3604 buildInterfaceType(dyn, fixedListOrNull); | |
| 3605 getDynamicRuntimeType(); | |
| 3606 getVoidRuntimeType(); | |
| 3607 convertRtiToRuntimeType(dyn); | |
| 3608 dart.dsend(dyn, _isTest, dyn2); | |
| 3609 dart.dsend(dyn, _asCheck, dyn2); | |
| 3610 dart.dsend(dyn, _assertCheck, dyn2); | |
| 3611 } | |
| 3612 dart.fn(functionTypeTestMetaHelper); | |
| 3613 function convertRtiToRuntimeType(rti) { | |
| 3614 if (rti == null) { | |
| 3615 return getDynamicRuntimeType(); | |
| 3616 } else if (typeof rti == "function") { | |
| 3617 return new RuntimeTypePlain(rti.name); | |
| 3618 } else if (rti.constructor == Array) { | |
| 3619 let list = dart.as(rti, core.List); | |
| 3620 let name = list[dartx.get](0).name; | |
| 3621 let arguments$ = []; | |
| 3622 for (let i = 1; dart.notNull(i) < dart.notNull(list.length); i = dart.notN
ull(i) + 1) { | |
| 3623 arguments$[dartx.add](convertRtiToRuntimeType(list[dartx.get](i))); | |
| 3624 } | |
| 3625 return new RuntimeTypeGeneric(name, dart.as(arguments$, core.List$(Runtime
Type)), rti); | |
| 3626 } else if ("func" in rti) { | |
| 3627 return new FunctionTypeInfoDecoderRing(rti).toRuntimeType(); | |
| 3628 } else { | |
| 3629 throw new RuntimeError("Cannot convert " + `'${JSON.stringify(rti)}' to Ru
ntimeType.`); | |
| 3630 } | |
| 3631 } | |
| 3632 dart.fn(convertRtiToRuntimeType, RuntimeType, [core.Object]); | |
| 3633 class RuntimeTypePlain extends RuntimeType { | |
| 3634 RuntimeTypePlain(name) { | |
| 3635 this.name = name; | |
| 3636 super.RuntimeType(); | |
| 3637 } | |
| 3638 toRti() { | |
| 3639 let allClasses = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names
.ALL_CLASSES); | |
| 3640 let rti = allClasses[this.name]; | |
| 3641 if (rti == null) | |
| 3642 throw `no type for '${this.name}'`; | |
| 3643 return rti; | |
| 3644 } | |
| 3645 toString() { | |
| 3646 return this.name; | |
| 3647 } | |
| 3648 } | |
| 3649 dart.setSignature(RuntimeTypePlain, { | |
| 3650 constructors: () => ({RuntimeTypePlain: [RuntimeTypePlain, [core.String]]}), | |
| 3651 methods: () => ({toRti: [core.Object, []]}) | |
| 3652 }); | |
| 3653 class RuntimeTypeGeneric extends RuntimeType { | |
| 3654 RuntimeTypeGeneric(name, arguments$, rti) { | |
| 3655 this.name = name; | |
| 3656 this.arguments = arguments$; | |
| 3657 this.rti = rti; | |
| 3658 super.RuntimeType(); | |
| 3659 } | |
| 3660 toRti() { | |
| 3661 if (this.rti != null) | |
| 3662 return this.rti; | |
| 3663 let allClasses = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names
.ALL_CLASSES); | |
| 3664 let result = [allClasses[this.name]]; | |
| 3665 if (dart.dindex(result, 0) == null) { | |
| 3666 throw `no type for '${this.name}<...>'`; | |
| 3667 } | |
| 3668 for (let argument of this.arguments) { | |
| 3669 result.push(argument.toRti()); | |
| 3670 } | |
| 3671 return this.rti = result; | |
| 3672 } | |
| 3673 toString() { | |
| 3674 return `${this.name}<${this.arguments[dartx.join](", ")}>`; | |
| 3675 } | |
| 3676 } | |
| 3677 dart.setSignature(RuntimeTypeGeneric, { | |
| 3678 constructors: () => ({RuntimeTypeGeneric: [RuntimeTypeGeneric, [core.String,
core.List$(RuntimeType), core.Object]]}), | |
| 3679 methods: () => ({toRti: [core.Object, []]}) | |
| 3680 }); | |
| 3681 let _typeData = Symbol('_typeData'); | |
| 3682 let _cachedToString = Symbol('_cachedToString'); | |
| 3683 let _hasReturnType = Symbol('_hasReturnType'); | |
| 3684 let _returnType = Symbol('_returnType'); | |
| 3685 let _isVoid = Symbol('_isVoid'); | |
| 3686 let _hasArguments = Symbol('_hasArguments'); | |
| 3687 let _hasOptionalArguments = Symbol('_hasOptionalArguments'); | |
| 3688 let _optionalArguments = Symbol('_optionalArguments'); | |
| 3689 let _hasNamedArguments = Symbol('_hasNamedArguments'); | |
| 3690 let _namedArguments = Symbol('_namedArguments'); | |
| 3691 let _convert = Symbol('_convert'); | |
| 3692 class FunctionTypeInfoDecoderRing extends core.Object { | |
| 3693 FunctionTypeInfoDecoderRing(typeData) { | |
| 3694 this[_typeData] = typeData; | |
| 3695 this[_cachedToString] = null; | |
| 3696 } | |
| 3697 get [_hasReturnType]() { | |
| 3698 return "ret" in this[_typeData]; | |
| 3699 } | |
| 3700 get [_returnType]() { | |
| 3701 return this[_typeData].ret; | |
| 3702 } | |
| 3703 get [_isVoid]() { | |
| 3704 return !!this[_typeData].void; | |
| 3705 } | |
| 3706 get [_hasArguments]() { | |
| 3707 return "args" in this[_typeData]; | |
| 3708 } | |
| 3709 get [_arguments]() { | |
| 3710 return dart.as(this[_typeData].args, core.List); | |
| 3711 } | |
| 3712 get [_hasOptionalArguments]() { | |
| 3713 return "opt" in this[_typeData]; | |
| 3714 } | |
| 3715 get [_optionalArguments]() { | |
| 3716 return dart.as(this[_typeData].opt, core.List); | |
| 3717 } | |
| 3718 get [_hasNamedArguments]() { | |
| 3719 return "named" in this[_typeData]; | |
| 3720 } | |
| 3721 get [_namedArguments]() { | |
| 3722 return this[_typeData].named; | |
| 3723 } | |
| 3724 toRuntimeType() { | |
| 3725 return dart.const(new DynamicRuntimeType()); | |
| 3726 } | |
| 3727 [_convert](type) { | |
| 3728 let result = runtimeTypeToString(type); | |
| 3729 if (result != null) | |
| 3730 return result; | |
| 3731 if ("func" in type) { | |
| 3732 return dart.toString(new FunctionTypeInfoDecoderRing(type)); | |
| 3733 } else { | |
| 3734 throw 'bad type'; | |
| 3735 } | |
| 3736 } | |
| 3737 toString() { | |
| 3738 if (this[_cachedToString] != null) | |
| 3739 return this[_cachedToString]; | |
| 3740 let s = "("; | |
| 3741 let sep = ''; | |
| 3742 if (this[_hasArguments]) { | |
| 3743 for (let argument of this[_arguments]) { | |
| 3744 s = dart.notNull(s) + dart.notNull(sep); | |
| 3745 s = dart.notNull(s) + dart.notNull(this[_convert](argument)); | |
| 3746 sep = ', '; | |
| 3747 } | |
| 3748 } | |
| 3749 if (this[_hasOptionalArguments]) { | |
| 3750 s = dart.notNull(s) + `${sep}[`; | |
| 3751 sep = ''; | |
| 3752 for (let argument of this[_optionalArguments]) { | |
| 3753 s = dart.notNull(s) + dart.notNull(sep); | |
| 3754 s = dart.notNull(s) + dart.notNull(this[_convert](argument)); | |
| 3755 sep = ', '; | |
| 3756 } | |
| 3757 s = dart.notNull(s) + ']'; | |
| 3758 } | |
| 3759 if (this[_hasNamedArguments]) { | |
| 3760 s = dart.notNull(s) + `${sep}{`; | |
| 3761 sep = ''; | |
| 3762 for (let name of _js_names.extractKeys(this[_namedArguments])) { | |
| 3763 s = dart.notNull(s) + dart.notNull(sep); | |
| 3764 s = dart.notNull(s) + `${name}: `; | |
| 3765 s = dart.notNull(s) + dart.notNull(this[_convert](this[_namedArguments
][name])); | |
| 3766 sep = ', '; | |
| 3767 } | |
| 3768 s = dart.notNull(s) + '}'; | |
| 3769 } | |
| 3770 s = dart.notNull(s) + ') -> '; | |
| 3771 if (this[_isVoid]) { | |
| 3772 s = dart.notNull(s) + 'void'; | |
| 3773 } else if (this[_hasReturnType]) { | |
| 3774 s = dart.notNull(s) + dart.notNull(this[_convert](this[_returnType])); | |
| 3775 } else { | |
| 3776 s = dart.notNull(s) + 'dynamic'; | |
| 3777 } | |
| 3778 return this[_cachedToString] = `${s}`; | |
| 3779 } | |
| 3780 } | |
| 3781 dart.setSignature(FunctionTypeInfoDecoderRing, { | |
| 3782 constructors: () => ({FunctionTypeInfoDecoderRing: [FunctionTypeInfoDecoderR
ing, [core.Object]]}), | |
| 3783 methods: () => ({ | |
| 3784 toRuntimeType: [RuntimeType, []], | |
| 3785 [_convert]: [core.String, [core.Object]] | |
| 3786 }) | |
| 3787 }); | |
| 3788 class UnimplementedNoSuchMethodError extends core.Error { | |
| 3789 UnimplementedNoSuchMethodError(message) { | |
| 3790 this[_message] = message; | |
| 3791 super.Error(); | |
| 3792 } | |
| 3793 toString() { | |
| 3794 return `Unsupported operation: ${this[_message]}`; | |
| 3795 } | |
| 3796 } | |
| 3797 UnimplementedNoSuchMethodError[dart.implements] = () => [core.NoSuchMethodErro
r]; | |
| 3798 dart.setSignature(UnimplementedNoSuchMethodError, { | |
| 3799 constructors: () => ({UnimplementedNoSuchMethodError: [UnimplementedNoSuchMe
thodError, [core.String]]}) | |
| 3800 }); | |
| 3801 function random64() { | 1135 function random64() { |
| 3802 let int32a = Math.random() * 0x100000000 >>> 0; | 1136 let int32a = Math.random() * 0x100000000 >>> 0; |
| 3803 let int32b = Math.random() * 0x100000000 >>> 0; | 1137 let int32b = Math.random() * 0x100000000 >>> 0; |
| 3804 return dart.notNull(int32a) + dart.notNull(int32b) * 4294967296; | 1138 return dart.notNull(int32a) + dart.notNull(int32b) * 4294967296; |
| 3805 } | 1139 } |
| 3806 dart.fn(random64, core.int, []); | 1140 dart.fn(random64, core.int, []); |
| 3807 function jsonEncodeNative(string) { | 1141 function jsonEncodeNative(string) { |
| 3808 return JSON.stringify(string); | 1142 return JSON.stringify(string); |
| 3809 } | 1143 } |
| 3810 dart.fn(jsonEncodeNative, core.String, [core.String]); | 1144 dart.fn(jsonEncodeNative, core.String, [core.String]); |
| 3811 function getIsolateAffinityTag(name) { | |
| 3812 let isolateTagGetter = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_n
ames.GET_ISOLATE_TAG); | |
| 3813 return isolateTagGetter(name); | |
| 3814 } | |
| 3815 dart.fn(getIsolateAffinityTag, core.String, [core.String]); | |
| 3816 let LoadLibraryFunctionType = dart.typedef('LoadLibraryFunctionType', () => da
rt.functionType(async.Future$(core.Null), [])); | |
| 3817 function _loadLibraryWrapper(loadId) { | |
| 3818 return dart.fn(() => loadDeferredLibrary(loadId), async.Future$(core.Null),
[]); | |
| 3819 } | |
| 3820 dart.fn(_loadLibraryWrapper, LoadLibraryFunctionType, [core.String]); | |
| 3821 dart.defineLazyProperties(exports, { | |
| 3822 get _loadingLibraries() { | |
| 3823 return dart.map(); | |
| 3824 }, | |
| 3825 get _loadedLibraries() { | |
| 3826 return core.Set$(core.String).new(); | |
| 3827 } | |
| 3828 }); | |
| 3829 let DeferredLoadCallback = dart.typedef('DeferredLoadCallback', () => dart.fun
ctionType(dart.void, [])); | |
| 3830 exports.deferredLoadHook = null; | |
| 3831 function loadDeferredLibrary(loadId) { | |
| 3832 let urisMap = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names.DEFE
RRED_LIBRARY_URIS); | |
| 3833 let uris = dart.as(urisMap[loadId], core.List$(core.String)); | |
| 3834 let hashesMap = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names.DE
FERRED_LIBRARY_HASHES); | |
| 3835 let hashes = dart.as(hashesMap[loadId], core.List$(core.String)); | |
| 3836 if (uris == null) | |
| 3837 return async.Future$(core.Null).value(null); | |
| 3838 let indices = core.List$(core.int).generate(uris.length, dart.fn(i => dart.a
s(i, core.int), core.int, [core.Object])); | |
| 3839 let isHunkLoaded = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names
.IS_HUNK_LOADED); | |
| 3840 let isHunkInitialized = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_
names.IS_HUNK_INITIALIZED); | |
| 3841 let indicesToLoad = indices[dartx.where](dart.fn(i => !isHunkLoaded(hashes[d
artx.get](i)), core.bool, [core.int]))[dartx.toList](); | |
| 3842 return dart.as(async.Future.wait(dart.as(indicesToLoad[dartx.map](dart.fn(i
=> _loadHunk(uris[dartx.get](i)), async.Future$(core.Null), [core.int])), core.I
terable$(async.Future))).then(dart.fn(_ => { | |
| 3843 let indicesToInitialize = indices[dartx.where](dart.fn(i => !isHunkInitial
ized(hashes[dartx.get](i)), core.bool, [core.int]))[dartx.toList](); | |
| 3844 for (let i of indicesToInitialize) { | |
| 3845 let initializer = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_na
mes.INITIALIZE_LOADED_HUNK); | |
| 3846 initializer(hashes[dartx.get](i)); | |
| 3847 } | |
| 3848 let updated = exports._loadedLibraries.add(loadId); | |
| 3849 if (dart.notNull(updated) && dart.notNull(exports.deferredLoadHook != null
)) { | |
| 3850 exports.deferredLoadHook(); | |
| 3851 } | |
| 3852 })), async.Future$(core.Null)); | |
| 3853 } | |
| 3854 dart.fn(loadDeferredLibrary, async.Future$(core.Null), [core.String]); | |
| 3855 function _loadHunk(hunkName) { | |
| 3856 let future = exports._loadingLibraries.get(hunkName); | |
| 3857 if (future != null) { | |
| 3858 return dart.as(future.then(dart.fn(_ => null, dart.bottom, [core.Object]))
, async.Future$(core.Null)); | |
| 3859 } | |
| 3860 let uri = _isolate_helper.IsolateNatives.thisScript; | |
| 3861 let index = uri[dartx.lastIndexOf]('/'); | |
| 3862 uri = `${uri[dartx.substring](0, dart.notNull(index) + 1)}${hunkName}`; | |
| 3863 if (dart.notNull(Primitives.isJsshell) || dart.notNull(Primitives.isD8)) { | |
| 3864 return exports._loadingLibraries.set(hunkName, async.Future$(core.Null).ne
w(dart.fn(() => { | |
| 3865 try { | |
| 3866 new Function(`load("${uri}")`)(); | |
| 3867 } catch (error) { | |
| 3868 let stackTrace = dart.stackTrace(error); | |
| 3869 throw new async.DeferredLoadException(`Loading ${uri} failed.`); | |
| 3870 } | |
| 3871 | |
| 3872 return null; | |
| 3873 }))); | |
| 3874 } else if (_isolate_helper.isWorker()) { | |
| 3875 return exports._loadingLibraries.set(hunkName, async.Future$(core.Null).ne
w(dart.fn(() => { | |
| 3876 let completer = async.Completer$(core.Null).new(); | |
| 3877 _isolate_helper.enterJsAsync(); | |
| 3878 let leavingFuture = dart.as(completer.future.whenComplete(dart.fn(() =>
{ | |
| 3879 _isolate_helper.leaveJsAsync(); | |
| 3880 })), async.Future$(core.Null)); | |
| 3881 let index = uri[dartx.lastIndexOf]('/'); | |
| 3882 uri = `${uri[dartx.substring](0, dart.notNull(index) + 1)}${hunkName}`; | |
| 3883 let xhr = new XMLHttpRequest(); | |
| 3884 xhr.open("GET", uri); | |
| 3885 xhr.addEventListener("load", convertDartClosureToJS(dart.fn(event => { | |
| 3886 if (xhr.status != 200) { | |
| 3887 completer.completeError(new async.DeferredLoadException(`Loading ${u
ri} failed.`)); | |
| 3888 return; | |
| 3889 } | |
| 3890 let code = xhr.responseText; | |
| 3891 try { | |
| 3892 new Function(code)(); | |
| 3893 } catch (error) { | |
| 3894 let stackTrace = dart.stackTrace(error); | |
| 3895 completer.completeError(new async.DeferredLoadException(`Evaluating
${uri} failed.`)); | |
| 3896 return; | |
| 3897 } | |
| 3898 | |
| 3899 completer.complete(null); | |
| 3900 }), 1), false); | |
| 3901 let fail = convertDartClosureToJS(dart.fn(event => { | |
| 3902 new async.DeferredLoadException(`Loading ${uri} failed.`); | |
| 3903 }), 1); | |
| 3904 xhr.addEventListener("error", fail, false); | |
| 3905 xhr.addEventListener("abort", fail, false); | |
| 3906 xhr.send(); | |
| 3907 return leavingFuture; | |
| 3908 }))); | |
| 3909 } | |
| 3910 return exports._loadingLibraries.set(hunkName, async.Future$(core.Null).new(
dart.fn(() => { | |
| 3911 let completer = async.Completer$(core.Null).new(); | |
| 3912 let script = document.createElement("script"); | |
| 3913 script.type = "text/javascript"; | |
| 3914 script.src = uri; | |
| 3915 script.addEventListener("load", convertDartClosureToJS(dart.fn(event => { | |
| 3916 completer.complete(null); | |
| 3917 }), 1), false); | |
| 3918 script.addEventListener("error", convertDartClosureToJS(dart.fn(event => { | |
| 3919 completer.completeError(new async.DeferredLoadException(`Loading ${uri}
failed.`)); | |
| 3920 }), 1), false); | |
| 3921 document.body.appendChild(script); | |
| 3922 return completer.future; | |
| 3923 }))); | |
| 3924 } | |
| 3925 dart.fn(_loadHunk, async.Future$(core.Null), [core.String]); | |
| 3926 class MainError extends core.Error { | |
| 3927 MainError(message) { | |
| 3928 this[_message] = message; | |
| 3929 super.Error(); | |
| 3930 } | |
| 3931 toString() { | |
| 3932 return `NoSuchMethodError: ${this[_message]}`; | |
| 3933 } | |
| 3934 } | |
| 3935 MainError[dart.implements] = () => [core.NoSuchMethodError]; | |
| 3936 dart.setSignature(MainError, { | |
| 3937 constructors: () => ({MainError: [MainError, [core.String]]}) | |
| 3938 }); | |
| 3939 function missingMain() { | |
| 3940 throw new MainError("No top-level function named 'main'."); | |
| 3941 } | |
| 3942 dart.fn(missingMain, dart.void, []); | |
| 3943 function badMain() { | |
| 3944 throw new MainError("'main' is not a function."); | |
| 3945 } | |
| 3946 dart.fn(badMain, dart.void, []); | |
| 3947 function mainHasTooManyParameters() { | |
| 3948 throw new MainError("'main' expects too many parameters."); | |
| 3949 } | |
| 3950 dart.fn(mainHasTooManyParameters, dart.void, []); | |
| 3951 // Exports: | 1145 // Exports: |
| 3952 exports.NoSideEffects = NoSideEffects; | |
| 3953 exports.NoThrows = NoThrows; | 1146 exports.NoThrows = NoThrows; |
| 3954 exports.NoInline = NoInline; | 1147 exports.NoInline = NoInline; |
| 3955 exports.IrRepresentation = IrRepresentation; | |
| 3956 exports.Native = Native; | 1148 exports.Native = Native; |
| 3957 exports.JsName = JsName; | 1149 exports.JsName = JsName; |
| 3958 exports.JsPeerInterface = JsPeerInterface; | 1150 exports.JsPeerInterface = JsPeerInterface; |
| 3959 exports.SupportJsExtensionMethods = SupportJsExtensionMethods; | 1151 exports.SupportJsExtensionMethods = SupportJsExtensionMethods; |
| 3960 exports.ConstantMap$ = ConstantMap$; | |
| 3961 exports.ConstantMap = ConstantMap; | |
| 3962 exports.ConstantStringMap$ = ConstantStringMap$; | |
| 3963 exports.ConstantStringMap = ConstantStringMap; | |
| 3964 exports.ConstantProtoMap$ = ConstantProtoMap$; | |
| 3965 exports.ConstantProtoMap = ConstantProtoMap; | |
| 3966 exports.GeneralConstantMap$ = GeneralConstantMap$; | |
| 3967 exports.GeneralConstantMap = GeneralConstantMap; | |
| 3968 exports.contains = contains; | |
| 3969 exports.arrayLength = arrayLength; | |
| 3970 exports.arrayGet = arrayGet; | |
| 3971 exports.arraySet = arraySet; | |
| 3972 exports.propertyGet = propertyGet; | |
| 3973 exports.callHasOwnProperty = callHasOwnProperty; | |
| 3974 exports.propertySet = propertySet; | |
| 3975 exports.getPropertyFromPrototype = getPropertyFromPrototype; | |
| 3976 exports.defineProperty = defineProperty; | 1152 exports.defineProperty = defineProperty; |
| 3977 exports.regExpGetNative = regExpGetNative; | 1153 exports.regExpGetNative = regExpGetNative; |
| 3978 exports.regExpGetGlobalNative = regExpGetGlobalNative; | 1154 exports.regExpGetGlobalNative = regExpGetGlobalNative; |
| 3979 exports.regExpCaptureCount = regExpCaptureCount; | 1155 exports.regExpCaptureCount = regExpCaptureCount; |
| 3980 exports.JSSyntaxRegExp = JSSyntaxRegExp; | 1156 exports.JSSyntaxRegExp = JSSyntaxRegExp; |
| 3981 exports.firstMatchAfter = firstMatchAfter; | 1157 exports.firstMatchAfter = firstMatchAfter; |
| 3982 exports.StringMatch = StringMatch; | 1158 exports.StringMatch = StringMatch; |
| 3983 exports.allMatchesInStringUnchecked = allMatchesInStringUnchecked; | 1159 exports.allMatchesInStringUnchecked = allMatchesInStringUnchecked; |
| 3984 exports.stringContainsUnchecked = stringContainsUnchecked; | 1160 exports.stringContainsUnchecked = stringContainsUnchecked; |
| 3985 exports.stringReplaceJS = stringReplaceJS; | 1161 exports.stringReplaceJS = stringReplaceJS; |
| 3986 exports.stringReplaceFirstRE = stringReplaceFirstRE; | 1162 exports.stringReplaceFirstRE = stringReplaceFirstRE; |
| 3987 exports.ESCAPE_REGEXP = ESCAPE_REGEXP; | 1163 exports.ESCAPE_REGEXP = ESCAPE_REGEXP; |
| 3988 exports.stringReplaceAllUnchecked = stringReplaceAllUnchecked; | 1164 exports.stringReplaceAllUnchecked = stringReplaceAllUnchecked; |
| 3989 exports.stringReplaceAllFuncUnchecked = stringReplaceAllFuncUnchecked; | 1165 exports.stringReplaceAllFuncUnchecked = stringReplaceAllFuncUnchecked; |
| 3990 exports.stringReplaceAllEmptyFuncUnchecked = stringReplaceAllEmptyFuncUnchecke
d; | 1166 exports.stringReplaceAllEmptyFuncUnchecked = stringReplaceAllEmptyFuncUnchecke
d; |
| 3991 exports.stringReplaceAllStringFuncUnchecked = stringReplaceAllStringFuncUnchec
ked; | 1167 exports.stringReplaceAllStringFuncUnchecked = stringReplaceAllStringFuncUnchec
ked; |
| 3992 exports.stringReplaceFirstUnchecked = stringReplaceFirstUnchecked; | 1168 exports.stringReplaceFirstUnchecked = stringReplaceFirstUnchecked; |
| 3993 exports.stringJoinUnchecked = stringJoinUnchecked; | 1169 exports.stringJoinUnchecked = stringJoinUnchecked; |
| 3994 exports.createRuntimeType = createRuntimeType; | |
| 3995 exports.TypeImpl = TypeImpl; | |
| 3996 exports.TypeVariable = TypeVariable; | |
| 3997 exports.getMangledTypeName = getMangledTypeName; | |
| 3998 exports.setRuntimeTypeInfo = setRuntimeTypeInfo; | |
| 3999 exports.getRuntimeTypeInfo = getRuntimeTypeInfo; | |
| 4000 exports.getRuntimeTypeArguments = getRuntimeTypeArguments; | |
| 4001 exports.getRuntimeTypeArgument = getRuntimeTypeArgument; | |
| 4002 exports.getTypeArgumentByIndex = getTypeArgumentByIndex; | |
| 4003 exports.copyTypeArguments = copyTypeArguments; | |
| 4004 exports.getClassName = getClassName; | |
| 4005 exports.getRuntimeTypeAsString = getRuntimeTypeAsString; | |
| 4006 exports.getConstructorName = getConstructorName; | |
| 4007 exports.runtimeTypeToString = runtimeTypeToString; | |
| 4008 exports.joinArguments = joinArguments; | |
| 4009 exports.getRuntimeTypeString = getRuntimeTypeString; | |
| 4010 exports.getRuntimeType = getRuntimeType; | 1170 exports.getRuntimeType = getRuntimeType; |
| 4011 exports.substitute = substitute; | |
| 4012 exports.checkSubtype = checkSubtype; | |
| 4013 exports.computeTypeName = computeTypeName; | |
| 4014 exports.subtypeCast = subtypeCast; | |
| 4015 exports.assertSubtype = assertSubtype; | |
| 4016 exports.assertIsSubtype = assertIsSubtype; | |
| 4017 exports.throwTypeError = throwTypeError; | |
| 4018 exports.checkArguments = checkArguments; | |
| 4019 exports.areSubtypes = areSubtypes; | |
| 4020 exports.computeSignature = computeSignature; | |
| 4021 exports.isSupertypeOfNull = isSupertypeOfNull; | |
| 4022 exports.checkSubtypeOfRuntimeType = checkSubtypeOfRuntimeType; | |
| 4023 exports.subtypeOfRuntimeTypeCast = subtypeOfRuntimeTypeCast; | |
| 4024 exports.assertSubtypeOfRuntimeType = assertSubtypeOfRuntimeType; | |
| 4025 exports.getArguments = getArguments; | |
| 4026 exports.isSubtype = isSubtype; | |
| 4027 exports.isAssignable = isAssignable; | |
| 4028 exports.areAssignable = areAssignable; | |
| 4029 exports.areAssignableMaps = areAssignableMaps; | |
| 4030 exports.isFunctionSubtype = isFunctionSubtype; | |
| 4031 exports.invoke = invoke; | |
| 4032 exports.invokeOn = invokeOn; | |
| 4033 exports.call = call; | |
| 4034 exports.getField = getField; | |
| 4035 exports.getIndex = getIndex; | 1171 exports.getIndex = getIndex; |
| 4036 exports.getLength = getLength; | 1172 exports.getLength = getLength; |
| 4037 exports.isJsArray = isJsArray; | 1173 exports.isJsArray = isJsArray; |
| 4038 exports.hasField = hasField; | |
| 4039 exports.hasNoField = hasNoField; | |
| 4040 exports.isJsFunction = isJsFunction; | |
| 4041 exports.isJsObject = isJsObject; | |
| 4042 exports.isIdentical = isIdentical; | |
| 4043 exports.isNotIdentical = isNotIdentical; | |
| 4044 exports.unmangleGlobalNameIfPreservedAnyways = unmangleGlobalNameIfPreservedAn
yways; | |
| 4045 exports.unmangleAllIdentifiersIfPreservedAnyways = unmangleAllIdentifiersIfPre
servedAnyways; | |
| 4046 exports.patch = patch; | 1174 exports.patch = patch; |
| 4047 exports.InternalMap = InternalMap; | 1175 exports.InternalMap = InternalMap; |
| 4048 exports.requiresPreamble = requiresPreamble; | |
| 4049 exports.S = S; | |
| 4050 exports.createInvocationMirror = createInvocationMirror; | |
| 4051 exports.createUnmangledInvocationMirror = createUnmangledInvocationMirror; | |
| 4052 exports.throwInvalidReflectionError = throwInvalidReflectionError; | |
| 4053 exports.traceHelper = traceHelper; | |
| 4054 exports.JSInvocationMirror = JSInvocationMirror; | |
| 4055 exports.CachedInvocation = CachedInvocation; | |
| 4056 exports.CachedCatchAllInvocation = CachedCatchAllInvocation; | |
| 4057 exports.CachedNoSuchMethodInvocation = CachedNoSuchMethodInvocation; | |
| 4058 exports.ReflectionInfo = ReflectionInfo; | |
| 4059 exports.getMetadata = getMetadata; | |
| 4060 exports.Primitives = Primitives; | 1176 exports.Primitives = Primitives; |
| 4061 exports.JsCache = JsCache; | |
| 4062 exports.iae = iae; | |
| 4063 exports.ioore = ioore; | |
| 4064 exports.stringLastIndexOfUnchecked = stringLastIndexOfUnchecked; | 1177 exports.stringLastIndexOfUnchecked = stringLastIndexOfUnchecked; |
| 4065 exports.checkNull = checkNull; | 1178 exports.checkNull = checkNull; |
| 4066 exports.checkNum = checkNum; | 1179 exports.checkNum = checkNum; |
| 4067 exports.checkInt = checkInt; | 1180 exports.checkInt = checkInt; |
| 4068 exports.checkBool = checkBool; | 1181 exports.checkBool = checkBool; |
| 4069 exports.checkString = checkString; | 1182 exports.checkString = checkString; |
| 4070 exports.wrapException = wrapException; | |
| 4071 exports.toStringWrapper = toStringWrapper; | |
| 4072 exports.throwExpression = throwExpression; | |
| 4073 exports.makeLiteralListConst = makeLiteralListConst; | |
| 4074 exports.throwRuntimeError = throwRuntimeError; | 1183 exports.throwRuntimeError = throwRuntimeError; |
| 4075 exports.throwAbstractClassInstantiationError = throwAbstractClassInstantiation
Error; | 1184 exports.throwAbstractClassInstantiationError = throwAbstractClassInstantiation
Error; |
| 4076 exports.TypeErrorDecoder = TypeErrorDecoder; | |
| 4077 exports.NullError = NullError; | 1185 exports.NullError = NullError; |
| 4078 exports.JsNoSuchMethodError = JsNoSuchMethodError; | 1186 exports.JsNoSuchMethodError = JsNoSuchMethodError; |
| 4079 exports.UnknownJsTypeError = UnknownJsTypeError; | 1187 exports.UnknownJsTypeError = UnknownJsTypeError; |
| 4080 exports.unwrapException = unwrapException; | |
| 4081 exports.getTraceFromException = getTraceFromException; | 1188 exports.getTraceFromException = getTraceFromException; |
| 4082 exports.objectHashCode = objectHashCode; | 1189 exports.objectHashCode = objectHashCode; |
| 4083 exports.fillLiteralMap = fillLiteralMap; | 1190 exports.fillLiteralMap = fillLiteralMap; |
| 4084 exports.invokeClosure = invokeClosure; | |
| 4085 exports.convertDartClosureToJS = convertDartClosureToJS; | 1191 exports.convertDartClosureToJS = convertDartClosureToJS; |
| 4086 exports.Closure = Closure; | |
| 4087 exports.closureFromTearOff = closureFromTearOff; | |
| 4088 exports.TearOffClosure = TearOffClosure; | |
| 4089 exports.BoundClosure = BoundClosure; | |
| 4090 exports.jsHasOwnProperty = jsHasOwnProperty; | 1192 exports.jsHasOwnProperty = jsHasOwnProperty; |
| 4091 exports.jsPropertyAccess = jsPropertyAccess; | 1193 exports.jsPropertyAccess = jsPropertyAccess; |
| 4092 exports.getFallThroughError = getFallThroughError; | 1194 exports.getFallThroughError = getFallThroughError; |
| 4093 exports.Creates = Creates; | 1195 exports.Creates = Creates; |
| 4094 exports.Returns = Returns; | 1196 exports.Returns = Returns; |
| 4095 exports.JSName = JSName; | 1197 exports.JSName = JSName; |
| 4096 exports.boolConversionCheck = boolConversionCheck; | |
| 4097 exports.stringTypeCheck = stringTypeCheck; | |
| 4098 exports.stringTypeCast = stringTypeCast; | |
| 4099 exports.doubleTypeCheck = doubleTypeCheck; | |
| 4100 exports.doubleTypeCast = doubleTypeCast; | |
| 4101 exports.numTypeCheck = numTypeCheck; | |
| 4102 exports.numTypeCast = numTypeCast; | |
| 4103 exports.boolTypeCheck = boolTypeCheck; | |
| 4104 exports.boolTypeCast = boolTypeCast; | |
| 4105 exports.intTypeCheck = intTypeCheck; | |
| 4106 exports.intTypeCast = intTypeCast; | |
| 4107 exports.propertyTypeError = propertyTypeError; | |
| 4108 exports.propertyTypeCastError = propertyTypeCastError; | |
| 4109 exports.propertyTypeCheck = propertyTypeCheck; | |
| 4110 exports.propertyTypeCast = propertyTypeCast; | |
| 4111 exports.interceptedTypeCheck = interceptedTypeCheck; | |
| 4112 exports.interceptedTypeCast = interceptedTypeCast; | |
| 4113 exports.numberOrStringSuperTypeCheck = numberOrStringSuperTypeCheck; | |
| 4114 exports.numberOrStringSuperTypeCast = numberOrStringSuperTypeCast; | |
| 4115 exports.numberOrStringSuperNativeTypeCheck = numberOrStringSuperNativeTypeChec
k; | |
| 4116 exports.numberOrStringSuperNativeTypeCast = numberOrStringSuperNativeTypeCast; | |
| 4117 exports.stringSuperTypeCheck = stringSuperTypeCheck; | |
| 4118 exports.stringSuperTypeCast = stringSuperTypeCast; | |
| 4119 exports.stringSuperNativeTypeCheck = stringSuperNativeTypeCheck; | |
| 4120 exports.stringSuperNativeTypeCast = stringSuperNativeTypeCast; | |
| 4121 exports.listTypeCheck = listTypeCheck; | |
| 4122 exports.listTypeCast = listTypeCast; | |
| 4123 exports.listSuperTypeCheck = listSuperTypeCheck; | |
| 4124 exports.listSuperTypeCast = listSuperTypeCast; | |
| 4125 exports.listSuperNativeTypeCheck = listSuperNativeTypeCheck; | |
| 4126 exports.listSuperNativeTypeCast = listSuperNativeTypeCast; | |
| 4127 exports.voidTypeCheck = voidTypeCheck; | |
| 4128 exports.checkMalformedType = checkMalformedType; | |
| 4129 exports.checkDeferredIsLoaded = checkDeferredIsLoaded; | |
| 4130 exports.TypeErrorImplementation = TypeErrorImplementation; | 1198 exports.TypeErrorImplementation = TypeErrorImplementation; |
| 4131 exports.CastErrorImplementation = CastErrorImplementation; | 1199 exports.CastErrorImplementation = CastErrorImplementation; |
| 4132 exports.FallThroughErrorImplementation = FallThroughErrorImplementation; | 1200 exports.FallThroughErrorImplementation = FallThroughErrorImplementation; |
| 4133 exports.assertHelper = assertHelper; | |
| 4134 exports.throwNoSuchMethod = throwNoSuchMethod; | |
| 4135 exports.throwCyclicInit = throwCyclicInit; | |
| 4136 exports.RuntimeError = RuntimeError; | 1201 exports.RuntimeError = RuntimeError; |
| 4137 exports.DeferredNotLoadedError = DeferredNotLoadedError; | |
| 4138 exports.RuntimeType = RuntimeType; | |
| 4139 exports.RuntimeFunctionType = RuntimeFunctionType; | |
| 4140 exports.buildFunctionType = buildFunctionType; | |
| 4141 exports.buildNamedFunctionType = buildNamedFunctionType; | |
| 4142 exports.buildInterfaceType = buildInterfaceType; | |
| 4143 exports.DynamicRuntimeType = DynamicRuntimeType; | |
| 4144 exports.getDynamicRuntimeType = getDynamicRuntimeType; | |
| 4145 exports.VoidRuntimeType = VoidRuntimeType; | |
| 4146 exports.getVoidRuntimeType = getVoidRuntimeType; | |
| 4147 exports.functionTypeTestMetaHelper = functionTypeTestMetaHelper; | |
| 4148 exports.convertRtiToRuntimeType = convertRtiToRuntimeType; | |
| 4149 exports.RuntimeTypePlain = RuntimeTypePlain; | |
| 4150 exports.RuntimeTypeGeneric = RuntimeTypeGeneric; | |
| 4151 exports.FunctionTypeInfoDecoderRing = FunctionTypeInfoDecoderRing; | |
| 4152 exports.UnimplementedNoSuchMethodError = UnimplementedNoSuchMethodError; | |
| 4153 exports.random64 = random64; | 1202 exports.random64 = random64; |
| 4154 exports.jsonEncodeNative = jsonEncodeNative; | 1203 exports.jsonEncodeNative = jsonEncodeNative; |
| 4155 exports.getIsolateAffinityTag = getIsolateAffinityTag; | 1204 })(_js_helper, core, collection, _interceptors, _foreign_helper); |
| 4156 exports.LoadLibraryFunctionType = LoadLibraryFunctionType; | |
| 4157 exports.DeferredLoadCallback = DeferredLoadCallback; | |
| 4158 exports.loadDeferredLibrary = loadDeferredLibrary; | |
| 4159 exports.MainError = MainError; | |
| 4160 exports.missingMain = missingMain; | |
| 4161 exports.badMain = badMain; | |
| 4162 exports.mainHasTooManyParameters = mainHasTooManyParameters; | |
| 4163 })(_js_helper, core, collection, _internal, _foreign_helper, _interceptors, _js_
names, _js_embedded_names, async, _isolate_helper); | |
| OLD | NEW |