| 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 _js_embedded_names = dart.import(_js_embedded_names); | 6 (function(exports, core, collection, _interceptors, _foreign_helper) { |
| 7 var _interceptors = dart.lazyImport(_interceptors); | |
| 8 var _js_names = dart.import(_js_names); | |
| 9 var async = dart.import(async); | |
| 10 var _isolate_helper = dart.lazyImport(_isolate_helper); | |
| 11 (function(exports, core, collection, _internal, _foreign_helper, _js_embedded_na
mes, _interceptors, _js_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 let _throwUnmodifiable = Symbol('_throwUnmodifiable'); | |
| 51 let ConstantMap$ = dart.generic(function(K, V) { | |
| 52 class ConstantMap extends core.Object { | |
| 53 _() { | |
| 54 } | |
| 55 get isEmpty() { | |
| 56 return this.length == 0; | |
| 57 } | |
| 58 get isNotEmpty() { | |
| 59 return !dart.notNull(this.isEmpty); | |
| 60 } | |
| 61 toString() { | |
| 62 return collection.Maps.mapToString(this); | |
| 63 } | |
| 64 [_throwUnmodifiable]() { | |
| 65 throw new core.UnsupportedError("Cannot modify unmodifiable Map"); | |
| 66 } | |
| 67 set(key, val) { | |
| 68 dart.as(key, K); | |
| 69 dart.as(val, V); | |
| 70 return this[_throwUnmodifiable](); | |
| 71 } | |
| 72 putIfAbsent(key, ifAbsent) { | |
| 73 dart.as(key, K); | |
| 74 dart.as(ifAbsent, dart.functionType(V, [])); | |
| 75 return dart.as(this[_throwUnmodifiable](), V); | |
| 76 } | |
| 77 remove(key) { | |
| 78 return dart.as(this[_throwUnmodifiable](), V); | |
| 79 } | |
| 80 clear() { | |
| 81 return this[_throwUnmodifiable](); | |
| 82 } | |
| 83 addAll(other) { | |
| 84 dart.as(other, core.Map$(K, V)); | |
| 85 return this[_throwUnmodifiable](); | |
| 86 } | |
| 87 } | |
| 88 ConstantMap[dart.implements] = () => [core.Map$(K, V)]; | |
| 89 dart.defineNamedConstructor(ConstantMap, '_'); | |
| 90 dart.setSignature(ConstantMap, { | |
| 91 constructors: () => ({_: [ConstantMap$(K, V), []]}), | |
| 92 methods: () => ({ | |
| 93 [_throwUnmodifiable]: [core.Object, []], | |
| 94 set: [dart.void, [K, V]], | |
| 95 putIfAbsent: [V, [K, dart.functionType(V, [])]], | |
| 96 remove: [V, [core.Object]], | |
| 97 clear: [dart.void, []], | |
| 98 addAll: [dart.void, [core.Map$(K, V)]] | |
| 99 }) | |
| 100 }); | |
| 101 return ConstantMap; | |
| 102 }); | |
| 103 let ConstantMap = ConstantMap$(); | |
| 104 let _jsObject = Symbol('_jsObject'); | |
| 105 let _keys = Symbol('_keys'); | |
| 106 let _fetch = Symbol('_fetch'); | |
| 107 let ConstantStringMap$ = dart.generic(function(K, V) { | |
| 108 class ConstantStringMap extends ConstantMap$(K, V) { | |
| 109 _(length, jsObject, keys) { | |
| 110 this.length = length; | |
| 111 this[_jsObject] = jsObject; | |
| 112 this[_keys] = keys; | |
| 113 super._(); | |
| 114 } | |
| 115 containsValue(needle) { | |
| 116 return this.values[core.$any](dart.fn(value => dart.equals(value, needle
), core.bool, [V])); | |
| 117 } | |
| 118 containsKey(key) { | |
| 119 if (!(typeof key == 'string')) | |
| 120 return false; | |
| 121 if (dart.equals('__proto__', key)) | |
| 122 return false; | |
| 123 return jsHasOwnProperty(this[_jsObject], dart.as(key, core.String)); | |
| 124 } | |
| 125 get(key) { | |
| 126 if (!dart.notNull(this.containsKey(key))) | |
| 127 return null; | |
| 128 return dart.as(this[_fetch](key), V); | |
| 129 } | |
| 130 [_fetch](key) { | |
| 131 return jsPropertyAccess(this[_jsObject], dart.as(key, core.String)); | |
| 132 } | |
| 133 forEach(f) { | |
| 134 dart.as(f, dart.functionType(dart.void, [K, V])); | |
| 135 let keys = this[_keys]; | |
| 136 for (let i = 0; dart.notNull(i) < dart.notNull(dart.as(dart.dload(keys,
'length'), core.num)); i = dart.notNull(i) + 1) { | |
| 137 let key = dart.dindex(keys, i); | |
| 138 f(dart.as(key, K), dart.as(this[_fetch](key), V)); | |
| 139 } | |
| 140 } | |
| 141 get keys() { | |
| 142 return new (_ConstantMapKeyIterable$(K))(this); | |
| 143 } | |
| 144 get values() { | |
| 145 return _internal.MappedIterable$(K, V).new(this[_keys], dart.fn(key => d
art.as(this[_fetch](key), V), V, [core.Object])); | |
| 146 } | |
| 147 } | |
| 148 ConstantStringMap[dart.implements] = () => [_internal.EfficientLength]; | |
| 149 dart.defineNamedConstructor(ConstantStringMap, '_'); | |
| 150 dart.setSignature(ConstantStringMap, { | |
| 151 constructors: () => ({_: [ConstantStringMap$(K, V), [core.int, core.Object
, core.List$(K)]]}), | |
| 152 methods: () => ({ | |
| 153 containsValue: [core.bool, [core.Object]], | |
| 154 containsKey: [core.bool, [core.Object]], | |
| 155 get: [V, [core.Object]], | |
| 156 [_fetch]: [core.Object, [core.Object]], | |
| 157 forEach: [dart.void, [dart.functionType(dart.void, [K, V])]] | |
| 158 }) | |
| 159 }); | |
| 160 return ConstantStringMap; | |
| 161 }); | |
| 162 let ConstantStringMap = ConstantStringMap$(); | |
| 163 let _protoValue = Symbol('_protoValue'); | |
| 164 let ConstantProtoMap$ = dart.generic(function(K, V) { | |
| 165 class ConstantProtoMap extends ConstantStringMap$(K, V) { | |
| 166 _(length, jsObject, keys, protoValue) { | |
| 167 this[_protoValue] = protoValue; | |
| 168 super._(dart.as(length, core.int), jsObject, dart.as(keys, core.List$(K)
)); | |
| 169 } | |
| 170 containsKey(key) { | |
| 171 if (!(typeof key == 'string')) | |
| 172 return false; | |
| 173 if (dart.equals('__proto__', key)) | |
| 174 return true; | |
| 175 return jsHasOwnProperty(this[_jsObject], dart.as(key, core.String)); | |
| 176 } | |
| 177 [_fetch](key) { | |
| 178 return dart.equals('__proto__', key) ? this[_protoValue] : jsPropertyAcc
ess(this[_jsObject], dart.as(key, core.String)); | |
| 179 } | |
| 180 } | |
| 181 dart.defineNamedConstructor(ConstantProtoMap, '_'); | |
| 182 dart.setSignature(ConstantProtoMap, { | |
| 183 constructors: () => ({_: [ConstantProtoMap$(K, V), [core.Object, core.Obje
ct, core.Object, V]]}) | |
| 184 }); | |
| 185 return ConstantProtoMap; | |
| 186 }); | |
| 187 let ConstantProtoMap = ConstantProtoMap$(); | |
| 188 let _map = Symbol('_map'); | |
| 189 let _ConstantMapKeyIterable$ = dart.generic(function(K) { | |
| 190 class _ConstantMapKeyIterable extends collection.IterableBase$(K) { | |
| 191 _ConstantMapKeyIterable(map) { | |
| 192 this[_map] = map; | |
| 193 super.IterableBase(); | |
| 194 } | |
| 195 get [core.$iterator]() { | |
| 196 return this[_map][_keys][core.$iterator]; | |
| 197 } | |
| 198 get [core.$length]() { | |
| 199 return this[_map][_keys][core.$length]; | |
| 200 } | |
| 201 } | |
| 202 dart.setSignature(_ConstantMapKeyIterable, { | |
| 203 constructors: () => ({_ConstantMapKeyIterable: [_ConstantMapKeyIterable$(K
), [ConstantStringMap$(K, core.Object)]]}) | |
| 204 }); | |
| 205 return _ConstantMapKeyIterable; | |
| 206 }); | |
| 207 let _ConstantMapKeyIterable = _ConstantMapKeyIterable$(); | |
| 208 let _jsData = Symbol('_jsData'); | |
| 209 let _getMap = Symbol('_getMap'); | |
| 210 let GeneralConstantMap$ = dart.generic(function(K, V) { | |
| 211 class GeneralConstantMap extends ConstantMap$(K, V) { | |
| 212 GeneralConstantMap(jsData) { | |
| 213 this[_jsData] = jsData; | |
| 214 super._(); | |
| 215 } | |
| 216 [_getMap]() { | |
| 217 if (!this.$map) { | |
| 218 let backingMap = collection.LinkedHashMap$(K, V).new(); | |
| 219 this.$map = fillLiteralMap(this[_jsData], backingMap); | |
| 220 } | |
| 221 return dart.as(this.$map, core.Map$(K, V)); | |
| 222 } | |
| 223 containsValue(needle) { | |
| 224 return this[_getMap]().containsValue(needle); | |
| 225 } | |
| 226 containsKey(key) { | |
| 227 return this[_getMap]().containsKey(key); | |
| 228 } | |
| 229 get(key) { | |
| 230 return this[_getMap]().get(key); | |
| 231 } | |
| 232 forEach(f) { | |
| 233 dart.as(f, dart.functionType(dart.void, [K, V])); | |
| 234 this[_getMap]().forEach(f); | |
| 235 } | |
| 236 get keys() { | |
| 237 return this[_getMap]().keys; | |
| 238 } | |
| 239 get values() { | |
| 240 return this[_getMap]().values; | |
| 241 } | |
| 242 get length() { | |
| 243 return this[_getMap]().length; | |
| 244 } | |
| 245 } | |
| 246 dart.setSignature(GeneralConstantMap, { | |
| 247 constructors: () => ({GeneralConstantMap: [GeneralConstantMap$(K, V), [cor
e.Object]]}), | |
| 248 methods: () => ({ | |
| 249 [_getMap]: [core.Map$(K, V), []], | |
| 250 containsValue: [core.bool, [core.Object]], | |
| 251 containsKey: [core.bool, [core.Object]], | |
| 252 get: [V, [core.Object]], | |
| 253 forEach: [dart.void, [dart.functionType(dart.void, [K, V])]] | |
| 254 }) | |
| 255 }); | |
| 256 return GeneralConstantMap; | |
| 257 }); | |
| 258 let GeneralConstantMap = GeneralConstantMap$(); | |
| 259 function contains(userAgent, name) { | |
| 260 return userAgent.indexOf(name) != -1; | |
| 261 } | |
| 262 dart.fn(contains, core.bool, [core.String, core.String]); | |
| 263 function arrayLength(array) { | |
| 264 return array.length; | |
| 265 } | |
| 266 dart.fn(arrayLength, core.int, [core.List]); | |
| 267 function arrayGet(array, index) { | |
| 268 return array[index]; | |
| 269 } | |
| 270 dart.fn(arrayGet, core.Object, [core.List, core.int]); | |
| 271 function arraySet(array, index, value) { | |
| 272 array[index] = value; | |
| 273 } | |
| 274 dart.fn(arraySet, dart.void, [core.List, core.int, core.Object]); | |
| 275 function propertyGet(object, property) { | |
| 276 return object[property]; | |
| 277 } | |
| 278 dart.fn(propertyGet, core.Object, [core.Object, core.String]); | |
| 279 function callHasOwnProperty(func, object, property) { | |
| 280 return func.call(object, property); | |
| 281 } | |
| 282 dart.fn(callHasOwnProperty, core.bool, [core.Object, core.Object, core.String]
); | |
| 283 function propertySet(object, property, value) { | |
| 284 object[property] = value; | |
| 285 } | |
| 286 dart.fn(propertySet, dart.void, [core.Object, core.String, core.Object]); | |
| 287 function getPropertyFromPrototype(object, name) { | |
| 288 return Object.getPrototypeOf(object)[name]; | |
| 289 } | |
| 290 dart.fn(getPropertyFromPrototype, core.Object, [core.Object, core.String]); | |
| 291 exports.getTagFunction = null; | |
| 292 exports.alternateTagFunction = null; | |
| 293 exports.prototypeForTagFunction = null; | |
| 294 function toStringForNativeObject(obj) { | |
| 295 let name = exports.getTagFunction == null ? '<Unknown>' : dart.dcall(exports
.getTagFunction, obj); | |
| 296 return `Instance of ${name}`; | |
| 297 } | |
| 298 dart.fn(toStringForNativeObject, core.String, [core.Object]); | |
| 299 function hashCodeForNativeObject(object) { | |
| 300 return Primitives.objectHashCode(object); | |
| 301 } | |
| 302 dart.fn(hashCodeForNativeObject, core.int, [core.Object]); | |
| 303 function defineProperty(obj, property, value) { | 30 function defineProperty(obj, property, value) { |
| 304 Object.defineProperty(obj, property, {value: value, enumerable: false, writa
ble: true, configurable: true}); | 31 Object.defineProperty(obj, property, {value: value, enumerable: false, writa
ble: true, configurable: true}); |
| 305 } | 32 } |
| 306 dart.fn(defineProperty, dart.void, [core.Object, core.String, core.Object]); | 33 dart.fn(defineProperty, dart.void, [core.Object, core.String, core.Object]); |
| 307 function isDartObject(obj) { | |
| 308 return obj instanceof _foreign_helper.JS_DART_OBJECT_CONSTRUCTOR(); | |
| 309 } | |
| 310 dart.fn(isDartObject, core.bool, [core.Object]); | |
| 311 dart.copyProperties(exports, { | |
| 312 get interceptorsByTag() { | |
| 313 return _foreign_helper.JS_EMBEDDED_GLOBAL('=Object', _js_embedded_names.IN
TERCEPTORS_BY_TAG); | |
| 314 }, | |
| 315 get leafTags() { | |
| 316 return _foreign_helper.JS_EMBEDDED_GLOBAL('=Object', _js_embedded_names.LE
AF_TAGS); | |
| 317 } | |
| 318 }); | |
| 319 function findDispatchTagForInterceptorClass(interceptorClassConstructor) { | |
| 320 return dart.as(interceptorClassConstructor[_js_embedded_names.NATIVE_SUPERCL
ASS_TAG_NAME], core.String); | |
| 321 } | |
| 322 dart.fn(findDispatchTagForInterceptorClass, core.String, [core.Object]); | |
| 323 exports.dispatchRecordsForInstanceTags = null; | |
| 324 exports.interceptorsForUncacheableTags = null; | |
| 325 function lookupInterceptor(tag) { | |
| 326 return propertyGet(exports.interceptorsByTag, tag); | |
| 327 } | |
| 328 dart.fn(lookupInterceptor, core.Object, [core.String]); | |
| 329 let UNCACHED_MARK = '~'; | |
| 330 let INSTANCE_CACHED_MARK = '!'; | |
| 331 let LEAF_MARK = '-'; | |
| 332 let INTERIOR_MARK = '+'; | |
| 333 let DISCRIMINATED_MARK = '*'; | |
| 334 function lookupAndCacheInterceptor(obj) { | 34 function lookupAndCacheInterceptor(obj) { |
| 335 dart.assert(!dart.notNull(isDartObject(obj))); | 35 return null; |
| 336 let tag = dart.as(dart.dcall(exports.getTagFunction, obj), core.String); | |
| 337 let record = propertyGet(exports.dispatchRecordsForInstanceTags, tag); | |
| 338 if (record != null) | |
| 339 return patchInstance(obj, record); | |
| 340 let interceptor = propertyGet(exports.interceptorsForUncacheableTags, tag); | |
| 341 if (interceptor != null) | |
| 342 return interceptor; | |
| 343 let interceptorClass = lookupInterceptor(tag); | |
| 344 if (interceptorClass == null) { | |
| 345 tag = dart.as(dart.dcall(exports.alternateTagFunction, obj, tag), core.Str
ing); | |
| 346 if (tag != null) { | |
| 347 record = propertyGet(exports.dispatchRecordsForInstanceTags, tag); | |
| 348 if (record != null) | |
| 349 return patchInstance(obj, record); | |
| 350 interceptor = propertyGet(exports.interceptorsForUncacheableTags, tag); | |
| 351 if (interceptor != null) | |
| 352 return interceptor; | |
| 353 interceptorClass = lookupInterceptor(tag); | |
| 354 } | |
| 355 } | |
| 356 if (interceptorClass == null) { | |
| 357 return null; | |
| 358 } | |
| 359 interceptor = interceptorClass.prototype; | |
| 360 let mark = tag[0]; | |
| 361 if (dart.equals(mark, INSTANCE_CACHED_MARK)) { | |
| 362 record = makeLeafDispatchRecord(interceptor); | |
| 363 propertySet(exports.dispatchRecordsForInstanceTags, tag, record); | |
| 364 return patchInstance(obj, record); | |
| 365 } | |
| 366 if (dart.equals(mark, UNCACHED_MARK)) { | |
| 367 propertySet(exports.interceptorsForUncacheableTags, tag, interceptor); | |
| 368 return interceptor; | |
| 369 } | |
| 370 if (dart.equals(mark, LEAF_MARK)) { | |
| 371 return patchProto(obj, makeLeafDispatchRecord(interceptor)); | |
| 372 } | |
| 373 if (dart.equals(mark, INTERIOR_MARK)) { | |
| 374 return patchInteriorProto(obj, interceptor); | |
| 375 } | |
| 376 if (dart.equals(mark, DISCRIMINATED_MARK)) { | |
| 377 throw new core.UnimplementedError(tag); | |
| 378 } | |
| 379 let isLeaf = exports.leafTags[tag] === true; | |
| 380 if (isLeaf) { | |
| 381 return patchProto(obj, makeLeafDispatchRecord(interceptor)); | |
| 382 } else { | |
| 383 return patchInteriorProto(obj, interceptor); | |
| 384 } | |
| 385 } | 36 } |
| 386 dart.fn(lookupAndCacheInterceptor); | 37 dart.fn(lookupAndCacheInterceptor); |
| 387 function patchInstance(obj, record) { | |
| 388 _interceptors.setDispatchProperty(obj, record); | |
| 389 return _interceptors.dispatchRecordInterceptor(record); | |
| 390 } | |
| 391 dart.fn(patchInstance); | |
| 392 function patchProto(obj, record) { | |
| 393 _interceptors.setDispatchProperty(Object.getPrototypeOf(obj), record); | |
| 394 return _interceptors.dispatchRecordInterceptor(record); | |
| 395 } | |
| 396 dart.fn(patchProto); | |
| 397 function patchInteriorProto(obj, interceptor) { | |
| 398 let proto = Object.getPrototypeOf(obj); | |
| 399 let record = _interceptors.makeDispatchRecord(interceptor, proto, null, null
); | |
| 400 _interceptors.setDispatchProperty(proto, record); | |
| 401 return interceptor; | |
| 402 } | |
| 403 dart.fn(patchInteriorProto); | |
| 404 function makeLeafDispatchRecord(interceptor) { | |
| 405 let fieldName = _foreign_helper.JS_IS_INDEXABLE_FIELD_NAME(); | |
| 406 let indexability = !!interceptor[fieldName]; | |
| 407 return _interceptors.makeDispatchRecord(interceptor, false, null, indexabili
ty); | |
| 408 } | |
| 409 dart.fn(makeLeafDispatchRecord); | |
| 410 function makeDefaultDispatchRecord(tag, interceptorClass, proto) { | |
| 411 let interceptor = interceptorClass.prototype; | |
| 412 let isLeaf = exports.leafTags[tag] === true; | |
| 413 if (isLeaf) { | |
| 414 return makeLeafDispatchRecord(interceptor); | |
| 415 } else { | |
| 416 return _interceptors.makeDispatchRecord(interceptor, proto, null, null); | |
| 417 } | |
| 418 } | |
| 419 dart.fn(makeDefaultDispatchRecord); | |
| 420 function setNativeSubclassDispatchRecord(proto, interceptor) { | |
| 421 _interceptors.setDispatchProperty(proto, makeLeafDispatchRecord(interceptor)
); | |
| 422 } | |
| 423 dart.fn(setNativeSubclassDispatchRecord); | |
| 424 function constructorNameFallback(object) { | |
| 425 return _constructorNameFallback(object); | |
| 426 } | |
| 427 dart.fn(constructorNameFallback, core.String, [core.Object]); | |
| 428 exports.initNativeDispatchFlag = null; | 38 exports.initNativeDispatchFlag = null; |
| 429 function initNativeDispatch() { | 39 function initNativeDispatch() { |
| 430 if (dart.equals(true, exports.initNativeDispatchFlag)) | 40 if (dart.equals(true, exports.initNativeDispatchFlag)) |
| 431 return; | 41 return; |
| 432 exports.initNativeDispatchFlag = true; | 42 exports.initNativeDispatchFlag = true; |
| 433 initNativeDispatchContinue(); | |
| 434 } | 43 } |
| 435 dart.fn(initNativeDispatch, dart.void, []); | 44 dart.fn(initNativeDispatch, dart.void, []); |
| 436 function initNativeDispatchContinue() { | |
| 437 exports.dispatchRecordsForInstanceTags = Object.create(null); | |
| 438 exports.interceptorsForUncacheableTags = Object.create(null); | |
| 439 initHooks(); | |
| 440 let map = exports.interceptorsByTag; | |
| 441 let tags = Object.getOwnPropertyNames(map); | |
| 442 if (typeof window != "undefined") { | |
| 443 let context = window; | |
| 444 let fun = function() { | |
| 445 }; | |
| 446 for (let i = 0; dart.notNull(i) < dart.notNull(dart.as(dart.dload(tags, 'l
ength'), core.num)); i = dart.notNull(i) + 1) { | |
| 447 let tag = dart.dindex(tags, i); | |
| 448 let proto = dart.dcall(exports.prototypeForTagFunction, tag); | |
| 449 if (proto != null) { | |
| 450 let interceptorClass = map[tag]; | |
| 451 let record = makeDefaultDispatchRecord(tag, interceptorClass, proto); | |
| 452 if (record != null) { | |
| 453 _interceptors.setDispatchProperty(proto, record); | |
| 454 fun.prototype = proto; | |
| 455 } | |
| 456 } | |
| 457 } | |
| 458 } | |
| 459 for (let i = 0; dart.notNull(i) < dart.notNull(dart.as(dart.dload(tags, 'len
gth'), core.num)); i = dart.notNull(i) + 1) { | |
| 460 let tag = tags[i]; | |
| 461 if (/^[A-Za-z_]/.test(tag)) { | |
| 462 let interceptorClass = propertyGet(map, tag); | |
| 463 propertySet(map, dart.notNull(INSTANCE_CACHED_MARK) + dart.notNull(tag),
interceptorClass); | |
| 464 propertySet(map, dart.notNull(UNCACHED_MARK) + dart.notNull(tag), interc
eptorClass); | |
| 465 propertySet(map, dart.notNull(LEAF_MARK) + dart.notNull(tag), intercepto
rClass); | |
| 466 propertySet(map, dart.notNull(INTERIOR_MARK) + dart.notNull(tag), interc
eptorClass); | |
| 467 propertySet(map, dart.notNull(DISCRIMINATED_MARK) + dart.notNull(tag), i
nterceptorClass); | |
| 468 } | |
| 469 } | |
| 470 } | |
| 471 dart.fn(initNativeDispatchContinue, dart.void, []); | |
| 472 function initHooks() { | |
| 473 let hooks = _baseHooks(); | |
| 474 let _fallbackConstructorHooksTransformer = _fallbackConstructorHooksTransfor
merGenerator(_constructorNameFallback); | |
| 475 hooks = applyHooksTransformer(_fallbackConstructorHooksTransformer, hooks); | |
| 476 hooks = applyHooksTransformer(_firefoxHooksTransformer, hooks); | |
| 477 hooks = applyHooksTransformer(_ieHooksTransformer, hooks); | |
| 478 hooks = applyHooksTransformer(_operaHooksTransformer, hooks); | |
| 479 hooks = applyHooksTransformer(_safariHooksTransformer, hooks); | |
| 480 hooks = applyHooksTransformer(_fixDocumentHooksTransformer, hooks); | |
| 481 hooks = applyHooksTransformer(_dartExperimentalFixupGetTagHooksTransformer,
hooks); | |
| 482 if (typeof dartNativeDispatchHooksTransformer != "undefined") { | |
| 483 let transformers = dartNativeDispatchHooksTransformer; | |
| 484 if (typeof transformers == "function") { | |
| 485 transformers = [transformers]; | |
| 486 } | |
| 487 if (transformers.constructor == Array) { | |
| 488 for (let i = 0; dart.notNull(i) < transformers.length; i = dart.notNull(
i) + 1) { | |
| 489 let transformer = transformers[i]; | |
| 490 if (typeof transformer == "function") { | |
| 491 hooks = applyHooksTransformer(transformer, hooks); | |
| 492 } | |
| 493 } | |
| 494 } | |
| 495 } | |
| 496 let getTag = hooks.getTag; | |
| 497 let getUnknownTag = hooks.getUnknownTag; | |
| 498 let prototypeForTag = hooks.prototypeForTag; | |
| 499 exports.getTagFunction = dart.fn(o => getTag(o)); | |
| 500 exports.alternateTagFunction = dart.fn((o, tag) => getUnknownTag(o, tag), co
re.Object, [core.Object, core.String]); | |
| 501 exports.prototypeForTagFunction = dart.fn(tag => prototypeForTag(tag), core.
Object, [core.String]); | |
| 502 } | |
| 503 dart.fn(initHooks, dart.void, []); | |
| 504 function applyHooksTransformer(transformer, hooks) { | |
| 505 let newHooks = transformer(hooks); | |
| 506 return newHooks || hooks; | |
| 507 } | |
| 508 dart.fn(applyHooksTransformer); | |
| 509 let _baseHooks = dart.const(new _foreign_helper.JS_CONST('function() {\n func
tion typeNameInChrome(o) {\n var constructor = o.constructor;\n if (constr
uctor) {\n var name = constructor.name;\n if (name) return name;\n
}\n var s = Object.prototype.toString.call(o);\n return s.substring(8, s.l
ength - 1);\n }\n function getUnknownTag(object, tag) {\n // This code real
ly belongs in [getUnknownTagGenericBrowser] but having it\n // here allows [g
etUnknownTag] to be tested on d8.\n if (/^HTML[A-Z].*Element$/.test(tag)) {\n
// Check that it is not a simple JavaScript object.\n var name = Obje
ct.prototype.toString.call(object);\n if (name == "[object Object]") return
null;\n return "HTMLElement";\n }\n }\n function getUnknownTagGeneric
Browser(object, tag) {\n if (self.HTMLElement && object instanceof HTMLElemen
t) return "HTMLElement";\n return getUnknownTag(object, tag);\n }\n functio
n prototypeForTag(tag) {\n if (typeof window == "undefined") return null;\n
if (typeof window[tag] == "undefined") return null;\n var constructor = win
dow[tag];\n if (typeof constructor != "function") return null;\n return co
nstructor.prototype;\n }\n function discriminator(tag) { return null; }\n\n v
ar isBrowser = typeof navigator == "object";\n\n return {\n getTag: typeName
InChrome,\n getUnknownTag: isBrowser ? getUnknownTagGenericBrowser : getUnkno
wnTag,\n prototypeForTag: prototypeForTag,\n discriminator: discriminator
};\n}')); | |
| 510 let _constructorNameFallback = dart.const(new _foreign_helper.JS_CONST('functi
on getTagFallback(o) {\n var constructor = o.constructor;\n if (typeof constru
ctor == "function") {\n var name = constructor.name;\n // If the name is a
non-empty string, we use that as the type name of this\n // object. There a
re various cases where that does not work, so we have to\n // detect them and
fall through to the toString() based implementation.\n\n if (typeof name ==
"string" &&\n\n // Sometimes the string is empty. This test also catches
minified\n // shadow dom polyfil wrapper for Window on Firefox where the
faked\n // constructor name does not \'stick\'. The shortest real DOM o
bject\n // names have three characters (e.g. URL, CSS).\n name.len
gth > 2 &&\n\n // On Firefox we often get "Object" as the constructor nam
e, even for\n // more specialized DOM objects.\n name !== "Object"
&&\n\n // This can happen in Opera.\n name !== "Function.prototyp
e") {\n return name;\n }\n }\n var s = Object.prototype.toString.call(
o);\n return s.substring(8, s.length - 1);\n}')); | |
| 511 let _fallbackConstructorHooksTransformerGenerator = dart.const(new _foreign_he
lper.JS_CONST('function(getTagFallback) {\n return function(hooks) {\n // If
we are not in a browser, assume we are in d8.\n // TODO(sra): Recognize jssh
ell.\n if (typeof navigator != "object") return hooks;\n\n var ua = naviga
tor.userAgent;\n // TODO(antonm): remove a reference to DumpRenderTree.\n
if (ua.indexOf("DumpRenderTree") >= 0) return hooks;\n if (ua.indexOf("Chrome
") >= 0) {\n // Confirm constructor name is usable for dispatch.\n fun
ction confirm(p) {\n return typeof window == "object" && window[p] && win
dow[p].name == p;\n }\n if (confirm("Window") && confirm("HTMLElement"
)) return hooks;\n }\n\n hooks.getTag = getTagFallback;\n };\n}')); | |
| 512 let _ieHooksTransformer = dart.const(new _foreign_helper.JS_CONST('function(ho
oks) {\n var userAgent = typeof navigator == "object" ? navigator.userAgent : "
";\n if (userAgent.indexOf("Trident/") == -1) return hooks;\n\n var getTag = h
ooks.getTag;\n\n var quickMap = {\n "BeforeUnloadEvent": "Event",\n "Data
Transfer": "Clipboard",\n "HTMLDDElement": "HTMLElement",\n "HTMLDTElement
": "HTMLElement",\n "HTMLPhraseElement": "HTMLElement",\n "Position": "Geo
position"\n };\n\n function getTagIE(o) {\n var tag = getTag(o);\n var n
ewTag = quickMap[tag];\n if (newTag) return newTag;\n // Patches for types
which report themselves as Objects.\n if (tag == "Object") {\n if (wind
ow.DataView && (o instanceof window.DataView)) return "DataView";\n }\n re
turn tag;\n }\n\n function prototypeForTagIE(tag) {\n var constructor = win
dow[tag];\n if (constructor == null) return null;\n return constructor.pro
totype;\n }\n\n hooks.getTag = getTagIE;\n hooks.prototypeForTag = prototypeF
orTagIE;\n}')); | |
| 513 let _fixDocumentHooksTransformer = dart.const(new _foreign_helper.JS_CONST('fu
nction(hooks) {\n var getTag = hooks.getTag;\n var prototypeForTag = hooks.pro
totypeForTag;\n function getTagFixed(o) {\n var tag = getTag(o);\n if (ta
g == "Document") {\n // Some browsers and the polymer polyfill call both HT
ML and XML documents\n // "Document", so we check for the xmlVersion proper
ty, which is the empty\n // string on HTML documents. Since both dart:html
classes Document and\n // HtmlDocument share the same type, we must patch t
he instances and not\n // the prototype.\n if (!!o.xmlVersion) return
"!Document";\n return "!HTMLDocument";\n }\n return tag;\n }\n\n fu
nction prototypeForTagFixed(tag) {\n if (tag == "Document") return null; //
Do not pre-patch Document.\n return prototypeForTag(tag);\n }\n\n hooks.get
Tag = getTagFixed;\n hooks.prototypeForTag = prototypeForTagFixed;\n}')); | |
| 514 let _firefoxHooksTransformer = dart.const(new _foreign_helper.JS_CONST('functi
on(hooks) {\n var userAgent = typeof navigator == "object" ? navigator.userAgen
t : "";\n if (userAgent.indexOf("Firefox") == -1) return hooks;\n\n var getTag
= hooks.getTag;\n\n var quickMap = {\n "BeforeUnloadEvent": "Event",\n "
DataTransfer": "Clipboard",\n "GeoGeolocation": "Geolocation",\n "Location
": "!Location", // Fixes issue 18151\n "WorkerMessageEvent": "M
essageEvent",\n "XMLDocument": "!Document"};\n\n function getTagFirefox(o) {
\n var tag = getTag(o);\n return quickMap[tag] || tag;\n }\n\n hooks.get
Tag = getTagFirefox;\n}')); | |
| 515 let _operaHooksTransformer = dart.const(new _foreign_helper.JS_CONST('function
(hooks) { return hooks; }\n')); | |
| 516 let _safariHooksTransformer = dart.const(new _foreign_helper.JS_CONST('functio
n(hooks) { return hooks; }\n')); | |
| 517 let _dartExperimentalFixupGetTagHooksTransformer = dart.const(new _foreign_hel
per.JS_CONST('function(hooks) {\n if (typeof dartExperimentalFixupGetTag != "fu
nction") return hooks;\n hooks.getTag = dartExperimentalFixupGetTag(hooks.getTa
g);\n}')); | |
| 518 let _nativeRegExp = Symbol('_nativeRegExp'); | 45 let _nativeRegExp = Symbol('_nativeRegExp'); |
| 519 function regExpGetNative(regexp) { | 46 function regExpGetNative(regexp) { |
| 520 return regexp[_nativeRegExp]; | 47 return regexp[_nativeRegExp]; |
| 521 } | 48 } |
| 522 dart.fn(regExpGetNative, () => dart.functionType(core.Object, [JSSyntaxRegExp]
)); | 49 dart.fn(regExpGetNative, () => dart.functionType(core.Object, [JSSyntaxRegExp]
)); |
| 523 let _nativeGlobalVersion = Symbol('_nativeGlobalVersion'); | 50 let _nativeGlobalVersion = Symbol('_nativeGlobalVersion'); |
| 524 function regExpGetGlobalNative(regexp) { | 51 function regExpGetGlobalNative(regexp) { |
| 525 let nativeRegexp = regexp[_nativeGlobalVersion]; | 52 let nativeRegexp = regexp[_nativeGlobalVersion]; |
| 526 nativeRegexp.lastIndex = 0; | 53 nativeRegexp.lastIndex = 0; |
| 527 return nativeRegexp; | 54 return nativeRegexp; |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 967 } else { | 494 } else { |
| 968 checkNull(from); | 495 checkNull(from); |
| 969 throw "String.replace(Pattern) UNIMPLEMENTED"; | 496 throw "String.replace(Pattern) UNIMPLEMENTED"; |
| 970 } | 497 } |
| 971 } | 498 } |
| 972 dart.fn(stringReplaceFirstUnchecked, core.Object, [core.Object, core.Object, c
ore.Object], [core.int]); | 499 dart.fn(stringReplaceFirstUnchecked, core.Object, [core.Object, core.Object, c
ore.Object], [core.int]); |
| 973 function stringJoinUnchecked(array, separator) { | 500 function stringJoinUnchecked(array, separator) { |
| 974 return array.join(separator); | 501 return array.join(separator); |
| 975 } | 502 } |
| 976 dart.fn(stringJoinUnchecked); | 503 dart.fn(stringJoinUnchecked); |
| 977 function createRuntimeType(name) { | |
| 978 return new TypeImpl(name); | |
| 979 } | |
| 980 dart.fn(createRuntimeType, core.Type, [core.String]); | |
| 981 let _typeName = Symbol('_typeName'); | |
| 982 let _unmangledName = Symbol('_unmangledName'); | |
| 983 class TypeImpl extends core.Object { | |
| 984 TypeImpl(typeName) { | |
| 985 this[_typeName] = typeName; | |
| 986 this[_unmangledName] = null; | |
| 987 } | |
| 988 toString() { | |
| 989 if (this[_unmangledName] != null) | |
| 990 return this[_unmangledName]; | |
| 991 let unmangledName = unmangleAllIdentifiersIfPreservedAnyways(this[_typeNam
e]); | |
| 992 return this[_unmangledName] = unmangledName; | |
| 993 } | |
| 994 get hashCode() { | |
| 995 return dart.hashCode(this[_typeName]); | |
| 996 } | |
| 997 ['=='](other) { | |
| 998 return dart.is(other, TypeImpl) && dart.equals(this[_typeName], dart.dload
(other, _typeName)); | |
| 999 } | |
| 1000 } | |
| 1001 TypeImpl[dart.implements] = () => [core.Type]; | |
| 1002 dart.setSignature(TypeImpl, { | |
| 1003 constructors: () => ({TypeImpl: [TypeImpl, [core.String]]}) | |
| 1004 }); | |
| 1005 class TypeVariable extends core.Object { | |
| 1006 TypeVariable(owner, name, bound) { | |
| 1007 this.owner = owner; | |
| 1008 this.name = name; | |
| 1009 this.bound = bound; | |
| 1010 } | |
| 1011 } | |
| 1012 dart.setSignature(TypeVariable, { | |
| 1013 constructors: () => ({TypeVariable: [TypeVariable, [core.Type, core.String,
core.int]]}) | |
| 1014 }); | |
| 1015 function getMangledTypeName(type) { | |
| 1016 return type[_typeName]; | |
| 1017 } | |
| 1018 dart.fn(getMangledTypeName, core.Object, [TypeImpl]); | |
| 1019 function setRuntimeTypeInfo(target, typeInfo) { | |
| 1020 dart.assert(dart.notNull(typeInfo == null) || dart.notNull(isJsArray(typeInf
o))); | |
| 1021 if (target != null) | |
| 1022 target.$builtinTypeInfo = typeInfo; | |
| 1023 return target; | |
| 1024 } | |
| 1025 dart.fn(setRuntimeTypeInfo, core.Object, [core.Object, core.Object]); | |
| 1026 function getRuntimeTypeInfo(target) { | |
| 1027 if (target == null) | |
| 1028 return null; | |
| 1029 return target.$builtinTypeInfo; | |
| 1030 } | |
| 1031 dart.fn(getRuntimeTypeInfo, core.Object, [core.Object]); | |
| 1032 function getRuntimeTypeArguments(target, substitutionName) { | |
| 1033 let substitution = getField(target, `${_foreign_helper.JS_OPERATOR_AS_PREFIX
()}${substitutionName}`); | |
| 1034 return substitute(substitution, getRuntimeTypeInfo(target)); | |
| 1035 } | |
| 1036 dart.fn(getRuntimeTypeArguments); | |
| 1037 function getRuntimeTypeArgument(target, substitutionName, index) { | |
| 1038 let arguments$ = getRuntimeTypeArguments(target, substitutionName); | |
| 1039 return arguments$ == null ? null : getIndex(arguments$, index); | |
| 1040 } | |
| 1041 dart.fn(getRuntimeTypeArgument, core.Object, [core.Object, core.String, core.i
nt]); | |
| 1042 function getTypeArgumentByIndex(target, index) { | |
| 1043 let rti = getRuntimeTypeInfo(target); | |
| 1044 return rti == null ? null : getIndex(rti, index); | |
| 1045 } | |
| 1046 dart.fn(getTypeArgumentByIndex, core.Object, [core.Object, core.int]); | |
| 1047 function copyTypeArguments(source, target) { | |
| 1048 target.$builtinTypeInfo = source.$builtinTypeInfo; | |
| 1049 } | |
| 1050 dart.fn(copyTypeArguments, dart.void, [core.Object, core.Object]); | |
| 1051 function getClassName(object) { | |
| 1052 return _interceptors.getInterceptor(object).constructor.builtin$cls; | |
| 1053 } | |
| 1054 dart.fn(getClassName, core.String, [core.Object]); | |
| 1055 function getRuntimeTypeAsString(runtimeType, opts) { | |
| 1056 let onTypeVariable = opts && 'onTypeVariable' in opts ? opts.onTypeVariable
: null; | |
| 1057 dart.assert(isJsArray(runtimeType)); | |
| 1058 let className = getConstructorName(getIndex(runtimeType, 0)); | |
| 1059 return `${className}` + `${joinArguments(runtimeType, 1, {onTypeVariable: on
TypeVariable})}`; | |
| 1060 } | |
| 1061 dart.fn(getRuntimeTypeAsString, core.String, [core.Object], {onTypeVariable: d
art.functionType(core.String, [core.int])}); | |
| 1062 function getConstructorName(type) { | |
| 1063 return type.builtin$cls; | |
| 1064 } | |
| 1065 dart.fn(getConstructorName, core.String, [core.Object]); | |
| 1066 function runtimeTypeToString(type, opts) { | |
| 1067 let onTypeVariable = opts && 'onTypeVariable' in opts ? opts.onTypeVariable
: null; | |
| 1068 if (type == null) { | |
| 1069 return 'dynamic'; | |
| 1070 } else if (isJsArray(type)) { | |
| 1071 return getRuntimeTypeAsString(type, {onTypeVariable: onTypeVariable}); | |
| 1072 } else if (isJsFunction(type)) { | |
| 1073 return getConstructorName(type); | |
| 1074 } else if (typeof type == 'number') { | |
| 1075 if (onTypeVariable == null) { | |
| 1076 return dart.toString(type); | |
| 1077 } else { | |
| 1078 return onTypeVariable(dart.as(type, core.int)); | |
| 1079 } | |
| 1080 } else { | |
| 1081 return null; | |
| 1082 } | |
| 1083 } | |
| 1084 dart.fn(runtimeTypeToString, core.String, [core.Object], {onTypeVariable: dart
.functionType(core.String, [core.int])}); | |
| 1085 function joinArguments(types, startIndex, opts) { | |
| 1086 let onTypeVariable = opts && 'onTypeVariable' in opts ? opts.onTypeVariable
: null; | |
| 1087 if (types == null) | |
| 1088 return ''; | |
| 1089 dart.assert(isJsArray(types)); | |
| 1090 let firstArgument = true; | |
| 1091 let allDynamic = true; | |
| 1092 let buffer = new core.StringBuffer(); | |
| 1093 for (let index = startIndex; dart.notNull(index) < dart.notNull(getLength(ty
pes)); index = dart.notNull(index) + 1) { | |
| 1094 if (firstArgument) { | |
| 1095 firstArgument = false; | |
| 1096 } else { | |
| 1097 buffer.write(', '); | |
| 1098 } | |
| 1099 let argument = getIndex(types, index); | |
| 1100 if (argument != null) { | |
| 1101 allDynamic = false; | |
| 1102 } | |
| 1103 buffer.write(runtimeTypeToString(argument, {onTypeVariable: onTypeVariable
})); | |
| 1104 } | |
| 1105 return allDynamic ? '' : `<${buffer}>`; | |
| 1106 } | |
| 1107 dart.fn(joinArguments, core.String, [core.Object, core.int], {onTypeVariable:
dart.functionType(core.String, [core.int])}); | |
| 1108 function getRuntimeTypeString(object) { | |
| 1109 let className = getClassName(object); | |
| 1110 if (object == null) | |
| 1111 return className; | |
| 1112 let typeInfo = object.$builtinTypeInfo; | |
| 1113 return `${className}${joinArguments(typeInfo, 0)}`; | |
| 1114 } | |
| 1115 dart.fn(getRuntimeTypeString, core.String, [core.Object]); | |
| 1116 function getRuntimeType(object) { | 504 function getRuntimeType(object) { |
| 1117 let type = getRuntimeTypeString(object); | 505 return dart.as(dart.realRuntimeType(object), core.Type); |
| 1118 return new TypeImpl(type); | |
| 1119 } | 506 } |
| 1120 dart.fn(getRuntimeType, core.Type, [core.Object]); | 507 dart.fn(getRuntimeType, core.Type, [core.Object]); |
| 1121 function substitute(substitution, arguments$) { | |
| 1122 dart.assert(dart.notNull(substitution == null) || dart.notNull(isJsFunction(
substitution))); | |
| 1123 dart.assert(dart.notNull(arguments$ == null) || dart.notNull(isJsArray(argum
ents$))); | |
| 1124 if (isJsFunction(substitution)) { | |
| 1125 substitution = invoke(substitution, arguments$); | |
| 1126 if (isJsArray(substitution)) { | |
| 1127 arguments$ = substitution; | |
| 1128 } else if (isJsFunction(substitution)) { | |
| 1129 arguments$ = invoke(substitution, arguments$); | |
| 1130 } | |
| 1131 } | |
| 1132 return arguments$; | |
| 1133 } | |
| 1134 dart.fn(substitute); | |
| 1135 function checkSubtype(object, isField, checks, asField) { | |
| 1136 if (object == null) | |
| 1137 return false; | |
| 1138 let arguments$ = getRuntimeTypeInfo(object); | |
| 1139 let interceptor = _interceptors.getInterceptor(object); | |
| 1140 let isSubclass = getField(interceptor, isField); | |
| 1141 if (isSubclass == null) | |
| 1142 return false; | |
| 1143 let substitution = getField(interceptor, asField); | |
| 1144 return checkArguments(substitution, arguments$, checks); | |
| 1145 } | |
| 1146 dart.fn(checkSubtype, core.bool, [core.Object, core.String, core.List, core.St
ring]); | |
| 1147 function computeTypeName(isField, arguments$) { | |
| 1148 let prefixLength = _foreign_helper.JS_OPERATOR_IS_PREFIX().length; | |
| 1149 return Primitives.formatType(isField.substring(prefixLength, isField.length)
, arguments$); | |
| 1150 } | |
| 1151 dart.fn(computeTypeName, core.String, [core.String, core.List]); | |
| 1152 function subtypeCast(object, isField, checks, asField) { | |
| 1153 if (dart.notNull(object != null) && !dart.notNull(checkSubtype(object, isFie
ld, checks, asField))) { | |
| 1154 let actualType = Primitives.objectTypeName(object); | |
| 1155 let typeName = computeTypeName(isField, checks); | |
| 1156 throw new CastErrorImplementation(actualType, typeName); | |
| 1157 } | |
| 1158 return object; | |
| 1159 } | |
| 1160 dart.fn(subtypeCast, core.Object, [core.Object, core.String, core.List, core.S
tring]); | |
| 1161 function assertSubtype(object, isField, checks, asField) { | |
| 1162 if (dart.notNull(object != null) && !dart.notNull(checkSubtype(object, isFie
ld, checks, asField))) { | |
| 1163 let typeName = computeTypeName(isField, checks); | |
| 1164 throw new TypeErrorImplementation(object, typeName); | |
| 1165 } | |
| 1166 return object; | |
| 1167 } | |
| 1168 dart.fn(assertSubtype, core.Object, [core.Object, core.String, core.List, core
.String]); | |
| 1169 function assertIsSubtype(subtype, supertype, message) { | |
| 1170 if (!dart.notNull(isSubtype(subtype, supertype))) { | |
| 1171 throwTypeError(message); | |
| 1172 } | |
| 1173 } | |
| 1174 dart.fn(assertIsSubtype, core.Object, [core.Object, core.Object, core.String])
; | |
| 1175 function throwTypeError(message) { | |
| 1176 throw new TypeErrorImplementation.fromMessage(dart.as(message, core.String))
; | |
| 1177 } | |
| 1178 dart.fn(throwTypeError); | |
| 1179 function checkArguments(substitution, arguments$, checks) { | |
| 1180 return areSubtypes(substitute(substitution, arguments$), checks); | |
| 1181 } | |
| 1182 dart.fn(checkArguments, core.bool, [core.Object, core.Object, core.Object]); | |
| 1183 function areSubtypes(s, t) { | |
| 1184 if (dart.notNull(s == null) || dart.notNull(t == null)) | |
| 1185 return true; | |
| 1186 dart.assert(isJsArray(s)); | |
| 1187 dart.assert(isJsArray(t)); | |
| 1188 dart.assert(getLength(s) == getLength(t)); | |
| 1189 let len = getLength(s); | |
| 1190 for (let i = 0; dart.notNull(i) < dart.notNull(len); i = dart.notNull(i) + 1
) { | |
| 1191 if (!dart.notNull(isSubtype(getIndex(s, i), getIndex(t, i)))) { | |
| 1192 return false; | |
| 1193 } | |
| 1194 } | |
| 1195 return true; | |
| 1196 } | |
| 1197 dart.fn(areSubtypes, core.bool, [core.Object, core.Object]); | |
| 1198 function computeSignature(signature, context, contextName) { | |
| 1199 let typeArguments = getRuntimeTypeArguments(context, contextName); | |
| 1200 return invokeOn(signature, context, typeArguments); | |
| 1201 } | |
| 1202 dart.fn(computeSignature); | |
| 1203 function isSupertypeOfNull(type) { | |
| 1204 return dart.notNull(type == null) || getConstructorName(type) == _foreign_he
lper.JS_OBJECT_CLASS_NAME() || getConstructorName(type) == _foreign_helper.JS_NU
LL_CLASS_NAME(); | |
| 1205 } | |
| 1206 dart.fn(isSupertypeOfNull, core.bool, [core.Object]); | |
| 1207 function checkSubtypeOfRuntimeType(o, t) { | |
| 1208 if (o == null) | |
| 1209 return isSupertypeOfNull(t); | |
| 1210 if (t == null) | |
| 1211 return true; | |
| 1212 let rti = getRuntimeTypeInfo(o); | |
| 1213 o = _interceptors.getInterceptor(o); | |
| 1214 let type = o.constructor; | |
| 1215 if (rti != null) { | |
| 1216 rti = rti.slice(); | |
| 1217 rti.splice(0, 0, type); | |
| 1218 type = rti; | |
| 1219 } else if (hasField(t, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`)) { | |
| 1220 let signatureName = `${_foreign_helper.JS_OPERATOR_IS_PREFIX()}_${getField
(t, _foreign_helper.JS_FUNCTION_TYPE_TAG())}`; | |
| 1221 if (hasField(o, signatureName)) | |
| 1222 return true; | |
| 1223 let targetSignatureFunction = getField(o, `${_foreign_helper.JS_SIGNATURE_
NAME()}`); | |
| 1224 if (targetSignatureFunction == null) | |
| 1225 return false; | |
| 1226 type = invokeOn(targetSignatureFunction, o, null); | |
| 1227 return isFunctionSubtype(type, t); | |
| 1228 } | |
| 1229 return isSubtype(type, t); | |
| 1230 } | |
| 1231 dart.fn(checkSubtypeOfRuntimeType, core.bool, [core.Object, core.Object]); | |
| 1232 function subtypeOfRuntimeTypeCast(object, type) { | |
| 1233 if (dart.notNull(object != null) && !dart.notNull(checkSubtypeOfRuntimeType(
object, type))) { | |
| 1234 let actualType = Primitives.objectTypeName(object); | |
| 1235 throw new CastErrorImplementation(actualType, runtimeTypeToString(type)); | |
| 1236 } | |
| 1237 return object; | |
| 1238 } | |
| 1239 dart.fn(subtypeOfRuntimeTypeCast, core.Object, [core.Object, core.Object]); | |
| 1240 function assertSubtypeOfRuntimeType(object, type) { | |
| 1241 if (dart.notNull(object != null) && !dart.notNull(checkSubtypeOfRuntimeType(
object, type))) { | |
| 1242 throw new TypeErrorImplementation(object, runtimeTypeToString(type)); | |
| 1243 } | |
| 1244 return object; | |
| 1245 } | |
| 1246 dart.fn(assertSubtypeOfRuntimeType, core.Object, [core.Object, core.Object]); | |
| 1247 function getArguments(type) { | |
| 1248 return isJsArray(type) ? type.slice(1) : null; | |
| 1249 } | |
| 1250 dart.fn(getArguments); | |
| 1251 function isSubtype(s, t) { | |
| 1252 if (isIdentical(s, t)) | |
| 1253 return true; | |
| 1254 if (dart.notNull(s == null) || dart.notNull(t == null)) | |
| 1255 return true; | |
| 1256 if (hasField(t, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`)) { | |
| 1257 return isFunctionSubtype(s, t); | |
| 1258 } | |
| 1259 if (hasField(s, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`)) { | |
| 1260 return getConstructorName(t) == _foreign_helper.JS_FUNCTION_CLASS_NAME(); | |
| 1261 } | |
| 1262 let typeOfS = isJsArray(s) ? getIndex(s, 0) : s; | |
| 1263 let typeOfT = isJsArray(t) ? getIndex(t, 0) : t; | |
| 1264 let name = runtimeTypeToString(typeOfT); | |
| 1265 let substitution = null; | |
| 1266 if (isNotIdentical(typeOfT, typeOfS)) { | |
| 1267 let test = `${_foreign_helper.JS_OPERATOR_IS_PREFIX()}${name}`; | |
| 1268 let typeOfSPrototype = typeOfS.prototype; | |
| 1269 if (hasNoField(typeOfSPrototype, test)) | |
| 1270 return false; | |
| 1271 let field = `${_foreign_helper.JS_OPERATOR_AS_PREFIX()}${runtimeTypeToStri
ng(typeOfT)}`; | |
| 1272 substitution = getField(typeOfSPrototype, field); | |
| 1273 } | |
| 1274 if (!dart.notNull(isJsArray(s)) && dart.notNull(substitution == null) || !da
rt.notNull(isJsArray(t))) { | |
| 1275 return true; | |
| 1276 } | |
| 1277 return checkArguments(substitution, getArguments(s), getArguments(t)); | |
| 1278 } | |
| 1279 dart.fn(isSubtype, core.bool, [core.Object, core.Object]); | |
| 1280 function isAssignable(s, t) { | |
| 1281 return dart.notNull(isSubtype(s, t)) || dart.notNull(isSubtype(t, s)); | |
| 1282 } | |
| 1283 dart.fn(isAssignable, core.bool, [core.Object, core.Object]); | |
| 1284 function areAssignable(s, t, allowShorter) { | |
| 1285 if (dart.notNull(t == null) && dart.notNull(s == null)) | |
| 1286 return true; | |
| 1287 if (t == null) | |
| 1288 return allowShorter; | |
| 1289 if (s == null) | |
| 1290 return false; | |
| 1291 dart.assert(isJsArray(s)); | |
| 1292 dart.assert(isJsArray(t)); | |
| 1293 let sLength = getLength(s); | |
| 1294 let tLength = getLength(t); | |
| 1295 if (allowShorter) { | |
| 1296 if (dart.notNull(sLength) < dart.notNull(tLength)) | |
| 1297 return false; | |
| 1298 } else { | |
| 1299 if (sLength != tLength) | |
| 1300 return false; | |
| 1301 } | |
| 1302 for (let i = 0; dart.notNull(i) < dart.notNull(tLength); i = dart.notNull(i)
+ 1) { | |
| 1303 if (!dart.notNull(isAssignable(getIndex(s, i), getIndex(t, i)))) { | |
| 1304 return false; | |
| 1305 } | |
| 1306 } | |
| 1307 return true; | |
| 1308 } | |
| 1309 dart.fn(areAssignable, core.bool, [core.List, core.List, core.bool]); | |
| 1310 function areAssignableMaps(s, t) { | |
| 1311 if (t == null) | |
| 1312 return true; | |
| 1313 if (s == null) | |
| 1314 return false; | |
| 1315 dart.assert(isJsObject(s)); | |
| 1316 dart.assert(isJsObject(t)); | |
| 1317 let names = _interceptors.JSArray.markFixedList(dart.as(Object.getOwnPropert
yNames(t), core.List)); | |
| 1318 for (let i = 0; dart.notNull(i) < dart.notNull(names[core.$length]); i = dar
t.notNull(i) + 1) { | |
| 1319 let name = names[core.$get](i); | |
| 1320 if (!Object.hasOwnProperty.call(s, name)) { | |
| 1321 return false; | |
| 1322 } | |
| 1323 let tType = t[name]; | |
| 1324 let sType = s[name]; | |
| 1325 if (!dart.notNull(isAssignable(tType, sType))) | |
| 1326 return false; | |
| 1327 } | |
| 1328 return true; | |
| 1329 } | |
| 1330 dart.fn(areAssignableMaps, core.bool, [core.Object, core.Object]); | |
| 1331 function isFunctionSubtype(s, t) { | |
| 1332 dart.assert(hasField(t, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`)); | |
| 1333 if (hasNoField(s, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`)) | |
| 1334 return false; | |
| 1335 if (hasField(s, `${_foreign_helper.JS_FUNCTION_TYPE_VOID_RETURN_TAG()}`)) { | |
| 1336 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))) { | |
| 1337 return false; | |
| 1338 } | |
| 1339 } else if (hasNoField(t, `${_foreign_helper.JS_FUNCTION_TYPE_VOID_RETURN_TAG
()}`)) { | |
| 1340 let sReturnType = getField(s, `${_foreign_helper.JS_FUNCTION_TYPE_RETURN_T
YPE_TAG()}`); | |
| 1341 let tReturnType = getField(t, `${_foreign_helper.JS_FUNCTION_TYPE_RETURN_T
YPE_TAG()}`); | |
| 1342 if (!dart.notNull(isAssignable(sReturnType, tReturnType))) | |
| 1343 return false; | |
| 1344 } | |
| 1345 let sParameterTypes = getField(s, `${_foreign_helper.JS_FUNCTION_TYPE_REQUIR
ED_PARAMETERS_TAG()}`); | |
| 1346 let tParameterTypes = getField(t, `${_foreign_helper.JS_FUNCTION_TYPE_REQUIR
ED_PARAMETERS_TAG()}`); | |
| 1347 let sOptionalParameterTypes = getField(s, `${_foreign_helper.JS_FUNCTION_TYP
E_OPTIONAL_PARAMETERS_TAG()}`); | |
| 1348 let tOptionalParameterTypes = getField(t, `${_foreign_helper.JS_FUNCTION_TYP
E_OPTIONAL_PARAMETERS_TAG()}`); | |
| 1349 let sParametersLen = sParameterTypes != null ? getLength(sParameterTypes) :
0; | |
| 1350 let tParametersLen = tParameterTypes != null ? getLength(tParameterTypes) :
0; | |
| 1351 let sOptionalParametersLen = sOptionalParameterTypes != null ? getLength(sOp
tionalParameterTypes) : 0; | |
| 1352 let tOptionalParametersLen = tOptionalParameterTypes != null ? getLength(tOp
tionalParameterTypes) : 0; | |
| 1353 if (dart.notNull(sParametersLen) > dart.notNull(tParametersLen)) { | |
| 1354 return false; | |
| 1355 } | |
| 1356 if (dart.notNull(sParametersLen) + dart.notNull(sOptionalParametersLen) < da
rt.notNull(tParametersLen) + dart.notNull(tOptionalParametersLen)) { | |
| 1357 return false; | |
| 1358 } | |
| 1359 if (sParametersLen == tParametersLen) { | |
| 1360 if (!dart.notNull(areAssignable(dart.as(sParameterTypes, core.List), dart.
as(tParameterTypes, core.List), false))) | |
| 1361 return false; | |
| 1362 if (!dart.notNull(areAssignable(dart.as(sOptionalParameterTypes, core.List
), dart.as(tOptionalParameterTypes, core.List), true))) { | |
| 1363 return false; | |
| 1364 } | |
| 1365 } else { | |
| 1366 let pos = 0; | |
| 1367 for (; dart.notNull(pos) < dart.notNull(sParametersLen); pos = dart.notNul
l(pos) + 1) { | |
| 1368 if (!dart.notNull(isAssignable(getIndex(sParameterTypes, pos), getIndex(
tParameterTypes, pos)))) { | |
| 1369 return false; | |
| 1370 } | |
| 1371 } | |
| 1372 let sPos = 0; | |
| 1373 let tPos = pos; | |
| 1374 for (; dart.notNull(tPos) < dart.notNull(tParametersLen); sPos = dart.notN
ull(sPos) + 1, tPos = dart.notNull(tPos) + 1) { | |
| 1375 if (!dart.notNull(isAssignable(getIndex(sOptionalParameterTypes, sPos),
getIndex(tParameterTypes, tPos)))) { | |
| 1376 return false; | |
| 1377 } | |
| 1378 } | |
| 1379 tPos = 0; | |
| 1380 for (; dart.notNull(tPos) < dart.notNull(tOptionalParametersLen); sPos = d
art.notNull(sPos) + 1, tPos = dart.notNull(tPos) + 1) { | |
| 1381 if (!dart.notNull(isAssignable(getIndex(sOptionalParameterTypes, sPos),
getIndex(tOptionalParameterTypes, tPos)))) { | |
| 1382 return false; | |
| 1383 } | |
| 1384 } | |
| 1385 } | |
| 1386 let sNamedParameters = getField(s, `${_foreign_helper.JS_FUNCTION_TYPE_NAMED
_PARAMETERS_TAG()}`); | |
| 1387 let tNamedParameters = getField(t, `${_foreign_helper.JS_FUNCTION_TYPE_NAMED
_PARAMETERS_TAG()}`); | |
| 1388 return areAssignableMaps(sNamedParameters, tNamedParameters); | |
| 1389 } | |
| 1390 dart.fn(isFunctionSubtype, core.bool, [core.Object, core.Object]); | |
| 1391 function invoke(func, arguments$) { | |
| 1392 return invokeOn(func, null, arguments$); | |
| 1393 } | |
| 1394 dart.fn(invoke); | |
| 1395 function invokeOn(func, receiver, arguments$) { | |
| 1396 dart.assert(isJsFunction(func)); | |
| 1397 dart.assert(dart.notNull(arguments$ == null) || dart.notNull(isJsArray(argum
ents$))); | |
| 1398 return func.apply(receiver, arguments$); | |
| 1399 } | |
| 1400 dart.fn(invokeOn, core.Object, [core.Object, core.Object, core.Object]); | |
| 1401 function call(object, name) { | |
| 1402 return object[name](); | |
| 1403 } | |
| 1404 dart.fn(call, core.Object, [core.Object, core.String]); | |
| 1405 function getField(object, name) { | |
| 1406 return object[name]; | |
| 1407 } | |
| 1408 dart.fn(getField, core.Object, [core.Object, core.String]); | |
| 1409 function getIndex(array, index) { | 508 function getIndex(array, index) { |
| 1410 dart.assert(isJsArray(array)); | 509 dart.assert(isJsArray(array)); |
| 1411 return array[index]; | 510 return array[index]; |
| 1412 } | 511 } |
| 1413 dart.fn(getIndex, core.Object, [core.Object, core.int]); | 512 dart.fn(getIndex, core.Object, [core.Object, core.int]); |
| 1414 function getLength(array) { | 513 function getLength(array) { |
| 1415 dart.assert(isJsArray(array)); | 514 dart.assert(isJsArray(array)); |
| 1416 return array.length; | 515 return array.length; |
| 1417 } | 516 } |
| 1418 dart.fn(getLength, core.int, [core.Object]); | 517 dart.fn(getLength, core.int, [core.Object]); |
| 1419 function isJsArray(value) { | 518 function isJsArray(value) { |
| 1420 return dart.is(value, _interceptors.JSArray); | 519 return dart.is(value, _interceptors.JSArray); |
| 1421 } | 520 } |
| 1422 dart.fn(isJsArray, core.bool, [core.Object]); | 521 dart.fn(isJsArray, core.bool, [core.Object]); |
| 1423 function hasField(object, name) { | |
| 1424 return name in object; | |
| 1425 } | |
| 1426 dart.fn(hasField); | |
| 1427 function hasNoField(object, name) { | |
| 1428 return dart.dsend(hasField(object, name), '!'); | |
| 1429 } | |
| 1430 dart.fn(hasNoField); | |
| 1431 function isJsFunction(o) { | |
| 1432 return typeof o == "function"; | |
| 1433 } | |
| 1434 dart.fn(isJsFunction, core.bool, [core.Object]); | |
| 1435 function isJsObject(o) { | |
| 1436 return typeof o == 'object'; | |
| 1437 } | |
| 1438 dart.fn(isJsObject, core.bool, [core.Object]); | |
| 1439 function isIdentical(s, t) { | |
| 1440 return s === t; | |
| 1441 } | |
| 1442 dart.fn(isIdentical, core.bool, [core.Object, core.Object]); | |
| 1443 function isNotIdentical(s, t) { | |
| 1444 return s !== t; | |
| 1445 } | |
| 1446 dart.fn(isNotIdentical, core.bool, [core.Object, core.Object]); | |
| 1447 function unmangleGlobalNameIfPreservedAnyways(str) { | |
| 1448 return str; | |
| 1449 } | |
| 1450 dart.fn(unmangleGlobalNameIfPreservedAnyways, core.String, [core.String]); | |
| 1451 function unmangleAllIdentifiersIfPreservedAnyways(str) { | |
| 1452 return str; | |
| 1453 } | |
| 1454 dart.fn(unmangleAllIdentifiersIfPreservedAnyways, core.String, [core.String]); | |
| 1455 class _Patch extends core.Object { | 522 class _Patch extends core.Object { |
| 1456 _Patch() { | 523 _Patch() { |
| 1457 } | 524 } |
| 1458 } | 525 } |
| 1459 dart.setSignature(_Patch, { | 526 dart.setSignature(_Patch, { |
| 1460 constructors: () => ({_Patch: [_Patch, []]}) | 527 constructors: () => ({_Patch: [_Patch, []]}) |
| 1461 }); | 528 }); |
| 1462 let patch = dart.const(new _Patch()); | 529 let patch = dart.const(new _Patch()); |
| 1463 class InternalMap extends core.Object {} | 530 class InternalMap extends core.Object {} |
| 1464 function requiresPreamble() { | |
| 1465 } | |
| 1466 dart.fn(requiresPreamble); | |
| 1467 function isJsIndexable(object, record) { | |
| 1468 if (record != null) { | |
| 1469 let result = _interceptors.dispatchRecordIndexability(record); | |
| 1470 if (result != null) | |
| 1471 return dart.as(result, core.bool); | |
| 1472 } | |
| 1473 return dart.is(object, exports.JavaScriptIndexingBehavior); | |
| 1474 } | |
| 1475 dart.fn(isJsIndexable, core.bool, [core.Object, core.Object]); | |
| 1476 function S(value) { | |
| 1477 if (typeof value == 'string') | |
| 1478 return dart.as(value, core.String); | |
| 1479 if (dart.is(value, core.num)) { | |
| 1480 if (!dart.equals(value, 0)) { | |
| 1481 return "" + value; | |
| 1482 } | |
| 1483 } else if (dart.equals(true, value)) { | |
| 1484 return 'true'; | |
| 1485 } else if (dart.equals(false, value)) { | |
| 1486 return 'false'; | |
| 1487 } else if (value == null) { | |
| 1488 return 'null'; | |
| 1489 } | |
| 1490 let res = dart.toString(value); | |
| 1491 if (!(typeof res == 'string')) | |
| 1492 throw new core.ArgumentError(value); | |
| 1493 return res; | |
| 1494 } | |
| 1495 dart.fn(S, core.String, [core.Object]); | |
| 1496 function createInvocationMirror(name, internalName, kind, arguments$, argument
Names) { | |
| 1497 return new JSInvocationMirror(name, dart.as(internalName, core.String), dart
.as(kind, core.int), dart.as(arguments$, core.List), dart.as(argumentNames, core
.List)); | |
| 1498 } | |
| 1499 dart.fn(createInvocationMirror, core.Object, [core.String, core.Object, core.O
bject, core.Object, core.Object]); | |
| 1500 function createUnmangledInvocationMirror(symbol, internalName, kind, arguments
$, argumentNames) { | |
| 1501 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)); | |
| 1502 } | |
| 1503 dart.fn(createUnmangledInvocationMirror, core.Object, [core.Symbol, core.Objec
t, core.Object, core.Object, core.Object]); | |
| 1504 function throwInvalidReflectionError(memberName) { | |
| 1505 throw new core.UnsupportedError(`Can't use '${memberName}' in reflection ` +
"because it is not included in a @MirrorsUsed annotation."); | |
| 1506 } | |
| 1507 dart.fn(throwInvalidReflectionError, dart.void, [core.String]); | |
| 1508 function traceHelper(method) { | |
| 1509 if (!this.cache) { | |
| 1510 this.cache = Object.create(null); | |
| 1511 } | |
| 1512 if (!this.cache[method]) { | |
| 1513 console.log(method); | |
| 1514 this.cache[method] = true; | |
| 1515 } | |
| 1516 } | |
| 1517 dart.fn(traceHelper, dart.void, [core.String]); | |
| 1518 let _memberName = Symbol('_memberName'); | |
| 1519 let _internalName = Symbol('_internalName'); | |
| 1520 let _kind = Symbol('_kind'); | |
| 1521 let _arguments = Symbol('_arguments'); | |
| 1522 let _namedArgumentNames = Symbol('_namedArgumentNames'); | |
| 1523 let _namedIndices = Symbol('_namedIndices'); | |
| 1524 let _getCachedInvocation = Symbol('_getCachedInvocation'); | |
| 1525 class JSInvocationMirror extends core.Object { | |
| 1526 JSInvocationMirror(memberName, internalName, kind, arguments$, namedArgument
Names) { | |
| 1527 this[_memberName] = memberName; | |
| 1528 this[_internalName] = internalName; | |
| 1529 this[_kind] = kind; | |
| 1530 this[_arguments] = arguments$; | |
| 1531 this[_namedArgumentNames] = namedArgumentNames; | |
| 1532 this[_namedIndices] = null; | |
| 1533 } | |
| 1534 get memberName() { | |
| 1535 if (dart.is(this[_memberName], core.Symbol)) | |
| 1536 return dart.as(this[_memberName], core.Symbol); | |
| 1537 let name = dart.as(this[_memberName], core.String); | |
| 1538 let unmangledName = _js_names.mangledNames.get(name); | |
| 1539 if (unmangledName != null) { | |
| 1540 name = unmangledName.split(':')[core.$get](0); | |
| 1541 } else { | |
| 1542 if (_js_names.mangledNames.get(this[_internalName]) == null) { | |
| 1543 core.print(`Warning: '${name}' is used reflectively but not in Mirrors
Used. ` + "This will break minified code."); | |
| 1544 } | |
| 1545 } | |
| 1546 this[_memberName] = new _internal.Symbol.unvalidated(name); | |
| 1547 return dart.as(this[_memberName], core.Symbol); | |
| 1548 } | |
| 1549 get isMethod() { | |
| 1550 return this[_kind] == JSInvocationMirror.METHOD; | |
| 1551 } | |
| 1552 get isGetter() { | |
| 1553 return this[_kind] == JSInvocationMirror.GETTER; | |
| 1554 } | |
| 1555 get isSetter() { | |
| 1556 return this[_kind] == JSInvocationMirror.SETTER; | |
| 1557 } | |
| 1558 get isAccessor() { | |
| 1559 return this[_kind] != JSInvocationMirror.METHOD; | |
| 1560 } | |
| 1561 get positionalArguments() { | |
| 1562 if (this.isGetter) | |
| 1563 return dart.const([]); | |
| 1564 let argumentCount = dart.notNull(this[_arguments][core.$length]) - dart.no
tNull(this[_namedArgumentNames][core.$length]); | |
| 1565 if (argumentCount == 0) | |
| 1566 return dart.const([]); | |
| 1567 let list = []; | |
| 1568 for (let index = 0; dart.notNull(index) < dart.notNull(argumentCount); ind
ex = dart.notNull(index) + 1) { | |
| 1569 list[core.$add](this[_arguments][core.$get](index)); | |
| 1570 } | |
| 1571 return dart.as(makeLiteralListConst(list), core.List); | |
| 1572 } | |
| 1573 get namedArguments() { | |
| 1574 if (this.isAccessor) | |
| 1575 return dart.map(); | |
| 1576 let namedArgumentCount = this[_namedArgumentNames][core.$length]; | |
| 1577 let namedArgumentsStartIndex = dart.notNull(this[_arguments][core.$length]
) - dart.notNull(namedArgumentCount); | |
| 1578 if (namedArgumentCount == 0) | |
| 1579 return dart.map(); | |
| 1580 let map = core.Map$(core.Symbol, core.Object).new(); | |
| 1581 for (let i = 0; dart.notNull(i) < dart.notNull(namedArgumentCount); i = da
rt.notNull(i) + 1) { | |
| 1582 map.set(new _internal.Symbol.unvalidated(dart.as(this[_namedArgumentName
s][core.$get](i), core.String)), this[_arguments][core.$get](dart.notNull(namedA
rgumentsStartIndex) + dart.notNull(i))); | |
| 1583 } | |
| 1584 return map; | |
| 1585 } | |
| 1586 [_getCachedInvocation](object) { | |
| 1587 let interceptor = _interceptors.getInterceptor(object); | |
| 1588 let receiver = object; | |
| 1589 let name = this[_internalName]; | |
| 1590 let arguments$ = this[_arguments]; | |
| 1591 let interceptedNames = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded
_names.INTERCEPTED_NAMES); | |
| 1592 let isIntercepted = Object.prototype.hasOwnProperty.call(interceptedNames,
name); | |
| 1593 if (isIntercepted) { | |
| 1594 receiver = interceptor; | |
| 1595 if (object === interceptor) { | |
| 1596 interceptor = null; | |
| 1597 } | |
| 1598 } else { | |
| 1599 interceptor = null; | |
| 1600 } | |
| 1601 let isCatchAll = false; | |
| 1602 let method = receiver[name]; | |
| 1603 if (typeof method != "function") { | |
| 1604 let baseName = _internal.Symbol.getName(dart.as(this.memberName, _intern
al.Symbol)); | |
| 1605 method = receiver[baseName + "*"]; | |
| 1606 if (method == null) { | |
| 1607 interceptor = _interceptors.getInterceptor(object); | |
| 1608 method = interceptor[baseName + "*"]; | |
| 1609 if (method != null) { | |
| 1610 isIntercepted = true; | |
| 1611 receiver = interceptor; | |
| 1612 } else { | |
| 1613 interceptor = null; | |
| 1614 } | |
| 1615 } | |
| 1616 isCatchAll = true; | |
| 1617 } | |
| 1618 if (typeof method == "function") { | |
| 1619 if (isCatchAll) { | |
| 1620 return new CachedCatchAllInvocation(name, method, isIntercepted, dart.
as(interceptor, _interceptors.Interceptor)); | |
| 1621 } else { | |
| 1622 return new CachedInvocation(name, method, isIntercepted, dart.as(inter
ceptor, _interceptors.Interceptor)); | |
| 1623 } | |
| 1624 } else { | |
| 1625 return new CachedNoSuchMethodInvocation(interceptor); | |
| 1626 } | |
| 1627 } | |
| 1628 static invokeFromMirror(invocation, victim) { | |
| 1629 let cached = invocation[_getCachedInvocation](victim); | |
| 1630 if (dart.dload(cached, 'isNoSuchMethod')) { | |
| 1631 return dart.dsend(cached, 'invokeOn', victim, invocation); | |
| 1632 } else { | |
| 1633 return dart.dsend(cached, 'invokeOn', victim, invocation[_arguments]); | |
| 1634 } | |
| 1635 } | |
| 1636 static getCachedInvocation(invocation, victim) { | |
| 1637 return invocation[_getCachedInvocation](victim); | |
| 1638 } | |
| 1639 } | |
| 1640 JSInvocationMirror[dart.implements] = () => [core.Invocation]; | |
| 1641 dart.setSignature(JSInvocationMirror, { | |
| 1642 constructors: () => ({JSInvocationMirror: [JSInvocationMirror, [core.Object,
core.String, core.int, core.List, core.List]]}), | |
| 1643 methods: () => ({[_getCachedInvocation]: [core.Object, [core.Object]]}), | |
| 1644 statics: () => ({ | |
| 1645 invokeFromMirror: [core.Object, [JSInvocationMirror, core.Object]], | |
| 1646 getCachedInvocation: [core.Object, [JSInvocationMirror, core.Object]] | |
| 1647 }), | |
| 1648 names: ['invokeFromMirror', 'getCachedInvocation'] | |
| 1649 }); | |
| 1650 JSInvocationMirror.METHOD = 0; | |
| 1651 JSInvocationMirror.GETTER = 1; | |
| 1652 JSInvocationMirror.SETTER = 2; | |
| 1653 class CachedInvocation extends core.Object { | |
| 1654 CachedInvocation(mangledName, jsFunction, isIntercepted, cachedInterceptor)
{ | |
| 1655 this.mangledName = mangledName; | |
| 1656 this.jsFunction = jsFunction; | |
| 1657 this.isIntercepted = isIntercepted; | |
| 1658 this.cachedInterceptor = cachedInterceptor; | |
| 1659 } | |
| 1660 get isNoSuchMethod() { | |
| 1661 return false; | |
| 1662 } | |
| 1663 get isGetterStub() { | |
| 1664 return !!this.jsFunction.$getterStub; | |
| 1665 } | |
| 1666 invokeOn(victim, arguments$) { | |
| 1667 let receiver = victim; | |
| 1668 if (!dart.notNull(this.isIntercepted)) { | |
| 1669 if (!dart.is(arguments$, _interceptors.JSArray)) | |
| 1670 arguments$ = core.List.from(arguments$); | |
| 1671 } else { | |
| 1672 let _ = [victim]; | |
| 1673 _[core.$addAll](arguments$); | |
| 1674 arguments$ = _; | |
| 1675 if (this.cachedInterceptor != null) | |
| 1676 receiver = this.cachedInterceptor; | |
| 1677 } | |
| 1678 return this.jsFunction.apply(receiver, arguments$); | |
| 1679 } | |
| 1680 } | |
| 1681 dart.setSignature(CachedInvocation, { | |
| 1682 constructors: () => ({CachedInvocation: [CachedInvocation, [core.String, cor
e.Object, core.bool, _interceptors.Interceptor]]}), | |
| 1683 methods: () => ({invokeOn: [core.Object, [core.Object, core.List]]}) | |
| 1684 }); | |
| 1685 class CachedCatchAllInvocation extends CachedInvocation { | |
| 1686 CachedCatchAllInvocation(name, jsFunction, isIntercepted, cachedInterceptor)
{ | |
| 1687 this.info = ReflectionInfo.new(jsFunction); | |
| 1688 super.CachedInvocation(name, jsFunction, isIntercepted, cachedInterceptor)
; | |
| 1689 } | |
| 1690 get isGetterStub() { | |
| 1691 return false; | |
| 1692 } | |
| 1693 invokeOn(victim, arguments$) { | |
| 1694 let receiver = victim; | |
| 1695 let providedArgumentCount = null; | |
| 1696 let fullParameterCount = dart.notNull(this.info.requiredParameterCount) +
dart.notNull(this.info.optionalParameterCount); | |
| 1697 if (!dart.notNull(this.isIntercepted)) { | |
| 1698 if (dart.is(arguments$, _interceptors.JSArray)) { | |
| 1699 providedArgumentCount = arguments$[core.$length]; | |
| 1700 if (dart.notNull(providedArgumentCount) < dart.notNull(fullParameterCo
unt)) { | |
| 1701 arguments$ = core.List.from(arguments$); | |
| 1702 } | |
| 1703 } else { | |
| 1704 arguments$ = core.List.from(arguments$); | |
| 1705 providedArgumentCount = arguments$[core.$length]; | |
| 1706 } | |
| 1707 } else { | |
| 1708 let _ = [victim]; | |
| 1709 _[core.$addAll](arguments$); | |
| 1710 arguments$ = _; | |
| 1711 if (this.cachedInterceptor != null) | |
| 1712 receiver = this.cachedInterceptor; | |
| 1713 providedArgumentCount = dart.notNull(arguments$[core.$length]) - 1; | |
| 1714 } | |
| 1715 if (dart.notNull(this.info.areOptionalParametersNamed) && dart.notNull(pro
videdArgumentCount) > dart.notNull(this.info.requiredParameterCount)) { | |
| 1716 throw new UnimplementedNoSuchMethodError(`Invocation of unstubbed method
'${this.info.reflectionName}'` + ` with ${arguments$[core.$length]} arguments.`
); | |
| 1717 } else if (dart.notNull(providedArgumentCount) < dart.notNull(this.info.re
quiredParameterCount)) { | |
| 1718 throw new UnimplementedNoSuchMethodError(`Invocation of unstubbed method
'${this.info.reflectionName}'` + ` with ${providedArgumentCount} arguments (too
few).`); | |
| 1719 } else if (dart.notNull(providedArgumentCount) > dart.notNull(fullParamete
rCount)) { | |
| 1720 throw new UnimplementedNoSuchMethodError(`Invocation of unstubbed method
'${this.info.reflectionName}'` + ` with ${providedArgumentCount} arguments (too
many).`); | |
| 1721 } | |
| 1722 for (let i = providedArgumentCount; dart.notNull(i) < dart.notNull(fullPar
ameterCount); i = dart.notNull(i) + 1) { | |
| 1723 arguments$[core.$add](getMetadata(this.info.defaultValue(i))); | |
| 1724 } | |
| 1725 return this.jsFunction.apply(receiver, arguments$); | |
| 1726 } | |
| 1727 } | |
| 1728 dart.setSignature(CachedCatchAllInvocation, { | |
| 1729 constructors: () => ({CachedCatchAllInvocation: [CachedCatchAllInvocation, [
core.String, core.Object, core.bool, _interceptors.Interceptor]]}) | |
| 1730 }); | |
| 1731 class CachedNoSuchMethodInvocation extends core.Object { | |
| 1732 CachedNoSuchMethodInvocation(interceptor) { | |
| 1733 this.interceptor = interceptor; | |
| 1734 } | |
| 1735 get isNoSuchMethod() { | |
| 1736 return true; | |
| 1737 } | |
| 1738 get isGetterStub() { | |
| 1739 return false; | |
| 1740 } | |
| 1741 invokeOn(victim, invocation) { | |
| 1742 let receiver = this.interceptor == null ? victim : this.interceptor; | |
| 1743 return dart.dsend(receiver, 'noSuchMethod', invocation); | |
| 1744 } | |
| 1745 } | |
| 1746 dart.setSignature(CachedNoSuchMethodInvocation, { | |
| 1747 constructors: () => ({CachedNoSuchMethodInvocation: [CachedNoSuchMethodInvoc
ation, [core.Object]]}), | |
| 1748 methods: () => ({invokeOn: [core.Object, [core.Object, core.Invocation]]}) | |
| 1749 }); | |
| 1750 class ReflectionInfo extends core.Object { | |
| 1751 internal(jsFunction, data, isAccessor, requiredParameterCount, optionalParam
eterCount, areOptionalParametersNamed, functionType) { | |
| 1752 this.jsFunction = jsFunction; | |
| 1753 this.data = data; | |
| 1754 this.isAccessor = isAccessor; | |
| 1755 this.requiredParameterCount = requiredParameterCount; | |
| 1756 this.optionalParameterCount = optionalParameterCount; | |
| 1757 this.areOptionalParametersNamed = areOptionalParametersNamed; | |
| 1758 this.functionType = functionType; | |
| 1759 this.cachedSortedIndices = null; | |
| 1760 } | |
| 1761 static new(jsFunction) { | |
| 1762 let data = dart.as(jsFunction.$reflectionInfo, core.List); | |
| 1763 if (data == null) | |
| 1764 return null; | |
| 1765 data = _interceptors.JSArray.markFixedList(data); | |
| 1766 let requiredParametersInfo = data[ReflectionInfo.REQUIRED_PARAMETERS_INFO]
; | |
| 1767 let requiredParameterCount = requiredParametersInfo >> 1; | |
| 1768 let isAccessor = (dart.notNull(requiredParametersInfo) & 1) == 1; | |
| 1769 let optionalParametersInfo = data[ReflectionInfo.OPTIONAL_PARAMETERS_INFO]
; | |
| 1770 let optionalParameterCount = optionalParametersInfo >> 1; | |
| 1771 let areOptionalParametersNamed = (dart.notNull(optionalParametersInfo) & 1
) == 1; | |
| 1772 let functionType = data[ReflectionInfo.FUNCTION_TYPE_INDEX]; | |
| 1773 return new ReflectionInfo.internal(jsFunction, data, isAccessor, requiredP
arameterCount, optionalParameterCount, areOptionalParametersNamed, functionType)
; | |
| 1774 } | |
| 1775 parameterName(parameter) { | |
| 1776 let metadataIndex = null; | |
| 1777 if (_foreign_helper.JS_GET_FLAG('MUST_RETAIN_METADATA')) { | |
| 1778 metadataIndex = this.data[2 * parameter + this.optionalParameterCount +
ReflectionInfo.FIRST_DEFAULT_ARGUMENT]; | |
| 1779 } else { | |
| 1780 metadataIndex = this.data[parameter + this.optionalParameterCount + Refl
ectionInfo.FIRST_DEFAULT_ARGUMENT]; | |
| 1781 } | |
| 1782 let metadata = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names.M
ETADATA); | |
| 1783 return metadata[metadataIndex]; | |
| 1784 } | |
| 1785 parameterMetadataAnnotations(parameter) { | |
| 1786 if (!dart.notNull(_foreign_helper.JS_GET_FLAG('MUST_RETAIN_METADATA'))) { | |
| 1787 throw new core.StateError('metadata has not been preserved'); | |
| 1788 } else { | |
| 1789 return dart.as(this.data[2 * parameter + this.optionalParameterCount + R
eflectionInfo.FIRST_DEFAULT_ARGUMENT + 1], core.List$(core.int)); | |
| 1790 } | |
| 1791 } | |
| 1792 defaultValue(parameter) { | |
| 1793 if (dart.notNull(parameter) < dart.notNull(this.requiredParameterCount)) | |
| 1794 return null; | |
| 1795 return this.data[ReflectionInfo.FIRST_DEFAULT_ARGUMENT + parameter - this.
requiredParameterCount]; | |
| 1796 } | |
| 1797 defaultValueInOrder(parameter) { | |
| 1798 if (dart.notNull(parameter) < dart.notNull(this.requiredParameterCount)) | |
| 1799 return null; | |
| 1800 if (!dart.notNull(this.areOptionalParametersNamed) || this.optionalParamet
erCount == 1) { | |
| 1801 return this.defaultValue(parameter); | |
| 1802 } | |
| 1803 let index = this.sortedIndex(dart.notNull(parameter) - dart.notNull(this.r
equiredParameterCount)); | |
| 1804 return this.defaultValue(index); | |
| 1805 } | |
| 1806 parameterNameInOrder(parameter) { | |
| 1807 if (dart.notNull(parameter) < dart.notNull(this.requiredParameterCount)) | |
| 1808 return null; | |
| 1809 if (!dart.notNull(this.areOptionalParametersNamed) || this.optionalParamet
erCount == 1) { | |
| 1810 return this.parameterName(parameter); | |
| 1811 } | |
| 1812 let index = this.sortedIndex(dart.notNull(parameter) - dart.notNull(this.r
equiredParameterCount)); | |
| 1813 return this.parameterName(index); | |
| 1814 } | |
| 1815 sortedIndex(unsortedIndex) { | |
| 1816 if (this.cachedSortedIndices == null) { | |
| 1817 this.cachedSortedIndices = core.List.new(this.optionalParameterCount); | |
| 1818 let positions = dart.map(); | |
| 1819 for (let i = 0; dart.notNull(i) < dart.notNull(this.optionalParameterCou
nt); i = dart.notNull(i) + 1) { | |
| 1820 let index = dart.notNull(this.requiredParameterCount) + dart.notNull(i
); | |
| 1821 positions.set(this.parameterName(index), index); | |
| 1822 } | |
| 1823 let index = 0; | |
| 1824 (() => { | |
| 1825 let _ = positions.keys[core.$toList](); | |
| 1826 _[core.$sort](); | |
| 1827 return _; | |
| 1828 })()[core.$forEach](dart.fn(name => { | |
| 1829 this.cachedSortedIndices[core.$set]((() => { | |
| 1830 let x = index; | |
| 1831 index = dart.notNull(x) + 1; | |
| 1832 return x; | |
| 1833 })(), positions.get(name)); | |
| 1834 }, core.Object, [core.String])); | |
| 1835 } | |
| 1836 return dart.as(this.cachedSortedIndices[core.$get](unsortedIndex), core.in
t); | |
| 1837 } | |
| 1838 computeFunctionRti(jsConstructor) { | |
| 1839 if (typeof this.functionType == "number") { | |
| 1840 return getMetadata(dart.as(this.functionType, core.int)); | |
| 1841 } else if (typeof this.functionType == "function") { | |
| 1842 let fakeInstance = new jsConstructor(); | |
| 1843 setRuntimeTypeInfo(fakeInstance, fakeInstance["<>"]); | |
| 1844 return this.functionType.apply({$receiver: fakeInstance}); | |
| 1845 } else { | |
| 1846 throw new RuntimeError('Unexpected function type'); | |
| 1847 } | |
| 1848 } | |
| 1849 get reflectionName() { | |
| 1850 return this.jsFunction.$reflectionName; | |
| 1851 } | |
| 1852 } | |
| 1853 dart.defineNamedConstructor(ReflectionInfo, 'internal'); | |
| 1854 dart.setSignature(ReflectionInfo, { | |
| 1855 constructors: () => ({ | |
| 1856 internal: [ReflectionInfo, [core.Object, core.List, core.bool, core.int, c
ore.int, core.bool, core.Object]], | |
| 1857 new: [ReflectionInfo, [core.Object]] | |
| 1858 }), | |
| 1859 methods: () => ({ | |
| 1860 parameterName: [core.String, [core.int]], | |
| 1861 parameterMetadataAnnotations: [core.List$(core.int), [core.int]], | |
| 1862 defaultValue: [core.int, [core.int]], | |
| 1863 defaultValueInOrder: [core.int, [core.int]], | |
| 1864 parameterNameInOrder: [core.String, [core.int]], | |
| 1865 sortedIndex: [core.int, [core.int]], | |
| 1866 computeFunctionRti: [core.Object, [core.Object]] | |
| 1867 }) | |
| 1868 }); | |
| 1869 ReflectionInfo.REQUIRED_PARAMETERS_INFO = 0; | |
| 1870 ReflectionInfo.OPTIONAL_PARAMETERS_INFO = 1; | |
| 1871 ReflectionInfo.FUNCTION_TYPE_INDEX = 2; | |
| 1872 ReflectionInfo.FIRST_DEFAULT_ARGUMENT = 3; | |
| 1873 function getMetadata(index) { | |
| 1874 let metadata = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names.MET
ADATA); | |
| 1875 return metadata[index]; | |
| 1876 } | |
| 1877 dart.fn(getMetadata, core.Object, [core.int]); | |
| 1878 class Primitives extends core.Object { | 531 class Primitives extends core.Object { |
| 1879 static initializeStatics(id) { | 532 static initializeStatics(id) { |
| 1880 Primitives.mirrorFunctionCacheName = dart.notNull(Primitives.mirrorFunctio
nCacheName) + `_${id}`; | 533 Primitives.mirrorFunctionCacheName = dart.notNull(Primitives.mirrorFunctio
nCacheName) + `_${id}`; |
| 1881 Primitives.mirrorInvokeCacheName = dart.notNull(Primitives.mirrorInvokeCac
heName) + `_${id}`; | 534 Primitives.mirrorInvokeCacheName = dart.notNull(Primitives.mirrorInvokeCac
heName) + `_${id}`; |
| 1882 } | 535 } |
| 1883 static objectHashCode(object) { | 536 static objectHashCode(object) { |
| 1884 let hash = dart.as(object.$identityHash, core.int); | 537 let hash = dart.as(object.$identityHash, core.int); |
| 1885 if (hash == null) { | 538 if (hash == null) { |
| 1886 hash = Math.random() * 0x3fffffff | 0; | 539 hash = Math.random() * 0x3fffffff | 0; |
| 1887 object.$identityHash = hash; | 540 object.$identityHash = hash; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1952 let result = parseFloat(source); | 605 let result = parseFloat(source); |
| 1953 if (result.isNaN) { | 606 if (result.isNaN) { |
| 1954 let trimmed = source.trim(); | 607 let trimmed = source.trim(); |
| 1955 if (trimmed == 'NaN' || trimmed == '+NaN' || trimmed == '-NaN') { | 608 if (trimmed == 'NaN' || trimmed == '+NaN' || trimmed == '-NaN') { |
| 1956 return result; | 609 return result; |
| 1957 } | 610 } |
| 1958 return handleError(source); | 611 return handleError(source); |
| 1959 } | 612 } |
| 1960 return result; | 613 return result; |
| 1961 } | 614 } |
| 1962 static formatType(className, typeArguments) { | |
| 1963 return unmangleAllIdentifiersIfPreservedAnyways(`${className}${joinArgumen
ts(typeArguments, 0)}`); | |
| 1964 } | |
| 1965 static objectTypeName(object) { | 615 static objectTypeName(object) { |
| 1966 let name = Primitives.constructorNameFallback(object); | 616 return dart.toString(getRuntimeType(object)); |
| 1967 if (name == 'Object') { | |
| 1968 let decompiled = String(object.constructor).match(/^\s*function\s*(\S*)\
s*\(/)[1]; | |
| 1969 if (typeof decompiled == 'string') | |
| 1970 if (/^\w+$/.test(decompiled)) | |
| 1971 name = dart.as(decompiled, core.String); | |
| 1972 } | |
| 1973 return Primitives.formatType(name, dart.as(getRuntimeTypeInfo(object), cor
e.List)); | |
| 1974 } | 617 } |
| 1975 static objectToString(object) { | 618 static objectToString(object) { |
| 1976 let name = dart.typeName(dart.realRuntimeType(object)); | 619 let name = dart.typeName(dart.realRuntimeType(object)); |
| 1977 return `Instance of '${name}'`; | 620 return `Instance of '${name}'`; |
| 1978 } | 621 } |
| 1979 static dateNow() { | 622 static dateNow() { |
| 1980 return Date.now(); | 623 return Date.now(); |
| 1981 } | 624 } |
| 1982 static initTicker() { | 625 static initTicker() { |
| 1983 if (Primitives.timerFrequency != null) | 626 if (Primitives.timerFrequency != null) |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1997 Primitives.timerFrequency = 1000000; | 640 Primitives.timerFrequency = 1000000; |
| 1998 Primitives.timerTicks = dart.fn(() => (1000 * performance.now()).floor(),
core.int, []); | 641 Primitives.timerTicks = dart.fn(() => (1000 * performance.now()).floor(),
core.int, []); |
| 1999 } | 642 } |
| 2000 static get isD8() { | 643 static get isD8() { |
| 2001 return typeof version == "function" && typeof os == "object" && "system" i
n os; | 644 return typeof version == "function" && typeof os == "object" && "system" i
n os; |
| 2002 } | 645 } |
| 2003 static get isJsshell() { | 646 static get isJsshell() { |
| 2004 return typeof version == "function" && typeof system == "function"; | 647 return typeof version == "function" && typeof system == "function"; |
| 2005 } | 648 } |
| 2006 static currentUri() { | 649 static currentUri() { |
| 2007 requiresPreamble(); | |
| 2008 if (!!self.location) { | 650 if (!!self.location) { |
| 2009 return self.location.href; | 651 return self.location.href; |
| 2010 } | 652 } |
| 2011 return null; | 653 return null; |
| 2012 } | 654 } |
| 2013 static _fromCharCodeApply(array) { | 655 static _fromCharCodeApply(array) { |
| 2014 let result = ""; | 656 let result = ""; |
| 2015 let kMaxApply = 500; | 657 let kMaxApply = 500; |
| 2016 let end = array[core.$length]; | 658 let end = array[core.$length]; |
| 2017 for (let i = 0; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) +
dart.notNull(kMaxApply)) { | 659 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... |
| 2165 throw new core.ArgumentError(object); | 807 throw new core.ArgumentError(object); |
| 2166 } | 808 } |
| 2167 return object[key]; | 809 return object[key]; |
| 2168 } | 810 } |
| 2169 static setProperty(object, key, value) { | 811 static setProperty(object, key, value) { |
| 2170 if (dart.notNull(object == null) || typeof object == 'boolean' || dart.is(
object, core.num) || typeof object == 'string') { | 812 if (dart.notNull(object == null) || typeof object == 'boolean' || dart.is(
object, core.num) || typeof object == 'string') { |
| 2171 throw new core.ArgumentError(object); | 813 throw new core.ArgumentError(object); |
| 2172 } | 814 } |
| 2173 object[key] = value; | 815 object[key] = value; |
| 2174 } | 816 } |
| 2175 static functionNoSuchMethod(func, positionalArguments, namedArguments) { | |
| 2176 let argumentCount = 0; | |
| 2177 let arguments$ = []; | |
| 2178 let namedArgumentList = []; | |
| 2179 if (positionalArguments != null) { | |
| 2180 argumentCount = dart.notNull(argumentCount) + dart.notNull(positionalArg
uments[core.$length]); | |
| 2181 arguments$[core.$addAll](positionalArguments); | |
| 2182 } | |
| 2183 let names = ''; | |
| 2184 if (dart.notNull(namedArguments != null) && !dart.notNull(namedArguments.i
sEmpty)) { | |
| 2185 namedArguments.forEach(dart.fn((name, argument) => { | |
| 2186 names = `${names}$${name}`; | |
| 2187 namedArgumentList[core.$add](name); | |
| 2188 arguments$[core.$add](argument); | |
| 2189 argumentCount = dart.notNull(argumentCount) + 1; | |
| 2190 }, core.Object, [core.String, core.Object])); | |
| 2191 } | |
| 2192 let selectorName = `${_foreign_helper.JS_GET_NAME("CALL_PREFIX")}$${argume
ntCount}${names}`; | |
| 2193 return dart.dsend(func, 'noSuchMethod', createUnmangledInvocationMirror(da
rt.const(new core.Symbol('call')), selectorName, JSInvocationMirror.METHOD, argu
ments$, namedArgumentList)); | |
| 2194 } | |
| 2195 static applyFunction(func, positionalArguments, namedArguments) { | |
| 2196 return namedArguments == null ? Primitives.applyFunctionWithPositionalArgu
ments(func, positionalArguments) : Primitives.applyFunctionWithNamedArguments(fu
nc, positionalArguments, namedArguments); | |
| 2197 } | |
| 2198 static applyFunctionWithPositionalArguments(func, positionalArguments) { | |
| 2199 let argumentCount = 0; | |
| 2200 let arguments$ = null; | |
| 2201 if (positionalArguments != null) { | |
| 2202 if (positionalArguments instanceof Array) { | |
| 2203 arguments$ = positionalArguments; | |
| 2204 } else { | |
| 2205 arguments$ = core.List.from(positionalArguments); | |
| 2206 } | |
| 2207 argumentCount = arguments$.length; | |
| 2208 } else { | |
| 2209 arguments$ = []; | |
| 2210 } | |
| 2211 let selectorName = `${_foreign_helper.JS_GET_NAME("CALL_PREFIX")}$${argume
ntCount}`; | |
| 2212 let jsFunction = func[selectorName]; | |
| 2213 if (jsFunction == null) { | |
| 2214 return Primitives.functionNoSuchMethod(func, positionalArguments, null); | |
| 2215 } | |
| 2216 return jsFunction.apply(func, arguments$); | |
| 2217 } | |
| 2218 static applyFunctionWithNamedArguments(func, positionalArguments, namedArgum
ents) { | |
| 2219 if (namedArguments.isEmpty) { | |
| 2220 return Primitives.applyFunctionWithPositionalArguments(func, positionalA
rguments); | |
| 2221 } | |
| 2222 let interceptor = _interceptors.getInterceptor(func); | |
| 2223 let jsFunction = interceptor["call*"]; | |
| 2224 if (jsFunction == null) { | |
| 2225 return Primitives.functionNoSuchMethod(func, positionalArguments, namedA
rguments); | |
| 2226 } | |
| 2227 let info = ReflectionInfo.new(jsFunction); | |
| 2228 if (dart.notNull(info == null) || !dart.notNull(info.areOptionalParameters
Named)) { | |
| 2229 return Primitives.functionNoSuchMethod(func, positionalArguments, namedA
rguments); | |
| 2230 } | |
| 2231 if (positionalArguments != null) { | |
| 2232 positionalArguments = core.List.from(positionalArguments); | |
| 2233 } else { | |
| 2234 positionalArguments = []; | |
| 2235 } | |
| 2236 if (info.requiredParameterCount != positionalArguments[core.$length]) { | |
| 2237 return Primitives.functionNoSuchMethod(func, positionalArguments, namedA
rguments); | |
| 2238 } | |
| 2239 let defaultArguments = core.Map.new(); | |
| 2240 for (let i = 0; dart.notNull(i) < dart.notNull(info.optionalParameterCount
); i = dart.notNull(i) + 1) { | |
| 2241 let index = dart.notNull(i) + dart.notNull(info.requiredParameterCount); | |
| 2242 let parameterName = info.parameterNameInOrder(index); | |
| 2243 let value = info.defaultValueInOrder(index); | |
| 2244 let defaultValue = getMetadata(value); | |
| 2245 defaultArguments.set(parameterName, defaultValue); | |
| 2246 } | |
| 2247 let bad = false; | |
| 2248 namedArguments.forEach(dart.fn((parameter, value) => { | |
| 2249 if (defaultArguments.containsKey(parameter)) { | |
| 2250 defaultArguments.set(parameter, value); | |
| 2251 } else { | |
| 2252 bad = true; | |
| 2253 } | |
| 2254 }, core.Object, [core.String, core.Object])); | |
| 2255 if (bad) { | |
| 2256 return Primitives.functionNoSuchMethod(func, positionalArguments, namedA
rguments); | |
| 2257 } | |
| 2258 positionalArguments[core.$addAll](defaultArguments.values); | |
| 2259 return jsFunction.apply(func, positionalArguments); | |
| 2260 } | |
| 2261 static _mangledNameMatchesType(mangledName, type) { | |
| 2262 return mangledName == type[_typeName]; | |
| 2263 } | |
| 2264 static identicalImplementation(a, b) { | 817 static identicalImplementation(a, b) { |
| 2265 return a == null ? b == null : a === b; | 818 return a == null ? b == null : a === b; |
| 2266 } | 819 } |
| 2267 static extractStackTrace(error) { | 820 static extractStackTrace(error) { |
| 2268 return getTraceFromException(error.$thrownJsError); | 821 return getTraceFromException(error.$thrownJsError); |
| 2269 } | 822 } |
| 2270 } | 823 } |
| 2271 dart.setSignature(Primitives, { | 824 dart.setSignature(Primitives, { |
| 2272 statics: () => ({ | 825 statics: () => ({ |
| 2273 initializeStatics: [dart.void, [core.int]], | 826 initializeStatics: [dart.void, [core.int]], |
| 2274 objectHashCode: [core.int, [core.Object]], | 827 objectHashCode: [core.int, [core.Object]], |
| 2275 _throwFormatException: [core.Object, [core.String]], | 828 _throwFormatException: [core.Object, [core.String]], |
| 2276 parseInt: [core.int, [core.String, core.int, dart.functionType(core.int, [
core.String])]], | 829 parseInt: [core.int, [core.String, core.int, dart.functionType(core.int, [
core.String])]], |
| 2277 parseDouble: [core.double, [core.String, dart.functionType(core.double, [c
ore.String])]], | 830 parseDouble: [core.double, [core.String, dart.functionType(core.double, [c
ore.String])]], |
| 2278 formatType: [core.String, [core.String, core.List]], | |
| 2279 objectTypeName: [core.String, [core.Object]], | 831 objectTypeName: [core.String, [core.Object]], |
| 2280 objectToString: [core.String, [core.Object]], | 832 objectToString: [core.String, [core.Object]], |
| 2281 dateNow: [core.num, []], | 833 dateNow: [core.num, []], |
| 2282 initTicker: [dart.void, []], | 834 initTicker: [dart.void, []], |
| 2283 currentUri: [core.String, []], | 835 currentUri: [core.String, []], |
| 2284 _fromCharCodeApply: [core.String, [core.List$(core.int)]], | 836 _fromCharCodeApply: [core.String, [core.List$(core.int)]], |
| 2285 stringFromCodePoints: [core.String, [core.Object]], | 837 stringFromCodePoints: [core.String, [core.Object]], |
| 2286 stringFromCharCodes: [core.String, [core.Object]], | 838 stringFromCharCodes: [core.String, [core.Object]], |
| 2287 stringFromCharCode: [core.String, [core.Object]], | 839 stringFromCharCode: [core.String, [core.Object]], |
| 2288 stringConcatUnchecked: [core.String, [core.String, core.String]], | 840 stringConcatUnchecked: [core.String, [core.String, core.String]], |
| 2289 flattenString: [core.String, [core.String]], | 841 flattenString: [core.String, [core.String]], |
| 2290 getTimeZoneName: [core.String, [core.Object]], | 842 getTimeZoneName: [core.String, [core.Object]], |
| 2291 getTimeZoneOffsetInMinutes: [core.int, [core.Object]], | 843 getTimeZoneOffsetInMinutes: [core.int, [core.Object]], |
| 2292 valueFromDecomposedDate: [core.Object, [core.Object, core.Object, core.Obj
ect, core.Object, core.Object, core.Object, core.Object, core.Object]], | 844 valueFromDecomposedDate: [core.Object, [core.Object, core.Object, core.Obj
ect, core.Object, core.Object, core.Object, core.Object, core.Object]], |
| 2293 patchUpY2K: [core.Object, [core.Object, core.Object, core.Object]], | 845 patchUpY2K: [core.Object, [core.Object, core.Object, core.Object]], |
| 2294 lazyAsJsDate: [core.Object, [core.Object]], | 846 lazyAsJsDate: [core.Object, [core.Object]], |
| 2295 getYear: [core.Object, [core.Object]], | 847 getYear: [core.Object, [core.Object]], |
| 2296 getMonth: [core.Object, [core.Object]], | 848 getMonth: [core.Object, [core.Object]], |
| 2297 getDay: [core.Object, [core.Object]], | 849 getDay: [core.Object, [core.Object]], |
| 2298 getHours: [core.Object, [core.Object]], | 850 getHours: [core.Object, [core.Object]], |
| 2299 getMinutes: [core.Object, [core.Object]], | 851 getMinutes: [core.Object, [core.Object]], |
| 2300 getSeconds: [core.Object, [core.Object]], | 852 getSeconds: [core.Object, [core.Object]], |
| 2301 getMilliseconds: [core.Object, [core.Object]], | 853 getMilliseconds: [core.Object, [core.Object]], |
| 2302 getWeekday: [core.Object, [core.Object]], | 854 getWeekday: [core.Object, [core.Object]], |
| 2303 valueFromDateString: [core.Object, [core.Object]], | 855 valueFromDateString: [core.Object, [core.Object]], |
| 2304 getProperty: [core.Object, [core.Object, core.Object]], | 856 getProperty: [core.Object, [core.Object, core.Object]], |
| 2305 setProperty: [dart.void, [core.Object, core.Object, core.Object]], | 857 setProperty: [dart.void, [core.Object, core.Object, core.Object]], |
| 2306 functionNoSuchMethod: [core.Object, [core.Object, core.List, core.Map$(cor
e.String, core.Object)]], | |
| 2307 applyFunction: [core.Object, [core.Function, core.List, core.Map$(core.Str
ing, core.Object)]], | |
| 2308 applyFunctionWithPositionalArguments: [core.Object, [core.Function, core.L
ist]], | |
| 2309 applyFunctionWithNamedArguments: [core.Object, [core.Function, core.List,
core.Map$(core.String, core.Object)]], | |
| 2310 _mangledNameMatchesType: [core.Object, [core.String, TypeImpl]], | |
| 2311 identicalImplementation: [core.bool, [core.Object, core.Object]], | 858 identicalImplementation: [core.bool, [core.Object, core.Object]], |
| 2312 extractStackTrace: [core.StackTrace, [core.Error]] | 859 extractStackTrace: [core.StackTrace, [core.Error]] |
| 2313 }), | 860 }), |
| 2314 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'] | 861 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'] |
| 2315 }); | 862 }); |
| 2316 Primitives.mirrorFunctionCacheName = '$cachedFunction'; | 863 Primitives.mirrorFunctionCacheName = '$cachedFunction'; |
| 2317 Primitives.mirrorInvokeCacheName = '$cachedInvocation'; | 864 Primitives.mirrorInvokeCacheName = '$cachedInvocation'; |
| 2318 Primitives.DOLLAR_CHAR_VALUE = 36; | 865 Primitives.DOLLAR_CHAR_VALUE = 36; |
| 2319 Primitives.timerFrequency = null; | 866 Primitives.timerFrequency = null; |
| 2320 Primitives.timerTicks = null; | 867 Primitives.timerTicks = null; |
| 2321 dart.defineLazyProperties(Primitives, { | |
| 2322 get constructorNameFallback() { | |
| 2323 return function getTagFallback(o) { | |
| 2324 var constructor = o.constructor; | |
| 2325 if (typeof constructor == "function") { | |
| 2326 var name = constructor.name; | |
| 2327 if (typeof name == "string" && name.length > 2 && name !== "Object" &&
name !== "Function.prototype") { | |
| 2328 return name; | |
| 2329 } | |
| 2330 } | |
| 2331 var s = Object.prototype.toString.call(o); | |
| 2332 return s.substring(8, s.length - 1); | |
| 2333 }; | |
| 2334 }, | |
| 2335 set constructorNameFallback(_) {} | |
| 2336 }); | |
| 2337 class JsCache extends core.Object { | |
| 2338 static allocate() { | |
| 2339 let result = Object.create(null); | |
| 2340 result.x = 0; | |
| 2341 delete result.x; | |
| 2342 return result; | |
| 2343 } | |
| 2344 static fetch(cache, key) { | |
| 2345 return cache[key]; | |
| 2346 } | |
| 2347 static update(cache, key, value) { | |
| 2348 cache[key] = value; | |
| 2349 } | |
| 2350 } | |
| 2351 dart.setSignature(JsCache, { | |
| 2352 statics: () => ({ | |
| 2353 allocate: [core.Object, []], | |
| 2354 fetch: [core.Object, [core.Object, core.String]], | |
| 2355 update: [dart.void, [core.Object, core.String, core.Object]] | |
| 2356 }), | |
| 2357 names: ['allocate', 'fetch', 'update'] | |
| 2358 }); | |
| 2359 function iae(argument) { | |
| 2360 throw new core.ArgumentError(argument); | |
| 2361 } | |
| 2362 dart.fn(iae); | |
| 2363 function ioore(receiver, index) { | |
| 2364 if (receiver == null) | |
| 2365 dart.dload(receiver, 'length'); | |
| 2366 if (!(typeof index == 'number')) | |
| 2367 iae(index); | |
| 2368 throw new core.RangeError.value(dart.as(index, core.num)); | |
| 2369 } | |
| 2370 dart.fn(ioore); | |
| 2371 function stringLastIndexOfUnchecked(receiver, element, start) { | 868 function stringLastIndexOfUnchecked(receiver, element, start) { |
| 2372 return receiver.lastIndexOf(element, start); | 869 return receiver.lastIndexOf(element, start); |
| 2373 } | 870 } |
| 2374 dart.fn(stringLastIndexOfUnchecked); | 871 dart.fn(stringLastIndexOfUnchecked); |
| 2375 function checkNull(object) { | 872 function checkNull(object) { |
| 2376 if (object == null) | 873 if (object == null) |
| 2377 throw new core.ArgumentError(null); | 874 throw new core.ArgumentError(null); |
| 2378 return object; | 875 return object; |
| 2379 } | 876 } |
| 2380 dart.fn(checkNull); | 877 dart.fn(checkNull); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 2399 return value; | 896 return value; |
| 2400 } | 897 } |
| 2401 dart.fn(checkBool); | 898 dart.fn(checkBool); |
| 2402 function checkString(value) { | 899 function checkString(value) { |
| 2403 if (!(typeof value == 'string')) { | 900 if (!(typeof value == 'string')) { |
| 2404 throw new core.ArgumentError(value); | 901 throw new core.ArgumentError(value); |
| 2405 } | 902 } |
| 2406 return value; | 903 return value; |
| 2407 } | 904 } |
| 2408 dart.fn(checkString); | 905 dart.fn(checkString); |
| 2409 function wrapException(ex) { | |
| 2410 if (ex == null) | |
| 2411 ex = new core.NullThrownError(); | |
| 2412 let wrapper = new Error(); | |
| 2413 wrapper.dartException = ex; | |
| 2414 if ("defineProperty" in Object) { | |
| 2415 Object.defineProperty(wrapper, "message", {get: _foreign_helper.DART_CLOSU
RE_TO_JS(toStringWrapper)}); | |
| 2416 wrapper.name = ""; | |
| 2417 } else { | |
| 2418 wrapper.toString = _foreign_helper.DART_CLOSURE_TO_JS(toStringWrapper); | |
| 2419 } | |
| 2420 return wrapper; | |
| 2421 } | |
| 2422 dart.fn(wrapException); | |
| 2423 function toStringWrapper() { | |
| 2424 return dart.toString(this.dartException); | |
| 2425 } | |
| 2426 dart.fn(toStringWrapper); | |
| 2427 function throwExpression(ex) { | |
| 2428 throw wrapException(ex); | |
| 2429 } | |
| 2430 dart.fn(throwExpression); | |
| 2431 function makeLiteralListConst(list) { | |
| 2432 list.immutable$list = true; | |
| 2433 list.fixed$length = true; | |
| 2434 return list; | |
| 2435 } | |
| 2436 dart.fn(makeLiteralListConst); | |
| 2437 function throwRuntimeError(message) { | 906 function throwRuntimeError(message) { |
| 2438 throw new RuntimeError(message); | 907 throw new RuntimeError(message); |
| 2439 } | 908 } |
| 2440 dart.fn(throwRuntimeError); | 909 dart.fn(throwRuntimeError); |
| 2441 function throwAbstractClassInstantiationError(className) { | 910 function throwAbstractClassInstantiationError(className) { |
| 2442 throw new core.AbstractClassInstantiationError(dart.as(className, core.Strin
g)); | 911 throw new core.AbstractClassInstantiationError(dart.as(className, core.Strin
g)); |
| 2443 } | 912 } |
| 2444 dart.fn(throwAbstractClassInstantiationError); | 913 dart.fn(throwAbstractClassInstantiationError); |
| 2445 let _argumentsExpr = Symbol('_argumentsExpr'); | 914 let _message = Symbol('_message'); |
| 2446 let _expr = Symbol('_expr'); | |
| 2447 let _method = Symbol('_method'); | 915 let _method = Symbol('_method'); |
| 2448 let _receiver = Symbol('_receiver'); | |
| 2449 let _pattern = Symbol('_pattern'); | |
| 2450 class TypeErrorDecoder extends core.Object { | |
| 2451 TypeErrorDecoder(arguments$, argumentsExpr, expr, method, receiver, pattern)
{ | |
| 2452 this[_arguments] = arguments$; | |
| 2453 this[_argumentsExpr] = argumentsExpr; | |
| 2454 this[_expr] = expr; | |
| 2455 this[_method] = method; | |
| 2456 this[_receiver] = receiver; | |
| 2457 this[_pattern] = pattern; | |
| 2458 } | |
| 2459 matchTypeError(message) { | |
| 2460 let match = new RegExp(this[_pattern]).exec(message); | |
| 2461 if (match == null) | |
| 2462 return null; | |
| 2463 let result = Object.create(null); | |
| 2464 if (this[_arguments] != -1) { | |
| 2465 result.arguments = match[this[_arguments] + 1]; | |
| 2466 } | |
| 2467 if (this[_argumentsExpr] != -1) { | |
| 2468 result.argumentsExpr = match[this[_argumentsExpr] + 1]; | |
| 2469 } | |
| 2470 if (this[_expr] != -1) { | |
| 2471 result.expr = match[this[_expr] + 1]; | |
| 2472 } | |
| 2473 if (this[_method] != -1) { | |
| 2474 result.method = match[this[_method] + 1]; | |
| 2475 } | |
| 2476 if (this[_receiver] != -1) { | |
| 2477 result.receiver = match[this[_receiver] + 1]; | |
| 2478 } | |
| 2479 return result; | |
| 2480 } | |
| 2481 static buildJavaScriptObject() { | |
| 2482 return { | |
| 2483 toString: function() { | |
| 2484 return "$receiver$"; | |
| 2485 } | |
| 2486 }; | |
| 2487 } | |
| 2488 static buildJavaScriptObjectWithNonClosure() { | |
| 2489 return { | |
| 2490 $method$: null, | |
| 2491 toString: function() { | |
| 2492 return "$receiver$"; | |
| 2493 } | |
| 2494 }; | |
| 2495 } | |
| 2496 static extractPattern(message) { | |
| 2497 message = message.replace(String({}), '$receiver$'); | |
| 2498 message = message.replace(new RegExp(ESCAPE_REGEXP, 'g'), '\\$&'); | |
| 2499 let match = dart.as(message.match(/\\\$[a-zA-Z]+\\\$/g), core.List$(core.S
tring)); | |
| 2500 if (match == null) | |
| 2501 match = dart.setType([], core.List$(core.String)); | |
| 2502 let arguments$ = match.indexOf('\\$arguments\\$'); | |
| 2503 let argumentsExpr = match.indexOf('\\$argumentsExpr\\$'); | |
| 2504 let expr = match.indexOf('\\$expr\\$'); | |
| 2505 let method = match.indexOf('\\$method\\$'); | |
| 2506 let receiver = match.indexOf('\\$receiver\\$'); | |
| 2507 let pattern = message.replace('\\$arguments\\$', '((?:x|[^x])*)').replace(
'\\$argumentsExpr\\$', '((?:x|[^x])*)').replace('\\$expr\\$', '((?:x|[^x])*)').r
eplace('\\$method\\$', '((?:x|[^x])*)').replace('\\$receiver\\$', '((?:x|[^x])*)
'); | |
| 2508 return new TypeErrorDecoder(arguments$, argumentsExpr, expr, method, recei
ver, pattern); | |
| 2509 } | |
| 2510 static provokeCallErrorOn(expression) { | |
| 2511 let func = function($expr$) { | |
| 2512 var $argumentsExpr$ = '$arguments$'; | |
| 2513 try { | |
| 2514 $expr$.$method$($argumentsExpr$); | |
| 2515 } catch (e) { | |
| 2516 return e.message; | |
| 2517 } | |
| 2518 | |
| 2519 }; | |
| 2520 return func(expression); | |
| 2521 } | |
| 2522 static provokeCallErrorOnNull() { | |
| 2523 let func = function() { | |
| 2524 var $argumentsExpr$ = '$arguments$'; | |
| 2525 try { | |
| 2526 null.$method$($argumentsExpr$); | |
| 2527 } catch (e) { | |
| 2528 return e.message; | |
| 2529 } | |
| 2530 | |
| 2531 }; | |
| 2532 return func(); | |
| 2533 } | |
| 2534 static provokeCallErrorOnUndefined() { | |
| 2535 let func = function() { | |
| 2536 var $argumentsExpr$ = '$arguments$'; | |
| 2537 try { | |
| 2538 (void 0).$method$($argumentsExpr$); | |
| 2539 } catch (e) { | |
| 2540 return e.message; | |
| 2541 } | |
| 2542 | |
| 2543 }; | |
| 2544 return func(); | |
| 2545 } | |
| 2546 static provokePropertyErrorOn(expression) { | |
| 2547 let func = function($expr$) { | |
| 2548 try { | |
| 2549 $expr$.$method$; | |
| 2550 } catch (e) { | |
| 2551 return e.message; | |
| 2552 } | |
| 2553 | |
| 2554 }; | |
| 2555 return func(expression); | |
| 2556 } | |
| 2557 static provokePropertyErrorOnNull() { | |
| 2558 let func = function() { | |
| 2559 try { | |
| 2560 null.$method$; | |
| 2561 } catch (e) { | |
| 2562 return e.message; | |
| 2563 } | |
| 2564 | |
| 2565 }; | |
| 2566 return func(); | |
| 2567 } | |
| 2568 static provokePropertyErrorOnUndefined() { | |
| 2569 let func = function() { | |
| 2570 try { | |
| 2571 (void 0).$method$; | |
| 2572 } catch (e) { | |
| 2573 return e.message; | |
| 2574 } | |
| 2575 | |
| 2576 }; | |
| 2577 return func(); | |
| 2578 } | |
| 2579 } | |
| 2580 dart.setSignature(TypeErrorDecoder, { | |
| 2581 constructors: () => ({TypeErrorDecoder: [TypeErrorDecoder, [core.int, core.i
nt, core.int, core.int, core.int, core.String]]}), | |
| 2582 methods: () => ({matchTypeError: [core.Object, [core.Object]]}), | |
| 2583 statics: () => ({ | |
| 2584 buildJavaScriptObject: [core.Object, []], | |
| 2585 buildJavaScriptObjectWithNonClosure: [core.Object, []], | |
| 2586 extractPattern: [core.Object, [core.String]], | |
| 2587 provokeCallErrorOn: [core.String, [core.Object]], | |
| 2588 provokeCallErrorOnNull: [core.String, []], | |
| 2589 provokeCallErrorOnUndefined: [core.String, []], | |
| 2590 provokePropertyErrorOn: [core.String, [core.Object]], | |
| 2591 provokePropertyErrorOnNull: [core.String, []], | |
| 2592 provokePropertyErrorOnUndefined: [core.String, []] | |
| 2593 }), | |
| 2594 names: ['buildJavaScriptObject', 'buildJavaScriptObjectWithNonClosure', 'ext
ractPattern', 'provokeCallErrorOn', 'provokeCallErrorOnNull', 'provokeCallErrorO
nUndefined', 'provokePropertyErrorOn', 'provokePropertyErrorOnNull', 'provokePro
pertyErrorOnUndefined'] | |
| 2595 }); | |
| 2596 dart.defineLazyProperties(TypeErrorDecoder, { | |
| 2597 get noSuchMethodPattern() { | |
| 2598 return dart.as(TypeErrorDecoder.extractPattern(TypeErrorDecoder.provokeCal
lErrorOn(TypeErrorDecoder.buildJavaScriptObject())), TypeErrorDecoder); | |
| 2599 }, | |
| 2600 get notClosurePattern() { | |
| 2601 return dart.as(TypeErrorDecoder.extractPattern(TypeErrorDecoder.provokeCal
lErrorOn(TypeErrorDecoder.buildJavaScriptObjectWithNonClosure())), TypeErrorDeco
der); | |
| 2602 }, | |
| 2603 get nullCallPattern() { | |
| 2604 return dart.as(TypeErrorDecoder.extractPattern(TypeErrorDecoder.provokeCal
lErrorOn(null)), TypeErrorDecoder); | |
| 2605 }, | |
| 2606 get nullLiteralCallPattern() { | |
| 2607 return dart.as(TypeErrorDecoder.extractPattern(TypeErrorDecoder.provokeCal
lErrorOnNull()), TypeErrorDecoder); | |
| 2608 }, | |
| 2609 get undefinedCallPattern() { | |
| 2610 return dart.as(TypeErrorDecoder.extractPattern(TypeErrorDecoder.provokeCal
lErrorOn(void 0)), TypeErrorDecoder); | |
| 2611 }, | |
| 2612 get undefinedLiteralCallPattern() { | |
| 2613 return dart.as(TypeErrorDecoder.extractPattern(TypeErrorDecoder.provokeCal
lErrorOnUndefined()), TypeErrorDecoder); | |
| 2614 }, | |
| 2615 get nullPropertyPattern() { | |
| 2616 return dart.as(TypeErrorDecoder.extractPattern(TypeErrorDecoder.provokePro
pertyErrorOn(null)), TypeErrorDecoder); | |
| 2617 }, | |
| 2618 get nullLiteralPropertyPattern() { | |
| 2619 return dart.as(TypeErrorDecoder.extractPattern(TypeErrorDecoder.provokePro
pertyErrorOnNull()), TypeErrorDecoder); | |
| 2620 }, | |
| 2621 get undefinedPropertyPattern() { | |
| 2622 return dart.as(TypeErrorDecoder.extractPattern(TypeErrorDecoder.provokePro
pertyErrorOn(void 0)), TypeErrorDecoder); | |
| 2623 }, | |
| 2624 get undefinedLiteralPropertyPattern() { | |
| 2625 return dart.as(TypeErrorDecoder.extractPattern(TypeErrorDecoder.provokePro
pertyErrorOnUndefined()), TypeErrorDecoder); | |
| 2626 } | |
| 2627 }); | |
| 2628 let _message = Symbol('_message'); | |
| 2629 class NullError extends core.Error { | 916 class NullError extends core.Error { |
| 2630 NullError(message, match) { | 917 NullError(message, match) { |
| 2631 this[_message] = message; | 918 this[_message] = message; |
| 2632 this[_method] = match == null ? null : dart.as(match.method, core.String); | 919 this[_method] = match == null ? null : dart.as(match.method, core.String); |
| 2633 super.Error(); | 920 super.Error(); |
| 2634 } | 921 } |
| 2635 toString() { | 922 toString() { |
| 2636 if (this[_method] == null) | 923 if (this[_method] == null) |
| 2637 return `NullError: ${this[_message]}`; | 924 return `NullError: ${this[_message]}`; |
| 2638 return `NullError: Cannot call "${this[_method]}" on null`; | 925 return `NullError: Cannot call "${this[_method]}" on null`; |
| 2639 } | 926 } |
| 2640 } | 927 } |
| 2641 NullError[dart.implements] = () => [core.NoSuchMethodError]; | 928 NullError[dart.implements] = () => [core.NoSuchMethodError]; |
| 2642 dart.setSignature(NullError, { | 929 dart.setSignature(NullError, { |
| 2643 constructors: () => ({NullError: [NullError, [core.String, core.Object]]}) | 930 constructors: () => ({NullError: [NullError, [core.String, core.Object]]}) |
| 2644 }); | 931 }); |
| 932 let _receiver = Symbol('_receiver'); |
| 2645 class JsNoSuchMethodError extends core.Error { | 933 class JsNoSuchMethodError extends core.Error { |
| 2646 JsNoSuchMethodError(message, match) { | 934 JsNoSuchMethodError(message, match) { |
| 2647 this[_message] = message; | 935 this[_message] = message; |
| 2648 this[_method] = match == null ? null : dart.as(match.method, core.String); | 936 this[_method] = match == null ? null : dart.as(match.method, core.String); |
| 2649 this[_receiver] = match == null ? null : dart.as(match.receiver, core.Stri
ng); | 937 this[_receiver] = match == null ? null : dart.as(match.receiver, core.Stri
ng); |
| 2650 super.Error(); | 938 super.Error(); |
| 2651 } | 939 } |
| 2652 toString() { | 940 toString() { |
| 2653 if (this[_method] == null) | 941 if (this[_method] == null) |
| 2654 return `NoSuchMethodError: ${this[_message]}`; | 942 return `NoSuchMethodError: ${this[_message]}`; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 2667 this[_message] = message; | 955 this[_message] = message; |
| 2668 super.Error(); | 956 super.Error(); |
| 2669 } | 957 } |
| 2670 toString() { | 958 toString() { |
| 2671 return this[_message].isEmpty ? 'Error' : `Error: ${this[_message]}`; | 959 return this[_message].isEmpty ? 'Error' : `Error: ${this[_message]}`; |
| 2672 } | 960 } |
| 2673 } | 961 } |
| 2674 dart.setSignature(UnknownJsTypeError, { | 962 dart.setSignature(UnknownJsTypeError, { |
| 2675 constructors: () => ({UnknownJsTypeError: [UnknownJsTypeError, [core.String]
]}) | 963 constructors: () => ({UnknownJsTypeError: [UnknownJsTypeError, [core.String]
]}) |
| 2676 }); | 964 }); |
| 2677 function unwrapException(ex) { | |
| 2678 let saveStackTrace = error => { | |
| 2679 if (dart.is(error, core.Error)) { | |
| 2680 let thrownStackTrace = error.$thrownJsError; | |
| 2681 if (thrownStackTrace == null) { | |
| 2682 error.$thrownJsError = ex; | |
| 2683 } | |
| 2684 } | |
| 2685 return error; | |
| 2686 }; | |
| 2687 dart.fn(saveStackTrace); | |
| 2688 if (ex == null) | |
| 2689 return null; | |
| 2690 if (typeof ex !== "object") | |
| 2691 return ex; | |
| 2692 if ("dartException" in ex) { | |
| 2693 return saveStackTrace(ex.dartException); | |
| 2694 } else if (!("message" in ex)) { | |
| 2695 return ex; | |
| 2696 } | |
| 2697 let message = ex.message; | |
| 2698 if ("number" in ex && typeof ex.number == "number") { | |
| 2699 let number = ex.number; | |
| 2700 let ieErrorCode = dart.notNull(number) & 65535; | |
| 2701 let ieFacilityNumber = dart.notNull(number) >> 16 & 8191; | |
| 2702 if (ieFacilityNumber == 10) { | |
| 2703 switch (ieErrorCode) { | |
| 2704 case 438: | |
| 2705 { | |
| 2706 return saveStackTrace(new JsNoSuchMethodError(`${message} (Error ${i
eErrorCode})`, null)); | |
| 2707 } | |
| 2708 case 445: | |
| 2709 case 5007: | |
| 2710 { | |
| 2711 return saveStackTrace(new NullError(`${message} (Error ${ieErrorCode
})`, null)); | |
| 2712 } | |
| 2713 } | |
| 2714 } | |
| 2715 } | |
| 2716 if (ex instanceof TypeError) { | |
| 2717 let match = null; | |
| 2718 let nsme = TypeErrorDecoder.noSuchMethodPattern; | |
| 2719 let notClosure = TypeErrorDecoder.notClosurePattern; | |
| 2720 let nullCall = TypeErrorDecoder.nullCallPattern; | |
| 2721 let nullLiteralCall = TypeErrorDecoder.nullLiteralCallPattern; | |
| 2722 let undefCall = TypeErrorDecoder.undefinedCallPattern; | |
| 2723 let undefLiteralCall = TypeErrorDecoder.undefinedLiteralCallPattern; | |
| 2724 let nullProperty = TypeErrorDecoder.nullPropertyPattern; | |
| 2725 let nullLiteralProperty = TypeErrorDecoder.nullLiteralPropertyPattern; | |
| 2726 let undefProperty = TypeErrorDecoder.undefinedPropertyPattern; | |
| 2727 let undefLiteralProperty = TypeErrorDecoder.undefinedLiteralPropertyPatter
n; | |
| 2728 if ((match = dart.dsend(nsme, 'matchTypeError', message)) != null) { | |
| 2729 return saveStackTrace(new JsNoSuchMethodError(dart.as(message, core.Stri
ng), match)); | |
| 2730 } else if ((match = dart.dsend(notClosure, 'matchTypeError', message)) !=
null) { | |
| 2731 match.method = "call"; | |
| 2732 return saveStackTrace(new JsNoSuchMethodError(dart.as(message, core.Stri
ng), match)); | |
| 2733 } 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
)) { | |
| 2734 return saveStackTrace(new NullError(dart.as(message, core.String), match
)); | |
| 2735 } | |
| 2736 return saveStackTrace(new UnknownJsTypeError(typeof message == 'string' ?
dart.as(message, core.String) : '')); | |
| 2737 } | |
| 2738 if (ex instanceof RangeError) { | |
| 2739 if (typeof message == 'string' && dart.notNull(contains(dart.as(message, c
ore.String), 'call stack'))) { | |
| 2740 return new core.StackOverflowError(); | |
| 2741 } | |
| 2742 return saveStackTrace(new core.ArgumentError()); | |
| 2743 } | |
| 2744 if (typeof InternalError == "function" && ex instanceof InternalError) { | |
| 2745 if (typeof message == 'string' && dart.notNull(dart.equals(message, 'too m
uch recursion'))) { | |
| 2746 return new core.StackOverflowError(); | |
| 2747 } | |
| 2748 } | |
| 2749 return ex; | |
| 2750 } | |
| 2751 dart.fn(unwrapException); | |
| 2752 function getTraceFromException(exception) { | 965 function getTraceFromException(exception) { |
| 2753 return new _StackTrace(exception); | 966 return new _StackTrace(exception); |
| 2754 } | 967 } |
| 2755 dart.fn(getTraceFromException, core.StackTrace, [core.Object]); | 968 dart.fn(getTraceFromException, core.StackTrace, [core.Object]); |
| 2756 let _exception = Symbol('_exception'); | 969 let _exception = Symbol('_exception'); |
| 2757 let _trace = Symbol('_trace'); | 970 let _trace = Symbol('_trace'); |
| 2758 class _StackTrace extends core.Object { | 971 class _StackTrace extends core.Object { |
| 2759 _StackTrace(exception) { | 972 _StackTrace(exception) { |
| 2760 this[_exception] = exception; | 973 this[_exception] = exception; |
| 2761 this[_trace] = null; | 974 this[_trace] = null; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2794 let value = getIndex(keyValuePairs, (() => { | 1007 let value = getIndex(keyValuePairs, (() => { |
| 2795 let x = index; | 1008 let x = index; |
| 2796 index = dart.notNull(x) + 1; | 1009 index = dart.notNull(x) + 1; |
| 2797 return x; | 1010 return x; |
| 2798 })()); | 1011 })()); |
| 2799 result.set(key, value); | 1012 result.set(key, value); |
| 2800 } | 1013 } |
| 2801 return result; | 1014 return result; |
| 2802 } | 1015 } |
| 2803 dart.fn(fillLiteralMap, core.Object, [core.Object, core.Map]); | 1016 dart.fn(fillLiteralMap, core.Object, [core.Object, core.Map]); |
| 2804 function invokeClosure(closure, isolate, numberOfArguments, arg1, arg2, arg3,
arg4) { | |
| 2805 if (numberOfArguments == 0) { | |
| 2806 return _foreign_helper.JS_CALL_IN_ISOLATE(isolate, dart.fn(() => dart.dcal
l(closure))); | |
| 2807 } else if (numberOfArguments == 1) { | |
| 2808 return _foreign_helper.JS_CALL_IN_ISOLATE(isolate, dart.fn(() => dart.dcal
l(closure, arg1))); | |
| 2809 } else if (numberOfArguments == 2) { | |
| 2810 return _foreign_helper.JS_CALL_IN_ISOLATE(isolate, dart.fn(() => dart.dcal
l(closure, arg1, arg2))); | |
| 2811 } else if (numberOfArguments == 3) { | |
| 2812 return _foreign_helper.JS_CALL_IN_ISOLATE(isolate, dart.fn(() => dart.dcal
l(closure, arg1, arg2, arg3))); | |
| 2813 } else if (numberOfArguments == 4) { | |
| 2814 return _foreign_helper.JS_CALL_IN_ISOLATE(isolate, dart.fn(() => dart.dcal
l(closure, arg1, arg2, arg3, arg4))); | |
| 2815 } else { | |
| 2816 throw core.Exception.new('Unsupported number of arguments for wrapped clos
ure'); | |
| 2817 } | |
| 2818 } | |
| 2819 dart.fn(invokeClosure, core.Object, [core.Function, core.Object, core.int, cor
e.Object, core.Object, core.Object, core.Object]); | |
| 2820 function convertDartClosureToJS(closure, arity) { | 1017 function convertDartClosureToJS(closure, arity) { |
| 2821 return closure; | 1018 return closure; |
| 2822 } | 1019 } |
| 2823 dart.fn(convertDartClosureToJS, core.Object, [core.Object, core.int]); | 1020 dart.fn(convertDartClosureToJS, core.Object, [core.Object, core.int]); |
| 2824 class Closure extends core.Object { | |
| 2825 Closure() { | |
| 2826 } | |
| 2827 static fromTearOff(receiver, functions, reflectionInfo, isStatic, jsArgument
s, propertyName) { | |
| 2828 _foreign_helper.JS_EFFECT(dart.fn(() => { | |
| 2829 BoundClosure.receiverOf(dart.as(void 0, BoundClosure)); | |
| 2830 BoundClosure.selfOf(dart.as(void 0, BoundClosure)); | |
| 2831 })); | |
| 2832 let func = functions[0]; | |
| 2833 let name = dart.as(func.$stubName, core.String); | |
| 2834 let callName = dart.as(func.$callName, core.String); | |
| 2835 func.$reflectionInfo = reflectionInfo; | |
| 2836 let info = ReflectionInfo.new(func); | |
| 2837 let functionType = info.functionType; | |
| 2838 let prototype = isStatic ? Object.create(new TearOffClosure().constructor.
prototype) : Object.create(new BoundClosure(null, null, null, null).constructor.
prototype); | |
| 2839 prototype.$initialize = prototype.constructor; | |
| 2840 let constructor = isStatic ? function() { | |
| 2841 this.$initialize(); | |
| 2842 } : Closure.isCsp ? function(a, b, c, d) { | |
| 2843 this.$initialize(a, b, c, d); | |
| 2844 } : new Function("a", "b", "c", "d", "this.$initialize(a,b,c,d);" + (() =>
{ | |
| 2845 let x = Closure.functionCounter; | |
| 2846 Closure.functionCounter = dart.notNull(x) + 1; | |
| 2847 return x; | |
| 2848 })()); | |
| 2849 prototype.constructor = constructor; | |
| 2850 constructor.prototype = prototype; | |
| 2851 let trampoline = func; | |
| 2852 let isIntercepted = false; | |
| 2853 if (!dart.notNull(isStatic)) { | |
| 2854 if (jsArguments.length == 1) { | |
| 2855 isIntercepted = true; | |
| 2856 } | |
| 2857 trampoline = Closure.forwardCallTo(receiver, func, isIntercepted); | |
| 2858 trampoline.$reflectionInfo = reflectionInfo; | |
| 2859 } else { | |
| 2860 prototype.$name = propertyName; | |
| 2861 } | |
| 2862 let signatureFunction = null; | |
| 2863 if (typeof functionType == "number") { | |
| 2864 let metadata = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names
.METADATA); | |
| 2865 signatureFunction = function(s) { | |
| 2866 return function() { | |
| 2867 return metadata[s]; | |
| 2868 }; | |
| 2869 }(functionType); | |
| 2870 } else if (!dart.notNull(isStatic) && typeof functionType == "function") { | |
| 2871 let getReceiver = isIntercepted ? _foreign_helper.RAW_DART_FUNCTION_REF(
BoundClosure.receiverOf) : _foreign_helper.RAW_DART_FUNCTION_REF(BoundClosure.se
lfOf); | |
| 2872 signatureFunction = function(f, r) { | |
| 2873 return function() { | |
| 2874 return f.apply({$receiver: r(this)}, arguments$); | |
| 2875 }; | |
| 2876 }(functionType, getReceiver); | |
| 2877 } else { | |
| 2878 throw 'Error in reflectionInfo.'; | |
| 2879 } | |
| 2880 prototype[_foreign_helper.JS_SIGNATURE_NAME()] = signatureFunction; | |
| 2881 prototype[callName] = trampoline; | |
| 2882 for (let i = 1; dart.notNull(i) < dart.notNull(functions[core.$length]); i
= dart.notNull(i) + 1) { | |
| 2883 let stub = functions[core.$get](i); | |
| 2884 let stubCallName = stub.$callName; | |
| 2885 if (stubCallName != null) { | |
| 2886 prototype[stubCallName] = isStatic ? stub : Closure.forwardCallTo(rece
iver, stub, isIntercepted); | |
| 2887 } | |
| 2888 } | |
| 2889 prototype["call*"] = trampoline; | |
| 2890 return constructor; | |
| 2891 } | |
| 2892 static cspForwardCall(arity, isSuperCall, stubName, func) { | |
| 2893 let getSelf = _foreign_helper.RAW_DART_FUNCTION_REF(BoundClosure.selfOf); | |
| 2894 if (isSuperCall) | |
| 2895 arity = -1; | |
| 2896 switch (arity) { | |
| 2897 case 0: | |
| 2898 { | |
| 2899 return function(n, S) { | |
| 2900 return function() { | |
| 2901 return S(this)[n](); | |
| 2902 }; | |
| 2903 }(stubName, getSelf); | |
| 2904 } | |
| 2905 case 1: | |
| 2906 { | |
| 2907 return function(n, S) { | |
| 2908 return function(a) { | |
| 2909 return S(this)[n](a); | |
| 2910 }; | |
| 2911 }(stubName, getSelf); | |
| 2912 } | |
| 2913 case 2: | |
| 2914 { | |
| 2915 return function(n, S) { | |
| 2916 return function(a, b) { | |
| 2917 return S(this)[n](a, b); | |
| 2918 }; | |
| 2919 }(stubName, getSelf); | |
| 2920 } | |
| 2921 case 3: | |
| 2922 { | |
| 2923 return function(n, S) { | |
| 2924 return function(a, b, c) { | |
| 2925 return S(this)[n](a, b, c); | |
| 2926 }; | |
| 2927 }(stubName, getSelf); | |
| 2928 } | |
| 2929 case 4: | |
| 2930 { | |
| 2931 return function(n, S) { | |
| 2932 return function(a, b, c, d) { | |
| 2933 return S(this)[n](a, b, c, d); | |
| 2934 }; | |
| 2935 }(stubName, getSelf); | |
| 2936 } | |
| 2937 case 5: | |
| 2938 { | |
| 2939 return function(n, S) { | |
| 2940 return function(a, b, c, d, e) { | |
| 2941 return S(this)[n](a, b, c, d, e); | |
| 2942 }; | |
| 2943 }(stubName, getSelf); | |
| 2944 } | |
| 2945 default: | |
| 2946 { | |
| 2947 return function(f, s) { | |
| 2948 return function() { | |
| 2949 return f.apply(s(this), arguments$); | |
| 2950 }; | |
| 2951 }(func, getSelf); | |
| 2952 } | |
| 2953 } | |
| 2954 } | |
| 2955 static get isCsp() { | |
| 2956 return typeof dart_precompiled == "function"; | |
| 2957 } | |
| 2958 static forwardCallTo(receiver, func, isIntercepted) { | |
| 2959 if (isIntercepted) | |
| 2960 return Closure.forwardInterceptedCallTo(receiver, func); | |
| 2961 let stubName = dart.as(func.$stubName, core.String); | |
| 2962 let arity = func.length; | |
| 2963 let lookedUpFunction = receiver[stubName]; | |
| 2964 let isSuperCall = !dart.notNull(core.identical(func, lookedUpFunction)); | |
| 2965 if (dart.notNull(Closure.isCsp) || dart.notNull(isSuperCall) || dart.notNu
ll(arity) >= 27) { | |
| 2966 return Closure.cspForwardCall(arity, isSuperCall, stubName, func); | |
| 2967 } | |
| 2968 if (arity == 0) { | |
| 2969 return new Function('return function(){' + `return this.${BoundClosure.s
elfFieldName()}.${stubName}();` + `${(() => { | |
| 2970 let x = Closure.functionCounter; | |
| 2971 Closure.functionCounter = dart.notNull(x) + 1; | |
| 2972 return x; | |
| 2973 })()}` + '}')(); | |
| 2974 } | |
| 2975 dart.assert(1 <= dart.notNull(arity) && dart.notNull(arity) < 27); | |
| 2976 let arguments$ = "abcdefghijklmnopqrstuvwxyz".split("").splice(0, arity).j
oin(","); | |
| 2977 return new Function(`return function(${arguments$}){` + `return this.${Bou
ndClosure.selfFieldName()}.${stubName}(${arguments$});` + `${(() => { | |
| 2978 let x = Closure.functionCounter; | |
| 2979 Closure.functionCounter = dart.notNull(x) + 1; | |
| 2980 return x; | |
| 2981 })()}` + '}')(); | |
| 2982 } | |
| 2983 static cspForwardInterceptedCall(arity, isSuperCall, name, func) { | |
| 2984 let getSelf = _foreign_helper.RAW_DART_FUNCTION_REF(BoundClosure.selfOf); | |
| 2985 let getReceiver = _foreign_helper.RAW_DART_FUNCTION_REF(BoundClosure.recei
verOf); | |
| 2986 if (isSuperCall) | |
| 2987 arity = -1; | |
| 2988 switch (arity) { | |
| 2989 case 0: | |
| 2990 { | |
| 2991 throw new RuntimeError('Intercepted function with no arguments.'); | |
| 2992 } | |
| 2993 case 1: | |
| 2994 { | |
| 2995 return function(n, s, r) { | |
| 2996 return function() { | |
| 2997 return s(this)[n](r(this)); | |
| 2998 }; | |
| 2999 }(name, getSelf, getReceiver); | |
| 3000 } | |
| 3001 case 2: | |
| 3002 { | |
| 3003 return function(n, s, r) { | |
| 3004 return function(a) { | |
| 3005 return s(this)[n](r(this), a); | |
| 3006 }; | |
| 3007 }(name, getSelf, getReceiver); | |
| 3008 } | |
| 3009 case 3: | |
| 3010 { | |
| 3011 return function(n, s, r) { | |
| 3012 return function(a, b) { | |
| 3013 return s(this)[n](r(this), a, b); | |
| 3014 }; | |
| 3015 }(name, getSelf, getReceiver); | |
| 3016 } | |
| 3017 case 4: | |
| 3018 { | |
| 3019 return function(n, s, r) { | |
| 3020 return function(a, b, c) { | |
| 3021 return s(this)[n](r(this), a, b, c); | |
| 3022 }; | |
| 3023 }(name, getSelf, getReceiver); | |
| 3024 } | |
| 3025 case 5: | |
| 3026 { | |
| 3027 return function(n, s, r) { | |
| 3028 return function(a, b, c, d) { | |
| 3029 return s(this)[n](r(this), a, b, c, d); | |
| 3030 }; | |
| 3031 }(name, getSelf, getReceiver); | |
| 3032 } | |
| 3033 case 6: | |
| 3034 { | |
| 3035 return function(n, s, r) { | |
| 3036 return function(a, b, c, d, e) { | |
| 3037 return s(this)[n](r(this), a, b, c, d, e); | |
| 3038 }; | |
| 3039 }(name, getSelf, getReceiver); | |
| 3040 } | |
| 3041 default: | |
| 3042 { | |
| 3043 return function(f, s, r, a) { | |
| 3044 return function() { | |
| 3045 a = [r(this)]; | |
| 3046 Array.prototype.push.apply(a, arguments$); | |
| 3047 return f.apply(s(this), a); | |
| 3048 }; | |
| 3049 }(func, getSelf, getReceiver); | |
| 3050 } | |
| 3051 } | |
| 3052 } | |
| 3053 static forwardInterceptedCallTo(receiver, func) { | |
| 3054 let selfField = BoundClosure.selfFieldName(); | |
| 3055 let receiverField = BoundClosure.receiverFieldName(); | |
| 3056 let stubName = dart.as(func.$stubName, core.String); | |
| 3057 let arity = func.length; | |
| 3058 let isCsp = typeof dart_precompiled == "function"; | |
| 3059 let lookedUpFunction = receiver[stubName]; | |
| 3060 let isSuperCall = !dart.notNull(core.identical(func, lookedUpFunction)); | |
| 3061 if (dart.notNull(isCsp) || dart.notNull(isSuperCall) || dart.notNull(arity
) >= 28) { | |
| 3062 return Closure.cspForwardInterceptedCall(arity, isSuperCall, stubName, f
unc); | |
| 3063 } | |
| 3064 if (arity == 1) { | |
| 3065 return new Function('return function(){' + `return this.${selfField}.${s
tubName}(this.${receiverField});` + `${(() => { | |
| 3066 let x = Closure.functionCounter; | |
| 3067 Closure.functionCounter = dart.notNull(x) + 1; | |
| 3068 return x; | |
| 3069 })()}` + '}')(); | |
| 3070 } | |
| 3071 dart.assert(1 < dart.notNull(arity) && dart.notNull(arity) < 28); | |
| 3072 let arguments$ = "abcdefghijklmnopqrstuvwxyz".split("").splice(0, dart.not
Null(arity) - 1).join(","); | |
| 3073 return new Function(`return function(${arguments$}){` + `return this.${sel
fField}.${stubName}(this.${receiverField}, ${arguments$});` + `${(() => { | |
| 3074 let x = Closure.functionCounter; | |
| 3075 Closure.functionCounter = dart.notNull(x) + 1; | |
| 3076 return x; | |
| 3077 })()}` + '}')(); | |
| 3078 } | |
| 3079 toString() { | |
| 3080 return "Closure"; | |
| 3081 } | |
| 3082 } | |
| 3083 Closure[dart.implements] = () => [core.Function]; | |
| 3084 dart.setSignature(Closure, { | |
| 3085 constructors: () => ({Closure: [Closure, []]}), | |
| 3086 statics: () => ({ | |
| 3087 fromTearOff: [core.Object, [core.Object, core.List, core.List, core.bool,
core.Object, core.String]], | |
| 3088 cspForwardCall: [core.Object, [core.int, core.bool, core.String, core.Obje
ct]], | |
| 3089 forwardCallTo: [core.Object, [core.Object, core.Object, core.bool]], | |
| 3090 cspForwardInterceptedCall: [core.Object, [core.int, core.bool, core.String
, core.Object]], | |
| 3091 forwardInterceptedCallTo: [core.Object, [core.Object, core.Object]] | |
| 3092 }), | |
| 3093 names: ['fromTearOff', 'cspForwardCall', 'forwardCallTo', 'cspForwardInterce
ptedCall', 'forwardInterceptedCallTo'] | |
| 3094 }); | |
| 3095 Closure.FUNCTION_INDEX = 0; | |
| 3096 Closure.NAME_INDEX = 1; | |
| 3097 Closure.CALL_NAME_INDEX = 2; | |
| 3098 Closure.REQUIRED_PARAMETER_INDEX = 3; | |
| 3099 Closure.OPTIONAL_PARAMETER_INDEX = 4; | |
| 3100 Closure.DEFAULT_ARGUMENTS_INDEX = 5; | |
| 3101 Closure.functionCounter = 0; | |
| 3102 function closureFromTearOff(receiver, functions, reflectionInfo, isStatic, jsA
rguments, name) { | |
| 3103 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); | |
| 3104 } | |
| 3105 dart.fn(closureFromTearOff); | |
| 3106 class TearOffClosure extends Closure { | |
| 3107 TearOffClosure() { | |
| 3108 super.Closure(); | |
| 3109 } | |
| 3110 } | |
| 3111 let _self = Symbol('_self'); | |
| 3112 let _target = Symbol('_target'); | |
| 3113 let _name = Symbol('_name'); | |
| 3114 class BoundClosure extends TearOffClosure { | |
| 3115 BoundClosure(self, target, receiver, name) { | |
| 3116 this[_self] = self; | |
| 3117 this[_target] = target; | |
| 3118 this[_receiver] = receiver; | |
| 3119 this[_name] = name; | |
| 3120 } | |
| 3121 ['=='](other) { | |
| 3122 if (core.identical(this, other)) | |
| 3123 return true; | |
| 3124 if (!dart.is(other, BoundClosure)) | |
| 3125 return false; | |
| 3126 return this[_self] === dart.dload(other, _self) && this[_target] === dart.
dload(other, _target) && this[_receiver] === dart.dload(other, _receiver); | |
| 3127 } | |
| 3128 get hashCode() { | |
| 3129 let receiverHashCode = null; | |
| 3130 if (this[_receiver] == null) { | |
| 3131 receiverHashCode = Primitives.objectHashCode(this[_self]); | |
| 3132 } else if (typeof this[_receiver] != 'object') { | |
| 3133 receiverHashCode = dart.hashCode(this[_receiver]); | |
| 3134 } else { | |
| 3135 receiverHashCode = Primitives.objectHashCode(this[_receiver]); | |
| 3136 } | |
| 3137 return dart.notNull(receiverHashCode) ^ dart.notNull(Primitives.objectHash
Code(this[_target])); | |
| 3138 } | |
| 3139 static selfOf(closure) { | |
| 3140 return closure[_self]; | |
| 3141 } | |
| 3142 static targetOf(closure) { | |
| 3143 return closure[_target]; | |
| 3144 } | |
| 3145 static receiverOf(closure) { | |
| 3146 return closure[_receiver]; | |
| 3147 } | |
| 3148 static nameOf(closure) { | |
| 3149 return closure[_name]; | |
| 3150 } | |
| 3151 static selfFieldName() { | |
| 3152 if (BoundClosure.selfFieldNameCache == null) { | |
| 3153 BoundClosure.selfFieldNameCache = BoundClosure.computeFieldNamed('self')
; | |
| 3154 } | |
| 3155 return BoundClosure.selfFieldNameCache; | |
| 3156 } | |
| 3157 static receiverFieldName() { | |
| 3158 if (BoundClosure.receiverFieldNameCache == null) { | |
| 3159 BoundClosure.receiverFieldNameCache = BoundClosure.computeFieldNamed('re
ceiver'); | |
| 3160 } | |
| 3161 return BoundClosure.receiverFieldNameCache; | |
| 3162 } | |
| 3163 static computeFieldNamed(fieldName) { | |
| 3164 let template = new BoundClosure('self', 'target', 'receiver', 'name'); | |
| 3165 let names = _interceptors.JSArray.markFixedList(dart.as(Object.getOwnPrope
rtyNames(template), core.List)); | |
| 3166 for (let i = 0; dart.notNull(i) < dart.notNull(names[core.$length]); i = d
art.notNull(i) + 1) { | |
| 3167 let name = names[core.$get](i); | |
| 3168 if (template[name] === fieldName) { | |
| 3169 return name; | |
| 3170 } | |
| 3171 } | |
| 3172 } | |
| 3173 } | |
| 3174 dart.setSignature(BoundClosure, { | |
| 3175 constructors: () => ({BoundClosure: [BoundClosure, [core.Object, core.Object
, core.Object, core.String]]}), | |
| 3176 statics: () => ({ | |
| 3177 selfOf: [core.Object, [BoundClosure]], | |
| 3178 targetOf: [core.Object, [BoundClosure]], | |
| 3179 receiverOf: [core.Object, [BoundClosure]], | |
| 3180 nameOf: [core.Object, [BoundClosure]], | |
| 3181 selfFieldName: [core.String, []], | |
| 3182 receiverFieldName: [core.String, []], | |
| 3183 computeFieldNamed: [core.String, [core.String]] | |
| 3184 }), | |
| 3185 names: ['selfOf', 'targetOf', 'receiverOf', 'nameOf', 'selfFieldName', 'rece
iverFieldName', 'computeFieldNamed'] | |
| 3186 }); | |
| 3187 BoundClosure.selfFieldNameCache = null; | |
| 3188 BoundClosure.receiverFieldNameCache = null; | |
| 3189 function jsHasOwnProperty(jsObject, property) { | 1021 function jsHasOwnProperty(jsObject, property) { |
| 3190 return jsObject.hasOwnProperty(property); | 1022 return jsObject.hasOwnProperty(property); |
| 3191 } | 1023 } |
| 3192 dart.fn(jsHasOwnProperty, core.bool, [core.Object, core.String]); | 1024 dart.fn(jsHasOwnProperty, core.bool, [core.Object, core.String]); |
| 3193 function jsPropertyAccess(jsObject, property) { | 1025 function jsPropertyAccess(jsObject, property) { |
| 3194 return jsObject[property]; | 1026 return jsObject[property]; |
| 3195 } | 1027 } |
| 3196 dart.fn(jsPropertyAccess, core.Object, [core.Object, core.String]); | 1028 dart.fn(jsPropertyAccess, core.Object, [core.Object, core.String]); |
| 3197 function getFallThroughError() { | 1029 function getFallThroughError() { |
| 3198 return new FallThroughErrorImplementation(); | 1030 return new FallThroughErrorImplementation(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 3215 constructors: () => ({Returns: [Returns, [core.String]]}) | 1047 constructors: () => ({Returns: [Returns, [core.String]]}) |
| 3216 }); | 1048 }); |
| 3217 class JSName extends core.Object { | 1049 class JSName extends core.Object { |
| 3218 JSName(name) { | 1050 JSName(name) { |
| 3219 this.name = name; | 1051 this.name = name; |
| 3220 } | 1052 } |
| 3221 } | 1053 } |
| 3222 dart.setSignature(JSName, { | 1054 dart.setSignature(JSName, { |
| 3223 constructors: () => ({JSName: [JSName, [core.String]]}) | 1055 constructors: () => ({JSName: [JSName, [core.String]]}) |
| 3224 }); | 1056 }); |
| 3225 function boolConversionCheck(value) { | |
| 3226 if (typeof value == 'boolean') | |
| 3227 return value; | |
| 3228 boolTypeCheck(value); | |
| 3229 dart.assert(value != null); | |
| 3230 return false; | |
| 3231 } | |
| 3232 dart.fn(boolConversionCheck); | |
| 3233 function stringTypeCheck(value) { | |
| 3234 if (value == null) | |
| 3235 return value; | |
| 3236 if (typeof value == 'string') | |
| 3237 return value; | |
| 3238 throw new TypeErrorImplementation(value, 'String'); | |
| 3239 } | |
| 3240 dart.fn(stringTypeCheck); | |
| 3241 function stringTypeCast(value) { | |
| 3242 if (typeof value == 'string' || dart.notNull(value == null)) | |
| 3243 return value; | |
| 3244 throw new CastErrorImplementation(Primitives.objectTypeName(value), 'String'
); | |
| 3245 } | |
| 3246 dart.fn(stringTypeCast); | |
| 3247 function doubleTypeCheck(value) { | |
| 3248 if (value == null) | |
| 3249 return value; | |
| 3250 if (typeof value == 'number') | |
| 3251 return value; | |
| 3252 throw new TypeErrorImplementation(value, 'double'); | |
| 3253 } | |
| 3254 dart.fn(doubleTypeCheck); | |
| 3255 function doubleTypeCast(value) { | |
| 3256 if (typeof value == 'number' || dart.notNull(value == null)) | |
| 3257 return value; | |
| 3258 throw new CastErrorImplementation(Primitives.objectTypeName(value), 'double'
); | |
| 3259 } | |
| 3260 dart.fn(doubleTypeCast); | |
| 3261 function numTypeCheck(value) { | |
| 3262 if (value == null) | |
| 3263 return value; | |
| 3264 if (dart.is(value, core.num)) | |
| 3265 return value; | |
| 3266 throw new TypeErrorImplementation(value, 'num'); | |
| 3267 } | |
| 3268 dart.fn(numTypeCheck); | |
| 3269 function numTypeCast(value) { | |
| 3270 if (dart.is(value, core.num) || dart.notNull(value == null)) | |
| 3271 return value; | |
| 3272 throw new CastErrorImplementation(Primitives.objectTypeName(value), 'num'); | |
| 3273 } | |
| 3274 dart.fn(numTypeCast); | |
| 3275 function boolTypeCheck(value) { | |
| 3276 if (value == null) | |
| 3277 return value; | |
| 3278 if (typeof value == 'boolean') | |
| 3279 return value; | |
| 3280 throw new TypeErrorImplementation(value, 'bool'); | |
| 3281 } | |
| 3282 dart.fn(boolTypeCheck); | |
| 3283 function boolTypeCast(value) { | |
| 3284 if (typeof value == 'boolean' || dart.notNull(value == null)) | |
| 3285 return value; | |
| 3286 throw new CastErrorImplementation(Primitives.objectTypeName(value), 'bool'); | |
| 3287 } | |
| 3288 dart.fn(boolTypeCast); | |
| 3289 function intTypeCheck(value) { | |
| 3290 if (value == null) | |
| 3291 return value; | |
| 3292 if (typeof value == 'number') | |
| 3293 return value; | |
| 3294 throw new TypeErrorImplementation(value, 'int'); | |
| 3295 } | |
| 3296 dart.fn(intTypeCheck); | |
| 3297 function intTypeCast(value) { | |
| 3298 if (typeof value == 'number' || dart.notNull(value == null)) | |
| 3299 return value; | |
| 3300 throw new CastErrorImplementation(Primitives.objectTypeName(value), 'int'); | |
| 3301 } | |
| 3302 dart.fn(intTypeCast); | |
| 3303 function propertyTypeError(value, property) { | |
| 3304 let name = dart.as(dart.dsend(property, 'substring', 3, dart.dload(property,
'length')), core.String); | |
| 3305 throw new TypeErrorImplementation(value, name); | |
| 3306 } | |
| 3307 dart.fn(propertyTypeError, dart.void, [core.Object, core.Object]); | |
| 3308 function propertyTypeCastError(value, property) { | |
| 3309 let actualType = Primitives.objectTypeName(value); | |
| 3310 let expectedType = dart.as(dart.dsend(property, 'substring', 3, dart.dload(p
roperty, 'length')), core.String); | |
| 3311 throw new CastErrorImplementation(actualType, expectedType); | |
| 3312 } | |
| 3313 dart.fn(propertyTypeCastError, dart.void, [core.Object, core.Object]); | |
| 3314 function propertyTypeCheck(value, property) { | |
| 3315 if (value == null) | |
| 3316 return value; | |
| 3317 if (!!value[property]) | |
| 3318 return value; | |
| 3319 propertyTypeError(value, property); | |
| 3320 } | |
| 3321 dart.fn(propertyTypeCheck); | |
| 3322 function propertyTypeCast(value, property) { | |
| 3323 if (dart.notNull(value == null) || !!value[property]) | |
| 3324 return value; | |
| 3325 propertyTypeCastError(value, property); | |
| 3326 } | |
| 3327 dart.fn(propertyTypeCast); | |
| 3328 function interceptedTypeCheck(value, property) { | |
| 3329 if (value == null) | |
| 3330 return value; | |
| 3331 if (dart.notNull(core.identical(typeof value, 'object')) && _interceptors.ge
tInterceptor(value)[property]) { | |
| 3332 return value; | |
| 3333 } | |
| 3334 propertyTypeError(value, property); | |
| 3335 } | |
| 3336 dart.fn(interceptedTypeCheck); | |
| 3337 function interceptedTypeCast(value, property) { | |
| 3338 if (dart.notNull(value == null) || typeof value === "object" && _interceptor
s.getInterceptor(value)[property]) { | |
| 3339 return value; | |
| 3340 } | |
| 3341 propertyTypeCastError(value, property); | |
| 3342 } | |
| 3343 dart.fn(interceptedTypeCast); | |
| 3344 function numberOrStringSuperTypeCheck(value, property) { | |
| 3345 if (value == null) | |
| 3346 return value; | |
| 3347 if (typeof value == 'string') | |
| 3348 return value; | |
| 3349 if (dart.is(value, core.num)) | |
| 3350 return value; | |
| 3351 if (!!value[property]) | |
| 3352 return value; | |
| 3353 propertyTypeError(value, property); | |
| 3354 } | |
| 3355 dart.fn(numberOrStringSuperTypeCheck); | |
| 3356 function numberOrStringSuperTypeCast(value, property) { | |
| 3357 if (typeof value == 'string') | |
| 3358 return value; | |
| 3359 if (dart.is(value, core.num)) | |
| 3360 return value; | |
| 3361 return propertyTypeCast(value, property); | |
| 3362 } | |
| 3363 dart.fn(numberOrStringSuperTypeCast); | |
| 3364 function numberOrStringSuperNativeTypeCheck(value, property) { | |
| 3365 if (value == null) | |
| 3366 return value; | |
| 3367 if (typeof value == 'string') | |
| 3368 return value; | |
| 3369 if (dart.is(value, core.num)) | |
| 3370 return value; | |
| 3371 if (_interceptors.getInterceptor(value)[property]) | |
| 3372 return value; | |
| 3373 propertyTypeError(value, property); | |
| 3374 } | |
| 3375 dart.fn(numberOrStringSuperNativeTypeCheck); | |
| 3376 function numberOrStringSuperNativeTypeCast(value, property) { | |
| 3377 if (value == null) | |
| 3378 return value; | |
| 3379 if (typeof value == 'string') | |
| 3380 return value; | |
| 3381 if (dart.is(value, core.num)) | |
| 3382 return value; | |
| 3383 if (_interceptors.getInterceptor(value)[property]) | |
| 3384 return value; | |
| 3385 propertyTypeCastError(value, property); | |
| 3386 } | |
| 3387 dart.fn(numberOrStringSuperNativeTypeCast); | |
| 3388 function stringSuperTypeCheck(value, property) { | |
| 3389 if (value == null) | |
| 3390 return value; | |
| 3391 if (typeof value == 'string') | |
| 3392 return value; | |
| 3393 if (!!value[property]) | |
| 3394 return value; | |
| 3395 propertyTypeError(value, property); | |
| 3396 } | |
| 3397 dart.fn(stringSuperTypeCheck); | |
| 3398 function stringSuperTypeCast(value, property) { | |
| 3399 if (typeof value == 'string') | |
| 3400 return value; | |
| 3401 return propertyTypeCast(value, property); | |
| 3402 } | |
| 3403 dart.fn(stringSuperTypeCast); | |
| 3404 function stringSuperNativeTypeCheck(value, property) { | |
| 3405 if (value == null) | |
| 3406 return value; | |
| 3407 if (typeof value == 'string') | |
| 3408 return value; | |
| 3409 if (_interceptors.getInterceptor(value)[property]) | |
| 3410 return value; | |
| 3411 propertyTypeError(value, property); | |
| 3412 } | |
| 3413 dart.fn(stringSuperNativeTypeCheck); | |
| 3414 function stringSuperNativeTypeCast(value, property) { | |
| 3415 if (typeof value == 'string' || dart.notNull(value == null)) | |
| 3416 return value; | |
| 3417 if (_interceptors.getInterceptor(value)[property]) | |
| 3418 return value; | |
| 3419 propertyTypeCastError(value, property); | |
| 3420 } | |
| 3421 dart.fn(stringSuperNativeTypeCast); | |
| 3422 function listTypeCheck(value) { | |
| 3423 if (value == null) | |
| 3424 return value; | |
| 3425 if (dart.is(value, core.List)) | |
| 3426 return value; | |
| 3427 throw new TypeErrorImplementation(value, 'List'); | |
| 3428 } | |
| 3429 dart.fn(listTypeCheck); | |
| 3430 function listTypeCast(value) { | |
| 3431 if (dart.is(value, core.List) || dart.notNull(value == null)) | |
| 3432 return value; | |
| 3433 throw new CastErrorImplementation(Primitives.objectTypeName(value), 'List'); | |
| 3434 } | |
| 3435 dart.fn(listTypeCast); | |
| 3436 function listSuperTypeCheck(value, property) { | |
| 3437 if (value == null) | |
| 3438 return value; | |
| 3439 if (dart.is(value, core.List)) | |
| 3440 return value; | |
| 3441 if (!!value[property]) | |
| 3442 return value; | |
| 3443 propertyTypeError(value, property); | |
| 3444 } | |
| 3445 dart.fn(listSuperTypeCheck); | |
| 3446 function listSuperTypeCast(value, property) { | |
| 3447 if (dart.is(value, core.List)) | |
| 3448 return value; | |
| 3449 return propertyTypeCast(value, property); | |
| 3450 } | |
| 3451 dart.fn(listSuperTypeCast); | |
| 3452 function listSuperNativeTypeCheck(value, property) { | |
| 3453 if (value == null) | |
| 3454 return value; | |
| 3455 if (dart.is(value, core.List)) | |
| 3456 return value; | |
| 3457 if (_interceptors.getInterceptor(value)[property]) | |
| 3458 return value; | |
| 3459 propertyTypeError(value, property); | |
| 3460 } | |
| 3461 dart.fn(listSuperNativeTypeCheck); | |
| 3462 function listSuperNativeTypeCast(value, property) { | |
| 3463 if (dart.is(value, core.List) || dart.notNull(value == null)) | |
| 3464 return value; | |
| 3465 if (_interceptors.getInterceptor(value)[property]) | |
| 3466 return value; | |
| 3467 propertyTypeCastError(value, property); | |
| 3468 } | |
| 3469 dart.fn(listSuperNativeTypeCast); | |
| 3470 function voidTypeCheck(value) { | |
| 3471 if (value == null) | |
| 3472 return value; | |
| 3473 throw new TypeErrorImplementation(value, 'void'); | |
| 3474 } | |
| 3475 dart.fn(voidTypeCheck); | |
| 3476 function checkMalformedType(value, message) { | |
| 3477 if (value == null) | |
| 3478 return value; | |
| 3479 throw new TypeErrorImplementation.fromMessage(dart.as(message, core.String))
; | |
| 3480 } | |
| 3481 dart.fn(checkMalformedType); | |
| 3482 function checkDeferredIsLoaded(loadId, uri) { | |
| 3483 if (!dart.notNull(exports._loadedLibraries[core.$contains](loadId))) { | |
| 3484 throw new DeferredNotLoadedError(uri); | |
| 3485 } | |
| 3486 } | |
| 3487 dart.fn(checkDeferredIsLoaded, dart.void, [core.String, core.String]); | |
| 3488 dart.defineLazyClass(exports, { | 1057 dart.defineLazyClass(exports, { |
| 3489 get JavaScriptIndexingBehavior() { | 1058 get JavaScriptIndexingBehavior() { |
| 3490 class JavaScriptIndexingBehavior extends _interceptors.JSMutableIndexable
{} | 1059 class JavaScriptIndexingBehavior extends _interceptors.JSMutableIndexable
{} |
| 3491 return JavaScriptIndexingBehavior; | 1060 return JavaScriptIndexingBehavior; |
| 3492 } | 1061 } |
| 3493 }); | 1062 }); |
| 3494 class TypeErrorImplementation extends core.Error { | 1063 class TypeErrorImplementation extends core.Error { |
| 3495 TypeErrorImplementation(value, type) { | 1064 TypeErrorImplementation(value, type) { |
| 3496 this.message = `type '${Primitives.objectTypeName(value)}' is not a subtyp
e ` + `of type '${type}'`; | 1065 this.message = `type '${Primitives.objectTypeName(value)}' is not a subtyp
e ` + `of type '${type}'`; |
| 3497 super.Error(); | 1066 super.Error(); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3529 FallThroughErrorImplementation() { | 1098 FallThroughErrorImplementation() { |
| 3530 super.FallThroughError(); | 1099 super.FallThroughError(); |
| 3531 } | 1100 } |
| 3532 toString() { | 1101 toString() { |
| 3533 return "Switch case fall-through."; | 1102 return "Switch case fall-through."; |
| 3534 } | 1103 } |
| 3535 } | 1104 } |
| 3536 dart.setSignature(FallThroughErrorImplementation, { | 1105 dart.setSignature(FallThroughErrorImplementation, { |
| 3537 constructors: () => ({FallThroughErrorImplementation: [FallThroughErrorImple
mentation, []]}) | 1106 constructors: () => ({FallThroughErrorImplementation: [FallThroughErrorImple
mentation, []]}) |
| 3538 }); | 1107 }); |
| 3539 function assertHelper(condition) { | |
| 3540 if (!(typeof condition == 'boolean')) { | |
| 3541 if (dart.is(condition, core.Function)) | |
| 3542 condition = dart.dcall(condition); | |
| 3543 if (!(typeof condition == 'boolean')) { | |
| 3544 throw new TypeErrorImplementation(condition, 'bool'); | |
| 3545 } | |
| 3546 } | |
| 3547 if (!dart.equals(true, condition)) | |
| 3548 throw new core.AssertionError(); | |
| 3549 } | |
| 3550 dart.fn(assertHelper, dart.void, [core.Object]); | |
| 3551 function throwNoSuchMethod(obj, name, arguments$, expectedArgumentNames) { | |
| 3552 let memberName = new _internal.Symbol.unvalidated(dart.as(name, core.String)
); | |
| 3553 throw new core.NoSuchMethodError(obj, memberName, dart.as(arguments$, core.L
ist), core.Map$(core.Symbol, core.Object).new(), dart.as(expectedArgumentNames,
core.List)); | |
| 3554 } | |
| 3555 dart.fn(throwNoSuchMethod, dart.void, [core.Object, core.Object, core.Object,
core.Object]); | |
| 3556 function throwCyclicInit(staticName) { | |
| 3557 throw new core.CyclicInitializationError(`Cyclic initialization for static $
{staticName}`); | |
| 3558 } | |
| 3559 dart.fn(throwCyclicInit, dart.void, [core.String]); | |
| 3560 class RuntimeError extends core.Error { | 1108 class RuntimeError extends core.Error { |
| 3561 RuntimeError(message) { | 1109 RuntimeError(message) { |
| 3562 this.message = message; | 1110 this.message = message; |
| 3563 super.Error(); | 1111 super.Error(); |
| 3564 } | 1112 } |
| 3565 toString() { | 1113 toString() { |
| 3566 return `RuntimeError: ${this.message}`; | 1114 return `RuntimeError: ${this.message}`; |
| 3567 } | 1115 } |
| 3568 } | 1116 } |
| 3569 dart.setSignature(RuntimeError, { | 1117 dart.setSignature(RuntimeError, { |
| 3570 constructors: () => ({RuntimeError: [RuntimeError, [core.Object]]}) | 1118 constructors: () => ({RuntimeError: [RuntimeError, [core.Object]]}) |
| 3571 }); | 1119 }); |
| 3572 class DeferredNotLoadedError extends core.Error { | |
| 3573 DeferredNotLoadedError(libraryName) { | |
| 3574 this.libraryName = libraryName; | |
| 3575 super.Error(); | |
| 3576 } | |
| 3577 toString() { | |
| 3578 return `Deferred library ${this.libraryName} was not loaded.`; | |
| 3579 } | |
| 3580 } | |
| 3581 DeferredNotLoadedError[dart.implements] = () => [core.NoSuchMethodError]; | |
| 3582 dart.setSignature(DeferredNotLoadedError, { | |
| 3583 constructors: () => ({DeferredNotLoadedError: [DeferredNotLoadedError, [core
.String]]}) | |
| 3584 }); | |
| 3585 class RuntimeType extends core.Object { | |
| 3586 RuntimeType() { | |
| 3587 } | |
| 3588 } | |
| 3589 dart.setSignature(RuntimeType, { | |
| 3590 constructors: () => ({RuntimeType: [RuntimeType, []]}) | |
| 3591 }); | |
| 3592 let _isTest = Symbol('_isTest'); | |
| 3593 let _extractFunctionTypeObjectFrom = Symbol('_extractFunctionTypeObjectFrom'); | |
| 3594 let _asCheck = Symbol('_asCheck'); | |
| 3595 let _check = Symbol('_check'); | |
| 3596 let _assertCheck = Symbol('_assertCheck'); | |
| 3597 class RuntimeFunctionType extends RuntimeType { | |
| 3598 RuntimeFunctionType(returnType, parameterTypes, optionalParameterTypes, name
dParameters) { | |
| 3599 this.returnType = returnType; | |
| 3600 this.parameterTypes = parameterTypes; | |
| 3601 this.optionalParameterTypes = optionalParameterTypes; | |
| 3602 this.namedParameters = namedParameters; | |
| 3603 super.RuntimeType(); | |
| 3604 } | |
| 3605 get isVoid() { | |
| 3606 return dart.is(this.returnType, VoidRuntimeType); | |
| 3607 } | |
| 3608 [_isTest](expression) { | |
| 3609 let functionTypeObject = this[_extractFunctionTypeObjectFrom](expression); | |
| 3610 return functionTypeObject == null ? false : isFunctionSubtype(functionType
Object, this.toRti()); | |
| 3611 } | |
| 3612 [_asCheck](expression) { | |
| 3613 return this[_check](expression, true); | |
| 3614 } | |
| 3615 [_assertCheck](expression) { | |
| 3616 if (RuntimeFunctionType.inAssert) | |
| 3617 return null; | |
| 3618 RuntimeFunctionType.inAssert = true; | |
| 3619 try { | |
| 3620 return this[_check](expression, false); | |
| 3621 } finally { | |
| 3622 RuntimeFunctionType.inAssert = false; | |
| 3623 } | |
| 3624 } | |
| 3625 [_check](expression, isCast) { | |
| 3626 if (expression == null) | |
| 3627 return null; | |
| 3628 if (this[_isTest](expression)) | |
| 3629 return expression; | |
| 3630 let self = dart.toString(new FunctionTypeInfoDecoderRing(this.toRti())); | |
| 3631 if (isCast) { | |
| 3632 let functionTypeObject = this[_extractFunctionTypeObjectFrom](expression
); | |
| 3633 let pretty = null; | |
| 3634 if (functionTypeObject != null) { | |
| 3635 pretty = dart.toString(new FunctionTypeInfoDecoderRing(functionTypeObj
ect)); | |
| 3636 } else { | |
| 3637 pretty = Primitives.objectTypeName(expression); | |
| 3638 } | |
| 3639 throw new CastErrorImplementation(pretty, self); | |
| 3640 } else { | |
| 3641 throw new TypeErrorImplementation(expression, self); | |
| 3642 } | |
| 3643 } | |
| 3644 [_extractFunctionTypeObjectFrom](o) { | |
| 3645 let interceptor = _interceptors.getInterceptor(o); | |
| 3646 return _foreign_helper.JS_SIGNATURE_NAME() in interceptor ? interceptor[_f
oreign_helper.JS_SIGNATURE_NAME()]() : null; | |
| 3647 } | |
| 3648 toRti() { | |
| 3649 let result = {[_foreign_helper.JS_FUNCTION_TYPE_TAG()]: "dynafunc"}; | |
| 3650 if (this.isVoid) { | |
| 3651 result[_foreign_helper.JS_FUNCTION_TYPE_VOID_RETURN_TAG()] = true; | |
| 3652 } else { | |
| 3653 if (!dart.is(this.returnType, DynamicRuntimeType)) { | |
| 3654 result[_foreign_helper.JS_FUNCTION_TYPE_RETURN_TYPE_TAG()] = this.retu
rnType.toRti(); | |
| 3655 } | |
| 3656 } | |
| 3657 if (dart.notNull(this.parameterTypes != null) && !dart.notNull(this.parame
terTypes[core.$isEmpty])) { | |
| 3658 result[_foreign_helper.JS_FUNCTION_TYPE_REQUIRED_PARAMETERS_TAG()] = Run
timeFunctionType.listToRti(this.parameterTypes); | |
| 3659 } | |
| 3660 if (dart.notNull(this.optionalParameterTypes != null) && !dart.notNull(thi
s.optionalParameterTypes[core.$isEmpty])) { | |
| 3661 result[_foreign_helper.JS_FUNCTION_TYPE_OPTIONAL_PARAMETERS_TAG()] = Run
timeFunctionType.listToRti(this.optionalParameterTypes); | |
| 3662 } | |
| 3663 if (this.namedParameters != null) { | |
| 3664 let namedRti = Object.create(null); | |
| 3665 let keys = _js_names.extractKeys(this.namedParameters); | |
| 3666 for (let i = 0; dart.notNull(i) < dart.notNull(keys[core.$length]); i =
dart.notNull(i) + 1) { | |
| 3667 let name = keys[core.$get](i); | |
| 3668 let rti = dart.dsend(this.namedParameters[name], 'toRti'); | |
| 3669 namedRti[name] = rti; | |
| 3670 } | |
| 3671 result[_foreign_helper.JS_FUNCTION_TYPE_NAMED_PARAMETERS_TAG()] = namedR
ti; | |
| 3672 } | |
| 3673 return result; | |
| 3674 } | |
| 3675 static listToRti(list) { | |
| 3676 list = list; | |
| 3677 let result = []; | |
| 3678 for (let i = 0; dart.notNull(i) < dart.notNull(dart.as(dart.dload(list, 'l
ength'), core.num)); i = dart.notNull(i) + 1) { | |
| 3679 result.push(dart.dsend(dart.dindex(list, i), 'toRti')); | |
| 3680 } | |
| 3681 return result; | |
| 3682 } | |
| 3683 toString() { | |
| 3684 let result = '('; | |
| 3685 let needsComma = false; | |
| 3686 if (this.parameterTypes != null) { | |
| 3687 for (let i = 0; dart.notNull(i) < dart.notNull(this.parameterTypes[core.
$length]); i = dart.notNull(i) + 1) { | |
| 3688 let type = this.parameterTypes[core.$get](i); | |
| 3689 if (needsComma) { | |
| 3690 result = dart.notNull(result) + ', '; | |
| 3691 } | |
| 3692 result = dart.notNull(result) + `${type}`; | |
| 3693 needsComma = true; | |
| 3694 } | |
| 3695 } | |
| 3696 if (dart.notNull(this.optionalParameterTypes != null) && !dart.notNull(thi
s.optionalParameterTypes[core.$isEmpty])) { | |
| 3697 if (needsComma) { | |
| 3698 result = dart.notNull(result) + ', '; | |
| 3699 } | |
| 3700 needsComma = false; | |
| 3701 result = dart.notNull(result) + '['; | |
| 3702 for (let i = 0; dart.notNull(i) < dart.notNull(this.optionalParameterTyp
es[core.$length]); i = dart.notNull(i) + 1) { | |
| 3703 let type = this.optionalParameterTypes[core.$get](i); | |
| 3704 if (needsComma) { | |
| 3705 result = dart.notNull(result) + ', '; | |
| 3706 } | |
| 3707 result = dart.notNull(result) + `${type}`; | |
| 3708 needsComma = true; | |
| 3709 } | |
| 3710 result = dart.notNull(result) + ']'; | |
| 3711 } else if (this.namedParameters != null) { | |
| 3712 if (needsComma) { | |
| 3713 result = dart.notNull(result) + ', '; | |
| 3714 } | |
| 3715 needsComma = false; | |
| 3716 result = dart.notNull(result) + '{'; | |
| 3717 let keys = _js_names.extractKeys(this.namedParameters); | |
| 3718 for (let i = 0; dart.notNull(i) < dart.notNull(keys[core.$length]); i =
dart.notNull(i) + 1) { | |
| 3719 let name = keys[core.$get](i); | |
| 3720 if (needsComma) { | |
| 3721 result = dart.notNull(result) + ', '; | |
| 3722 } | |
| 3723 let rti = dart.dsend(this.namedParameters[name], 'toRti'); | |
| 3724 result = dart.notNull(result) + `${rti} ${name}`; | |
| 3725 needsComma = true; | |
| 3726 } | |
| 3727 result = dart.notNull(result) + '}'; | |
| 3728 } | |
| 3729 result = dart.notNull(result) + `) -> ${this.returnType}`; | |
| 3730 return result; | |
| 3731 } | |
| 3732 } | |
| 3733 dart.setSignature(RuntimeFunctionType, { | |
| 3734 constructors: () => ({RuntimeFunctionType: [RuntimeFunctionType, [RuntimeTyp
e, core.List$(RuntimeType), core.List$(RuntimeType), core.Object]]}), | |
| 3735 methods: () => ({ | |
| 3736 [_isTest]: [core.bool, [core.Object]], | |
| 3737 [_asCheck]: [core.Object, [core.Object]], | |
| 3738 [_assertCheck]: [core.Object, [core.Object]], | |
| 3739 [_check]: [core.Object, [core.Object, core.bool]], | |
| 3740 [_extractFunctionTypeObjectFrom]: [core.Object, [core.Object]], | |
| 3741 toRti: [core.Object, []] | |
| 3742 }), | |
| 3743 statics: () => ({listToRti: [core.Object, [core.Object]]}), | |
| 3744 names: ['listToRti'] | |
| 3745 }); | |
| 3746 RuntimeFunctionType.inAssert = false; | |
| 3747 function buildFunctionType(returnType, parameterTypes, optionalParameterTypes)
{ | |
| 3748 return new RuntimeFunctionType(dart.as(returnType, RuntimeType), dart.as(par
ameterTypes, core.List$(RuntimeType)), dart.as(optionalParameterTypes, core.List
$(RuntimeType)), null); | |
| 3749 } | |
| 3750 dart.fn(buildFunctionType, RuntimeFunctionType, [core.Object, core.Object, cor
e.Object]); | |
| 3751 function buildNamedFunctionType(returnType, parameterTypes, namedParameters) { | |
| 3752 return new RuntimeFunctionType(dart.as(returnType, RuntimeType), dart.as(par
ameterTypes, core.List$(RuntimeType)), null, namedParameters); | |
| 3753 } | |
| 3754 dart.fn(buildNamedFunctionType, RuntimeFunctionType, [core.Object, core.Object
, core.Object]); | |
| 3755 function buildInterfaceType(rti, typeArguments) { | |
| 3756 let name = dart.as(rti.name, core.String); | |
| 3757 if (dart.notNull(typeArguments == null) || dart.notNull(dart.as(dart.dload(t
ypeArguments, 'isEmpty'), core.bool))) { | |
| 3758 return new RuntimeTypePlain(name); | |
| 3759 } | |
| 3760 return new RuntimeTypeGeneric(name, dart.as(typeArguments, core.List$(Runtim
eType)), null); | |
| 3761 } | |
| 3762 dart.fn(buildInterfaceType, RuntimeType, [core.Object, core.Object]); | |
| 3763 class DynamicRuntimeType extends RuntimeType { | |
| 3764 DynamicRuntimeType() { | |
| 3765 super.RuntimeType(); | |
| 3766 } | |
| 3767 toString() { | |
| 3768 return 'dynamic'; | |
| 3769 } | |
| 3770 toRti() { | |
| 3771 return null; | |
| 3772 } | |
| 3773 } | |
| 3774 dart.setSignature(DynamicRuntimeType, { | |
| 3775 constructors: () => ({DynamicRuntimeType: [DynamicRuntimeType, []]}), | |
| 3776 methods: () => ({toRti: [core.Object, []]}) | |
| 3777 }); | |
| 3778 function getDynamicRuntimeType() { | |
| 3779 return dart.const(new DynamicRuntimeType()); | |
| 3780 } | |
| 3781 dart.fn(getDynamicRuntimeType, RuntimeType, []); | |
| 3782 class VoidRuntimeType extends RuntimeType { | |
| 3783 VoidRuntimeType() { | |
| 3784 super.RuntimeType(); | |
| 3785 } | |
| 3786 toString() { | |
| 3787 return 'void'; | |
| 3788 } | |
| 3789 toRti() { | |
| 3790 return dart.throw_('internal error'); | |
| 3791 } | |
| 3792 } | |
| 3793 dart.setSignature(VoidRuntimeType, { | |
| 3794 constructors: () => ({VoidRuntimeType: [VoidRuntimeType, []]}), | |
| 3795 methods: () => ({toRti: [core.Object, []]}) | |
| 3796 }); | |
| 3797 function getVoidRuntimeType() { | |
| 3798 return dart.const(new VoidRuntimeType()); | |
| 3799 } | |
| 3800 dart.fn(getVoidRuntimeType, RuntimeType, []); | |
| 3801 function functionTypeTestMetaHelper() { | |
| 3802 let dyn = x; | |
| 3803 let dyn2 = x; | |
| 3804 let fixedListOrNull = dart.as(x, core.List); | |
| 3805 let fixedListOrNull2 = dart.as(x, core.List); | |
| 3806 let fixedList = dart.as(x, core.List); | |
| 3807 let jsObject = x; | |
| 3808 buildFunctionType(dyn, fixedListOrNull, fixedListOrNull2); | |
| 3809 buildNamedFunctionType(dyn, fixedList, jsObject); | |
| 3810 buildInterfaceType(dyn, fixedListOrNull); | |
| 3811 getDynamicRuntimeType(); | |
| 3812 getVoidRuntimeType(); | |
| 3813 convertRtiToRuntimeType(dyn); | |
| 3814 dart.dsend(dyn, _isTest, dyn2); | |
| 3815 dart.dsend(dyn, _asCheck, dyn2); | |
| 3816 dart.dsend(dyn, _assertCheck, dyn2); | |
| 3817 } | |
| 3818 dart.fn(functionTypeTestMetaHelper); | |
| 3819 function convertRtiToRuntimeType(rti) { | |
| 3820 if (rti == null) { | |
| 3821 return getDynamicRuntimeType(); | |
| 3822 } else if (typeof rti == "function") { | |
| 3823 return new RuntimeTypePlain(rti.name); | |
| 3824 } else if (rti.constructor == Array) { | |
| 3825 let list = dart.as(rti, core.List); | |
| 3826 let name = list[core.$get](0).name; | |
| 3827 let arguments$ = []; | |
| 3828 for (let i = 1; dart.notNull(i) < dart.notNull(list[core.$length]); i = da
rt.notNull(i) + 1) { | |
| 3829 arguments$[core.$add](convertRtiToRuntimeType(list[core.$get](i))); | |
| 3830 } | |
| 3831 return new RuntimeTypeGeneric(name, dart.as(arguments$, core.List$(Runtime
Type)), rti); | |
| 3832 } else if ("func" in rti) { | |
| 3833 return new FunctionTypeInfoDecoderRing(rti).toRuntimeType(); | |
| 3834 } else { | |
| 3835 throw new RuntimeError("Cannot convert " + `'${JSON.stringify(rti)}' to Ru
ntimeType.`); | |
| 3836 } | |
| 3837 } | |
| 3838 dart.fn(convertRtiToRuntimeType, RuntimeType, [core.Object]); | |
| 3839 class RuntimeTypePlain extends RuntimeType { | |
| 3840 RuntimeTypePlain(name) { | |
| 3841 this.name = name; | |
| 3842 super.RuntimeType(); | |
| 3843 } | |
| 3844 toRti() { | |
| 3845 let allClasses = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names
.ALL_CLASSES); | |
| 3846 let rti = allClasses[this.name]; | |
| 3847 if (rti == null) | |
| 3848 throw `no type for '${this.name}'`; | |
| 3849 return rti; | |
| 3850 } | |
| 3851 toString() { | |
| 3852 return this.name; | |
| 3853 } | |
| 3854 } | |
| 3855 dart.setSignature(RuntimeTypePlain, { | |
| 3856 constructors: () => ({RuntimeTypePlain: [RuntimeTypePlain, [core.String]]}), | |
| 3857 methods: () => ({toRti: [core.Object, []]}) | |
| 3858 }); | |
| 3859 class RuntimeTypeGeneric extends RuntimeType { | |
| 3860 RuntimeTypeGeneric(name, arguments$, rti) { | |
| 3861 this.name = name; | |
| 3862 this.arguments = arguments$; | |
| 3863 this.rti = rti; | |
| 3864 super.RuntimeType(); | |
| 3865 } | |
| 3866 toRti() { | |
| 3867 if (this.rti != null) | |
| 3868 return this.rti; | |
| 3869 let allClasses = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names
.ALL_CLASSES); | |
| 3870 let result = [allClasses[this.name]]; | |
| 3871 if (dart.dindex(result, 0) == null) { | |
| 3872 throw `no type for '${this.name}<...>'`; | |
| 3873 } | |
| 3874 for (let argument of this.arguments) { | |
| 3875 result.push(argument.toRti()); | |
| 3876 } | |
| 3877 return this.rti = result; | |
| 3878 } | |
| 3879 toString() { | |
| 3880 return `${this.name}<${this.arguments[core.$join](", ")}>`; | |
| 3881 } | |
| 3882 } | |
| 3883 dart.setSignature(RuntimeTypeGeneric, { | |
| 3884 constructors: () => ({RuntimeTypeGeneric: [RuntimeTypeGeneric, [core.String,
core.List$(RuntimeType), core.Object]]}), | |
| 3885 methods: () => ({toRti: [core.Object, []]}) | |
| 3886 }); | |
| 3887 let _typeData = Symbol('_typeData'); | |
| 3888 let _cachedToString = Symbol('_cachedToString'); | |
| 3889 let _hasReturnType = Symbol('_hasReturnType'); | |
| 3890 let _returnType = Symbol('_returnType'); | |
| 3891 let _isVoid = Symbol('_isVoid'); | |
| 3892 let _hasArguments = Symbol('_hasArguments'); | |
| 3893 let _hasOptionalArguments = Symbol('_hasOptionalArguments'); | |
| 3894 let _optionalArguments = Symbol('_optionalArguments'); | |
| 3895 let _hasNamedArguments = Symbol('_hasNamedArguments'); | |
| 3896 let _namedArguments = Symbol('_namedArguments'); | |
| 3897 let _convert = Symbol('_convert'); | |
| 3898 class FunctionTypeInfoDecoderRing extends core.Object { | |
| 3899 FunctionTypeInfoDecoderRing(typeData) { | |
| 3900 this[_typeData] = typeData; | |
| 3901 this[_cachedToString] = null; | |
| 3902 } | |
| 3903 get [_hasReturnType]() { | |
| 3904 return "ret" in this[_typeData]; | |
| 3905 } | |
| 3906 get [_returnType]() { | |
| 3907 return this[_typeData].ret; | |
| 3908 } | |
| 3909 get [_isVoid]() { | |
| 3910 return !!this[_typeData].void; | |
| 3911 } | |
| 3912 get [_hasArguments]() { | |
| 3913 return "args" in this[_typeData]; | |
| 3914 } | |
| 3915 get [_arguments]() { | |
| 3916 return dart.as(this[_typeData].args, core.List); | |
| 3917 } | |
| 3918 get [_hasOptionalArguments]() { | |
| 3919 return "opt" in this[_typeData]; | |
| 3920 } | |
| 3921 get [_optionalArguments]() { | |
| 3922 return dart.as(this[_typeData].opt, core.List); | |
| 3923 } | |
| 3924 get [_hasNamedArguments]() { | |
| 3925 return "named" in this[_typeData]; | |
| 3926 } | |
| 3927 get [_namedArguments]() { | |
| 3928 return this[_typeData].named; | |
| 3929 } | |
| 3930 toRuntimeType() { | |
| 3931 return dart.const(new DynamicRuntimeType()); | |
| 3932 } | |
| 3933 [_convert](type) { | |
| 3934 let result = runtimeTypeToString(type); | |
| 3935 if (result != null) | |
| 3936 return result; | |
| 3937 if ("func" in type) { | |
| 3938 return dart.toString(new FunctionTypeInfoDecoderRing(type)); | |
| 3939 } else { | |
| 3940 throw 'bad type'; | |
| 3941 } | |
| 3942 } | |
| 3943 toString() { | |
| 3944 if (this[_cachedToString] != null) | |
| 3945 return this[_cachedToString]; | |
| 3946 let s = "("; | |
| 3947 let sep = ''; | |
| 3948 if (this[_hasArguments]) { | |
| 3949 for (let argument of this[_arguments]) { | |
| 3950 s = dart.notNull(s) + dart.notNull(sep); | |
| 3951 s = dart.notNull(s) + dart.notNull(this[_convert](argument)); | |
| 3952 sep = ', '; | |
| 3953 } | |
| 3954 } | |
| 3955 if (this[_hasOptionalArguments]) { | |
| 3956 s = dart.notNull(s) + `${sep}[`; | |
| 3957 sep = ''; | |
| 3958 for (let argument of this[_optionalArguments]) { | |
| 3959 s = dart.notNull(s) + dart.notNull(sep); | |
| 3960 s = dart.notNull(s) + dart.notNull(this[_convert](argument)); | |
| 3961 sep = ', '; | |
| 3962 } | |
| 3963 s = dart.notNull(s) + ']'; | |
| 3964 } | |
| 3965 if (this[_hasNamedArguments]) { | |
| 3966 s = dart.notNull(s) + `${sep}{`; | |
| 3967 sep = ''; | |
| 3968 for (let name of _js_names.extractKeys(this[_namedArguments])) { | |
| 3969 s = dart.notNull(s) + dart.notNull(sep); | |
| 3970 s = dart.notNull(s) + `${name}: `; | |
| 3971 s = dart.notNull(s) + dart.notNull(this[_convert](this[_namedArguments
][name])); | |
| 3972 sep = ', '; | |
| 3973 } | |
| 3974 s = dart.notNull(s) + '}'; | |
| 3975 } | |
| 3976 s = dart.notNull(s) + ') -> '; | |
| 3977 if (this[_isVoid]) { | |
| 3978 s = dart.notNull(s) + 'void'; | |
| 3979 } else if (this[_hasReturnType]) { | |
| 3980 s = dart.notNull(s) + dart.notNull(this[_convert](this[_returnType])); | |
| 3981 } else { | |
| 3982 s = dart.notNull(s) + 'dynamic'; | |
| 3983 } | |
| 3984 return this[_cachedToString] = `${s}`; | |
| 3985 } | |
| 3986 } | |
| 3987 dart.setSignature(FunctionTypeInfoDecoderRing, { | |
| 3988 constructors: () => ({FunctionTypeInfoDecoderRing: [FunctionTypeInfoDecoderR
ing, [core.Object]]}), | |
| 3989 methods: () => ({ | |
| 3990 toRuntimeType: [RuntimeType, []], | |
| 3991 [_convert]: [core.String, [core.Object]] | |
| 3992 }) | |
| 3993 }); | |
| 3994 class UnimplementedNoSuchMethodError extends core.Error { | |
| 3995 UnimplementedNoSuchMethodError(message) { | |
| 3996 this[_message] = message; | |
| 3997 super.Error(); | |
| 3998 } | |
| 3999 toString() { | |
| 4000 return `Unsupported operation: ${this[_message]}`; | |
| 4001 } | |
| 4002 } | |
| 4003 UnimplementedNoSuchMethodError[dart.implements] = () => [core.NoSuchMethodErro
r]; | |
| 4004 dart.setSignature(UnimplementedNoSuchMethodError, { | |
| 4005 constructors: () => ({UnimplementedNoSuchMethodError: [UnimplementedNoSuchMe
thodError, [core.String]]}) | |
| 4006 }); | |
| 4007 function random64() { | 1120 function random64() { |
| 4008 let int32a = Math.random() * 0x100000000 >>> 0; | 1121 let int32a = Math.random() * 0x100000000 >>> 0; |
| 4009 let int32b = Math.random() * 0x100000000 >>> 0; | 1122 let int32b = Math.random() * 0x100000000 >>> 0; |
| 4010 return dart.notNull(int32a) + dart.notNull(int32b) * 4294967296; | 1123 return dart.notNull(int32a) + dart.notNull(int32b) * 4294967296; |
| 4011 } | 1124 } |
| 4012 dart.fn(random64, core.int, []); | 1125 dart.fn(random64, core.int, []); |
| 4013 function jsonEncodeNative(string) { | 1126 function jsonEncodeNative(string) { |
| 4014 return JSON.stringify(string); | 1127 return JSON.stringify(string); |
| 4015 } | 1128 } |
| 4016 dart.fn(jsonEncodeNative, core.String, [core.String]); | 1129 dart.fn(jsonEncodeNative, core.String, [core.String]); |
| 4017 function getIsolateAffinityTag(name) { | |
| 4018 let isolateTagGetter = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_n
ames.GET_ISOLATE_TAG); | |
| 4019 return isolateTagGetter(name); | |
| 4020 } | |
| 4021 dart.fn(getIsolateAffinityTag, core.String, [core.String]); | |
| 4022 let LoadLibraryFunctionType = dart.typedef('LoadLibraryFunctionType', () => da
rt.functionType(async.Future$(core.Null), [])); | |
| 4023 function _loadLibraryWrapper(loadId) { | |
| 4024 return dart.fn(() => loadDeferredLibrary(loadId), async.Future$(core.Null),
[]); | |
| 4025 } | |
| 4026 dart.fn(_loadLibraryWrapper, LoadLibraryFunctionType, [core.String]); | |
| 4027 dart.defineLazyProperties(exports, { | |
| 4028 get _loadingLibraries() { | |
| 4029 return dart.map(); | |
| 4030 }, | |
| 4031 get _loadedLibraries() { | |
| 4032 return core.Set$(core.String).new(); | |
| 4033 } | |
| 4034 }); | |
| 4035 let DeferredLoadCallback = dart.typedef('DeferredLoadCallback', () => dart.fun
ctionType(dart.void, [])); | |
| 4036 exports.deferredLoadHook = null; | |
| 4037 function loadDeferredLibrary(loadId) { | |
| 4038 let urisMap = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names.DEFE
RRED_LIBRARY_URIS); | |
| 4039 let uris = dart.as(urisMap[loadId], core.List$(core.String)); | |
| 4040 let hashesMap = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names.DE
FERRED_LIBRARY_HASHES); | |
| 4041 let hashes = dart.as(hashesMap[loadId], core.List$(core.String)); | |
| 4042 if (uris == null) | |
| 4043 return async.Future$(core.Null).value(null); | |
| 4044 let indices = core.List$(core.int).generate(uris[core.$length], dart.fn(i =>
dart.as(i, core.int), core.int, [core.Object])); | |
| 4045 let isHunkLoaded = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names
.IS_HUNK_LOADED); | |
| 4046 let isHunkInitialized = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_
names.IS_HUNK_INITIALIZED); | |
| 4047 let indicesToLoad = indices[core.$where](dart.fn(i => !isHunkLoaded(hashes[c
ore.$get](i)), core.bool, [core.int]))[core.$toList](); | |
| 4048 return dart.as(async.Future.wait(dart.as(indicesToLoad[core.$map](dart.fn(i
=> _loadHunk(uris[core.$get](i)), async.Future$(core.Null), [core.int])), core.I
terable$(async.Future))).then(dart.fn(_ => { | |
| 4049 let indicesToInitialize = indices[core.$where](dart.fn(i => !isHunkInitial
ized(hashes[core.$get](i)), core.bool, [core.int]))[core.$toList](); | |
| 4050 for (let i of indicesToInitialize) { | |
| 4051 let initializer = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_na
mes.INITIALIZE_LOADED_HUNK); | |
| 4052 initializer(hashes[core.$get](i)); | |
| 4053 } | |
| 4054 let updated = exports._loadedLibraries.add(loadId); | |
| 4055 if (dart.notNull(updated) && dart.notNull(exports.deferredLoadHook != null
)) { | |
| 4056 exports.deferredLoadHook(); | |
| 4057 } | |
| 4058 })), async.Future$(core.Null)); | |
| 4059 } | |
| 4060 dart.fn(loadDeferredLibrary, async.Future$(core.Null), [core.String]); | |
| 4061 function _loadHunk(hunkName) { | |
| 4062 let future = exports._loadingLibraries.get(hunkName); | |
| 4063 if (future != null) { | |
| 4064 return dart.as(future.then(dart.fn(_ => null, dart.bottom, [core.Object]))
, async.Future$(core.Null)); | |
| 4065 } | |
| 4066 let uri = _isolate_helper.IsolateNatives.thisScript; | |
| 4067 let index = uri.lastIndexOf('/'); | |
| 4068 uri = `${uri.substring(0, dart.notNull(index) + 1)}${hunkName}`; | |
| 4069 if (dart.notNull(Primitives.isJsshell) || dart.notNull(Primitives.isD8)) { | |
| 4070 return exports._loadingLibraries.set(hunkName, async.Future$(core.Null).ne
w(dart.fn(() => { | |
| 4071 try { | |
| 4072 new Function(`load("${uri}")`)(); | |
| 4073 } catch (error) { | |
| 4074 let stackTrace = dart.stackTrace(error); | |
| 4075 throw new async.DeferredLoadException(`Loading ${uri} failed.`); | |
| 4076 } | |
| 4077 | |
| 4078 return null; | |
| 4079 }))); | |
| 4080 } else if (_isolate_helper.isWorker()) { | |
| 4081 return exports._loadingLibraries.set(hunkName, async.Future$(core.Null).ne
w(dart.fn(() => { | |
| 4082 let completer = async.Completer$(core.Null).new(); | |
| 4083 _isolate_helper.enterJsAsync(); | |
| 4084 let leavingFuture = dart.as(completer.future.whenComplete(dart.fn(() =>
{ | |
| 4085 _isolate_helper.leaveJsAsync(); | |
| 4086 })), async.Future$(core.Null)); | |
| 4087 let index = uri.lastIndexOf('/'); | |
| 4088 uri = `${uri.substring(0, dart.notNull(index) + 1)}${hunkName}`; | |
| 4089 let xhr = new XMLHttpRequest(); | |
| 4090 xhr.open("GET", uri); | |
| 4091 xhr.addEventListener("load", convertDartClosureToJS(dart.fn(event => { | |
| 4092 if (xhr.status != 200) { | |
| 4093 completer.completeError(new async.DeferredLoadException(`Loading ${u
ri} failed.`)); | |
| 4094 return; | |
| 4095 } | |
| 4096 let code = xhr.responseText; | |
| 4097 try { | |
| 4098 new Function(code)(); | |
| 4099 } catch (error) { | |
| 4100 let stackTrace = dart.stackTrace(error); | |
| 4101 completer.completeError(new async.DeferredLoadException(`Evaluating
${uri} failed.`)); | |
| 4102 return; | |
| 4103 } | |
| 4104 | |
| 4105 completer.complete(null); | |
| 4106 }), 1), false); | |
| 4107 let fail = convertDartClosureToJS(dart.fn(event => { | |
| 4108 new async.DeferredLoadException(`Loading ${uri} failed.`); | |
| 4109 }), 1); | |
| 4110 xhr.addEventListener("error", fail, false); | |
| 4111 xhr.addEventListener("abort", fail, false); | |
| 4112 xhr.send(); | |
| 4113 return leavingFuture; | |
| 4114 }))); | |
| 4115 } | |
| 4116 return exports._loadingLibraries.set(hunkName, async.Future$(core.Null).new(
dart.fn(() => { | |
| 4117 let completer = async.Completer$(core.Null).new(); | |
| 4118 let script = document.createElement("script"); | |
| 4119 script.type = "text/javascript"; | |
| 4120 script.src = uri; | |
| 4121 script.addEventListener("load", convertDartClosureToJS(dart.fn(event => { | |
| 4122 completer.complete(null); | |
| 4123 }), 1), false); | |
| 4124 script.addEventListener("error", convertDartClosureToJS(dart.fn(event => { | |
| 4125 completer.completeError(new async.DeferredLoadException(`Loading ${uri}
failed.`)); | |
| 4126 }), 1), false); | |
| 4127 document.body.appendChild(script); | |
| 4128 return completer.future; | |
| 4129 }))); | |
| 4130 } | |
| 4131 dart.fn(_loadHunk, async.Future$(core.Null), [core.String]); | |
| 4132 class MainError extends core.Error { | |
| 4133 MainError(message) { | |
| 4134 this[_message] = message; | |
| 4135 super.Error(); | |
| 4136 } | |
| 4137 toString() { | |
| 4138 return `NoSuchMethodError: ${this[_message]}`; | |
| 4139 } | |
| 4140 } | |
| 4141 MainError[dart.implements] = () => [core.NoSuchMethodError]; | |
| 4142 dart.setSignature(MainError, { | |
| 4143 constructors: () => ({MainError: [MainError, [core.String]]}) | |
| 4144 }); | |
| 4145 function missingMain() { | |
| 4146 throw new MainError("No top-level function named 'main'."); | |
| 4147 } | |
| 4148 dart.fn(missingMain, dart.void, []); | |
| 4149 function badMain() { | |
| 4150 throw new MainError("'main' is not a function."); | |
| 4151 } | |
| 4152 dart.fn(badMain, dart.void, []); | |
| 4153 function mainHasTooManyParameters() { | |
| 4154 throw new MainError("'main' expects too many parameters."); | |
| 4155 } | |
| 4156 dart.fn(mainHasTooManyParameters, dart.void, []); | |
| 4157 // Exports: | 1130 // Exports: |
| 4158 exports.NoSideEffects = NoSideEffects; | |
| 4159 exports.NoThrows = NoThrows; | 1131 exports.NoThrows = NoThrows; |
| 4160 exports.NoInline = NoInline; | 1132 exports.NoInline = NoInline; |
| 4161 exports.IrRepresentation = IrRepresentation; | |
| 4162 exports.Native = Native; | 1133 exports.Native = Native; |
| 4163 exports.ConstantMap$ = ConstantMap$; | |
| 4164 exports.ConstantMap = ConstantMap; | |
| 4165 exports.ConstantStringMap$ = ConstantStringMap$; | |
| 4166 exports.ConstantStringMap = ConstantStringMap; | |
| 4167 exports.ConstantProtoMap$ = ConstantProtoMap$; | |
| 4168 exports.ConstantProtoMap = ConstantProtoMap; | |
| 4169 exports.GeneralConstantMap$ = GeneralConstantMap$; | |
| 4170 exports.GeneralConstantMap = GeneralConstantMap; | |
| 4171 exports.contains = contains; | |
| 4172 exports.arrayLength = arrayLength; | |
| 4173 exports.arrayGet = arrayGet; | |
| 4174 exports.arraySet = arraySet; | |
| 4175 exports.propertyGet = propertyGet; | |
| 4176 exports.callHasOwnProperty = callHasOwnProperty; | |
| 4177 exports.propertySet = propertySet; | |
| 4178 exports.getPropertyFromPrototype = getPropertyFromPrototype; | |
| 4179 exports.toStringForNativeObject = toStringForNativeObject; | |
| 4180 exports.hashCodeForNativeObject = hashCodeForNativeObject; | |
| 4181 exports.defineProperty = defineProperty; | 1134 exports.defineProperty = defineProperty; |
| 4182 exports.isDartObject = isDartObject; | |
| 4183 exports.findDispatchTagForInterceptorClass = findDispatchTagForInterceptorClas
s; | |
| 4184 exports.lookupInterceptor = lookupInterceptor; | |
| 4185 exports.UNCACHED_MARK = UNCACHED_MARK; | |
| 4186 exports.INSTANCE_CACHED_MARK = INSTANCE_CACHED_MARK; | |
| 4187 exports.LEAF_MARK = LEAF_MARK; | |
| 4188 exports.INTERIOR_MARK = INTERIOR_MARK; | |
| 4189 exports.DISCRIMINATED_MARK = DISCRIMINATED_MARK; | |
| 4190 exports.lookupAndCacheInterceptor = lookupAndCacheInterceptor; | 1135 exports.lookupAndCacheInterceptor = lookupAndCacheInterceptor; |
| 4191 exports.patchInstance = patchInstance; | |
| 4192 exports.patchProto = patchProto; | |
| 4193 exports.patchInteriorProto = patchInteriorProto; | |
| 4194 exports.makeLeafDispatchRecord = makeLeafDispatchRecord; | |
| 4195 exports.makeDefaultDispatchRecord = makeDefaultDispatchRecord; | |
| 4196 exports.setNativeSubclassDispatchRecord = setNativeSubclassDispatchRecord; | |
| 4197 exports.constructorNameFallback = constructorNameFallback; | |
| 4198 exports.initNativeDispatch = initNativeDispatch; | 1136 exports.initNativeDispatch = initNativeDispatch; |
| 4199 exports.initNativeDispatchContinue = initNativeDispatchContinue; | |
| 4200 exports.initHooks = initHooks; | |
| 4201 exports.applyHooksTransformer = applyHooksTransformer; | |
| 4202 exports.regExpGetNative = regExpGetNative; | 1137 exports.regExpGetNative = regExpGetNative; |
| 4203 exports.regExpGetGlobalNative = regExpGetGlobalNative; | 1138 exports.regExpGetGlobalNative = regExpGetGlobalNative; |
| 4204 exports.regExpCaptureCount = regExpCaptureCount; | 1139 exports.regExpCaptureCount = regExpCaptureCount; |
| 4205 exports.JSSyntaxRegExp = JSSyntaxRegExp; | 1140 exports.JSSyntaxRegExp = JSSyntaxRegExp; |
| 4206 exports.firstMatchAfter = firstMatchAfter; | 1141 exports.firstMatchAfter = firstMatchAfter; |
| 4207 exports.StringMatch = StringMatch; | 1142 exports.StringMatch = StringMatch; |
| 4208 exports.allMatchesInStringUnchecked = allMatchesInStringUnchecked; | 1143 exports.allMatchesInStringUnchecked = allMatchesInStringUnchecked; |
| 4209 exports.stringContainsUnchecked = stringContainsUnchecked; | 1144 exports.stringContainsUnchecked = stringContainsUnchecked; |
| 4210 exports.stringReplaceJS = stringReplaceJS; | 1145 exports.stringReplaceJS = stringReplaceJS; |
| 4211 exports.stringReplaceFirstRE = stringReplaceFirstRE; | 1146 exports.stringReplaceFirstRE = stringReplaceFirstRE; |
| 4212 exports.ESCAPE_REGEXP = ESCAPE_REGEXP; | 1147 exports.ESCAPE_REGEXP = ESCAPE_REGEXP; |
| 4213 exports.stringReplaceAllUnchecked = stringReplaceAllUnchecked; | 1148 exports.stringReplaceAllUnchecked = stringReplaceAllUnchecked; |
| 4214 exports.stringReplaceAllFuncUnchecked = stringReplaceAllFuncUnchecked; | 1149 exports.stringReplaceAllFuncUnchecked = stringReplaceAllFuncUnchecked; |
| 4215 exports.stringReplaceAllEmptyFuncUnchecked = stringReplaceAllEmptyFuncUnchecke
d; | 1150 exports.stringReplaceAllEmptyFuncUnchecked = stringReplaceAllEmptyFuncUnchecke
d; |
| 4216 exports.stringReplaceAllStringFuncUnchecked = stringReplaceAllStringFuncUnchec
ked; | 1151 exports.stringReplaceAllStringFuncUnchecked = stringReplaceAllStringFuncUnchec
ked; |
| 4217 exports.stringReplaceFirstUnchecked = stringReplaceFirstUnchecked; | 1152 exports.stringReplaceFirstUnchecked = stringReplaceFirstUnchecked; |
| 4218 exports.stringJoinUnchecked = stringJoinUnchecked; | 1153 exports.stringJoinUnchecked = stringJoinUnchecked; |
| 4219 exports.createRuntimeType = createRuntimeType; | |
| 4220 exports.TypeImpl = TypeImpl; | |
| 4221 exports.TypeVariable = TypeVariable; | |
| 4222 exports.getMangledTypeName = getMangledTypeName; | |
| 4223 exports.setRuntimeTypeInfo = setRuntimeTypeInfo; | |
| 4224 exports.getRuntimeTypeInfo = getRuntimeTypeInfo; | |
| 4225 exports.getRuntimeTypeArguments = getRuntimeTypeArguments; | |
| 4226 exports.getRuntimeTypeArgument = getRuntimeTypeArgument; | |
| 4227 exports.getTypeArgumentByIndex = getTypeArgumentByIndex; | |
| 4228 exports.copyTypeArguments = copyTypeArguments; | |
| 4229 exports.getClassName = getClassName; | |
| 4230 exports.getRuntimeTypeAsString = getRuntimeTypeAsString; | |
| 4231 exports.getConstructorName = getConstructorName; | |
| 4232 exports.runtimeTypeToString = runtimeTypeToString; | |
| 4233 exports.joinArguments = joinArguments; | |
| 4234 exports.getRuntimeTypeString = getRuntimeTypeString; | |
| 4235 exports.getRuntimeType = getRuntimeType; | 1154 exports.getRuntimeType = getRuntimeType; |
| 4236 exports.substitute = substitute; | |
| 4237 exports.checkSubtype = checkSubtype; | |
| 4238 exports.computeTypeName = computeTypeName; | |
| 4239 exports.subtypeCast = subtypeCast; | |
| 4240 exports.assertSubtype = assertSubtype; | |
| 4241 exports.assertIsSubtype = assertIsSubtype; | |
| 4242 exports.throwTypeError = throwTypeError; | |
| 4243 exports.checkArguments = checkArguments; | |
| 4244 exports.areSubtypes = areSubtypes; | |
| 4245 exports.computeSignature = computeSignature; | |
| 4246 exports.isSupertypeOfNull = isSupertypeOfNull; | |
| 4247 exports.checkSubtypeOfRuntimeType = checkSubtypeOfRuntimeType; | |
| 4248 exports.subtypeOfRuntimeTypeCast = subtypeOfRuntimeTypeCast; | |
| 4249 exports.assertSubtypeOfRuntimeType = assertSubtypeOfRuntimeType; | |
| 4250 exports.getArguments = getArguments; | |
| 4251 exports.isSubtype = isSubtype; | |
| 4252 exports.isAssignable = isAssignable; | |
| 4253 exports.areAssignable = areAssignable; | |
| 4254 exports.areAssignableMaps = areAssignableMaps; | |
| 4255 exports.isFunctionSubtype = isFunctionSubtype; | |
| 4256 exports.invoke = invoke; | |
| 4257 exports.invokeOn = invokeOn; | |
| 4258 exports.call = call; | |
| 4259 exports.getField = getField; | |
| 4260 exports.getIndex = getIndex; | 1155 exports.getIndex = getIndex; |
| 4261 exports.getLength = getLength; | 1156 exports.getLength = getLength; |
| 4262 exports.isJsArray = isJsArray; | 1157 exports.isJsArray = isJsArray; |
| 4263 exports.hasField = hasField; | |
| 4264 exports.hasNoField = hasNoField; | |
| 4265 exports.isJsFunction = isJsFunction; | |
| 4266 exports.isJsObject = isJsObject; | |
| 4267 exports.isIdentical = isIdentical; | |
| 4268 exports.isNotIdentical = isNotIdentical; | |
| 4269 exports.unmangleGlobalNameIfPreservedAnyways = unmangleGlobalNameIfPreservedAn
yways; | |
| 4270 exports.unmangleAllIdentifiersIfPreservedAnyways = unmangleAllIdentifiersIfPre
servedAnyways; | |
| 4271 exports.patch = patch; | 1158 exports.patch = patch; |
| 4272 exports.InternalMap = InternalMap; | 1159 exports.InternalMap = InternalMap; |
| 4273 exports.requiresPreamble = requiresPreamble; | |
| 4274 exports.isJsIndexable = isJsIndexable; | |
| 4275 exports.S = S; | |
| 4276 exports.createInvocationMirror = createInvocationMirror; | |
| 4277 exports.createUnmangledInvocationMirror = createUnmangledInvocationMirror; | |
| 4278 exports.throwInvalidReflectionError = throwInvalidReflectionError; | |
| 4279 exports.traceHelper = traceHelper; | |
| 4280 exports.JSInvocationMirror = JSInvocationMirror; | |
| 4281 exports.CachedInvocation = CachedInvocation; | |
| 4282 exports.CachedCatchAllInvocation = CachedCatchAllInvocation; | |
| 4283 exports.CachedNoSuchMethodInvocation = CachedNoSuchMethodInvocation; | |
| 4284 exports.ReflectionInfo = ReflectionInfo; | |
| 4285 exports.getMetadata = getMetadata; | |
| 4286 exports.Primitives = Primitives; | 1160 exports.Primitives = Primitives; |
| 4287 exports.JsCache = JsCache; | |
| 4288 exports.iae = iae; | |
| 4289 exports.ioore = ioore; | |
| 4290 exports.stringLastIndexOfUnchecked = stringLastIndexOfUnchecked; | 1161 exports.stringLastIndexOfUnchecked = stringLastIndexOfUnchecked; |
| 4291 exports.checkNull = checkNull; | 1162 exports.checkNull = checkNull; |
| 4292 exports.checkNum = checkNum; | 1163 exports.checkNum = checkNum; |
| 4293 exports.checkInt = checkInt; | 1164 exports.checkInt = checkInt; |
| 4294 exports.checkBool = checkBool; | 1165 exports.checkBool = checkBool; |
| 4295 exports.checkString = checkString; | 1166 exports.checkString = checkString; |
| 4296 exports.wrapException = wrapException; | |
| 4297 exports.toStringWrapper = toStringWrapper; | |
| 4298 exports.throwExpression = throwExpression; | |
| 4299 exports.makeLiteralListConst = makeLiteralListConst; | |
| 4300 exports.throwRuntimeError = throwRuntimeError; | 1167 exports.throwRuntimeError = throwRuntimeError; |
| 4301 exports.throwAbstractClassInstantiationError = throwAbstractClassInstantiation
Error; | 1168 exports.throwAbstractClassInstantiationError = throwAbstractClassInstantiation
Error; |
| 4302 exports.TypeErrorDecoder = TypeErrorDecoder; | |
| 4303 exports.NullError = NullError; | 1169 exports.NullError = NullError; |
| 4304 exports.JsNoSuchMethodError = JsNoSuchMethodError; | 1170 exports.JsNoSuchMethodError = JsNoSuchMethodError; |
| 4305 exports.UnknownJsTypeError = UnknownJsTypeError; | 1171 exports.UnknownJsTypeError = UnknownJsTypeError; |
| 4306 exports.unwrapException = unwrapException; | |
| 4307 exports.getTraceFromException = getTraceFromException; | 1172 exports.getTraceFromException = getTraceFromException; |
| 4308 exports.objectHashCode = objectHashCode; | 1173 exports.objectHashCode = objectHashCode; |
| 4309 exports.fillLiteralMap = fillLiteralMap; | 1174 exports.fillLiteralMap = fillLiteralMap; |
| 4310 exports.invokeClosure = invokeClosure; | |
| 4311 exports.convertDartClosureToJS = convertDartClosureToJS; | 1175 exports.convertDartClosureToJS = convertDartClosureToJS; |
| 4312 exports.Closure = Closure; | |
| 4313 exports.closureFromTearOff = closureFromTearOff; | |
| 4314 exports.TearOffClosure = TearOffClosure; | |
| 4315 exports.BoundClosure = BoundClosure; | |
| 4316 exports.jsHasOwnProperty = jsHasOwnProperty; | 1176 exports.jsHasOwnProperty = jsHasOwnProperty; |
| 4317 exports.jsPropertyAccess = jsPropertyAccess; | 1177 exports.jsPropertyAccess = jsPropertyAccess; |
| 4318 exports.getFallThroughError = getFallThroughError; | 1178 exports.getFallThroughError = getFallThroughError; |
| 4319 exports.Creates = Creates; | 1179 exports.Creates = Creates; |
| 4320 exports.Returns = Returns; | 1180 exports.Returns = Returns; |
| 4321 exports.JSName = JSName; | 1181 exports.JSName = JSName; |
| 4322 exports.boolConversionCheck = boolConversionCheck; | |
| 4323 exports.stringTypeCheck = stringTypeCheck; | |
| 4324 exports.stringTypeCast = stringTypeCast; | |
| 4325 exports.doubleTypeCheck = doubleTypeCheck; | |
| 4326 exports.doubleTypeCast = doubleTypeCast; | |
| 4327 exports.numTypeCheck = numTypeCheck; | |
| 4328 exports.numTypeCast = numTypeCast; | |
| 4329 exports.boolTypeCheck = boolTypeCheck; | |
| 4330 exports.boolTypeCast = boolTypeCast; | |
| 4331 exports.intTypeCheck = intTypeCheck; | |
| 4332 exports.intTypeCast = intTypeCast; | |
| 4333 exports.propertyTypeError = propertyTypeError; | |
| 4334 exports.propertyTypeCastError = propertyTypeCastError; | |
| 4335 exports.propertyTypeCheck = propertyTypeCheck; | |
| 4336 exports.propertyTypeCast = propertyTypeCast; | |
| 4337 exports.interceptedTypeCheck = interceptedTypeCheck; | |
| 4338 exports.interceptedTypeCast = interceptedTypeCast; | |
| 4339 exports.numberOrStringSuperTypeCheck = numberOrStringSuperTypeCheck; | |
| 4340 exports.numberOrStringSuperTypeCast = numberOrStringSuperTypeCast; | |
| 4341 exports.numberOrStringSuperNativeTypeCheck = numberOrStringSuperNativeTypeChec
k; | |
| 4342 exports.numberOrStringSuperNativeTypeCast = numberOrStringSuperNativeTypeCast; | |
| 4343 exports.stringSuperTypeCheck = stringSuperTypeCheck; | |
| 4344 exports.stringSuperTypeCast = stringSuperTypeCast; | |
| 4345 exports.stringSuperNativeTypeCheck = stringSuperNativeTypeCheck; | |
| 4346 exports.stringSuperNativeTypeCast = stringSuperNativeTypeCast; | |
| 4347 exports.listTypeCheck = listTypeCheck; | |
| 4348 exports.listTypeCast = listTypeCast; | |
| 4349 exports.listSuperTypeCheck = listSuperTypeCheck; | |
| 4350 exports.listSuperTypeCast = listSuperTypeCast; | |
| 4351 exports.listSuperNativeTypeCheck = listSuperNativeTypeCheck; | |
| 4352 exports.listSuperNativeTypeCast = listSuperNativeTypeCast; | |
| 4353 exports.voidTypeCheck = voidTypeCheck; | |
| 4354 exports.checkMalformedType = checkMalformedType; | |
| 4355 exports.checkDeferredIsLoaded = checkDeferredIsLoaded; | |
| 4356 exports.TypeErrorImplementation = TypeErrorImplementation; | 1182 exports.TypeErrorImplementation = TypeErrorImplementation; |
| 4357 exports.CastErrorImplementation = CastErrorImplementation; | 1183 exports.CastErrorImplementation = CastErrorImplementation; |
| 4358 exports.FallThroughErrorImplementation = FallThroughErrorImplementation; | 1184 exports.FallThroughErrorImplementation = FallThroughErrorImplementation; |
| 4359 exports.assertHelper = assertHelper; | |
| 4360 exports.throwNoSuchMethod = throwNoSuchMethod; | |
| 4361 exports.throwCyclicInit = throwCyclicInit; | |
| 4362 exports.RuntimeError = RuntimeError; | 1185 exports.RuntimeError = RuntimeError; |
| 4363 exports.DeferredNotLoadedError = DeferredNotLoadedError; | |
| 4364 exports.RuntimeType = RuntimeType; | |
| 4365 exports.RuntimeFunctionType = RuntimeFunctionType; | |
| 4366 exports.buildFunctionType = buildFunctionType; | |
| 4367 exports.buildNamedFunctionType = buildNamedFunctionType; | |
| 4368 exports.buildInterfaceType = buildInterfaceType; | |
| 4369 exports.DynamicRuntimeType = DynamicRuntimeType; | |
| 4370 exports.getDynamicRuntimeType = getDynamicRuntimeType; | |
| 4371 exports.VoidRuntimeType = VoidRuntimeType; | |
| 4372 exports.getVoidRuntimeType = getVoidRuntimeType; | |
| 4373 exports.functionTypeTestMetaHelper = functionTypeTestMetaHelper; | |
| 4374 exports.convertRtiToRuntimeType = convertRtiToRuntimeType; | |
| 4375 exports.RuntimeTypePlain = RuntimeTypePlain; | |
| 4376 exports.RuntimeTypeGeneric = RuntimeTypeGeneric; | |
| 4377 exports.FunctionTypeInfoDecoderRing = FunctionTypeInfoDecoderRing; | |
| 4378 exports.UnimplementedNoSuchMethodError = UnimplementedNoSuchMethodError; | |
| 4379 exports.random64 = random64; | 1186 exports.random64 = random64; |
| 4380 exports.jsonEncodeNative = jsonEncodeNative; | 1187 exports.jsonEncodeNative = jsonEncodeNative; |
| 4381 exports.getIsolateAffinityTag = getIsolateAffinityTag; | 1188 })(_js_helper, core, collection, _interceptors, _foreign_helper); |
| 4382 exports.LoadLibraryFunctionType = LoadLibraryFunctionType; | |
| 4383 exports.DeferredLoadCallback = DeferredLoadCallback; | |
| 4384 exports.loadDeferredLibrary = loadDeferredLibrary; | |
| 4385 exports.MainError = MainError; | |
| 4386 exports.missingMain = missingMain; | |
| 4387 exports.badMain = badMain; | |
| 4388 exports.mainHasTooManyParameters = mainHasTooManyParameters; | |
| 4389 })(_js_helper, core, collection, _internal, _foreign_helper, _js_embedded_names,
_interceptors, _js_names, async, _isolate_helper); | |
| OLD | NEW |