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 _internal = dart.import(_internal); |
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); | |
7 var _interceptors = dart.lazyImport(_interceptors); | 6 var _interceptors = dart.lazyImport(_interceptors); |
8 var _js_names = dart.import(_js_names); | 7 var _js_names = dart.import(_js_names); |
| 8 var _js_embedded_names = dart.import(_js_embedded_names); |
9 var async = dart.import(async); | 9 var async = dart.import(async); |
10 var _isolate_helper = dart.lazyImport(_isolate_helper); | 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) { | 11 (function(exports, core, collection, _internal, _foreign_helper, _interceptors,
_js_names, _js_embedded_names, async, _isolate_helper) { |
12 'use strict'; | 12 'use strict'; |
13 class NoSideEffects extends core.Object { | 13 class NoSideEffects extends core.Object { |
14 NoSideEffects() { | 14 NoSideEffects() { |
15 } | 15 } |
16 } | 16 } |
17 dart.setSignature(NoSideEffects, { | 17 dart.setSignature(NoSideEffects, { |
18 constructors: () => ({NoSideEffects: [NoSideEffects, []]}) | 18 constructors: () => ({NoSideEffects: [NoSideEffects, []]}) |
19 }); | 19 }); |
20 class NoThrows extends core.Object { | 20 class NoThrows extends core.Object { |
21 NoThrows() { | 21 NoThrows() { |
(...skipping 18 matching lines...) Expand all Loading... |
40 constructors: () => ({IrRepresentation: [IrRepresentation, [core.bool]]}) | 40 constructors: () => ({IrRepresentation: [IrRepresentation, [core.bool]]}) |
41 }); | 41 }); |
42 class Native extends core.Object { | 42 class Native extends core.Object { |
43 Native(name) { | 43 Native(name) { |
44 this.name = name; | 44 this.name = name; |
45 } | 45 } |
46 } | 46 } |
47 dart.setSignature(Native, { | 47 dart.setSignature(Native, { |
48 constructors: () => ({Native: [Native, [core.String]]}) | 48 constructors: () => ({Native: [Native, [core.String]]}) |
49 }); | 49 }); |
| 50 class JsName extends core.Object { |
| 51 JsName(opts) { |
| 52 let name = opts && 'name' in opts ? opts.name : null; |
| 53 this.name = name; |
| 54 } |
| 55 } |
| 56 dart.setSignature(JsName, { |
| 57 constructors: () => ({JsName: [JsName, [], {name: core.String}]}) |
| 58 }); |
| 59 class JsPeerInterface extends core.Object { |
| 60 JsPeerInterface(opts) { |
| 61 let name = opts && 'name' in opts ? opts.name : null; |
| 62 this.name = name; |
| 63 } |
| 64 } |
| 65 dart.setSignature(JsPeerInterface, { |
| 66 constructors: () => ({JsPeerInterface: [JsPeerInterface, [], {name: core.Str
ing}]}) |
| 67 }); |
| 68 class SupportJsExtensionMethod extends core.Object { |
| 69 SupportJsExtensionMethod() { |
| 70 } |
| 71 } |
| 72 dart.setSignature(SupportJsExtensionMethod, { |
| 73 constructors: () => ({SupportJsExtensionMethod: [SupportJsExtensionMethod, [
]]}) |
| 74 }); |
50 let _throwUnmodifiable = Symbol('_throwUnmodifiable'); | 75 let _throwUnmodifiable = Symbol('_throwUnmodifiable'); |
51 let ConstantMap$ = dart.generic(function(K, V) { | 76 let ConstantMap$ = dart.generic(function(K, V) { |
52 class ConstantMap extends core.Object { | 77 class ConstantMap extends core.Object { |
53 _() { | 78 _() { |
54 } | 79 } |
55 get isEmpty() { | 80 get isEmpty() { |
56 return this.length == 0; | 81 return this.length == 0; |
57 } | 82 } |
58 get isNotEmpty() { | 83 get isNotEmpty() { |
59 return !dart.notNull(this.isEmpty); | 84 return !dart.notNull(this.isEmpty); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 let _fetch = Symbol('_fetch'); | 131 let _fetch = Symbol('_fetch'); |
107 let ConstantStringMap$ = dart.generic(function(K, V) { | 132 let ConstantStringMap$ = dart.generic(function(K, V) { |
108 class ConstantStringMap extends ConstantMap$(K, V) { | 133 class ConstantStringMap extends ConstantMap$(K, V) { |
109 _(length, jsObject, keys) { | 134 _(length, jsObject, keys) { |
110 this.length = length; | 135 this.length = length; |
111 this[_jsObject] = jsObject; | 136 this[_jsObject] = jsObject; |
112 this[_keys] = keys; | 137 this[_keys] = keys; |
113 super._(); | 138 super._(); |
114 } | 139 } |
115 containsValue(needle) { | 140 containsValue(needle) { |
116 return this.values[core.$any](dart.fn(value => dart.equals(value, needle
), core.bool, [V])); | 141 return this.values[dartx.any](dart.fn(value => dart.equals(value, needle
), core.bool, [V])); |
117 } | 142 } |
118 containsKey(key) { | 143 containsKey(key) { |
119 if (!(typeof key == 'string')) | 144 if (!(typeof key == 'string')) |
120 return false; | 145 return false; |
121 if (dart.equals('__proto__', key)) | 146 if (dart.equals('__proto__', key)) |
122 return false; | 147 return false; |
123 return jsHasOwnProperty(this[_jsObject], dart.as(key, core.String)); | 148 return jsHasOwnProperty(this[_jsObject], dart.as(key, core.String)); |
124 } | 149 } |
125 get(key) { | 150 get(key) { |
126 if (!dart.notNull(this.containsKey(key))) | 151 if (!dart.notNull(this.containsKey(key))) |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 return ConstantProtoMap; | 210 return ConstantProtoMap; |
186 }); | 211 }); |
187 let ConstantProtoMap = ConstantProtoMap$(); | 212 let ConstantProtoMap = ConstantProtoMap$(); |
188 let _map = Symbol('_map'); | 213 let _map = Symbol('_map'); |
189 let _ConstantMapKeyIterable$ = dart.generic(function(K) { | 214 let _ConstantMapKeyIterable$ = dart.generic(function(K) { |
190 class _ConstantMapKeyIterable extends collection.IterableBase$(K) { | 215 class _ConstantMapKeyIterable extends collection.IterableBase$(K) { |
191 _ConstantMapKeyIterable(map) { | 216 _ConstantMapKeyIterable(map) { |
192 this[_map] = map; | 217 this[_map] = map; |
193 super.IterableBase(); | 218 super.IterableBase(); |
194 } | 219 } |
195 get [core.$iterator]() { | 220 get iterator() { |
196 return this[_map][_keys][core.$iterator]; | 221 return this[_map][_keys][dartx.iterator]; |
197 } | 222 } |
198 get [core.$length]() { | 223 get length() { |
199 return this[_map][_keys][core.$length]; | 224 return this[_map][_keys].length; |
200 } | 225 } |
201 } | 226 } |
202 dart.setSignature(_ConstantMapKeyIterable, { | 227 dart.setSignature(_ConstantMapKeyIterable, { |
203 constructors: () => ({_ConstantMapKeyIterable: [_ConstantMapKeyIterable$(K
), [ConstantStringMap$(K, core.Object)]]}) | 228 constructors: () => ({_ConstantMapKeyIterable: [_ConstantMapKeyIterable$(K
), [ConstantStringMap$(K, core.Object)]]}) |
204 }); | 229 }); |
205 return _ConstantMapKeyIterable; | 230 return _ConstantMapKeyIterable; |
206 }); | 231 }); |
207 let _ConstantMapKeyIterable = _ConstantMapKeyIterable$(); | 232 let _ConstantMapKeyIterable = _ConstantMapKeyIterable$(); |
208 let _jsData = Symbol('_jsData'); | 233 let _jsData = Symbol('_jsData'); |
209 let _getMap = Symbol('_getMap'); | 234 let _getMap = Symbol('_getMap'); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 } | 306 } |
282 dart.fn(callHasOwnProperty, core.bool, [core.Object, core.Object, core.String]
); | 307 dart.fn(callHasOwnProperty, core.bool, [core.Object, core.Object, core.String]
); |
283 function propertySet(object, property, value) { | 308 function propertySet(object, property, value) { |
284 object[property] = value; | 309 object[property] = value; |
285 } | 310 } |
286 dart.fn(propertySet, dart.void, [core.Object, core.String, core.Object]); | 311 dart.fn(propertySet, dart.void, [core.Object, core.String, core.Object]); |
287 function getPropertyFromPrototype(object, name) { | 312 function getPropertyFromPrototype(object, name) { |
288 return Object.getPrototypeOf(object)[name]; | 313 return Object.getPrototypeOf(object)[name]; |
289 } | 314 } |
290 dart.fn(getPropertyFromPrototype, core.Object, [core.Object, core.String]); | 315 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) { | 316 function defineProperty(obj, property, value) { |
304 Object.defineProperty(obj, property, {value: value, enumerable: false, writa
ble: true, configurable: true}); | 317 Object.defineProperty(obj, property, {value: value, enumerable: false, writa
ble: true, configurable: true}); |
305 } | 318 } |
306 dart.fn(defineProperty, dart.void, [core.Object, core.String, core.Object]); | 319 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) { | |
335 dart.assert(!dart.notNull(isDartObject(obj))); | |
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 } | |
386 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; | |
429 function initNativeDispatch() { | |
430 if (dart.equals(true, exports.initNativeDispatchFlag)) | |
431 return; | |
432 exports.initNativeDispatchFlag = true; | |
433 initNativeDispatchContinue(); | |
434 } | |
435 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'); | 320 let _nativeRegExp = Symbol('_nativeRegExp'); |
519 function regExpGetNative(regexp) { | 321 function regExpGetNative(regexp) { |
520 return regexp[_nativeRegExp]; | 322 return regexp[_nativeRegExp]; |
521 } | 323 } |
522 dart.fn(regExpGetNative, () => dart.functionType(core.Object, [JSSyntaxRegExp]
)); | 324 dart.fn(regExpGetNative, () => dart.functionType(core.Object, [JSSyntaxRegExp]
)); |
523 let _nativeGlobalVersion = Symbol('_nativeGlobalVersion'); | 325 let _nativeGlobalVersion = Symbol('_nativeGlobalVersion'); |
524 function regExpGetGlobalNative(regexp) { | 326 function regExpGetGlobalNative(regexp) { |
525 let nativeRegexp = regexp[_nativeGlobalVersion]; | 327 let nativeRegexp = regexp[_nativeGlobalVersion]; |
526 nativeRegexp.lastIndex = 0; | 328 nativeRegexp.lastIndex = 0; |
527 return nativeRegexp; | 329 return nativeRegexp; |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 if (match == null) | 420 if (match == null) |
619 return null; | 421 return null; |
620 return new _MatchImplementation(this, dart.as(match, core.List$(core.Strin
g))); | 422 return new _MatchImplementation(this, dart.as(match, core.List$(core.Strin
g))); |
621 } | 423 } |
622 [_execAnchored](string, start) { | 424 [_execAnchored](string, start) { |
623 let regexp = this[_nativeAnchoredVersion]; | 425 let regexp = this[_nativeAnchoredVersion]; |
624 regexp.lastIndex = start; | 426 regexp.lastIndex = start; |
625 let match = dart.as(regexp.exec(string), core.List); | 427 let match = dart.as(regexp.exec(string), core.List); |
626 if (match == null) | 428 if (match == null) |
627 return null; | 429 return null; |
628 if (match[core.$get](dart.notNull(match[core.$length]) - 1) != null) | 430 if (match[dartx.get](dart.notNull(match.length) - 1) != null) |
629 return null; | 431 return null; |
630 match[core.$length] = dart.notNull(match[core.$length]) - 1; | 432 match.length = dart.notNull(match.length) - 1; |
631 return new _MatchImplementation(this, dart.as(match, core.List$(core.Strin
g))); | 433 return new _MatchImplementation(this, dart.as(match, core.List$(core.Strin
g))); |
632 } | 434 } |
633 matchAsPrefix(string, start) { | 435 matchAsPrefix(string, start) { |
634 if (start === void 0) | 436 if (start === void 0) |
635 start = 0; | 437 start = 0; |
636 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(string.l
ength)) { | 438 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(string.l
ength)) { |
637 throw new core.RangeError.range(start, 0, string.length); | 439 throw new core.RangeError.range(start, 0, string.length); |
638 } | 440 } |
639 return this[_execAnchored](string, start); | 441 return this[_execAnchored](string, start); |
640 } | 442 } |
641 get isMultiLine() { | 443 get isMultiLine() { |
642 return this[_isMultiLine]; | 444 return this[_isMultiLine]; |
643 } | 445 } |
644 get isCaseSensitive() { | 446 get isCaseSensitive() { |
645 return this[_isCaseSensitive]; | 447 return this[_isCaseSensitive]; |
646 } | 448 } |
647 } | 449 } |
648 JSSyntaxRegExp[dart.implements] = () => [core.RegExp]; | 450 JSSyntaxRegExp[dart.implements] = () => [core.RegExp]; |
| 451 dart.implementExtension(JSSyntaxRegExp, () => [core.Pattern]); |
649 dart.setSignature(JSSyntaxRegExp, { | 452 dart.setSignature(JSSyntaxRegExp, { |
650 constructors: () => ({JSSyntaxRegExp: [JSSyntaxRegExp, [core.String], {multi
Line: core.bool, caseSensitive: core.bool}]}), | 453 constructors: () => ({JSSyntaxRegExp: [JSSyntaxRegExp, [core.String], {multi
Line: core.bool, caseSensitive: core.bool}]}), |
651 methods: () => ({ | 454 methods: () => ({ |
652 firstMatch: [core.Match, [core.String]], | 455 firstMatch: [core.Match, [core.String]], |
653 hasMatch: [core.bool, [core.String]], | 456 hasMatch: [core.bool, [core.String]], |
654 stringMatch: [core.String, [core.String]], | 457 stringMatch: [core.String, [core.String]], |
655 allMatches: [core.Iterable$(core.Match), [core.String], [core.int]], | 458 allMatches: [core.Iterable$(core.Match), [core.String], [core.int]], |
656 [_execGlobal]: [core.Match, [core.String, core.int]], | 459 [_execGlobal]: [core.Match, [core.String, core.int]], |
657 [_execAnchored]: [core.Match, [core.String, core.int]], | 460 [_execAnchored]: [core.Match, [core.String, core.int]], |
658 matchAsPrefix: [core.Match, [core.String], [core.int]] | 461 matchAsPrefix: [core.Match, [core.String], [core.int]] |
659 }), | 462 }), |
660 statics: () => ({makeNative: [core.Object, [core.String, core.bool, core.boo
l, core.bool]]}), | 463 statics: () => ({makeNative: [core.Object, [core.String, core.bool, core.boo
l, core.bool]]}), |
661 names: ['makeNative'] | 464 names: ['makeNative'] |
662 }); | 465 }); |
663 let _match = Symbol('_match'); | 466 let _match = Symbol('_match'); |
664 class _MatchImplementation extends core.Object { | 467 class _MatchImplementation extends core.Object { |
665 _MatchImplementation(pattern, match) { | 468 _MatchImplementation(pattern, match) { |
666 this.pattern = pattern; | 469 this.pattern = pattern; |
667 this[_match] = match; | 470 this[_match] = match; |
668 dart.assert(typeof this[_match].input == 'string'); | 471 dart.assert(typeof this[_match].input == 'string'); |
669 dart.assert(typeof this[_match].index == 'number'); | 472 dart.assert(typeof this[_match].index == 'number'); |
670 } | 473 } |
671 get input() { | 474 get input() { |
672 return this[_match].input; | 475 return this[_match].input; |
673 } | 476 } |
674 get start() { | 477 get start() { |
675 return this[_match].index; | 478 return this[_match].index; |
676 } | 479 } |
677 get end() { | 480 get end() { |
678 return dart.notNull(this.start) + dart.notNull(this[_match][core.$get](0).
length); | 481 return dart.notNull(this.start) + dart.notNull(this[_match][dartx.get](0).
length); |
679 } | 482 } |
680 group(index) { | 483 group(index) { |
681 return this[_match][core.$get](index); | 484 return this[_match][dartx.get](index); |
682 } | 485 } |
683 get(index) { | 486 get(index) { |
684 return this.group(index); | 487 return this.group(index); |
685 } | 488 } |
686 get groupCount() { | 489 get groupCount() { |
687 return dart.notNull(this[_match][core.$length]) - 1; | 490 return dart.notNull(this[_match].length) - 1; |
688 } | 491 } |
689 groups(groups) { | 492 groups(groups) { |
690 let out = dart.setType([], core.List$(core.String)); | 493 let out = dart.list([], core.String); |
691 for (let i of groups) { | 494 for (let i of groups) { |
692 out[core.$add](this.group(i)); | 495 out[dartx.add](this.group(i)); |
693 } | 496 } |
694 return out; | 497 return out; |
695 } | 498 } |
696 } | 499 } |
697 _MatchImplementation[dart.implements] = () => [core.Match]; | 500 _MatchImplementation[dart.implements] = () => [core.Match]; |
698 dart.setSignature(_MatchImplementation, { | 501 dart.setSignature(_MatchImplementation, { |
699 constructors: () => ({_MatchImplementation: [_MatchImplementation, [core.Pat
tern, core.List$(core.String)]]}), | 502 constructors: () => ({_MatchImplementation: [_MatchImplementation, [core.Pat
tern, core.List$(core.String)]]}), |
700 methods: () => ({ | 503 methods: () => ({ |
701 group: [core.String, [core.int]], | 504 group: [core.String, [core.int]], |
702 get: [core.String, [core.int]], | 505 get: [core.String, [core.int]], |
703 groups: [core.List$(core.String), [core.List$(core.int)]] | 506 groups: [core.List$(core.String), [core.List$(core.int)]] |
704 }) | 507 }) |
705 }); | 508 }); |
706 let _re = Symbol('_re'); | 509 let _re = Symbol('_re'); |
707 let _string = Symbol('_string'); | 510 let _string = Symbol('_string'); |
708 let _start = Symbol('_start'); | 511 let _start = Symbol('_start'); |
709 class _AllMatchesIterable extends collection.IterableBase$(core.Match) { | 512 class _AllMatchesIterable extends collection.IterableBase$(core.Match) { |
710 _AllMatchesIterable(re, string, start) { | 513 _AllMatchesIterable(re, string, start) { |
711 this[_re] = re; | 514 this[_re] = re; |
712 this[_string] = string; | 515 this[_string] = string; |
713 this[_start] = start; | 516 this[_start] = start; |
714 super.IterableBase(); | 517 super.IterableBase(); |
715 } | 518 } |
716 get [core.$iterator]() { | 519 get iterator() { |
717 return new _AllMatchesIterator(this[_re], this[_string], this[_start]); | 520 return new _AllMatchesIterator(this[_re], this[_string], this[_start]); |
718 } | 521 } |
719 } | 522 } |
720 dart.setSignature(_AllMatchesIterable, { | 523 dart.setSignature(_AllMatchesIterable, { |
721 constructors: () => ({_AllMatchesIterable: [_AllMatchesIterable, [JSSyntaxRe
gExp, core.String, core.int]]}) | 524 constructors: () => ({_AllMatchesIterable: [_AllMatchesIterable, [JSSyntaxRe
gExp, core.String, core.int]]}) |
722 }); | 525 }); |
723 let _regExp = Symbol('_regExp'); | 526 let _regExp = Symbol('_regExp'); |
724 let _nextIndex = Symbol('_nextIndex'); | 527 let _nextIndex = Symbol('_nextIndex'); |
725 let _current = Symbol('_current'); | 528 let _current = Symbol('_current'); |
726 class _AllMatchesIterator extends core.Object { | 529 class _AllMatchesIterator extends core.Object { |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
779 } | 582 } |
780 group(group_) { | 583 group(group_) { |
781 if (group_ != 0) { | 584 if (group_ != 0) { |
782 throw new core.RangeError.value(group_); | 585 throw new core.RangeError.value(group_); |
783 } | 586 } |
784 return this.pattern; | 587 return this.pattern; |
785 } | 588 } |
786 groups(groups_) { | 589 groups(groups_) { |
787 let result = core.List$(core.String).new(); | 590 let result = core.List$(core.String).new(); |
788 for (let g of groups_) { | 591 for (let g of groups_) { |
789 result[core.$add](this.group(g)); | 592 result[dartx.add](this.group(g)); |
790 } | 593 } |
791 return result; | 594 return result; |
792 } | 595 } |
793 } | 596 } |
794 StringMatch[dart.implements] = () => [core.Match]; | 597 StringMatch[dart.implements] = () => [core.Match]; |
795 dart.setSignature(StringMatch, { | 598 dart.setSignature(StringMatch, { |
796 constructors: () => ({StringMatch: [StringMatch, [core.int, core.String, cor
e.String]]}), | 599 constructors: () => ({StringMatch: [StringMatch, [core.int, core.String, cor
e.String]]}), |
797 methods: () => ({ | 600 methods: () => ({ |
798 get: [core.String, [core.int]], | 601 get: [core.String, [core.int]], |
799 group: [core.String, [core.int]], | 602 group: [core.String, [core.int]], |
800 groups: [core.List$(core.String), [core.List$(core.int)]] | 603 groups: [core.List$(core.String), [core.List$(core.int)]] |
801 }) | 604 }) |
802 }); | 605 }); |
803 function allMatchesInStringUnchecked(needle, haystack, startIndex) { | 606 function allMatchesInStringUnchecked(needle, haystack, startIndex) { |
804 let result = core.List$(core.Match).new(); | 607 let result = core.List$(core.Match).new(); |
805 let length = haystack.length; | 608 let length = haystack.length; |
806 let patternLength = needle.length; | 609 let patternLength = needle.length; |
807 while (true) { | 610 while (true) { |
808 let position = haystack.indexOf(needle, startIndex); | 611 let position = haystack[dartx.indexOf](needle, startIndex); |
809 if (position == -1) { | 612 if (position == -1) { |
810 break; | 613 break; |
811 } | 614 } |
812 result[core.$add](new StringMatch(position, haystack, needle)); | 615 result[dartx.add](new StringMatch(position, haystack, needle)); |
813 let endIndex = dart.notNull(position) + dart.notNull(patternLength); | 616 let endIndex = dart.notNull(position) + dart.notNull(patternLength); |
814 if (endIndex == length) { | 617 if (endIndex == length) { |
815 break; | 618 break; |
816 } else if (position == endIndex) { | 619 } else if (position == endIndex) { |
817 startIndex = dart.notNull(startIndex) + 1; | 620 startIndex = dart.notNull(startIndex) + 1; |
818 } else { | 621 } else { |
819 startIndex = endIndex; | 622 startIndex = endIndex; |
820 } | 623 } |
821 } | 624 } |
822 return result; | 625 return result; |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 this[_typeName] = typeName; | 788 this[_typeName] = typeName; |
986 this[_unmangledName] = null; | 789 this[_unmangledName] = null; |
987 } | 790 } |
988 toString() { | 791 toString() { |
989 if (this[_unmangledName] != null) | 792 if (this[_unmangledName] != null) |
990 return this[_unmangledName]; | 793 return this[_unmangledName]; |
991 let unmangledName = unmangleAllIdentifiersIfPreservedAnyways(this[_typeNam
e]); | 794 let unmangledName = unmangleAllIdentifiersIfPreservedAnyways(this[_typeNam
e]); |
992 return this[_unmangledName] = unmangledName; | 795 return this[_unmangledName] = unmangledName; |
993 } | 796 } |
994 get hashCode() { | 797 get hashCode() { |
995 return dart.hashCode(this[_typeName]); | 798 return dart[dartx.hashCode](this[_typeName]); |
996 } | 799 } |
997 ['=='](other) { | 800 ['=='](other) { |
998 return dart.is(other, TypeImpl) && dart.equals(this[_typeName], dart.dload
(other, _typeName)); | 801 return dart.is(other, TypeImpl) && dart.equals(this[_typeName], dart.dload
(other, _typeName)); |
999 } | 802 } |
1000 } | 803 } |
1001 TypeImpl[dart.implements] = () => [core.Type]; | 804 TypeImpl[dart.implements] = () => [core.Type]; |
1002 dart.setSignature(TypeImpl, { | 805 dart.setSignature(TypeImpl, { |
1003 constructors: () => ({TypeImpl: [TypeImpl, [core.String]]}) | 806 constructors: () => ({TypeImpl: [TypeImpl, [core.String]]}) |
1004 }); | 807 }); |
1005 class TypeVariable extends core.Object { | 808 class TypeVariable extends core.Object { |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1139 let interceptor = _interceptors.getInterceptor(object); | 942 let interceptor = _interceptors.getInterceptor(object); |
1140 let isSubclass = getField(interceptor, isField); | 943 let isSubclass = getField(interceptor, isField); |
1141 if (isSubclass == null) | 944 if (isSubclass == null) |
1142 return false; | 945 return false; |
1143 let substitution = getField(interceptor, asField); | 946 let substitution = getField(interceptor, asField); |
1144 return checkArguments(substitution, arguments$, checks); | 947 return checkArguments(substitution, arguments$, checks); |
1145 } | 948 } |
1146 dart.fn(checkSubtype, core.bool, [core.Object, core.String, core.List, core.St
ring]); | 949 dart.fn(checkSubtype, core.bool, [core.Object, core.String, core.List, core.St
ring]); |
1147 function computeTypeName(isField, arguments$) { | 950 function computeTypeName(isField, arguments$) { |
1148 let prefixLength = _foreign_helper.JS_OPERATOR_IS_PREFIX().length; | 951 let prefixLength = _foreign_helper.JS_OPERATOR_IS_PREFIX().length; |
1149 return Primitives.formatType(isField.substring(prefixLength, isField.length)
, arguments$); | 952 return Primitives.formatType(isField[dartx.substring](prefixLength, isField.
length), arguments$); |
1150 } | 953 } |
1151 dart.fn(computeTypeName, core.String, [core.String, core.List]); | 954 dart.fn(computeTypeName, core.String, [core.String, core.List]); |
1152 function subtypeCast(object, isField, checks, asField) { | 955 function subtypeCast(object, isField, checks, asField) { |
1153 if (dart.notNull(object != null) && !dart.notNull(checkSubtype(object, isFie
ld, checks, asField))) { | 956 if (dart.notNull(object != null) && !dart.notNull(checkSubtype(object, isFie
ld, checks, asField))) { |
1154 let actualType = Primitives.objectTypeName(object); | 957 let actualType = Primitives.objectTypeName(object); |
1155 let typeName = computeTypeName(isField, checks); | 958 let typeName = computeTypeName(isField, checks); |
1156 throw new CastErrorImplementation(actualType, typeName); | 959 throw new CastErrorImplementation(actualType, typeName); |
1157 } | 960 } |
1158 return object; | 961 return object; |
1159 } | 962 } |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1308 } | 1111 } |
1309 dart.fn(areAssignable, core.bool, [core.List, core.List, core.bool]); | 1112 dart.fn(areAssignable, core.bool, [core.List, core.List, core.bool]); |
1310 function areAssignableMaps(s, t) { | 1113 function areAssignableMaps(s, t) { |
1311 if (t == null) | 1114 if (t == null) |
1312 return true; | 1115 return true; |
1313 if (s == null) | 1116 if (s == null) |
1314 return false; | 1117 return false; |
1315 dart.assert(isJsObject(s)); | 1118 dart.assert(isJsObject(s)); |
1316 dart.assert(isJsObject(t)); | 1119 dart.assert(isJsObject(t)); |
1317 let names = _interceptors.JSArray.markFixedList(dart.as(Object.getOwnPropert
yNames(t), core.List)); | 1120 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) { | 1121 for (let i = 0; dart.notNull(i) < dart.notNull(names.length); i = dart.notNu
ll(i) + 1) { |
1319 let name = names[core.$get](i); | 1122 let name = names[dartx.get](i); |
1320 if (!Object.hasOwnProperty.call(s, name)) { | 1123 if (!Object.hasOwnProperty.call(s, name)) { |
1321 return false; | 1124 return false; |
1322 } | 1125 } |
1323 let tType = t[name]; | 1126 let tType = t[name]; |
1324 let sType = s[name]; | 1127 let sType = s[name]; |
1325 if (!dart.notNull(isAssignable(tType, sType))) | 1128 if (!dart.notNull(isAssignable(tType, sType))) |
1326 return false; | 1129 return false; |
1327 } | 1130 } |
1328 return true; | 1131 return true; |
1329 } | 1132 } |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1457 } | 1260 } |
1458 } | 1261 } |
1459 dart.setSignature(_Patch, { | 1262 dart.setSignature(_Patch, { |
1460 constructors: () => ({_Patch: [_Patch, []]}) | 1263 constructors: () => ({_Patch: [_Patch, []]}) |
1461 }); | 1264 }); |
1462 let patch = dart.const(new _Patch()); | 1265 let patch = dart.const(new _Patch()); |
1463 class InternalMap extends core.Object {} | 1266 class InternalMap extends core.Object {} |
1464 function requiresPreamble() { | 1267 function requiresPreamble() { |
1465 } | 1268 } |
1466 dart.fn(requiresPreamble); | 1269 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) { | 1270 function S(value) { |
1477 if (typeof value == 'string') | 1271 if (typeof value == 'string') |
1478 return dart.as(value, core.String); | 1272 return dart.as(value, core.String); |
1479 if (dart.is(value, core.num)) { | 1273 if (dart.is(value, core.num)) { |
1480 if (!dart.equals(value, 0)) { | 1274 if (!dart.equals(value, 0)) { |
1481 return "" + value; | 1275 return "" + value; |
1482 } | 1276 } |
1483 } else if (dart.equals(true, value)) { | 1277 } else if (dart.equals(true, value)) { |
1484 return 'true'; | 1278 return 'true'; |
1485 } else if (dart.equals(false, value)) { | 1279 } else if (dart.equals(false, value)) { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1530 this[_arguments] = arguments$; | 1324 this[_arguments] = arguments$; |
1531 this[_namedArgumentNames] = namedArgumentNames; | 1325 this[_namedArgumentNames] = namedArgumentNames; |
1532 this[_namedIndices] = null; | 1326 this[_namedIndices] = null; |
1533 } | 1327 } |
1534 get memberName() { | 1328 get memberName() { |
1535 if (dart.is(this[_memberName], core.Symbol)) | 1329 if (dart.is(this[_memberName], core.Symbol)) |
1536 return dart.as(this[_memberName], core.Symbol); | 1330 return dart.as(this[_memberName], core.Symbol); |
1537 let name = dart.as(this[_memberName], core.String); | 1331 let name = dart.as(this[_memberName], core.String); |
1538 let unmangledName = _js_names.mangledNames.get(name); | 1332 let unmangledName = _js_names.mangledNames.get(name); |
1539 if (unmangledName != null) { | 1333 if (unmangledName != null) { |
1540 name = unmangledName.split(':')[core.$get](0); | 1334 name = unmangledName[dartx.split](':')[dartx.get](0); |
1541 } else { | 1335 } else { |
1542 if (_js_names.mangledNames.get(this[_internalName]) == null) { | 1336 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."); | 1337 core.print(`Warning: '${name}' is used reflectively but not in Mirrors
Used. ` + "This will break minified code."); |
1544 } | 1338 } |
1545 } | 1339 } |
1546 this[_memberName] = new _internal.Symbol.unvalidated(name); | 1340 this[_memberName] = new _internal.Symbol.unvalidated(name); |
1547 return dart.as(this[_memberName], core.Symbol); | 1341 return dart.as(this[_memberName], core.Symbol); |
1548 } | 1342 } |
1549 get isMethod() { | 1343 get isMethod() { |
1550 return this[_kind] == JSInvocationMirror.METHOD; | 1344 return this[_kind] == JSInvocationMirror.METHOD; |
1551 } | 1345 } |
1552 get isGetter() { | 1346 get isGetter() { |
1553 return this[_kind] == JSInvocationMirror.GETTER; | 1347 return this[_kind] == JSInvocationMirror.GETTER; |
1554 } | 1348 } |
1555 get isSetter() { | 1349 get isSetter() { |
1556 return this[_kind] == JSInvocationMirror.SETTER; | 1350 return this[_kind] == JSInvocationMirror.SETTER; |
1557 } | 1351 } |
1558 get isAccessor() { | 1352 get isAccessor() { |
1559 return this[_kind] != JSInvocationMirror.METHOD; | 1353 return this[_kind] != JSInvocationMirror.METHOD; |
1560 } | 1354 } |
1561 get positionalArguments() { | 1355 get positionalArguments() { |
1562 if (this.isGetter) | 1356 if (this.isGetter) |
1563 return dart.const([]); | 1357 return dart.const([]); |
1564 let argumentCount = dart.notNull(this[_arguments][core.$length]) - dart.no
tNull(this[_namedArgumentNames][core.$length]); | 1358 let argumentCount = dart.notNull(this[_arguments].length) - dart.notNull(t
his[_namedArgumentNames].length); |
1565 if (argumentCount == 0) | 1359 if (argumentCount == 0) |
1566 return dart.const([]); | 1360 return dart.const([]); |
1567 let list = []; | 1361 let list = []; |
1568 for (let index = 0; dart.notNull(index) < dart.notNull(argumentCount); ind
ex = dart.notNull(index) + 1) { | 1362 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)); | 1363 list[dartx.add](this[_arguments][dartx.get](index)); |
1570 } | 1364 } |
1571 return dart.as(makeLiteralListConst(list), core.List); | 1365 return dart.as(makeLiteralListConst(list), core.List); |
1572 } | 1366 } |
1573 get namedArguments() { | 1367 get namedArguments() { |
1574 if (this.isAccessor) | 1368 if (this.isAccessor) |
1575 return dart.map(); | 1369 return dart.map(); |
1576 let namedArgumentCount = this[_namedArgumentNames][core.$length]; | 1370 let namedArgumentCount = this[_namedArgumentNames].length; |
1577 let namedArgumentsStartIndex = dart.notNull(this[_arguments][core.$length]
) - dart.notNull(namedArgumentCount); | 1371 let namedArgumentsStartIndex = dart.notNull(this[_arguments].length) - dar
t.notNull(namedArgumentCount); |
1578 if (namedArgumentCount == 0) | 1372 if (namedArgumentCount == 0) |
1579 return dart.map(); | 1373 return dart.map(); |
1580 let map = core.Map$(core.Symbol, core.Object).new(); | 1374 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) { | 1375 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))); | 1376 map.set(new _internal.Symbol.unvalidated(dart.as(this[_namedArgumentName
s][dartx.get](i), core.String)), this[_arguments][dartx.get](dart.notNull(namedA
rgumentsStartIndex) + dart.notNull(i))); |
1583 } | 1377 } |
1584 return map; | 1378 return map; |
1585 } | 1379 } |
1586 [_getCachedInvocation](object) { | 1380 [_getCachedInvocation](object) { |
1587 let interceptor = _interceptors.getInterceptor(object); | 1381 let interceptor = _interceptors.getInterceptor(object); |
1588 let receiver = object; | 1382 let receiver = object; |
1589 let name = this[_internalName]; | 1383 let name = this[_internalName]; |
1590 let arguments$ = this[_arguments]; | 1384 let arguments$ = this[_arguments]; |
1591 let interceptedNames = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded
_names.INTERCEPTED_NAMES); | 1385 let interceptedNames = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded
_names.INTERCEPTED_NAMES); |
1592 let isIntercepted = Object.prototype.hasOwnProperty.call(interceptedNames,
name); | 1386 let isIntercepted = Object.prototype.hasOwnProperty.call(interceptedNames,
name); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1663 get isGetterStub() { | 1457 get isGetterStub() { |
1664 return !!this.jsFunction.$getterStub; | 1458 return !!this.jsFunction.$getterStub; |
1665 } | 1459 } |
1666 invokeOn(victim, arguments$) { | 1460 invokeOn(victim, arguments$) { |
1667 let receiver = victim; | 1461 let receiver = victim; |
1668 if (!dart.notNull(this.isIntercepted)) { | 1462 if (!dart.notNull(this.isIntercepted)) { |
1669 if (!dart.is(arguments$, _interceptors.JSArray)) | 1463 if (!dart.is(arguments$, _interceptors.JSArray)) |
1670 arguments$ = core.List.from(arguments$); | 1464 arguments$ = core.List.from(arguments$); |
1671 } else { | 1465 } else { |
1672 let _ = [victim]; | 1466 let _ = [victim]; |
1673 _[core.$addAll](arguments$); | 1467 _[dartx.addAll](arguments$); |
1674 arguments$ = _; | 1468 arguments$ = _; |
1675 if (this.cachedInterceptor != null) | 1469 if (this.cachedInterceptor != null) |
1676 receiver = this.cachedInterceptor; | 1470 receiver = this.cachedInterceptor; |
1677 } | 1471 } |
1678 return this.jsFunction.apply(receiver, arguments$); | 1472 return this.jsFunction.apply(receiver, arguments$); |
1679 } | 1473 } |
1680 } | 1474 } |
1681 dart.setSignature(CachedInvocation, { | 1475 dart.setSignature(CachedInvocation, { |
1682 constructors: () => ({CachedInvocation: [CachedInvocation, [core.String, cor
e.Object, core.bool, _interceptors.Interceptor]]}), | 1476 constructors: () => ({CachedInvocation: [CachedInvocation, [core.String, cor
e.Object, core.bool, _interceptors.Interceptor]]}), |
1683 methods: () => ({invokeOn: [core.Object, [core.Object, core.List]]}) | 1477 methods: () => ({invokeOn: [core.Object, [core.Object, core.List]]}) |
1684 }); | 1478 }); |
1685 class CachedCatchAllInvocation extends CachedInvocation { | 1479 class CachedCatchAllInvocation extends CachedInvocation { |
1686 CachedCatchAllInvocation(name, jsFunction, isIntercepted, cachedInterceptor)
{ | 1480 CachedCatchAllInvocation(name, jsFunction, isIntercepted, cachedInterceptor)
{ |
1687 this.info = ReflectionInfo.new(jsFunction); | 1481 this.info = ReflectionInfo.new(jsFunction); |
1688 super.CachedInvocation(name, jsFunction, isIntercepted, cachedInterceptor)
; | 1482 super.CachedInvocation(name, jsFunction, isIntercepted, cachedInterceptor)
; |
1689 } | 1483 } |
1690 get isGetterStub() { | 1484 get isGetterStub() { |
1691 return false; | 1485 return false; |
1692 } | 1486 } |
1693 invokeOn(victim, arguments$) { | 1487 invokeOn(victim, arguments$) { |
1694 let receiver = victim; | 1488 let receiver = victim; |
1695 let providedArgumentCount = null; | 1489 let providedArgumentCount = null; |
1696 let fullParameterCount = dart.notNull(this.info.requiredParameterCount) +
dart.notNull(this.info.optionalParameterCount); | 1490 let fullParameterCount = dart.notNull(this.info.requiredParameterCount) +
dart.notNull(this.info.optionalParameterCount); |
1697 if (!dart.notNull(this.isIntercepted)) { | 1491 if (!dart.notNull(this.isIntercepted)) { |
1698 if (dart.is(arguments$, _interceptors.JSArray)) { | 1492 if (dart.is(arguments$, _interceptors.JSArray)) { |
1699 providedArgumentCount = arguments$[core.$length]; | 1493 providedArgumentCount = arguments$.length; |
1700 if (dart.notNull(providedArgumentCount) < dart.notNull(fullParameterCo
unt)) { | 1494 if (dart.notNull(providedArgumentCount) < dart.notNull(fullParameterCo
unt)) { |
1701 arguments$ = core.List.from(arguments$); | 1495 arguments$ = core.List.from(arguments$); |
1702 } | 1496 } |
1703 } else { | 1497 } else { |
1704 arguments$ = core.List.from(arguments$); | 1498 arguments$ = core.List.from(arguments$); |
1705 providedArgumentCount = arguments$[core.$length]; | 1499 providedArgumentCount = arguments$.length; |
1706 } | 1500 } |
1707 } else { | 1501 } else { |
1708 let _ = [victim]; | 1502 let _ = [victim]; |
1709 _[core.$addAll](arguments$); | 1503 _[dartx.addAll](arguments$); |
1710 arguments$ = _; | 1504 arguments$ = _; |
1711 if (this.cachedInterceptor != null) | 1505 if (this.cachedInterceptor != null) |
1712 receiver = this.cachedInterceptor; | 1506 receiver = this.cachedInterceptor; |
1713 providedArgumentCount = dart.notNull(arguments$[core.$length]) - 1; | 1507 providedArgumentCount = dart.notNull(arguments$.length) - 1; |
1714 } | 1508 } |
1715 if (dart.notNull(this.info.areOptionalParametersNamed) && dart.notNull(pro
videdArgumentCount) > dart.notNull(this.info.requiredParameterCount)) { | 1509 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.`
); | 1510 throw new UnimplementedNoSuchMethodError(`Invocation of unstubbed method
'${this.info.reflectionName}'` + ` with ${arguments$.length} arguments.`); |
1717 } else if (dart.notNull(providedArgumentCount) < dart.notNull(this.info.re
quiredParameterCount)) { | 1511 } 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).`); | 1512 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)) { | 1513 } 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).`); | 1514 throw new UnimplementedNoSuchMethodError(`Invocation of unstubbed method
'${this.info.reflectionName}'` + ` with ${providedArgumentCount} arguments (too
many).`); |
1721 } | 1515 } |
1722 for (let i = providedArgumentCount; dart.notNull(i) < dart.notNull(fullPar
ameterCount); i = dart.notNull(i) + 1) { | 1516 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))); | 1517 arguments$[dartx.add](getMetadata(this.info.defaultValue(i))); |
1724 } | 1518 } |
1725 return this.jsFunction.apply(receiver, arguments$); | 1519 return this.jsFunction.apply(receiver, arguments$); |
1726 } | 1520 } |
1727 } | 1521 } |
1728 dart.setSignature(CachedCatchAllInvocation, { | 1522 dart.setSignature(CachedCatchAllInvocation, { |
1729 constructors: () => ({CachedCatchAllInvocation: [CachedCatchAllInvocation, [
core.String, core.Object, core.bool, _interceptors.Interceptor]]}) | 1523 constructors: () => ({CachedCatchAllInvocation: [CachedCatchAllInvocation, [
core.String, core.Object, core.bool, _interceptors.Interceptor]]}) |
1730 }); | 1524 }); |
1731 class CachedNoSuchMethodInvocation extends core.Object { | 1525 class CachedNoSuchMethodInvocation extends core.Object { |
1732 CachedNoSuchMethodInvocation(interceptor) { | 1526 CachedNoSuchMethodInvocation(interceptor) { |
1733 this.interceptor = interceptor; | 1527 this.interceptor = interceptor; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1815 sortedIndex(unsortedIndex) { | 1609 sortedIndex(unsortedIndex) { |
1816 if (this.cachedSortedIndices == null) { | 1610 if (this.cachedSortedIndices == null) { |
1817 this.cachedSortedIndices = core.List.new(this.optionalParameterCount); | 1611 this.cachedSortedIndices = core.List.new(this.optionalParameterCount); |
1818 let positions = dart.map(); | 1612 let positions = dart.map(); |
1819 for (let i = 0; dart.notNull(i) < dart.notNull(this.optionalParameterCou
nt); i = dart.notNull(i) + 1) { | 1613 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
); | 1614 let index = dart.notNull(this.requiredParameterCount) + dart.notNull(i
); |
1821 positions.set(this.parameterName(index), index); | 1615 positions.set(this.parameterName(index), index); |
1822 } | 1616 } |
1823 let index = 0; | 1617 let index = 0; |
1824 (() => { | 1618 (() => { |
1825 let _ = positions.keys[core.$toList](); | 1619 let _ = positions.keys[dartx.toList](); |
1826 _[core.$sort](); | 1620 _[dartx.sort](); |
1827 return _; | 1621 return _; |
1828 })()[core.$forEach](dart.fn((name => { | 1622 })()[dartx.forEach](dart.fn((name => { |
1829 this.cachedSortedIndices[core.$set]((() => { | 1623 this.cachedSortedIndices[dartx.set]((() => { |
1830 let x = index; | 1624 let x = index; |
1831 index = dart.notNull(x) + 1; | 1625 index = dart.notNull(x) + 1; |
1832 return x; | 1626 return x; |
1833 })(), positions.get(name)); | 1627 })(), positions.get(name)); |
1834 }).bind(this), core.Object, [core.String])); | 1628 }).bind(this), core.Object, [core.String])); |
1835 } | 1629 } |
1836 return dart.as(this.cachedSortedIndices[core.$get](unsortedIndex), core.in
t); | 1630 return dart.as(this.cachedSortedIndices[dartx.get](unsortedIndex), core.in
t); |
1837 } | 1631 } |
1838 computeFunctionRti(jsConstructor) { | 1632 computeFunctionRti(jsConstructor) { |
1839 if (typeof this.functionType == "number") { | 1633 if (typeof this.functionType == "number") { |
1840 return getMetadata(dart.as(this.functionType, core.int)); | 1634 return getMetadata(dart.as(this.functionType, core.int)); |
1841 } else if (typeof this.functionType == "function") { | 1635 } else if (typeof this.functionType == "function") { |
1842 let fakeInstance = new jsConstructor(); | 1636 let fakeInstance = new jsConstructor(); |
1843 setRuntimeTypeInfo(fakeInstance, fakeInstance["<>"]); | 1637 setRuntimeTypeInfo(fakeInstance, fakeInstance["<>"]); |
1844 return this.functionType.apply({$receiver: fakeInstance}); | 1638 return this.functionType.apply({$receiver: fakeInstance}); |
1845 } else { | 1639 } else { |
1846 throw new RuntimeError('Unexpected function type'); | 1640 throw new RuntimeError('Unexpected function type'); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1923 } | 1717 } |
1924 if (dart.notNull(radix) < 10 || dart.notNull(dart.dindex(match, decima
lIndex) == null)) { | 1718 if (dart.notNull(radix) < 10 || dart.notNull(dart.dindex(match, decima
lIndex) == null)) { |
1925 let maxCharCode = null; | 1719 let maxCharCode = null; |
1926 if (dart.notNull(radix) <= 10) { | 1720 if (dart.notNull(radix) <= 10) { |
1927 maxCharCode = 48 + dart.notNull(radix) - 1; | 1721 maxCharCode = 48 + dart.notNull(radix) - 1; |
1928 } else { | 1722 } else { |
1929 maxCharCode = 97 + dart.notNull(radix) - 10 - 1; | 1723 maxCharCode = 97 + dart.notNull(radix) - 10 - 1; |
1930 } | 1724 } |
1931 let digitsPart = dart.as(dart.dindex(match, digitsIndex), core.Strin
g); | 1725 let digitsPart = dart.as(dart.dindex(match, digitsIndex), core.Strin
g); |
1932 for (let i = 0; dart.notNull(i) < dart.notNull(digitsPart.length); i
= dart.notNull(i) + 1) { | 1726 for (let i = 0; dart.notNull(i) < dart.notNull(digitsPart.length); i
= dart.notNull(i) + 1) { |
1933 let characterCode = dart.notNull(digitsPart.codeUnitAt(0)) | 32; | 1727 let characterCode = dart.notNull(digitsPart[dartx.codeUnitAt](0))
| 32; |
1934 if (dart.notNull(digitsPart.codeUnitAt(i)) > dart.notNull(maxCharC
ode)) { | 1728 if (dart.notNull(digitsPart[dartx.codeUnitAt](i)) > dart.notNull(m
axCharCode)) { |
1935 return handleError(source); | 1729 return handleError(source); |
1936 } | 1730 } |
1937 } | 1731 } |
1938 } | 1732 } |
1939 } | 1733 } |
1940 } | 1734 } |
1941 if (match == null) | 1735 if (match == null) |
1942 return handleError(source); | 1736 return handleError(source); |
1943 return parseInt(source, radix); | 1737 return parseInt(source, radix); |
1944 } | 1738 } |
1945 static parseDouble(source, handleError) { | 1739 static parseDouble(source, handleError) { |
1946 checkString(source); | 1740 checkString(source); |
1947 if (handleError == null) | 1741 if (handleError == null) |
1948 handleError = dart.fn(s => dart.as(Primitives._throwFormatException(dart
.as(s, core.String)), core.double), core.double, [core.Object]); | 1742 handleError = dart.fn(s => dart.as(Primitives._throwFormatException(dart
.as(s, core.String)), core.double), core.double, [core.Object]); |
1949 if (!/^\s*[+-]?(?:Infinity|NaN|(?:\.\d+|\d+(?:\.\d*)?)(?:[eE][+-]?\d+)?)\s
*$/.test(source)) { | 1743 if (!/^\s*[+-]?(?:Infinity|NaN|(?:\.\d+|\d+(?:\.\d*)?)(?:[eE][+-]?\d+)?)\s
*$/.test(source)) { |
1950 return handleError(source); | 1744 return handleError(source); |
1951 } | 1745 } |
1952 let result = parseFloat(source); | 1746 let result = parseFloat(source); |
1953 if (result.isNaN) { | 1747 if (result[dartx.isNaN]) { |
1954 let trimmed = source.trim(); | 1748 let trimmed = source[dartx.trim](); |
1955 if (trimmed == 'NaN' || trimmed == '+NaN' || trimmed == '-NaN') { | 1749 if (trimmed == 'NaN' || trimmed == '+NaN' || trimmed == '-NaN') { |
1956 return result; | 1750 return result; |
1957 } | 1751 } |
1958 return handleError(source); | 1752 return handleError(source); |
1959 } | 1753 } |
1960 return result; | 1754 return result; |
1961 } | 1755 } |
1962 static formatType(className, typeArguments) { | 1756 static formatType(className, typeArguments) { |
1963 return unmangleAllIdentifiersIfPreservedAnyways(`${className}${joinArgumen
ts(typeArguments, 0)}`); | 1757 return unmangleAllIdentifiersIfPreservedAnyways(`${className}${joinArgumen
ts(typeArguments, 0)}`); |
1964 } | 1758 } |
(...skipping 23 matching lines...) Expand all Loading... |
1988 return; | 1782 return; |
1989 let window = window; | 1783 let window = window; |
1990 if (window == null) | 1784 if (window == null) |
1991 return; | 1785 return; |
1992 let performance = window.performance; | 1786 let performance = window.performance; |
1993 if (performance == null) | 1787 if (performance == null) |
1994 return; | 1788 return; |
1995 if (typeof performance.now != "function") | 1789 if (typeof performance.now != "function") |
1996 return; | 1790 return; |
1997 Primitives.timerFrequency = 1000000; | 1791 Primitives.timerFrequency = 1000000; |
1998 Primitives.timerTicks = dart.fn(() => (1000 * performance.now()).floor(),
core.int, []); | 1792 Primitives.timerTicks = dart.fn(() => (1000 * performance.now())[dartx.flo
or](), core.int, []); |
1999 } | 1793 } |
2000 static get isD8() { | 1794 static get isD8() { |
2001 return typeof version == "function" && typeof os == "object" && "system" i
n os; | 1795 return typeof version == "function" && typeof os == "object" && "system" i
n os; |
2002 } | 1796 } |
2003 static get isJsshell() { | 1797 static get isJsshell() { |
2004 return typeof version == "function" && typeof system == "function"; | 1798 return typeof version == "function" && typeof system == "function"; |
2005 } | 1799 } |
2006 static currentUri() { | 1800 static currentUri() { |
2007 requiresPreamble(); | 1801 requiresPreamble(); |
2008 if (!!self.location) { | 1802 if (!!self.location) { |
2009 return self.location.href; | 1803 return self.location.href; |
2010 } | 1804 } |
2011 return null; | 1805 return null; |
2012 } | 1806 } |
2013 static _fromCharCodeApply(array) { | 1807 static _fromCharCodeApply(array) { |
2014 let result = ""; | 1808 let result = ""; |
2015 let kMaxApply = 500; | 1809 let kMaxApply = 500; |
2016 let end = array[core.$length]; | 1810 let end = array.length; |
2017 for (let i = 0; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) +
dart.notNull(kMaxApply)) { | 1811 for (let i = 0; dart.notNull(i) < dart.notNull(end); i = dart.notNull(i) +
dart.notNull(kMaxApply)) { |
2018 let subarray = null; | 1812 let subarray = null; |
2019 if (dart.notNull(end) <= dart.notNull(kMaxApply)) { | 1813 if (dart.notNull(end) <= dart.notNull(kMaxApply)) { |
2020 subarray = array; | 1814 subarray = array; |
2021 } else { | 1815 } else { |
2022 subarray = array.slice(i, dart.notNull(i) + dart.notNull(kMaxApply) <
dart.notNull(end) ? dart.notNull(i) + dart.notNull(kMaxApply) : end); | 1816 subarray = array.slice(i, dart.notNull(i) + dart.notNull(kMaxApply) <
dart.notNull(end) ? dart.notNull(i) + dart.notNull(kMaxApply) : end); |
2023 } | 1817 } |
2024 result = result + String.fromCharCode.apply(null, subarray); | 1818 result = result + String.fromCharCode.apply(null, subarray); |
2025 } | 1819 } |
2026 return result; | 1820 return result; |
2027 } | 1821 } |
2028 static stringFromCodePoints(codePoints) { | 1822 static stringFromCodePoints(codePoints) { |
2029 let a = dart.setType([], core.List$(core.int)); | 1823 let a = dart.list([], core.int); |
2030 for (let i of dart.as(codePoints, core.Iterable)) { | 1824 for (let i of dart.as(codePoints, core.Iterable)) { |
2031 if (!(typeof i == 'number')) | 1825 if (!(typeof i == 'number')) |
2032 throw new core.ArgumentError(i); | 1826 throw new core.ArgumentError(i); |
2033 if (dart.dsend(i, '<=', 65535)) { | 1827 if (dart.dsend(i, '<=', 65535)) { |
2034 a[core.$add](dart.as(i, core.int)); | 1828 a[dartx.add](dart.as(i, core.int)); |
2035 } else if (dart.dsend(i, '<=', 1114111)) { | 1829 } else if (dart.dsend(i, '<=', 1114111)) { |
2036 a[core.$add]((55296)['+'](dart.as(dart.dsend(dart.dsend(dart.dsend(i,
'-', 65536), '>>', 10), '&', 1023), core.num))); | 1830 a[dartx.add]((55296)[dartx['+']](dart.as(dart.dsend(dart.dsend(dart.ds
end(i, '-', 65536), '>>', 10), '&', 1023), core.num))); |
2037 a[core.$add]((56320)['+'](dart.as(dart.dsend(i, '&', 1023), core.num))
); | 1831 a[dartx.add]((56320)[dartx['+']](dart.as(dart.dsend(i, '&', 1023), cor
e.num))); |
2038 } else { | 1832 } else { |
2039 throw new core.ArgumentError(i); | 1833 throw new core.ArgumentError(i); |
2040 } | 1834 } |
2041 } | 1835 } |
2042 return Primitives._fromCharCodeApply(a); | 1836 return Primitives._fromCharCodeApply(a); |
2043 } | 1837 } |
2044 static stringFromCharCodes(charCodes) { | 1838 static stringFromCharCodes(charCodes) { |
2045 for (let i of dart.as(charCodes, core.Iterable)) { | 1839 for (let i of dart.as(charCodes, core.Iterable)) { |
2046 if (!(typeof i == 'number')) | 1840 if (!(typeof i == 'number')) |
2047 throw new core.ArgumentError(i); | 1841 throw new core.ArgumentError(i); |
2048 if (dart.dsend(i, '<', 0)) | 1842 if (dart.dsend(i, '<', 0)) |
2049 throw new core.ArgumentError(i); | 1843 throw new core.ArgumentError(i); |
2050 if (dart.dsend(i, '>', 65535)) | 1844 if (dart.dsend(i, '>', 65535)) |
2051 return Primitives.stringFromCodePoints(charCodes); | 1845 return Primitives.stringFromCodePoints(charCodes); |
2052 } | 1846 } |
2053 return Primitives._fromCharCodeApply(dart.as(charCodes, core.List$(core.in
t))); | 1847 return Primitives._fromCharCodeApply(dart.as(charCodes, core.List$(core.in
t))); |
2054 } | 1848 } |
2055 static stringFromCharCode(charCode) { | 1849 static stringFromCharCode(charCode) { |
2056 if (0 <= dart.notNull(dart.as(charCode, core.num))) { | 1850 if (0 <= dart.notNull(dart.as(charCode, core.num))) { |
2057 if (dart.dsend(charCode, '<=', 65535)) { | 1851 if (dart.dsend(charCode, '<=', 65535)) { |
2058 return String.fromCharCode(charCode); | 1852 return String.fromCharCode(charCode); |
2059 } | 1853 } |
2060 if (dart.dsend(charCode, '<=', 1114111)) { | 1854 if (dart.dsend(charCode, '<=', 1114111)) { |
2061 let bits = dart.dsend(charCode, '-', 65536); | 1855 let bits = dart.dsend(charCode, '-', 65536); |
2062 let low = (56320)['|'](dart.as(dart.dsend(bits, '&', 1023), core.int))
; | 1856 let low = (56320)[dartx['|']](dart.as(dart.dsend(bits, '&', 1023), cor
e.int)); |
2063 let high = (55296)['|'](dart.as(dart.dsend(bits, '>>', 10), core.int))
; | 1857 let high = (55296)[dartx['|']](dart.as(dart.dsend(bits, '>>', 10), cor
e.int)); |
2064 return String.fromCharCode(high, low); | 1858 return String.fromCharCode(high, low); |
2065 } | 1859 } |
2066 } | 1860 } |
2067 throw new core.RangeError.range(dart.as(charCode, core.num), 0, 1114111); | 1861 throw new core.RangeError.range(dart.as(charCode, core.num), 0, 1114111); |
2068 } | 1862 } |
2069 static stringConcatUnchecked(string1, string2) { | 1863 static stringConcatUnchecked(string1, string2) { |
2070 return _foreign_helper.JS_STRING_CONCAT(string1, string2); | 1864 return _foreign_helper.JS_STRING_CONCAT(string1, string2); |
2071 } | 1865 } |
2072 static flattenString(str) { | 1866 static flattenString(str) { |
2073 return str.charCodeAt(0) == 0 ? str : str; | 1867 return str.charCodeAt(0) == 0 ? str : str; |
2074 } | 1868 } |
2075 static getTimeZoneName(receiver) { | 1869 static getTimeZoneName(receiver) { |
2076 let d = Primitives.lazyAsJsDate(receiver); | 1870 let d = Primitives.lazyAsJsDate(receiver); |
2077 let match = dart.as(/\((.*)\)/.exec(d.toString()), core.List); | 1871 let match = dart.as(/\((.*)\)/.exec(d.toString()), core.List); |
2078 if (match != null) | 1872 if (match != null) |
2079 return dart.as(match[core.$get](1), core.String); | 1873 return dart.as(match[dartx.get](1), core.String); |
2080 match = dart.as(/^[A-Z,a-z]{3}\s[A-Z,a-z]{3}\s\d+\s\d{2}:\d{2}:\d{2}\s([A-
Z]{3,5})\s\d{4}$/.exec(d.toString()), core.List); | 1874 match = dart.as(/^[A-Z,a-z]{3}\s[A-Z,a-z]{3}\s\d+\s\d{2}:\d{2}:\d{2}\s([A-
Z]{3,5})\s\d{4}$/.exec(d.toString()), core.List); |
2081 if (match != null) | 1875 if (match != null) |
2082 return dart.as(match[core.$get](1), core.String); | 1876 return dart.as(match[dartx.get](1), core.String); |
2083 match = dart.as(/(?:GMT|UTC)[+-]\d{4}/.exec(d.toString()), core.List); | 1877 match = dart.as(/(?:GMT|UTC)[+-]\d{4}/.exec(d.toString()), core.List); |
2084 if (match != null) | 1878 if (match != null) |
2085 return dart.as(match[core.$get](0), core.String); | 1879 return dart.as(match[dartx.get](0), core.String); |
2086 return ""; | 1880 return ""; |
2087 } | 1881 } |
2088 static getTimeZoneOffsetInMinutes(receiver) { | 1882 static getTimeZoneOffsetInMinutes(receiver) { |
2089 return -Primitives.lazyAsJsDate(receiver).getTimezoneOffset(); | 1883 return -Primitives.lazyAsJsDate(receiver).getTimezoneOffset(); |
2090 } | 1884 } |
2091 static valueFromDecomposedDate(years, month, day, hours, minutes, seconds, m
illiseconds, isUtc) { | 1885 static valueFromDecomposedDate(years, month, day, hours, minutes, seconds, m
illiseconds, isUtc) { |
2092 let MAX_MILLISECONDS_SINCE_EPOCH = 8640000000000000; | 1886 let MAX_MILLISECONDS_SINCE_EPOCH = 8640000000000000; |
2093 checkInt(years); | 1887 checkInt(years); |
2094 checkInt(month); | 1888 checkInt(month); |
2095 checkInt(day); | 1889 checkInt(day); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2149 return dart.dload(receiver, 'isUtc') ? Primitives.lazyAsJsDate(receiver).g
etUTCMilliseconds() + 0 : Primitives.lazyAsJsDate(receiver).getMilliseconds() +
0; | 1943 return dart.dload(receiver, 'isUtc') ? Primitives.lazyAsJsDate(receiver).g
etUTCMilliseconds() + 0 : Primitives.lazyAsJsDate(receiver).getMilliseconds() +
0; |
2150 } | 1944 } |
2151 static getWeekday(receiver) { | 1945 static getWeekday(receiver) { |
2152 let weekday = dart.dload(receiver, 'isUtc') ? Primitives.lazyAsJsDate(rece
iver).getUTCDay() + 0 : Primitives.lazyAsJsDate(receiver).getDay() + 0; | 1946 let weekday = dart.dload(receiver, 'isUtc') ? Primitives.lazyAsJsDate(rece
iver).getUTCDay() + 0 : Primitives.lazyAsJsDate(receiver).getDay() + 0; |
2153 return (dart.notNull(weekday) + 6) % 7 + 1; | 1947 return (dart.notNull(weekday) + 6) % 7 + 1; |
2154 } | 1948 } |
2155 static valueFromDateString(str) { | 1949 static valueFromDateString(str) { |
2156 if (!(typeof str == 'string')) | 1950 if (!(typeof str == 'string')) |
2157 throw new core.ArgumentError(str); | 1951 throw new core.ArgumentError(str); |
2158 let value = Date.parse(str); | 1952 let value = Date.parse(str); |
2159 if (value.isNaN) | 1953 if (value[dartx.isNaN]) |
2160 throw new core.ArgumentError(str); | 1954 throw new core.ArgumentError(str); |
2161 return value; | 1955 return value; |
2162 } | 1956 } |
2163 static getProperty(object, key) { | 1957 static getProperty(object, key) { |
2164 if (dart.notNull(object == null) || typeof object == 'boolean' || dart.is(
object, core.num) || typeof object == 'string') { | 1958 if (dart.notNull(object == null) || typeof object == 'boolean' || dart.is(
object, core.num) || typeof object == 'string') { |
2165 throw new core.ArgumentError(object); | 1959 throw new core.ArgumentError(object); |
2166 } | 1960 } |
2167 return object[key]; | 1961 return object[key]; |
2168 } | 1962 } |
2169 static setProperty(object, key, value) { | 1963 static setProperty(object, key, value) { |
2170 if (dart.notNull(object == null) || typeof object == 'boolean' || dart.is(
object, core.num) || typeof object == 'string') { | 1964 if (dart.notNull(object == null) || typeof object == 'boolean' || dart.is(
object, core.num) || typeof object == 'string') { |
2171 throw new core.ArgumentError(object); | 1965 throw new core.ArgumentError(object); |
2172 } | 1966 } |
2173 object[key] = value; | 1967 object[key] = value; |
2174 } | 1968 } |
2175 static functionNoSuchMethod(func, positionalArguments, namedArguments) { | 1969 static functionNoSuchMethod(func, positionalArguments, namedArguments) { |
2176 let argumentCount = 0; | 1970 let argumentCount = 0; |
2177 let arguments$ = []; | 1971 let arguments$ = []; |
2178 let namedArgumentList = []; | 1972 let namedArgumentList = []; |
2179 if (positionalArguments != null) { | 1973 if (positionalArguments != null) { |
2180 argumentCount = dart.notNull(argumentCount) + dart.notNull(positionalArg
uments[core.$length]); | 1974 argumentCount = dart.notNull(argumentCount) + dart.notNull(positionalArg
uments.length); |
2181 arguments$[core.$addAll](positionalArguments); | 1975 arguments$[dartx.addAll](positionalArguments); |
2182 } | 1976 } |
2183 let names = ''; | 1977 let names = ''; |
2184 if (dart.notNull(namedArguments != null) && !dart.notNull(namedArguments.i
sEmpty)) { | 1978 if (dart.notNull(namedArguments != null) && !dart.notNull(namedArguments.i
sEmpty)) { |
2185 namedArguments.forEach(dart.fn((name, argument) => { | 1979 namedArguments.forEach(dart.fn((name, argument) => { |
2186 names = `${names}$${name}`; | 1980 names = `${names}$${name}`; |
2187 namedArgumentList[core.$add](name); | 1981 namedArgumentList[dartx.add](name); |
2188 arguments$[core.$add](argument); | 1982 arguments$[dartx.add](argument); |
2189 argumentCount = dart.notNull(argumentCount) + 1; | 1983 argumentCount = dart.notNull(argumentCount) + 1; |
2190 }, core.Object, [core.String, core.Object])); | 1984 }, core.Object, [core.String, core.Object])); |
2191 } | 1985 } |
2192 let selectorName = `${_foreign_helper.JS_GET_NAME("CALL_PREFIX")}$${argume
ntCount}${names}`; | 1986 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)); | 1987 return dart.dsend(func, 'noSuchMethod', createUnmangledInvocationMirror(da
rt.const(new core.Symbol('call')), selectorName, JSInvocationMirror.METHOD, argu
ments$, namedArgumentList)); |
2194 } | 1988 } |
2195 static applyFunction(func, positionalArguments, namedArguments) { | 1989 static applyFunction(func, positionalArguments, namedArguments) { |
2196 return namedArguments == null ? Primitives.applyFunctionWithPositionalArgu
ments(func, positionalArguments) : Primitives.applyFunctionWithNamedArguments(fu
nc, positionalArguments, namedArguments); | 1990 return namedArguments == null ? Primitives.applyFunctionWithPositionalArgu
ments(func, positionalArguments) : Primitives.applyFunctionWithNamedArguments(fu
nc, positionalArguments, namedArguments); |
2197 } | 1991 } |
2198 static applyFunctionWithPositionalArguments(func, positionalArguments) { | 1992 static applyFunctionWithPositionalArguments(func, positionalArguments) { |
(...skipping 27 matching lines...) Expand all Loading... |
2226 } | 2020 } |
2227 let info = ReflectionInfo.new(jsFunction); | 2021 let info = ReflectionInfo.new(jsFunction); |
2228 if (dart.notNull(info == null) || !dart.notNull(info.areOptionalParameters
Named)) { | 2022 if (dart.notNull(info == null) || !dart.notNull(info.areOptionalParameters
Named)) { |
2229 return Primitives.functionNoSuchMethod(func, positionalArguments, namedA
rguments); | 2023 return Primitives.functionNoSuchMethod(func, positionalArguments, namedA
rguments); |
2230 } | 2024 } |
2231 if (positionalArguments != null) { | 2025 if (positionalArguments != null) { |
2232 positionalArguments = core.List.from(positionalArguments); | 2026 positionalArguments = core.List.from(positionalArguments); |
2233 } else { | 2027 } else { |
2234 positionalArguments = []; | 2028 positionalArguments = []; |
2235 } | 2029 } |
2236 if (info.requiredParameterCount != positionalArguments[core.$length]) { | 2030 if (info.requiredParameterCount != positionalArguments.length) { |
2237 return Primitives.functionNoSuchMethod(func, positionalArguments, namedA
rguments); | 2031 return Primitives.functionNoSuchMethod(func, positionalArguments, namedA
rguments); |
2238 } | 2032 } |
2239 let defaultArguments = core.Map.new(); | 2033 let defaultArguments = core.Map.new(); |
2240 for (let i = 0; dart.notNull(i) < dart.notNull(info.optionalParameterCount
); i = dart.notNull(i) + 1) { | 2034 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); | 2035 let index = dart.notNull(i) + dart.notNull(info.requiredParameterCount); |
2242 let parameterName = info.parameterNameInOrder(index); | 2036 let parameterName = info.parameterNameInOrder(index); |
2243 let value = info.defaultValueInOrder(index); | 2037 let value = info.defaultValueInOrder(index); |
2244 let defaultValue = getMetadata(value); | 2038 let defaultValue = getMetadata(value); |
2245 defaultArguments.set(parameterName, defaultValue); | 2039 defaultArguments.set(parameterName, defaultValue); |
2246 } | 2040 } |
2247 let bad = false; | 2041 let bad = false; |
2248 namedArguments.forEach(dart.fn((parameter, value) => { | 2042 namedArguments.forEach(dart.fn((parameter, value) => { |
2249 if (defaultArguments.containsKey(parameter)) { | 2043 if (defaultArguments.containsKey(parameter)) { |
2250 defaultArguments.set(parameter, value); | 2044 defaultArguments.set(parameter, value); |
2251 } else { | 2045 } else { |
2252 bad = true; | 2046 bad = true; |
2253 } | 2047 } |
2254 }, core.Object, [core.String, core.Object])); | 2048 }, core.Object, [core.String, core.Object])); |
2255 if (bad) { | 2049 if (bad) { |
2256 return Primitives.functionNoSuchMethod(func, positionalArguments, namedA
rguments); | 2050 return Primitives.functionNoSuchMethod(func, positionalArguments, namedA
rguments); |
2257 } | 2051 } |
2258 positionalArguments[core.$addAll](defaultArguments.values); | 2052 positionalArguments[dartx.addAll](defaultArguments.values); |
2259 return jsFunction.apply(func, positionalArguments); | 2053 return jsFunction.apply(func, positionalArguments); |
2260 } | 2054 } |
2261 static _mangledNameMatchesType(mangledName, type) { | 2055 static _mangledNameMatchesType(mangledName, type) { |
2262 return mangledName == type[_typeName]; | 2056 return mangledName == type[_typeName]; |
2263 } | 2057 } |
2264 static identicalImplementation(a, b) { | 2058 static identicalImplementation(a, b) { |
2265 return a == null ? b == null : a === b; | 2059 return a == null ? b == null : a === b; |
2266 } | 2060 } |
2267 static extractStackTrace(error) { | 2061 static extractStackTrace(error) { |
2268 return getTraceFromException(error.$thrownJsError); | 2062 return getTraceFromException(error.$thrownJsError); |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2491 toString: function() { | 2285 toString: function() { |
2492 return "$receiver$"; | 2286 return "$receiver$"; |
2493 } | 2287 } |
2494 }; | 2288 }; |
2495 } | 2289 } |
2496 static extractPattern(message) { | 2290 static extractPattern(message) { |
2497 message = message.replace(String({}), '$receiver$'); | 2291 message = message.replace(String({}), '$receiver$'); |
2498 message = message.replace(new RegExp(ESCAPE_REGEXP, 'g'), '\\$&'); | 2292 message = message.replace(new RegExp(ESCAPE_REGEXP, 'g'), '\\$&'); |
2499 let match = dart.as(message.match(/\\\$[a-zA-Z]+\\\$/g), core.List$(core.S
tring)); | 2293 let match = dart.as(message.match(/\\\$[a-zA-Z]+\\\$/g), core.List$(core.S
tring)); |
2500 if (match == null) | 2294 if (match == null) |
2501 match = dart.setType([], core.List$(core.String)); | 2295 match = dart.list([], core.String); |
2502 let arguments$ = match.indexOf('\\$arguments\\$'); | 2296 let arguments$ = match.indexOf('\\$arguments\\$'); |
2503 let argumentsExpr = match.indexOf('\\$argumentsExpr\\$'); | 2297 let argumentsExpr = match.indexOf('\\$argumentsExpr\\$'); |
2504 let expr = match.indexOf('\\$expr\\$'); | 2298 let expr = match.indexOf('\\$expr\\$'); |
2505 let method = match.indexOf('\\$method\\$'); | 2299 let method = match.indexOf('\\$method\\$'); |
2506 let receiver = match.indexOf('\\$receiver\\$'); | 2300 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])*)
'); | 2301 let pattern = message.replace('\\$arguments\\$', '((?:x|[^x])*)').replace(
'\\$argumentsExpr\\$', '((?:x|[^x])*)').replace('\\$expr\\$', '((?:x|[^x])*)').r
eplace('\\$method\\$', '((?:x|[^x])*)').replace('\\$receiver\\$', '((?:x|[^x])*)
'); |
2508 return new TypeErrorDecoder(arguments$, argumentsExpr, expr, method, recei
ver, pattern); | 2302 return new TypeErrorDecoder(arguments$, argumentsExpr, expr, method, recei
ver, pattern); |
2509 } | 2303 } |
2510 static provokeCallErrorOn(expression) { | 2304 static provokeCallErrorOn(expression) { |
2511 let func = function($expr$) { | 2305 let func = function($expr$) { |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2661 JsNoSuchMethodError[dart.implements] = () => [core.NoSuchMethodError]; | 2455 JsNoSuchMethodError[dart.implements] = () => [core.NoSuchMethodError]; |
2662 dart.setSignature(JsNoSuchMethodError, { | 2456 dart.setSignature(JsNoSuchMethodError, { |
2663 constructors: () => ({JsNoSuchMethodError: [JsNoSuchMethodError, [core.Strin
g, core.Object]]}) | 2457 constructors: () => ({JsNoSuchMethodError: [JsNoSuchMethodError, [core.Strin
g, core.Object]]}) |
2664 }); | 2458 }); |
2665 class UnknownJsTypeError extends core.Error { | 2459 class UnknownJsTypeError extends core.Error { |
2666 UnknownJsTypeError(message) { | 2460 UnknownJsTypeError(message) { |
2667 this[_message] = message; | 2461 this[_message] = message; |
2668 super.Error(); | 2462 super.Error(); |
2669 } | 2463 } |
2670 toString() { | 2464 toString() { |
2671 return this[_message].isEmpty ? 'Error' : `Error: ${this[_message]}`; | 2465 return this[_message][dartx.isEmpty] ? 'Error' : `Error: ${this[_message]}
`; |
2672 } | 2466 } |
2673 } | 2467 } |
2674 dart.setSignature(UnknownJsTypeError, { | 2468 dart.setSignature(UnknownJsTypeError, { |
2675 constructors: () => ({UnknownJsTypeError: [UnknownJsTypeError, [core.String]
]}) | 2469 constructors: () => ({UnknownJsTypeError: [UnknownJsTypeError, [core.String]
]}) |
2676 }); | 2470 }); |
2677 function unwrapException(ex) { | 2471 function unwrapException(ex) { |
2678 let saveStackTrace = error => { | 2472 let saveStackTrace = error => { |
2679 if (dart.is(error, core.Error)) { | 2473 if (dart.is(error, core.Error)) { |
2680 let thrownStackTrace = error.$thrownJsError; | 2474 let thrownStackTrace = error.$thrownJsError; |
2681 if (thrownStackTrace == null) { | 2475 if (thrownStackTrace == null) { |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2872 signatureFunction = function(f, r) { | 2666 signatureFunction = function(f, r) { |
2873 return function() { | 2667 return function() { |
2874 return f.apply({$receiver: r(this)}, arguments$); | 2668 return f.apply({$receiver: r(this)}, arguments$); |
2875 }; | 2669 }; |
2876 }(functionType, getReceiver); | 2670 }(functionType, getReceiver); |
2877 } else { | 2671 } else { |
2878 throw 'Error in reflectionInfo.'; | 2672 throw 'Error in reflectionInfo.'; |
2879 } | 2673 } |
2880 prototype[_foreign_helper.JS_SIGNATURE_NAME()] = signatureFunction; | 2674 prototype[_foreign_helper.JS_SIGNATURE_NAME()] = signatureFunction; |
2881 prototype[callName] = trampoline; | 2675 prototype[callName] = trampoline; |
2882 for (let i = 1; dart.notNull(i) < dart.notNull(functions[core.$length]); i
= dart.notNull(i) + 1) { | 2676 for (let i = 1; dart.notNull(i) < dart.notNull(functions.length); i = dart
.notNull(i) + 1) { |
2883 let stub = functions[core.$get](i); | 2677 let stub = functions[dartx.get](i); |
2884 let stubCallName = stub.$callName; | 2678 let stubCallName = stub.$callName; |
2885 if (stubCallName != null) { | 2679 if (stubCallName != null) { |
2886 prototype[stubCallName] = isStatic ? stub : Closure.forwardCallTo(rece
iver, stub, isIntercepted); | 2680 prototype[stubCallName] = isStatic ? stub : Closure.forwardCallTo(rece
iver, stub, isIntercepted); |
2887 } | 2681 } |
2888 } | 2682 } |
2889 prototype["call*"] = trampoline; | 2683 prototype["call*"] = trampoline; |
2890 return constructor; | 2684 return constructor; |
2891 } | 2685 } |
2892 static cspForwardCall(arity, isSuperCall, stubName, func) { | 2686 static cspForwardCall(arity, isSuperCall, stubName, func) { |
2893 let getSelf = _foreign_helper.RAW_DART_FUNCTION_REF(BoundClosure.selfOf); | 2687 let getSelf = _foreign_helper.RAW_DART_FUNCTION_REF(BoundClosure.selfOf); |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3156 } | 2950 } |
3157 static receiverFieldName() { | 2951 static receiverFieldName() { |
3158 if (BoundClosure.receiverFieldNameCache == null) { | 2952 if (BoundClosure.receiverFieldNameCache == null) { |
3159 BoundClosure.receiverFieldNameCache = BoundClosure.computeFieldNamed('re
ceiver'); | 2953 BoundClosure.receiverFieldNameCache = BoundClosure.computeFieldNamed('re
ceiver'); |
3160 } | 2954 } |
3161 return BoundClosure.receiverFieldNameCache; | 2955 return BoundClosure.receiverFieldNameCache; |
3162 } | 2956 } |
3163 static computeFieldNamed(fieldName) { | 2957 static computeFieldNamed(fieldName) { |
3164 let template = new BoundClosure('self', 'target', 'receiver', 'name'); | 2958 let template = new BoundClosure('self', 'target', 'receiver', 'name'); |
3165 let names = _interceptors.JSArray.markFixedList(dart.as(Object.getOwnPrope
rtyNames(template), core.List)); | 2959 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) { | 2960 for (let i = 0; dart.notNull(i) < dart.notNull(names.length); i = dart.not
Null(i) + 1) { |
3167 let name = names[core.$get](i); | 2961 let name = names[dartx.get](i); |
3168 if (template[name] === fieldName) { | 2962 if (template[name] === fieldName) { |
3169 return name; | 2963 return name; |
3170 } | 2964 } |
3171 } | 2965 } |
3172 } | 2966 } |
3173 } | 2967 } |
3174 dart.setSignature(BoundClosure, { | 2968 dart.setSignature(BoundClosure, { |
3175 constructors: () => ({BoundClosure: [BoundClosure, [core.Object, core.Object
, core.Object, core.String]]}), | 2969 constructors: () => ({BoundClosure: [BoundClosure, [core.Object, core.Object
, core.Object, core.String]]}), |
3176 statics: () => ({ | 2970 statics: () => ({ |
3177 selfOf: [core.Object, [BoundClosure]], | 2971 selfOf: [core.Object, [BoundClosure]], |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3473 throw new TypeErrorImplementation(value, 'void'); | 3267 throw new TypeErrorImplementation(value, 'void'); |
3474 } | 3268 } |
3475 dart.fn(voidTypeCheck); | 3269 dart.fn(voidTypeCheck); |
3476 function checkMalformedType(value, message) { | 3270 function checkMalformedType(value, message) { |
3477 if (value == null) | 3271 if (value == null) |
3478 return value; | 3272 return value; |
3479 throw new TypeErrorImplementation.fromMessage(dart.as(message, core.String))
; | 3273 throw new TypeErrorImplementation.fromMessage(dart.as(message, core.String))
; |
3480 } | 3274 } |
3481 dart.fn(checkMalformedType); | 3275 dart.fn(checkMalformedType); |
3482 function checkDeferredIsLoaded(loadId, uri) { | 3276 function checkDeferredIsLoaded(loadId, uri) { |
3483 if (!dart.notNull(exports._loadedLibraries[core.$contains](loadId))) { | 3277 if (!dart.notNull(exports._loadedLibraries.contains(loadId))) { |
3484 throw new DeferredNotLoadedError(uri); | 3278 throw new DeferredNotLoadedError(uri); |
3485 } | 3279 } |
3486 } | 3280 } |
3487 dart.fn(checkDeferredIsLoaded, dart.void, [core.String, core.String]); | 3281 dart.fn(checkDeferredIsLoaded, dart.void, [core.String, core.String]); |
3488 dart.defineLazyClass(exports, { | 3282 dart.defineLazyClass(exports, { |
3489 get JavaScriptIndexingBehavior() { | 3283 get JavaScriptIndexingBehavior() { |
3490 class JavaScriptIndexingBehavior extends _interceptors.JSMutableIndexable
{} | 3284 class JavaScriptIndexingBehavior extends _interceptors.JSMutableIndexable
{} |
3491 return JavaScriptIndexingBehavior; | 3285 return JavaScriptIndexingBehavior; |
3492 } | 3286 } |
3493 }); | 3287 }); |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3647 } | 3441 } |
3648 toRti() { | 3442 toRti() { |
3649 let result = {[_foreign_helper.JS_FUNCTION_TYPE_TAG()]: "dynafunc"}; | 3443 let result = {[_foreign_helper.JS_FUNCTION_TYPE_TAG()]: "dynafunc"}; |
3650 if (this.isVoid) { | 3444 if (this.isVoid) { |
3651 result[_foreign_helper.JS_FUNCTION_TYPE_VOID_RETURN_TAG()] = true; | 3445 result[_foreign_helper.JS_FUNCTION_TYPE_VOID_RETURN_TAG()] = true; |
3652 } else { | 3446 } else { |
3653 if (!dart.is(this.returnType, DynamicRuntimeType)) { | 3447 if (!dart.is(this.returnType, DynamicRuntimeType)) { |
3654 result[_foreign_helper.JS_FUNCTION_TYPE_RETURN_TYPE_TAG()] = this.retu
rnType.toRti(); | 3448 result[_foreign_helper.JS_FUNCTION_TYPE_RETURN_TYPE_TAG()] = this.retu
rnType.toRti(); |
3655 } | 3449 } |
3656 } | 3450 } |
3657 if (dart.notNull(this.parameterTypes != null) && !dart.notNull(this.parame
terTypes[core.$isEmpty])) { | 3451 if (dart.notNull(this.parameterTypes != null) && !dart.notNull(this.parame
terTypes[dartx.isEmpty])) { |
3658 result[_foreign_helper.JS_FUNCTION_TYPE_REQUIRED_PARAMETERS_TAG()] = Run
timeFunctionType.listToRti(this.parameterTypes); | 3452 result[_foreign_helper.JS_FUNCTION_TYPE_REQUIRED_PARAMETERS_TAG()] = Run
timeFunctionType.listToRti(this.parameterTypes); |
3659 } | 3453 } |
3660 if (dart.notNull(this.optionalParameterTypes != null) && !dart.notNull(thi
s.optionalParameterTypes[core.$isEmpty])) { | 3454 if (dart.notNull(this.optionalParameterTypes != null) && !dart.notNull(thi
s.optionalParameterTypes[dartx.isEmpty])) { |
3661 result[_foreign_helper.JS_FUNCTION_TYPE_OPTIONAL_PARAMETERS_TAG()] = Run
timeFunctionType.listToRti(this.optionalParameterTypes); | 3455 result[_foreign_helper.JS_FUNCTION_TYPE_OPTIONAL_PARAMETERS_TAG()] = Run
timeFunctionType.listToRti(this.optionalParameterTypes); |
3662 } | 3456 } |
3663 if (this.namedParameters != null) { | 3457 if (this.namedParameters != null) { |
3664 let namedRti = Object.create(null); | 3458 let namedRti = Object.create(null); |
3665 let keys = _js_names.extractKeys(this.namedParameters); | 3459 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) { | 3460 for (let i = 0; dart.notNull(i) < dart.notNull(keys.length); i = dart.no
tNull(i) + 1) { |
3667 let name = keys[core.$get](i); | 3461 let name = keys[dartx.get](i); |
3668 let rti = dart.dsend(this.namedParameters[name], 'toRti'); | 3462 let rti = dart.dsend(this.namedParameters[name], 'toRti'); |
3669 namedRti[name] = rti; | 3463 namedRti[name] = rti; |
3670 } | 3464 } |
3671 result[_foreign_helper.JS_FUNCTION_TYPE_NAMED_PARAMETERS_TAG()] = namedR
ti; | 3465 result[_foreign_helper.JS_FUNCTION_TYPE_NAMED_PARAMETERS_TAG()] = namedR
ti; |
3672 } | 3466 } |
3673 return result; | 3467 return result; |
3674 } | 3468 } |
3675 static listToRti(list) { | 3469 static listToRti(list) { |
3676 list = list; | 3470 list = list; |
3677 let result = []; | 3471 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) { | 3472 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')); | 3473 result.push(dart.dsend(dart.dindex(list, i), 'toRti')); |
3680 } | 3474 } |
3681 return result; | 3475 return result; |
3682 } | 3476 } |
3683 toString() { | 3477 toString() { |
3684 let result = '('; | 3478 let result = '('; |
3685 let needsComma = false; | 3479 let needsComma = false; |
3686 if (this.parameterTypes != null) { | 3480 if (this.parameterTypes != null) { |
3687 for (let i = 0; dart.notNull(i) < dart.notNull(this.parameterTypes[core.
$length]); i = dart.notNull(i) + 1) { | 3481 for (let i = 0; dart.notNull(i) < dart.notNull(this.parameterTypes.lengt
h); i = dart.notNull(i) + 1) { |
3688 let type = this.parameterTypes[core.$get](i); | 3482 let type = this.parameterTypes[dartx.get](i); |
3689 if (needsComma) { | 3483 if (needsComma) { |
3690 result = dart.notNull(result) + ', '; | 3484 result = dart.notNull(result) + ', '; |
3691 } | 3485 } |
3692 result = dart.notNull(result) + `${type}`; | 3486 result = dart.notNull(result) + `${type}`; |
3693 needsComma = true; | 3487 needsComma = true; |
3694 } | 3488 } |
3695 } | 3489 } |
3696 if (dart.notNull(this.optionalParameterTypes != null) && !dart.notNull(thi
s.optionalParameterTypes[core.$isEmpty])) { | 3490 if (dart.notNull(this.optionalParameterTypes != null) && !dart.notNull(thi
s.optionalParameterTypes[dartx.isEmpty])) { |
3697 if (needsComma) { | 3491 if (needsComma) { |
3698 result = dart.notNull(result) + ', '; | 3492 result = dart.notNull(result) + ', '; |
3699 } | 3493 } |
3700 needsComma = false; | 3494 needsComma = false; |
3701 result = dart.notNull(result) + '['; | 3495 result = dart.notNull(result) + '['; |
3702 for (let i = 0; dart.notNull(i) < dart.notNull(this.optionalParameterTyp
es[core.$length]); i = dart.notNull(i) + 1) { | 3496 for (let i = 0; dart.notNull(i) < dart.notNull(this.optionalParameterTyp
es.length); i = dart.notNull(i) + 1) { |
3703 let type = this.optionalParameterTypes[core.$get](i); | 3497 let type = this.optionalParameterTypes[dartx.get](i); |
3704 if (needsComma) { | 3498 if (needsComma) { |
3705 result = dart.notNull(result) + ', '; | 3499 result = dart.notNull(result) + ', '; |
3706 } | 3500 } |
3707 result = dart.notNull(result) + `${type}`; | 3501 result = dart.notNull(result) + `${type}`; |
3708 needsComma = true; | 3502 needsComma = true; |
3709 } | 3503 } |
3710 result = dart.notNull(result) + ']'; | 3504 result = dart.notNull(result) + ']'; |
3711 } else if (this.namedParameters != null) { | 3505 } else if (this.namedParameters != null) { |
3712 if (needsComma) { | 3506 if (needsComma) { |
3713 result = dart.notNull(result) + ', '; | 3507 result = dart.notNull(result) + ', '; |
3714 } | 3508 } |
3715 needsComma = false; | 3509 needsComma = false; |
3716 result = dart.notNull(result) + '{'; | 3510 result = dart.notNull(result) + '{'; |
3717 let keys = _js_names.extractKeys(this.namedParameters); | 3511 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) { | 3512 for (let i = 0; dart.notNull(i) < dart.notNull(keys.length); i = dart.no
tNull(i) + 1) { |
3719 let name = keys[core.$get](i); | 3513 let name = keys[dartx.get](i); |
3720 if (needsComma) { | 3514 if (needsComma) { |
3721 result = dart.notNull(result) + ', '; | 3515 result = dart.notNull(result) + ', '; |
3722 } | 3516 } |
3723 let rti = dart.dsend(this.namedParameters[name], 'toRti'); | 3517 let rti = dart.dsend(this.namedParameters[name], 'toRti'); |
3724 result = dart.notNull(result) + `${rti} ${name}`; | 3518 result = dart.notNull(result) + `${rti} ${name}`; |
3725 needsComma = true; | 3519 needsComma = true; |
3726 } | 3520 } |
3727 result = dart.notNull(result) + '}'; | 3521 result = dart.notNull(result) + '}'; |
3728 } | 3522 } |
3729 result = dart.notNull(result) + `) -> ${this.returnType}`; | 3523 result = dart.notNull(result) + `) -> ${this.returnType}`; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3816 dart.dsend(dyn, _assertCheck, dyn2); | 3610 dart.dsend(dyn, _assertCheck, dyn2); |
3817 } | 3611 } |
3818 dart.fn(functionTypeTestMetaHelper); | 3612 dart.fn(functionTypeTestMetaHelper); |
3819 function convertRtiToRuntimeType(rti) { | 3613 function convertRtiToRuntimeType(rti) { |
3820 if (rti == null) { | 3614 if (rti == null) { |
3821 return getDynamicRuntimeType(); | 3615 return getDynamicRuntimeType(); |
3822 } else if (typeof rti == "function") { | 3616 } else if (typeof rti == "function") { |
3823 return new RuntimeTypePlain(rti.name); | 3617 return new RuntimeTypePlain(rti.name); |
3824 } else if (rti.constructor == Array) { | 3618 } else if (rti.constructor == Array) { |
3825 let list = dart.as(rti, core.List); | 3619 let list = dart.as(rti, core.List); |
3826 let name = list[core.$get](0).name; | 3620 let name = list[dartx.get](0).name; |
3827 let arguments$ = []; | 3621 let arguments$ = []; |
3828 for (let i = 1; dart.notNull(i) < dart.notNull(list[core.$length]); i = da
rt.notNull(i) + 1) { | 3622 for (let i = 1; dart.notNull(i) < dart.notNull(list.length); i = dart.notN
ull(i) + 1) { |
3829 arguments$[core.$add](convertRtiToRuntimeType(list[core.$get](i))); | 3623 arguments$[dartx.add](convertRtiToRuntimeType(list[dartx.get](i))); |
3830 } | 3624 } |
3831 return new RuntimeTypeGeneric(name, dart.as(arguments$, core.List$(Runtime
Type)), rti); | 3625 return new RuntimeTypeGeneric(name, dart.as(arguments$, core.List$(Runtime
Type)), rti); |
3832 } else if ("func" in rti) { | 3626 } else if ("func" in rti) { |
3833 return new FunctionTypeInfoDecoderRing(rti).toRuntimeType(); | 3627 return new FunctionTypeInfoDecoderRing(rti).toRuntimeType(); |
3834 } else { | 3628 } else { |
3835 throw new RuntimeError("Cannot convert " + `'${JSON.stringify(rti)}' to Ru
ntimeType.`); | 3629 throw new RuntimeError("Cannot convert " + `'${JSON.stringify(rti)}' to Ru
ntimeType.`); |
3836 } | 3630 } |
3837 } | 3631 } |
3838 dart.fn(convertRtiToRuntimeType, RuntimeType, [core.Object]); | 3632 dart.fn(convertRtiToRuntimeType, RuntimeType, [core.Object]); |
3839 class RuntimeTypePlain extends RuntimeType { | 3633 class RuntimeTypePlain extends RuntimeType { |
(...skipping 30 matching lines...) Expand all Loading... |
3870 let result = [allClasses[this.name]]; | 3664 let result = [allClasses[this.name]]; |
3871 if (dart.dindex(result, 0) == null) { | 3665 if (dart.dindex(result, 0) == null) { |
3872 throw `no type for '${this.name}<...>'`; | 3666 throw `no type for '${this.name}<...>'`; |
3873 } | 3667 } |
3874 for (let argument of this.arguments) { | 3668 for (let argument of this.arguments) { |
3875 result.push(argument.toRti()); | 3669 result.push(argument.toRti()); |
3876 } | 3670 } |
3877 return this.rti = result; | 3671 return this.rti = result; |
3878 } | 3672 } |
3879 toString() { | 3673 toString() { |
3880 return `${this.name}<${this.arguments[core.$join](", ")}>`; | 3674 return `${this.name}<${this.arguments[dartx.join](", ")}>`; |
3881 } | 3675 } |
3882 } | 3676 } |
3883 dart.setSignature(RuntimeTypeGeneric, { | 3677 dart.setSignature(RuntimeTypeGeneric, { |
3884 constructors: () => ({RuntimeTypeGeneric: [RuntimeTypeGeneric, [core.String,
core.List$(RuntimeType), core.Object]]}), | 3678 constructors: () => ({RuntimeTypeGeneric: [RuntimeTypeGeneric, [core.String,
core.List$(RuntimeType), core.Object]]}), |
3885 methods: () => ({toRti: [core.Object, []]}) | 3679 methods: () => ({toRti: [core.Object, []]}) |
3886 }); | 3680 }); |
3887 let _typeData = Symbol('_typeData'); | 3681 let _typeData = Symbol('_typeData'); |
3888 let _cachedToString = Symbol('_cachedToString'); | 3682 let _cachedToString = Symbol('_cachedToString'); |
3889 let _hasReturnType = Symbol('_hasReturnType'); | 3683 let _hasReturnType = Symbol('_hasReturnType'); |
3890 let _returnType = Symbol('_returnType'); | 3684 let _returnType = Symbol('_returnType'); |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4034 }); | 3828 }); |
4035 let DeferredLoadCallback = dart.typedef('DeferredLoadCallback', () => dart.fun
ctionType(dart.void, [])); | 3829 let DeferredLoadCallback = dart.typedef('DeferredLoadCallback', () => dart.fun
ctionType(dart.void, [])); |
4036 exports.deferredLoadHook = null; | 3830 exports.deferredLoadHook = null; |
4037 function loadDeferredLibrary(loadId) { | 3831 function loadDeferredLibrary(loadId) { |
4038 let urisMap = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names.DEFE
RRED_LIBRARY_URIS); | 3832 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)); | 3833 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); | 3834 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)); | 3835 let hashes = dart.as(hashesMap[loadId], core.List$(core.String)); |
4042 if (uris == null) | 3836 if (uris == null) |
4043 return async.Future$(core.Null).value(null); | 3837 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])); | 3838 let indices = core.List$(core.int).generate(uris.length, dart.fn(i => dart.a
s(i, core.int), core.int, [core.Object])); |
4045 let isHunkLoaded = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names
.IS_HUNK_LOADED); | 3839 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); | 3840 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](); | 3841 let indicesToLoad = indices[dartx.where](dart.fn(i => !isHunkLoaded(hashes[d
artx.get](i)), core.bool, [core.int]))[dartx.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(_ => { | 3842 return dart.as(async.Future.wait(dart.as(indicesToLoad[dartx.map](dart.fn(i
=> _loadHunk(uris[dartx.get](i)), async.Future$(core.Null), [core.int])), core.I
terable$(async.Future))).then(dart.fn(_ => { |
4049 let indicesToInitialize = indices[core.$where](dart.fn(i => !isHunkInitial
ized(hashes[core.$get](i)), core.bool, [core.int]))[core.$toList](); | 3843 let indicesToInitialize = indices[dartx.where](dart.fn(i => !isHunkInitial
ized(hashes[dartx.get](i)), core.bool, [core.int]))[dartx.toList](); |
4050 for (let i of indicesToInitialize) { | 3844 for (let i of indicesToInitialize) { |
4051 let initializer = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_na
mes.INITIALIZE_LOADED_HUNK); | 3845 let initializer = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_na
mes.INITIALIZE_LOADED_HUNK); |
4052 initializer(hashes[core.$get](i)); | 3846 initializer(hashes[dartx.get](i)); |
4053 } | 3847 } |
4054 let updated = exports._loadedLibraries.add(loadId); | 3848 let updated = exports._loadedLibraries.add(loadId); |
4055 if (dart.notNull(updated) && dart.notNull(exports.deferredLoadHook != null
)) { | 3849 if (dart.notNull(updated) && dart.notNull(exports.deferredLoadHook != null
)) { |
4056 exports.deferredLoadHook(); | 3850 exports.deferredLoadHook(); |
4057 } | 3851 } |
4058 })), async.Future$(core.Null)); | 3852 })), async.Future$(core.Null)); |
4059 } | 3853 } |
4060 dart.fn(loadDeferredLibrary, async.Future$(core.Null), [core.String]); | 3854 dart.fn(loadDeferredLibrary, async.Future$(core.Null), [core.String]); |
4061 function _loadHunk(hunkName) { | 3855 function _loadHunk(hunkName) { |
4062 let future = exports._loadingLibraries.get(hunkName); | 3856 let future = exports._loadingLibraries.get(hunkName); |
4063 if (future != null) { | 3857 if (future != null) { |
4064 return dart.as(future.then(dart.fn(_ => null, dart.bottom, [core.Object]))
, async.Future$(core.Null)); | 3858 return dart.as(future.then(dart.fn(_ => null, dart.bottom, [core.Object]))
, async.Future$(core.Null)); |
4065 } | 3859 } |
4066 let uri = _isolate_helper.IsolateNatives.thisScript; | 3860 let uri = _isolate_helper.IsolateNatives.thisScript; |
4067 let index = uri.lastIndexOf('/'); | 3861 let index = uri[dartx.lastIndexOf]('/'); |
4068 uri = `${uri.substring(0, dart.notNull(index) + 1)}${hunkName}`; | 3862 uri = `${uri[dartx.substring](0, dart.notNull(index) + 1)}${hunkName}`; |
4069 if (dart.notNull(Primitives.isJsshell) || dart.notNull(Primitives.isD8)) { | 3863 if (dart.notNull(Primitives.isJsshell) || dart.notNull(Primitives.isD8)) { |
4070 return exports._loadingLibraries.set(hunkName, async.Future$(core.Null).ne
w(dart.fn(() => { | 3864 return exports._loadingLibraries.set(hunkName, async.Future$(core.Null).ne
w(dart.fn(() => { |
4071 try { | 3865 try { |
4072 new Function(`load("${uri}")`)(); | 3866 new Function(`load("${uri}")`)(); |
4073 } catch (error) { | 3867 } catch (error) { |
4074 let stackTrace = dart.stackTrace(error); | 3868 let stackTrace = dart.stackTrace(error); |
4075 throw new async.DeferredLoadException(`Loading ${uri} failed.`); | 3869 throw new async.DeferredLoadException(`Loading ${uri} failed.`); |
4076 } | 3870 } |
4077 | 3871 |
4078 return null; | 3872 return null; |
4079 }))); | 3873 }))); |
4080 } else if (_isolate_helper.isWorker()) { | 3874 } else if (_isolate_helper.isWorker()) { |
4081 return exports._loadingLibraries.set(hunkName, async.Future$(core.Null).ne
w(dart.fn(() => { | 3875 return exports._loadingLibraries.set(hunkName, async.Future$(core.Null).ne
w(dart.fn(() => { |
4082 let completer = async.Completer$(core.Null).new(); | 3876 let completer = async.Completer$(core.Null).new(); |
4083 _isolate_helper.enterJsAsync(); | 3877 _isolate_helper.enterJsAsync(); |
4084 let leavingFuture = dart.as(completer.future.whenComplete(dart.fn(() =>
{ | 3878 let leavingFuture = dart.as(completer.future.whenComplete(dart.fn(() =>
{ |
4085 _isolate_helper.leaveJsAsync(); | 3879 _isolate_helper.leaveJsAsync(); |
4086 })), async.Future$(core.Null)); | 3880 })), async.Future$(core.Null)); |
4087 let index = uri.lastIndexOf('/'); | 3881 let index = uri[dartx.lastIndexOf]('/'); |
4088 uri = `${uri.substring(0, dart.notNull(index) + 1)}${hunkName}`; | 3882 uri = `${uri[dartx.substring](0, dart.notNull(index) + 1)}${hunkName}`; |
4089 let xhr = new XMLHttpRequest(); | 3883 let xhr = new XMLHttpRequest(); |
4090 xhr.open("GET", uri); | 3884 xhr.open("GET", uri); |
4091 xhr.addEventListener("load", convertDartClosureToJS(dart.fn(event => { | 3885 xhr.addEventListener("load", convertDartClosureToJS(dart.fn(event => { |
4092 if (xhr.status != 200) { | 3886 if (xhr.status != 200) { |
4093 completer.completeError(new async.DeferredLoadException(`Loading ${u
ri} failed.`)); | 3887 completer.completeError(new async.DeferredLoadException(`Loading ${u
ri} failed.`)); |
4094 return; | 3888 return; |
4095 } | 3889 } |
4096 let code = xhr.responseText; | 3890 let code = xhr.responseText; |
4097 try { | 3891 try { |
4098 new Function(code)(); | 3892 new Function(code)(); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4153 function mainHasTooManyParameters() { | 3947 function mainHasTooManyParameters() { |
4154 throw new MainError("'main' expects too many parameters."); | 3948 throw new MainError("'main' expects too many parameters."); |
4155 } | 3949 } |
4156 dart.fn(mainHasTooManyParameters, dart.void, []); | 3950 dart.fn(mainHasTooManyParameters, dart.void, []); |
4157 // Exports: | 3951 // Exports: |
4158 exports.NoSideEffects = NoSideEffects; | 3952 exports.NoSideEffects = NoSideEffects; |
4159 exports.NoThrows = NoThrows; | 3953 exports.NoThrows = NoThrows; |
4160 exports.NoInline = NoInline; | 3954 exports.NoInline = NoInline; |
4161 exports.IrRepresentation = IrRepresentation; | 3955 exports.IrRepresentation = IrRepresentation; |
4162 exports.Native = Native; | 3956 exports.Native = Native; |
| 3957 exports.JsName = JsName; |
| 3958 exports.JsPeerInterface = JsPeerInterface; |
| 3959 exports.SupportJsExtensionMethod = SupportJsExtensionMethod; |
4163 exports.ConstantMap$ = ConstantMap$; | 3960 exports.ConstantMap$ = ConstantMap$; |
4164 exports.ConstantMap = ConstantMap; | 3961 exports.ConstantMap = ConstantMap; |
4165 exports.ConstantStringMap$ = ConstantStringMap$; | 3962 exports.ConstantStringMap$ = ConstantStringMap$; |
4166 exports.ConstantStringMap = ConstantStringMap; | 3963 exports.ConstantStringMap = ConstantStringMap; |
4167 exports.ConstantProtoMap$ = ConstantProtoMap$; | 3964 exports.ConstantProtoMap$ = ConstantProtoMap$; |
4168 exports.ConstantProtoMap = ConstantProtoMap; | 3965 exports.ConstantProtoMap = ConstantProtoMap; |
4169 exports.GeneralConstantMap$ = GeneralConstantMap$; | 3966 exports.GeneralConstantMap$ = GeneralConstantMap$; |
4170 exports.GeneralConstantMap = GeneralConstantMap; | 3967 exports.GeneralConstantMap = GeneralConstantMap; |
4171 exports.contains = contains; | 3968 exports.contains = contains; |
4172 exports.arrayLength = arrayLength; | 3969 exports.arrayLength = arrayLength; |
4173 exports.arrayGet = arrayGet; | 3970 exports.arrayGet = arrayGet; |
4174 exports.arraySet = arraySet; | 3971 exports.arraySet = arraySet; |
4175 exports.propertyGet = propertyGet; | 3972 exports.propertyGet = propertyGet; |
4176 exports.callHasOwnProperty = callHasOwnProperty; | 3973 exports.callHasOwnProperty = callHasOwnProperty; |
4177 exports.propertySet = propertySet; | 3974 exports.propertySet = propertySet; |
4178 exports.getPropertyFromPrototype = getPropertyFromPrototype; | 3975 exports.getPropertyFromPrototype = getPropertyFromPrototype; |
4179 exports.toStringForNativeObject = toStringForNativeObject; | |
4180 exports.hashCodeForNativeObject = hashCodeForNativeObject; | |
4181 exports.defineProperty = defineProperty; | 3976 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; | |
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; | |
4199 exports.initNativeDispatchContinue = initNativeDispatchContinue; | |
4200 exports.initHooks = initHooks; | |
4201 exports.applyHooksTransformer = applyHooksTransformer; | |
4202 exports.regExpGetNative = regExpGetNative; | 3977 exports.regExpGetNative = regExpGetNative; |
4203 exports.regExpGetGlobalNative = regExpGetGlobalNative; | 3978 exports.regExpGetGlobalNative = regExpGetGlobalNative; |
4204 exports.regExpCaptureCount = regExpCaptureCount; | 3979 exports.regExpCaptureCount = regExpCaptureCount; |
4205 exports.JSSyntaxRegExp = JSSyntaxRegExp; | 3980 exports.JSSyntaxRegExp = JSSyntaxRegExp; |
4206 exports.firstMatchAfter = firstMatchAfter; | 3981 exports.firstMatchAfter = firstMatchAfter; |
4207 exports.StringMatch = StringMatch; | 3982 exports.StringMatch = StringMatch; |
4208 exports.allMatchesInStringUnchecked = allMatchesInStringUnchecked; | 3983 exports.allMatchesInStringUnchecked = allMatchesInStringUnchecked; |
4209 exports.stringContainsUnchecked = stringContainsUnchecked; | 3984 exports.stringContainsUnchecked = stringContainsUnchecked; |
4210 exports.stringReplaceJS = stringReplaceJS; | 3985 exports.stringReplaceJS = stringReplaceJS; |
4211 exports.stringReplaceFirstRE = stringReplaceFirstRE; | 3986 exports.stringReplaceFirstRE = stringReplaceFirstRE; |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4264 exports.hasNoField = hasNoField; | 4039 exports.hasNoField = hasNoField; |
4265 exports.isJsFunction = isJsFunction; | 4040 exports.isJsFunction = isJsFunction; |
4266 exports.isJsObject = isJsObject; | 4041 exports.isJsObject = isJsObject; |
4267 exports.isIdentical = isIdentical; | 4042 exports.isIdentical = isIdentical; |
4268 exports.isNotIdentical = isNotIdentical; | 4043 exports.isNotIdentical = isNotIdentical; |
4269 exports.unmangleGlobalNameIfPreservedAnyways = unmangleGlobalNameIfPreservedAn
yways; | 4044 exports.unmangleGlobalNameIfPreservedAnyways = unmangleGlobalNameIfPreservedAn
yways; |
4270 exports.unmangleAllIdentifiersIfPreservedAnyways = unmangleAllIdentifiersIfPre
servedAnyways; | 4045 exports.unmangleAllIdentifiersIfPreservedAnyways = unmangleAllIdentifiersIfPre
servedAnyways; |
4271 exports.patch = patch; | 4046 exports.patch = patch; |
4272 exports.InternalMap = InternalMap; | 4047 exports.InternalMap = InternalMap; |
4273 exports.requiresPreamble = requiresPreamble; | 4048 exports.requiresPreamble = requiresPreamble; |
4274 exports.isJsIndexable = isJsIndexable; | |
4275 exports.S = S; | 4049 exports.S = S; |
4276 exports.createInvocationMirror = createInvocationMirror; | 4050 exports.createInvocationMirror = createInvocationMirror; |
4277 exports.createUnmangledInvocationMirror = createUnmangledInvocationMirror; | 4051 exports.createUnmangledInvocationMirror = createUnmangledInvocationMirror; |
4278 exports.throwInvalidReflectionError = throwInvalidReflectionError; | 4052 exports.throwInvalidReflectionError = throwInvalidReflectionError; |
4279 exports.traceHelper = traceHelper; | 4053 exports.traceHelper = traceHelper; |
4280 exports.JSInvocationMirror = JSInvocationMirror; | 4054 exports.JSInvocationMirror = JSInvocationMirror; |
4281 exports.CachedInvocation = CachedInvocation; | 4055 exports.CachedInvocation = CachedInvocation; |
4282 exports.CachedCatchAllInvocation = CachedCatchAllInvocation; | 4056 exports.CachedCatchAllInvocation = CachedCatchAllInvocation; |
4283 exports.CachedNoSuchMethodInvocation = CachedNoSuchMethodInvocation; | 4057 exports.CachedNoSuchMethodInvocation = CachedNoSuchMethodInvocation; |
4284 exports.ReflectionInfo = ReflectionInfo; | 4058 exports.ReflectionInfo = ReflectionInfo; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4379 exports.random64 = random64; | 4153 exports.random64 = random64; |
4380 exports.jsonEncodeNative = jsonEncodeNative; | 4154 exports.jsonEncodeNative = jsonEncodeNative; |
4381 exports.getIsolateAffinityTag = getIsolateAffinityTag; | 4155 exports.getIsolateAffinityTag = getIsolateAffinityTag; |
4382 exports.LoadLibraryFunctionType = LoadLibraryFunctionType; | 4156 exports.LoadLibraryFunctionType = LoadLibraryFunctionType; |
4383 exports.DeferredLoadCallback = DeferredLoadCallback; | 4157 exports.DeferredLoadCallback = DeferredLoadCallback; |
4384 exports.loadDeferredLibrary = loadDeferredLibrary; | 4158 exports.loadDeferredLibrary = loadDeferredLibrary; |
4385 exports.MainError = MainError; | 4159 exports.MainError = MainError; |
4386 exports.missingMain = missingMain; | 4160 exports.missingMain = missingMain; |
4387 exports.badMain = badMain; | 4161 exports.badMain = badMain; |
4388 exports.mainHasTooManyParameters = mainHasTooManyParameters; | 4162 exports.mainHasTooManyParameters = mainHasTooManyParameters; |
4389 })(_js_helper, core, collection, _internal, _foreign_helper, _js_embedded_names,
_interceptors, _js_names, async, _isolate_helper); | 4163 })(_js_helper, core, collection, _internal, _foreign_helper, _interceptors, _js_
names, _js_embedded_names, async, _isolate_helper); |
OLD | NEW |