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

Side by Side Diff: lib/runtime/dart/_js_helper.js

Issue 1138793002: Tag closures with their types (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Rebase Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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); 6 var _js_embedded_names = dart.import(_js_embedded_names);
7 var _interceptors = dart.lazyImport(_interceptors); 7 var _interceptors = dart.lazyImport(_interceptors);
8 var _js_names = dart.import(_js_names); 8 var _js_names = dart.import(_js_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, _js_embedded_na mes, _interceptors, _js_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 class NoThrows extends core.Object { 18 class NoThrows extends core.Object {
18 NoThrows() { 19 NoThrows() {
19 } 20 }
20 } 21 }
22 dart.setSignature(NoThrows, {});
21 class NoInline extends core.Object { 23 class NoInline extends core.Object {
22 NoInline() { 24 NoInline() {
23 } 25 }
24 } 26 }
27 dart.setSignature(NoInline, {});
25 class IrRepresentation extends core.Object { 28 class IrRepresentation extends core.Object {
26 IrRepresentation(value) { 29 IrRepresentation(value) {
27 this.value = value; 30 this.value = value;
28 } 31 }
29 } 32 }
33 dart.setSignature(IrRepresentation, {});
30 class Native extends core.Object { 34 class Native extends core.Object {
31 Native(name) { 35 Native(name) {
32 this.name = name; 36 this.name = name;
33 } 37 }
34 } 38 }
39 dart.setSignature(Native, {});
35 let _throwUnmodifiable = Symbol('_throwUnmodifiable'); 40 let _throwUnmodifiable = Symbol('_throwUnmodifiable');
36 let ConstantMap$ = dart.generic(function(K, V) { 41 let ConstantMap$ = dart.generic(function(K, V) {
37 class ConstantMap extends core.Object { 42 class ConstantMap extends core.Object {
38 _() { 43 _() {
39 } 44 }
40 get isEmpty() { 45 get isEmpty() {
41 return this.length == 0; 46 return this.length == 0;
42 } 47 }
43 get isNotEmpty() { 48 get isNotEmpty() {
44 return !dart.notNull(this.isEmpty); 49 return !dart.notNull(this.isEmpty);
(...skipping 20 matching lines...) Expand all
65 clear() { 70 clear() {
66 return this[_throwUnmodifiable](); 71 return this[_throwUnmodifiable]();
67 } 72 }
68 addAll(other) { 73 addAll(other) {
69 dart.as(other, core.Map$(K, V)); 74 dart.as(other, core.Map$(K, V));
70 return this[_throwUnmodifiable](); 75 return this[_throwUnmodifiable]();
71 } 76 }
72 } 77 }
73 ConstantMap[dart.implements] = () => [core.Map$(K, V)]; 78 ConstantMap[dart.implements] = () => [core.Map$(K, V)];
74 dart.defineNamedConstructor(ConstantMap, '_'); 79 dart.defineNamedConstructor(ConstantMap, '_');
80 dart.setSignature(ConstantMap, {
81 methods: () => ({
82 toString: dart.functionType(core.String, []),
83 [_throwUnmodifiable]: dart.functionType(dart.dynamic, []),
84 set: dart.functionType(dart.void, [K, V]),
85 putIfAbsent: dart.functionType(V, [K, dart.functionType(V, [])]),
86 remove: dart.functionType(V, [core.Object]),
87 clear: dart.functionType(dart.void, []),
88 addAll: dart.functionType(dart.void, [core.Map$(K, V)])
89 })
90 });
75 return ConstantMap; 91 return ConstantMap;
76 }); 92 });
77 let ConstantMap = ConstantMap$(); 93 let ConstantMap = ConstantMap$();
78 let _jsObject = Symbol('_jsObject'); 94 let _jsObject = Symbol('_jsObject');
79 let _keys = Symbol('_keys'); 95 let _keys = Symbol('_keys');
80 let _fetch = Symbol('_fetch'); 96 let _fetch = Symbol('_fetch');
81 let ConstantStringMap$ = dart.generic(function(K, V) { 97 let ConstantStringMap$ = dart.generic(function(K, V) {
82 class ConstantStringMap extends ConstantMap$(K, V) { 98 class ConstantStringMap extends ConstantMap$(K, V) {
83 _(length, jsObject, keys) { 99 _(length, jsObject, keys) {
84 this.length = length; 100 this.length = length;
85 this[_jsObject] = jsObject; 101 this[_jsObject] = jsObject;
86 this[_keys] = keys; 102 this[_keys] = keys;
87 super._(); 103 super._();
88 } 104 }
89 containsValue(needle) { 105 containsValue(needle) {
90 return this.values[core.$any](value => dart.equals(value, needle)); 106 return this.values[core.$any](dart.fn(value => dart.equals(value, needle ), core.bool, [V]));
91 } 107 }
92 containsKey(key) { 108 containsKey(key) {
93 if (!(typeof key == 'string')) 109 if (!(typeof key == 'string'))
94 return false; 110 return false;
95 if (dart.equals('__proto__', key)) 111 if (dart.equals('__proto__', key))
96 return false; 112 return false;
97 return jsHasOwnProperty(this[_jsObject], dart.as(key, core.String)); 113 return jsHasOwnProperty(this[_jsObject], dart.as(key, core.String));
98 } 114 }
99 get(key) { 115 get(key) {
100 if (!dart.notNull(this.containsKey(key))) 116 if (!dart.notNull(this.containsKey(key)))
101 return null; 117 return null;
102 return dart.as(this[_fetch](key), V); 118 return dart.as(this[_fetch](key), V);
103 } 119 }
104 [_fetch](key) { 120 [_fetch](key) {
105 return jsPropertyAccess(this[_jsObject], dart.as(key, core.String)); 121 return jsPropertyAccess(this[_jsObject], dart.as(key, core.String));
106 } 122 }
107 forEach(f) { 123 forEach(f) {
108 dart.as(f, dart.functionType(dart.void, [K, V])); 124 dart.as(f, dart.functionType(dart.void, [K, V]));
109 let keys = this[_keys]; 125 let keys = this[_keys];
110 for (let i = 0; i['<'](dart.dload(keys, 'length')); i = dart.notNull(i) + 1) { 126 for (let i = 0; i['<'](dart.dload(keys, 'length')); i = dart.notNull(i) + 1) {
111 let key = dart.dindex(keys, i); 127 let key = dart.dindex(keys, i);
112 f(dart.as(key, K), dart.as(this[_fetch](key), V)); 128 f(dart.as(key, K), dart.as(this[_fetch](key), V));
113 } 129 }
114 } 130 }
115 get keys() { 131 get keys() {
116 return new (_ConstantMapKeyIterable$(K))(this); 132 return new (_ConstantMapKeyIterable$(K))(this);
117 } 133 }
118 get values() { 134 get values() {
119 return new (_internal.MappedIterable$(K, V))(this[_keys], (key => dart.a s(this[_fetch](key), V)).bind(this)); 135 return new (_internal.MappedIterable$(K, V))(this[_keys], dart.fn((key = > dart.as(this[_fetch](key), V)).bind(this), V, [dart.dynamic]));
120 } 136 }
121 } 137 }
122 ConstantStringMap[dart.implements] = () => [_internal.EfficientLength]; 138 ConstantStringMap[dart.implements] = () => [_internal.EfficientLength];
123 dart.defineNamedConstructor(ConstantStringMap, '_'); 139 dart.defineNamedConstructor(ConstantStringMap, '_');
140 dart.setSignature(ConstantStringMap, {
141 methods: () => ({
142 containsValue: dart.functionType(core.bool, [core.Object]),
143 containsKey: dart.functionType(core.bool, [core.Object]),
144 get: dart.functionType(V, [core.Object]),
145 [_fetch]: dart.functionType(dart.dynamic, [dart.dynamic]),
146 forEach: dart.functionType(dart.void, [dart.functionType(dart.void, [K, V])])
147 })
148 });
124 return ConstantStringMap; 149 return ConstantStringMap;
125 }); 150 });
126 let ConstantStringMap = ConstantStringMap$(); 151 let ConstantStringMap = ConstantStringMap$();
127 let _protoValue = Symbol('_protoValue'); 152 let _protoValue = Symbol('_protoValue');
128 let ConstantProtoMap$ = dart.generic(function(K, V) { 153 let ConstantProtoMap$ = dart.generic(function(K, V) {
129 class ConstantProtoMap extends ConstantStringMap$(K, V) { 154 class ConstantProtoMap extends ConstantStringMap$(K, V) {
130 _(length, jsObject, keys, protoValue) { 155 _(length, jsObject, keys, protoValue) {
131 this[_protoValue] = protoValue; 156 this[_protoValue] = protoValue;
132 super._(dart.as(length, core.int), jsObject, dart.as(keys, core.List$(K) )); 157 super._(dart.as(length, core.int), jsObject, dart.as(keys, core.List$(K) ));
133 } 158 }
134 containsKey(key) { 159 containsKey(key) {
135 if (!(typeof key == 'string')) 160 if (!(typeof key == 'string'))
136 return false; 161 return false;
137 if (dart.equals('__proto__', key)) 162 if (dart.equals('__proto__', key))
138 return true; 163 return true;
139 return jsHasOwnProperty(this[_jsObject], dart.as(key, core.String)); 164 return jsHasOwnProperty(this[_jsObject], dart.as(key, core.String));
140 } 165 }
141 [_fetch](key) { 166 [_fetch](key) {
142 return dart.equals('__proto__', key) ? this[_protoValue] : jsPropertyAcc ess(this[_jsObject], dart.as(key, core.String)); 167 return dart.equals('__proto__', key) ? this[_protoValue] : jsPropertyAcc ess(this[_jsObject], dart.as(key, core.String));
143 } 168 }
144 } 169 }
145 dart.defineNamedConstructor(ConstantProtoMap, '_'); 170 dart.defineNamedConstructor(ConstantProtoMap, '_');
171 dart.setSignature(ConstantProtoMap, {
172 methods: () => ({
173 containsKey: dart.functionType(core.bool, [core.Object]),
174 [_fetch]: dart.functionType(dart.dynamic, [dart.dynamic])
175 })
176 });
146 return ConstantProtoMap; 177 return ConstantProtoMap;
147 }); 178 });
148 let ConstantProtoMap = ConstantProtoMap$(); 179 let ConstantProtoMap = ConstantProtoMap$();
149 let _map = Symbol('_map'); 180 let _map = Symbol('_map');
150 let _ConstantMapKeyIterable$ = dart.generic(function(K) { 181 let _ConstantMapKeyIterable$ = dart.generic(function(K) {
151 class _ConstantMapKeyIterable extends collection.IterableBase$(K) { 182 class _ConstantMapKeyIterable extends collection.IterableBase$(K) {
152 _ConstantMapKeyIterable(map) { 183 _ConstantMapKeyIterable(map) {
153 this[_map] = map; 184 this[_map] = map;
154 super.IterableBase(); 185 super.IterableBase();
155 } 186 }
156 get [core.$iterator]() { 187 get [core.$iterator]() {
157 return this[_map][_keys][core.$iterator]; 188 return this[_map][_keys][core.$iterator];
158 } 189 }
159 get [core.$length]() { 190 get [core.$length]() {
160 return this[_map][_keys][core.$length]; 191 return this[_map][_keys][core.$length];
161 } 192 }
162 } 193 }
194 dart.setSignature(_ConstantMapKeyIterable, {});
163 return _ConstantMapKeyIterable; 195 return _ConstantMapKeyIterable;
164 }); 196 });
165 let _ConstantMapKeyIterable = _ConstantMapKeyIterable$(); 197 let _ConstantMapKeyIterable = _ConstantMapKeyIterable$();
166 let _jsData = Symbol('_jsData'); 198 let _jsData = Symbol('_jsData');
167 let _getMap = Symbol('_getMap'); 199 let _getMap = Symbol('_getMap');
168 let GeneralConstantMap$ = dart.generic(function(K, V) { 200 let GeneralConstantMap$ = dart.generic(function(K, V) {
169 class GeneralConstantMap extends ConstantMap$(K, V) { 201 class GeneralConstantMap extends ConstantMap$(K, V) {
170 GeneralConstantMap(jsData) { 202 GeneralConstantMap(jsData) {
171 this[_jsData] = jsData; 203 this[_jsData] = jsData;
172 super._(); 204 super._();
(...skipping 21 matching lines...) Expand all
194 get keys() { 226 get keys() {
195 return this[_getMap]().keys; 227 return this[_getMap]().keys;
196 } 228 }
197 get values() { 229 get values() {
198 return this[_getMap]().values; 230 return this[_getMap]().values;
199 } 231 }
200 get length() { 232 get length() {
201 return this[_getMap]().length; 233 return this[_getMap]().length;
202 } 234 }
203 } 235 }
236 dart.setSignature(GeneralConstantMap, {
237 methods: () => ({
238 [_getMap]: dart.functionType(core.Map$(K, V), []),
239 containsValue: dart.functionType(core.bool, [core.Object]),
240 containsKey: dart.functionType(core.bool, [core.Object]),
241 get: dart.functionType(V, [core.Object]),
242 forEach: dart.functionType(dart.void, [dart.functionType(dart.void, [K, V])])
243 })
244 });
204 return GeneralConstantMap; 245 return GeneralConstantMap;
205 }); 246 });
206 let GeneralConstantMap = GeneralConstantMap$(); 247 let GeneralConstantMap = GeneralConstantMap$();
207 // Function contains: (String, String) → bool
208 function contains(userAgent, name) { 248 function contains(userAgent, name) {
209 return userAgent.indexOf(name) != -1; 249 return userAgent.indexOf(name) != -1;
210 } 250 }
211 // Function arrayLength: (List<dynamic>) → int 251 dart.fn(contains, core.bool, [core.String, core.String]);
212 function arrayLength(array) { 252 function arrayLength(array) {
213 return array.length; 253 return array.length;
214 } 254 }
215 // Function arrayGet: (List<dynamic>, int) → dynamic 255 dart.fn(arrayLength, core.int, [core.List]);
216 function arrayGet(array, index) { 256 function arrayGet(array, index) {
217 return array[index]; 257 return array[index];
218 } 258 }
219 // Function arraySet: (List<dynamic>, int, dynamic) → void 259 dart.fn(arrayGet, dart.dynamic, [core.List, core.int]);
220 function arraySet(array, index, value) { 260 function arraySet(array, index, value) {
221 array[index] = value; 261 array[index] = value;
222 } 262 }
223 // Function propertyGet: (dynamic, String) → dynamic 263 dart.fn(arraySet, dart.void, [core.List, core.int, dart.dynamic]);
224 function propertyGet(object, property) { 264 function propertyGet(object, property) {
225 return object[property]; 265 return object[property];
226 } 266 }
227 // Function callHasOwnProperty: (dynamic, dynamic, String) → bool 267 dart.fn(propertyGet, dart.dynamic, [dart.dynamic, core.String]);
228 function callHasOwnProperty(func, object, property) { 268 function callHasOwnProperty(func, object, property) {
229 return func.call(object, property); 269 return func.call(object, property);
230 } 270 }
231 // Function propertySet: (dynamic, String, dynamic) → void 271 dart.fn(callHasOwnProperty, core.bool, [dart.dynamic, dart.dynamic, core.Strin g]);
232 function propertySet(object, property, value) { 272 function propertySet(object, property, value) {
233 object[property] = value; 273 object[property] = value;
234 } 274 }
235 // Function getPropertyFromPrototype: (dynamic, String) → dynamic 275 dart.fn(propertySet, dart.void, [dart.dynamic, core.String, dart.dynamic]);
236 function getPropertyFromPrototype(object, name) { 276 function getPropertyFromPrototype(object, name) {
237 return Object.getPrototypeOf(object)[name]; 277 return Object.getPrototypeOf(object)[name];
238 } 278 }
279 dart.fn(getPropertyFromPrototype, dart.dynamic, [dart.dynamic, core.String]);
239 exports.getTagFunction = null; 280 exports.getTagFunction = null;
240 exports.alternateTagFunction = null; 281 exports.alternateTagFunction = null;
241 exports.prototypeForTagFunction = null; 282 exports.prototypeForTagFunction = null;
242 // Function toStringForNativeObject: (dynamic) → String
243 function toStringForNativeObject(obj) { 283 function toStringForNativeObject(obj) {
244 let name = exports.getTagFunction == null ? '<Unknown>' : dart.dcall(exports .getTagFunction, obj); 284 let name = exports.getTagFunction == null ? '<Unknown>' : dart.dcall(exports .getTagFunction, obj);
245 return `Instance of ${name}`; 285 return `Instance of ${name}`;
246 } 286 }
247 // Function hashCodeForNativeObject: (dynamic) → int 287 dart.fn(toStringForNativeObject, core.String, [dart.dynamic]);
248 function hashCodeForNativeObject(object) { 288 function hashCodeForNativeObject(object) {
249 return Primitives.objectHashCode(object); 289 return Primitives.objectHashCode(object);
250 } 290 }
251 // Function defineProperty: (dynamic, String, dynamic) → void 291 dart.fn(hashCodeForNativeObject, core.int, [dart.dynamic]);
252 function defineProperty(obj, property, value) { 292 function defineProperty(obj, property, value) {
253 Object.defineProperty(obj, property, {value: value, enumerable: false, writa ble: true, configurable: true}); 293 Object.defineProperty(obj, property, {value: value, enumerable: false, writa ble: true, configurable: true});
254 } 294 }
255 // Function isDartObject: (dynamic) → bool 295 dart.fn(defineProperty, dart.void, [dart.dynamic, core.String, dart.dynamic]);
256 function isDartObject(obj) { 296 function isDartObject(obj) {
257 return obj instanceof _foreign_helper.JS_DART_OBJECT_CONSTRUCTOR(); 297 return obj instanceof _foreign_helper.JS_DART_OBJECT_CONSTRUCTOR();
258 } 298 }
299 dart.fn(isDartObject, core.bool, [dart.dynamic]);
259 dart.copyProperties(exports, { 300 dart.copyProperties(exports, {
260 get interceptorsByTag() { 301 get interceptorsByTag() {
261 return _foreign_helper.JS_EMBEDDED_GLOBAL('=Object', _js_embedded_names.IN TERCEPTORS_BY_TAG); 302 return _foreign_helper.JS_EMBEDDED_GLOBAL('=Object', _js_embedded_names.IN TERCEPTORS_BY_TAG);
262 }, 303 },
263 get leafTags() { 304 get leafTags() {
264 return _foreign_helper.JS_EMBEDDED_GLOBAL('=Object', _js_embedded_names.LE AF_TAGS); 305 return _foreign_helper.JS_EMBEDDED_GLOBAL('=Object', _js_embedded_names.LE AF_TAGS);
265 } 306 }
266 }); 307 });
267 // Function findDispatchTagForInterceptorClass: (dynamic) → String
268 function findDispatchTagForInterceptorClass(interceptorClassConstructor) { 308 function findDispatchTagForInterceptorClass(interceptorClassConstructor) {
269 return dart.as(interceptorClassConstructor[_js_embedded_names.NATIVE_SUPERCL ASS_TAG_NAME], core.String); 309 return dart.as(interceptorClassConstructor[_js_embedded_names.NATIVE_SUPERCL ASS_TAG_NAME], core.String);
270 } 310 }
311 dart.fn(findDispatchTagForInterceptorClass, core.String, [dart.dynamic]);
271 exports.dispatchRecordsForInstanceTags = null; 312 exports.dispatchRecordsForInstanceTags = null;
272 exports.interceptorsForUncacheableTags = null; 313 exports.interceptorsForUncacheableTags = null;
273 // Function lookupInterceptor: (String) → dynamic
274 function lookupInterceptor(tag) { 314 function lookupInterceptor(tag) {
275 return propertyGet(exports.interceptorsByTag, tag); 315 return propertyGet(exports.interceptorsByTag, tag);
276 } 316 }
317 dart.fn(lookupInterceptor, dart.dynamic, [core.String]);
277 let UNCACHED_MARK = '~'; 318 let UNCACHED_MARK = '~';
278 let INSTANCE_CACHED_MARK = '!'; 319 let INSTANCE_CACHED_MARK = '!';
279 let LEAF_MARK = '-'; 320 let LEAF_MARK = '-';
280 let INTERIOR_MARK = '+'; 321 let INTERIOR_MARK = '+';
281 let DISCRIMINATED_MARK = '*'; 322 let DISCRIMINATED_MARK = '*';
282 // Function lookupAndCacheInterceptor: (dynamic) → dynamic
283 function lookupAndCacheInterceptor(obj) { 323 function lookupAndCacheInterceptor(obj) {
284 dart.assert(!dart.notNull(isDartObject(obj))); 324 dart.assert(!dart.notNull(isDartObject(obj)));
285 let tag = dart.as(dart.dcall(exports.getTagFunction, obj), core.String); 325 let tag = dart.as(dart.dcall(exports.getTagFunction, obj), core.String);
286 let record = propertyGet(exports.dispatchRecordsForInstanceTags, tag); 326 let record = propertyGet(exports.dispatchRecordsForInstanceTags, tag);
287 if (record != null) 327 if (record != null)
288 return patchInstance(obj, record); 328 return patchInstance(obj, record);
289 let interceptor = propertyGet(exports.interceptorsForUncacheableTags, tag); 329 let interceptor = propertyGet(exports.interceptorsForUncacheableTags, tag);
290 if (interceptor != null) 330 if (interceptor != null)
291 return interceptor; 331 return interceptor;
292 let interceptorClass = lookupInterceptor(tag); 332 let interceptorClass = lookupInterceptor(tag);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 if (dart.equals(mark, DISCRIMINATED_MARK)) { 365 if (dart.equals(mark, DISCRIMINATED_MARK)) {
326 throw new core.UnimplementedError(tag); 366 throw new core.UnimplementedError(tag);
327 } 367 }
328 let isLeaf = exports.leafTags[tag] === true; 368 let isLeaf = exports.leafTags[tag] === true;
329 if (isLeaf) { 369 if (isLeaf) {
330 return patchProto(obj, makeLeafDispatchRecord(interceptor)); 370 return patchProto(obj, makeLeafDispatchRecord(interceptor));
331 } else { 371 } else {
332 return patchInteriorProto(obj, interceptor); 372 return patchInteriorProto(obj, interceptor);
333 } 373 }
334 } 374 }
335 // Function patchInstance: (dynamic, dynamic) → dynamic 375 dart.fn(lookupAndCacheInterceptor);
336 function patchInstance(obj, record) { 376 function patchInstance(obj, record) {
337 _interceptors.setDispatchProperty(obj, record); 377 _interceptors.setDispatchProperty(obj, record);
338 return _interceptors.dispatchRecordInterceptor(record); 378 return _interceptors.dispatchRecordInterceptor(record);
339 } 379 }
340 // Function patchProto: (dynamic, dynamic) → dynamic 380 dart.fn(patchInstance);
341 function patchProto(obj, record) { 381 function patchProto(obj, record) {
342 _interceptors.setDispatchProperty(Object.getPrototypeOf(obj), record); 382 _interceptors.setDispatchProperty(Object.getPrototypeOf(obj), record);
343 return _interceptors.dispatchRecordInterceptor(record); 383 return _interceptors.dispatchRecordInterceptor(record);
344 } 384 }
345 // Function patchInteriorProto: (dynamic, dynamic) → dynamic 385 dart.fn(patchProto);
346 function patchInteriorProto(obj, interceptor) { 386 function patchInteriorProto(obj, interceptor) {
347 let proto = Object.getPrototypeOf(obj); 387 let proto = Object.getPrototypeOf(obj);
348 let record = _interceptors.makeDispatchRecord(interceptor, proto, null, null ); 388 let record = _interceptors.makeDispatchRecord(interceptor, proto, null, null );
349 _interceptors.setDispatchProperty(proto, record); 389 _interceptors.setDispatchProperty(proto, record);
350 return interceptor; 390 return interceptor;
351 } 391 }
352 // Function makeLeafDispatchRecord: (dynamic) → dynamic 392 dart.fn(patchInteriorProto);
353 function makeLeafDispatchRecord(interceptor) { 393 function makeLeafDispatchRecord(interceptor) {
354 let fieldName = _foreign_helper.JS_IS_INDEXABLE_FIELD_NAME(); 394 let fieldName = _foreign_helper.JS_IS_INDEXABLE_FIELD_NAME();
355 let indexability = !!interceptor[fieldName]; 395 let indexability = !!interceptor[fieldName];
356 return _interceptors.makeDispatchRecord(interceptor, false, null, indexabili ty); 396 return _interceptors.makeDispatchRecord(interceptor, false, null, indexabili ty);
357 } 397 }
358 // Function makeDefaultDispatchRecord: (dynamic, dynamic, dynamic) → dynamic 398 dart.fn(makeLeafDispatchRecord);
359 function makeDefaultDispatchRecord(tag, interceptorClass, proto) { 399 function makeDefaultDispatchRecord(tag, interceptorClass, proto) {
360 let interceptor = interceptorClass.prototype; 400 let interceptor = interceptorClass.prototype;
361 let isLeaf = exports.leafTags[tag] === true; 401 let isLeaf = exports.leafTags[tag] === true;
362 if (isLeaf) { 402 if (isLeaf) {
363 return makeLeafDispatchRecord(interceptor); 403 return makeLeafDispatchRecord(interceptor);
364 } else { 404 } else {
365 return _interceptors.makeDispatchRecord(interceptor, proto, null, null); 405 return _interceptors.makeDispatchRecord(interceptor, proto, null, null);
366 } 406 }
367 } 407 }
368 // Function setNativeSubclassDispatchRecord: (dynamic, dynamic) → dynamic 408 dart.fn(makeDefaultDispatchRecord);
369 function setNativeSubclassDispatchRecord(proto, interceptor) { 409 function setNativeSubclassDispatchRecord(proto, interceptor) {
370 _interceptors.setDispatchProperty(proto, makeLeafDispatchRecord(interceptor) ); 410 _interceptors.setDispatchProperty(proto, makeLeafDispatchRecord(interceptor) );
371 } 411 }
372 // Function constructorNameFallback: (dynamic) → String 412 dart.fn(setNativeSubclassDispatchRecord);
373 function constructorNameFallback(object) { 413 function constructorNameFallback(object) {
374 return _constructorNameFallback(object); 414 return _constructorNameFallback(object);
375 } 415 }
416 dart.fn(constructorNameFallback, core.String, [dart.dynamic]);
376 exports.initNativeDispatchFlag = null; 417 exports.initNativeDispatchFlag = null;
377 // Function initNativeDispatch: () → void
378 function initNativeDispatch() { 418 function initNativeDispatch() {
379 if (dart.equals(true, exports.initNativeDispatchFlag)) 419 if (dart.equals(true, exports.initNativeDispatchFlag))
380 return; 420 return;
381 exports.initNativeDispatchFlag = true; 421 exports.initNativeDispatchFlag = true;
382 initNativeDispatchContinue(); 422 initNativeDispatchContinue();
383 } 423 }
384 // Function initNativeDispatchContinue: () → void 424 dart.fn(initNativeDispatch, dart.void, []);
385 function initNativeDispatchContinue() { 425 function initNativeDispatchContinue() {
386 exports.dispatchRecordsForInstanceTags = Object.create(null); 426 exports.dispatchRecordsForInstanceTags = Object.create(null);
387 exports.interceptorsForUncacheableTags = Object.create(null); 427 exports.interceptorsForUncacheableTags = Object.create(null);
388 initHooks(); 428 initHooks();
389 let map = exports.interceptorsByTag; 429 let map = exports.interceptorsByTag;
390 let tags = Object.getOwnPropertyNames(map); 430 let tags = Object.getOwnPropertyNames(map);
391 if (typeof window != "undefined") { 431 if (typeof window != "undefined") {
392 let context = window; 432 let context = window;
393 let fun = function() { 433 let fun = function() {
394 }; 434 };
(...skipping 15 matching lines...) Expand all
410 if (/^[A-Za-z_]/.test(tag)) { 450 if (/^[A-Za-z_]/.test(tag)) {
411 let interceptorClass = propertyGet(map, tag); 451 let interceptorClass = propertyGet(map, tag);
412 propertySet(map, dart.notNull(INSTANCE_CACHED_MARK) + dart.notNull(tag), interceptorClass); 452 propertySet(map, dart.notNull(INSTANCE_CACHED_MARK) + dart.notNull(tag), interceptorClass);
413 propertySet(map, dart.notNull(UNCACHED_MARK) + dart.notNull(tag), interc eptorClass); 453 propertySet(map, dart.notNull(UNCACHED_MARK) + dart.notNull(tag), interc eptorClass);
414 propertySet(map, dart.notNull(LEAF_MARK) + dart.notNull(tag), intercepto rClass); 454 propertySet(map, dart.notNull(LEAF_MARK) + dart.notNull(tag), intercepto rClass);
415 propertySet(map, dart.notNull(INTERIOR_MARK) + dart.notNull(tag), interc eptorClass); 455 propertySet(map, dart.notNull(INTERIOR_MARK) + dart.notNull(tag), interc eptorClass);
416 propertySet(map, dart.notNull(DISCRIMINATED_MARK) + dart.notNull(tag), i nterceptorClass); 456 propertySet(map, dart.notNull(DISCRIMINATED_MARK) + dart.notNull(tag), i nterceptorClass);
417 } 457 }
418 } 458 }
419 } 459 }
420 // Function initHooks: () → void 460 dart.fn(initNativeDispatchContinue, dart.void, []);
421 function initHooks() { 461 function initHooks() {
422 let hooks = _baseHooks(); 462 let hooks = _baseHooks();
423 let _fallbackConstructorHooksTransformer = _fallbackConstructorHooksTransfor merGenerator(_constructorNameFallback); 463 let _fallbackConstructorHooksTransformer = _fallbackConstructorHooksTransfor merGenerator(_constructorNameFallback);
424 hooks = applyHooksTransformer(_fallbackConstructorHooksTransformer, hooks); 464 hooks = applyHooksTransformer(_fallbackConstructorHooksTransformer, hooks);
425 hooks = applyHooksTransformer(_firefoxHooksTransformer, hooks); 465 hooks = applyHooksTransformer(_firefoxHooksTransformer, hooks);
426 hooks = applyHooksTransformer(_ieHooksTransformer, hooks); 466 hooks = applyHooksTransformer(_ieHooksTransformer, hooks);
427 hooks = applyHooksTransformer(_operaHooksTransformer, hooks); 467 hooks = applyHooksTransformer(_operaHooksTransformer, hooks);
428 hooks = applyHooksTransformer(_safariHooksTransformer, hooks); 468 hooks = applyHooksTransformer(_safariHooksTransformer, hooks);
429 hooks = applyHooksTransformer(_fixDocumentHooksTransformer, hooks); 469 hooks = applyHooksTransformer(_fixDocumentHooksTransformer, hooks);
430 hooks = applyHooksTransformer(_dartExperimentalFixupGetTagHooksTransformer, hooks); 470 hooks = applyHooksTransformer(_dartExperimentalFixupGetTagHooksTransformer, hooks);
431 if (typeof dartNativeDispatchHooksTransformer != "undefined") { 471 if (typeof dartNativeDispatchHooksTransformer != "undefined") {
432 let transformers = dartNativeDispatchHooksTransformer; 472 let transformers = dartNativeDispatchHooksTransformer;
433 if (typeof transformers == "function") { 473 if (typeof transformers == "function") {
434 transformers = [transformers]; 474 transformers = [transformers];
435 } 475 }
436 if (transformers.constructor == Array) { 476 if (transformers.constructor == Array) {
437 for (let i = 0; dart.notNull(i) < transformers.length; i = dart.notNull( i) + 1) { 477 for (let i = 0; dart.notNull(i) < transformers.length; i = dart.notNull( i) + 1) {
438 let transformer = transformers[i]; 478 let transformer = transformers[i];
439 if (typeof transformer == "function") { 479 if (typeof transformer == "function") {
440 hooks = applyHooksTransformer(transformer, hooks); 480 hooks = applyHooksTransformer(transformer, hooks);
441 } 481 }
442 } 482 }
443 } 483 }
444 } 484 }
445 let getTag = hooks.getTag; 485 let getTag = hooks.getTag;
446 let getUnknownTag = hooks.getUnknownTag; 486 let getUnknownTag = hooks.getUnknownTag;
447 let prototypeForTag = hooks.prototypeForTag; 487 let prototypeForTag = hooks.prototypeForTag;
448 exports.getTagFunction = o => getTag(o); 488 exports.getTagFunction = dart.fn(o => getTag(o));
449 exports.alternateTagFunction = (o, tag) => getUnknownTag(o, tag); 489 exports.alternateTagFunction = dart.fn((o, tag) => getUnknownTag(o, tag), da rt.dynamic, [dart.dynamic, core.String]);
450 exports.prototypeForTagFunction = tag => prototypeForTag(tag); 490 exports.prototypeForTagFunction = dart.fn(tag => prototypeForTag(tag), dart. dynamic, [core.String]);
451 } 491 }
452 // Function applyHooksTransformer: (dynamic, dynamic) → dynamic 492 dart.fn(initHooks, dart.void, []);
453 function applyHooksTransformer(transformer, hooks) { 493 function applyHooksTransformer(transformer, hooks) {
454 let newHooks = transformer(hooks); 494 let newHooks = transformer(hooks);
455 return newHooks || hooks; 495 return newHooks || hooks;
456 } 496 }
497 dart.fn(applyHooksTransformer);
457 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}')); 498 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}'));
458 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}')); 499 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}'));
459 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}')); 500 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}'));
460 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}')); 501 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}'));
461 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}')); 502 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}'));
462 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}')); 503 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}'));
463 let _operaHooksTransformer = dart.const(new _foreign_helper.JS_CONST('function (hooks) { return hooks; }\n')); 504 let _operaHooksTransformer = dart.const(new _foreign_helper.JS_CONST('function (hooks) { return hooks; }\n'));
464 let _safariHooksTransformer = dart.const(new _foreign_helper.JS_CONST('functio n(hooks) { return hooks; }\n')); 505 let _safariHooksTransformer = dart.const(new _foreign_helper.JS_CONST('functio n(hooks) { return hooks; }\n'));
465 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}')); 506 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}'));
466 let _nativeRegExp = Symbol('_nativeRegExp'); 507 let _nativeRegExp = Symbol('_nativeRegExp');
467 // Function regExpGetNative: (JSSyntaxRegExp) → dynamic
468 function regExpGetNative(regexp) { 508 function regExpGetNative(regexp) {
469 return regexp[_nativeRegExp]; 509 return regexp[_nativeRegExp];
470 } 510 }
511 dart.fn(regExpGetNative, () => dart.functionType(dart.dynamic, [JSSyntaxRegExp ]));
471 let _nativeGlobalVersion = Symbol('_nativeGlobalVersion'); 512 let _nativeGlobalVersion = Symbol('_nativeGlobalVersion');
472 // Function regExpGetGlobalNative: (JSSyntaxRegExp) → dynamic
473 function regExpGetGlobalNative(regexp) { 513 function regExpGetGlobalNative(regexp) {
474 let nativeRegexp = regexp[_nativeGlobalVersion]; 514 let nativeRegexp = regexp[_nativeGlobalVersion];
475 nativeRegexp.lastIndex = 0; 515 nativeRegexp.lastIndex = 0;
476 return nativeRegexp; 516 return nativeRegexp;
477 } 517 }
518 dart.fn(regExpGetGlobalNative, () => dart.functionType(dart.dynamic, [JSSyntax RegExp]));
478 let _nativeAnchoredVersion = Symbol('_nativeAnchoredVersion'); 519 let _nativeAnchoredVersion = Symbol('_nativeAnchoredVersion');
479 // Function regExpCaptureCount: (JSSyntaxRegExp) → int
480 function regExpCaptureCount(regexp) { 520 function regExpCaptureCount(regexp) {
481 let nativeAnchoredRegExp = regexp[_nativeAnchoredVersion]; 521 let nativeAnchoredRegExp = regexp[_nativeAnchoredVersion];
482 let match = nativeAnchoredRegExp.exec(''); 522 let match = nativeAnchoredRegExp.exec('');
483 return dart.as(dart.dsend(dart.dload(match, 'length'), '-', 2), core.int); 523 return dart.as(dart.dsend(dart.dload(match, 'length'), '-', 2), core.int);
484 } 524 }
525 dart.fn(regExpCaptureCount, () => dart.functionType(core.int, [JSSyntaxRegExp] ));
485 let _nativeGlobalRegExp = Symbol('_nativeGlobalRegExp'); 526 let _nativeGlobalRegExp = Symbol('_nativeGlobalRegExp');
486 let _nativeAnchoredRegExp = Symbol('_nativeAnchoredRegExp'); 527 let _nativeAnchoredRegExp = Symbol('_nativeAnchoredRegExp');
487 let _isMultiLine = Symbol('_isMultiLine'); 528 let _isMultiLine = Symbol('_isMultiLine');
488 let _isCaseSensitive = Symbol('_isCaseSensitive'); 529 let _isCaseSensitive = Symbol('_isCaseSensitive');
489 let _execGlobal = Symbol('_execGlobal'); 530 let _execGlobal = Symbol('_execGlobal');
490 let _execAnchored = Symbol('_execAnchored'); 531 let _execAnchored = Symbol('_execAnchored');
491 class JSSyntaxRegExp extends core.Object { 532 class JSSyntaxRegExp extends core.Object {
492 toString() { 533 toString() {
493 return `RegExp/${this.pattern}/`; 534 return `RegExp/${this.pattern}/`;
494 } 535 }
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 return this[_execAnchored](string, start); 628 return this[_execAnchored](string, start);
588 } 629 }
589 get isMultiLine() { 630 get isMultiLine() {
590 return this[_isMultiLine]; 631 return this[_isMultiLine];
591 } 632 }
592 get isCaseSensitive() { 633 get isCaseSensitive() {
593 return this[_isCaseSensitive]; 634 return this[_isCaseSensitive];
594 } 635 }
595 } 636 }
596 JSSyntaxRegExp[dart.implements] = () => [core.RegExp]; 637 JSSyntaxRegExp[dart.implements] = () => [core.RegExp];
638 dart.setSignature(JSSyntaxRegExp, {
639 methods: () => ({
640 toString: dart.functionType(core.String, []),
641 firstMatch: dart.functionType(core.Match, [core.String]),
642 hasMatch: dart.functionType(core.bool, [core.String]),
643 stringMatch: dart.functionType(core.String, [core.String]),
644 allMatches: dart.functionType(core.Iterable$(core.Match), [core.String], [ core.int]),
645 [_execGlobal]: dart.functionType(core.Match, [core.String, core.int]),
646 [_execAnchored]: dart.functionType(core.Match, [core.String, core.int]),
647 matchAsPrefix: dart.functionType(core.Match, [core.String], [core.int])
648 }),
649 statics: () => ({makeNative: dart.functionType(dart.dynamic, [core.String, c ore.bool, core.bool, core.bool])}),
650 names: ['makeNative']
651 });
597 let _match = Symbol('_match'); 652 let _match = Symbol('_match');
598 class _MatchImplementation extends core.Object { 653 class _MatchImplementation extends core.Object {
599 _MatchImplementation(pattern, match) { 654 _MatchImplementation(pattern, match) {
600 this.pattern = pattern; 655 this.pattern = pattern;
601 this[_match] = match; 656 this[_match] = match;
602 dart.assert(typeof this[_match].input == 'string'); 657 dart.assert(typeof this[_match].input == 'string');
603 dart.assert(typeof this[_match].index == 'number'); 658 dart.assert(typeof this[_match].index == 'number');
604 } 659 }
605 get input() { 660 get input() {
606 return this[_match].input; 661 return this[_match].input;
(...skipping 15 matching lines...) Expand all
622 } 677 }
623 groups(groups) { 678 groups(groups) {
624 let out = dart.setType([], core.List$(core.String)); 679 let out = dart.setType([], core.List$(core.String));
625 for (let i of groups) { 680 for (let i of groups) {
626 out[core.$add](this.group(i)); 681 out[core.$add](this.group(i));
627 } 682 }
628 return out; 683 return out;
629 } 684 }
630 } 685 }
631 _MatchImplementation[dart.implements] = () => [core.Match]; 686 _MatchImplementation[dart.implements] = () => [core.Match];
687 dart.setSignature(_MatchImplementation, {
688 methods: () => ({
689 group: dart.functionType(core.String, [core.int]),
690 get: dart.functionType(core.String, [core.int]),
691 groups: dart.functionType(core.List$(core.String), [core.List$(core.int)])
692 })
693 });
632 let _re = Symbol('_re'); 694 let _re = Symbol('_re');
633 let _string = Symbol('_string'); 695 let _string = Symbol('_string');
634 let _start = Symbol('_start'); 696 let _start = Symbol('_start');
635 class _AllMatchesIterable extends collection.IterableBase$(core.Match) { 697 class _AllMatchesIterable extends collection.IterableBase$(core.Match) {
636 _AllMatchesIterable(re, string, start) { 698 _AllMatchesIterable(re, string, start) {
637 this[_re] = re; 699 this[_re] = re;
638 this[_string] = string; 700 this[_string] = string;
639 this[_start] = start; 701 this[_start] = start;
640 super.IterableBase(); 702 super.IterableBase();
641 } 703 }
642 get [core.$iterator]() { 704 get [core.$iterator]() {
643 return new _AllMatchesIterator(this[_re], this[_string], this[_start]); 705 return new _AllMatchesIterator(this[_re], this[_string], this[_start]);
644 } 706 }
645 } 707 }
708 dart.setSignature(_AllMatchesIterable, {});
646 let _regExp = Symbol('_regExp'); 709 let _regExp = Symbol('_regExp');
647 let _nextIndex = Symbol('_nextIndex'); 710 let _nextIndex = Symbol('_nextIndex');
648 let _current = Symbol('_current'); 711 let _current = Symbol('_current');
649 class _AllMatchesIterator extends core.Object { 712 class _AllMatchesIterator extends core.Object {
650 _AllMatchesIterator(regExp, string, nextIndex) { 713 _AllMatchesIterator(regExp, string, nextIndex) {
651 this[_regExp] = regExp; 714 this[_regExp] = regExp;
652 this[_string] = string; 715 this[_string] = string;
653 this[_nextIndex] = nextIndex; 716 this[_nextIndex] = nextIndex;
654 this[_current] = null; 717 this[_current] = null;
655 } 718 }
(...skipping 14 matching lines...) Expand all
670 this[_nextIndex] = nextIndex; 733 this[_nextIndex] = nextIndex;
671 return true; 734 return true;
672 } 735 }
673 } 736 }
674 this[_current] = null; 737 this[_current] = null;
675 this[_string] = null; 738 this[_string] = null;
676 return false; 739 return false;
677 } 740 }
678 } 741 }
679 _AllMatchesIterator[dart.implements] = () => [core.Iterator$(core.Match)]; 742 _AllMatchesIterator[dart.implements] = () => [core.Iterator$(core.Match)];
680 // Function firstMatchAfter: (JSSyntaxRegExp, String, int) → Match 743 dart.setSignature(_AllMatchesIterator, {
744 methods: () => ({moveNext: dart.functionType(core.bool, [])})
745 });
681 function firstMatchAfter(regExp, string, start) { 746 function firstMatchAfter(regExp, string, start) {
682 return regExp[_execGlobal](string, start); 747 return regExp[_execGlobal](string, start);
683 } 748 }
749 dart.fn(firstMatchAfter, core.Match, [JSSyntaxRegExp, core.String, core.int]);
684 class StringMatch extends core.Object { 750 class StringMatch extends core.Object {
685 StringMatch(start, input, pattern) { 751 StringMatch(start, input, pattern) {
686 this.start = start; 752 this.start = start;
687 this.input = input; 753 this.input = input;
688 this.pattern = pattern; 754 this.pattern = pattern;
689 } 755 }
690 get end() { 756 get end() {
691 return dart.notNull(this.start) + dart.notNull(this.pattern.length); 757 return dart.notNull(this.start) + dart.notNull(this.pattern.length);
692 } 758 }
693 get(g) { 759 get(g) {
(...skipping 10 matching lines...) Expand all
704 } 770 }
705 groups(groups_) { 771 groups(groups_) {
706 let result = new (core.List$(core.String))(); 772 let result = new (core.List$(core.String))();
707 for (let g of groups_) { 773 for (let g of groups_) {
708 result[core.$add](this.group(g)); 774 result[core.$add](this.group(g));
709 } 775 }
710 return result; 776 return result;
711 } 777 }
712 } 778 }
713 StringMatch[dart.implements] = () => [core.Match]; 779 StringMatch[dart.implements] = () => [core.Match];
714 // Function allMatchesInStringUnchecked: (String, String, int) → List<Match> 780 dart.setSignature(StringMatch, {
781 methods: () => ({
782 get: dart.functionType(core.String, [core.int]),
783 group: dart.functionType(core.String, [core.int]),
784 groups: dart.functionType(core.List$(core.String), [core.List$(core.int)])
785 })
786 });
715 function allMatchesInStringUnchecked(needle, haystack, startIndex) { 787 function allMatchesInStringUnchecked(needle, haystack, startIndex) {
716 let result = new (core.List$(core.Match))(); 788 let result = new (core.List$(core.Match))();
717 let length = haystack.length; 789 let length = haystack.length;
718 let patternLength = needle.length; 790 let patternLength = needle.length;
719 while (true) { 791 while (true) {
720 let position = haystack.indexOf(needle, startIndex); 792 let position = haystack.indexOf(needle, startIndex);
721 if (position == -1) { 793 if (position == -1) {
722 break; 794 break;
723 } 795 }
724 result[core.$add](new StringMatch(position, haystack, needle)); 796 result[core.$add](new StringMatch(position, haystack, needle));
725 let endIndex = dart.notNull(position) + dart.notNull(patternLength); 797 let endIndex = dart.notNull(position) + dart.notNull(patternLength);
726 if (endIndex == length) { 798 if (endIndex == length) {
727 break; 799 break;
728 } else if (position == endIndex) { 800 } else if (position == endIndex) {
729 startIndex = dart.notNull(startIndex) + 1; 801 startIndex = dart.notNull(startIndex) + 1;
730 } else { 802 } else {
731 startIndex = endIndex; 803 startIndex = endIndex;
732 } 804 }
733 } 805 }
734 return result; 806 return result;
735 } 807 }
736 // Function stringContainsUnchecked: (dynamic, dynamic, dynamic) → dynamic 808 dart.fn(allMatchesInStringUnchecked, core.List$(core.Match), [core.String, cor e.String, core.int]);
737 function stringContainsUnchecked(receiver, other, startIndex) { 809 function stringContainsUnchecked(receiver, other, startIndex) {
738 if (typeof other == 'string') { 810 if (typeof other == 'string') {
739 return !dart.equals(dart.dsend(receiver, 'indexOf', other, startIndex), -1 ); 811 return !dart.equals(dart.dsend(receiver, 'indexOf', other, startIndex), -1 );
740 } else if (dart.is(other, JSSyntaxRegExp)) { 812 } else if (dart.is(other, JSSyntaxRegExp)) {
741 return dart.dsend(other, 'hasMatch', dart.dsend(receiver, 'substring', sta rtIndex)); 813 return dart.dsend(other, 'hasMatch', dart.dsend(receiver, 'substring', sta rtIndex));
742 } else { 814 } else {
743 let substr = dart.dsend(receiver, 'substring', startIndex); 815 let substr = dart.dsend(receiver, 'substring', startIndex);
744 return dart.dload(dart.dsend(other, 'allMatches', substr), 'isNotEmpty'); 816 return dart.dload(dart.dsend(other, 'allMatches', substr), 'isNotEmpty');
745 } 817 }
746 } 818 }
747 // Function stringReplaceJS: (dynamic, dynamic, dynamic) → dynamic 819 dart.fn(stringContainsUnchecked);
748 function stringReplaceJS(receiver, replacer, to) { 820 function stringReplaceJS(receiver, replacer, to) {
749 to = to.replace(/\$/g, "$$$$"); 821 to = to.replace(/\$/g, "$$$$");
750 return receiver.replace(replacer, to); 822 return receiver.replace(replacer, to);
751 } 823 }
752 // Function stringReplaceFirstRE: (dynamic, dynamic, dynamic, dynamic) → dynam ic 824 dart.fn(stringReplaceJS);
753 function stringReplaceFirstRE(receiver, regexp, to, startIndex) { 825 function stringReplaceFirstRE(receiver, regexp, to, startIndex) {
754 let match = dart.dsend(regexp, _execGlobal, receiver, startIndex); 826 let match = dart.dsend(regexp, _execGlobal, receiver, startIndex);
755 if (match == null) 827 if (match == null)
756 return receiver; 828 return receiver;
757 let start = dart.dload(match, 'start'); 829 let start = dart.dload(match, 'start');
758 let end = dart.dload(match, 'end'); 830 let end = dart.dload(match, 'end');
759 return `${dart.dsend(receiver, 'substring', 0, start)}${to}${dart.dsend(rece iver, 'substring', end)}`; 831 return `${dart.dsend(receiver, 'substring', 0, start)}${to}${dart.dsend(rece iver, 'substring', end)}`;
760 } 832 }
833 dart.fn(stringReplaceFirstRE);
761 let ESCAPE_REGEXP = '[[\\]{}()*+?.\\\\^$|]'; 834 let ESCAPE_REGEXP = '[[\\]{}()*+?.\\\\^$|]';
762 // Function stringReplaceAllUnchecked: (dynamic, dynamic, dynamic) → dynamic
763 function stringReplaceAllUnchecked(receiver, from, to) { 835 function stringReplaceAllUnchecked(receiver, from, to) {
764 checkString(to); 836 checkString(to);
765 if (typeof from == 'string') { 837 if (typeof from == 'string') {
766 if (dart.equals(from, "")) { 838 if (dart.equals(from, "")) {
767 if (dart.equals(receiver, "")) { 839 if (dart.equals(receiver, "")) {
768 return to; 840 return to;
769 } else { 841 } else {
770 let result = new core.StringBuffer(); 842 let result = new core.StringBuffer();
771 let length = dart.as(dart.dload(receiver, 'length'), core.int); 843 let length = dart.as(dart.dload(receiver, 'length'), core.int);
772 result.write(to); 844 result.write(to);
(...skipping 10 matching lines...) Expand all
783 return stringReplaceJS(receiver, replacer, to); 855 return stringReplaceJS(receiver, replacer, to);
784 } 856 }
785 } else if (dart.is(from, JSSyntaxRegExp)) { 857 } else if (dart.is(from, JSSyntaxRegExp)) {
786 let re = regExpGetGlobalNative(dart.as(from, JSSyntaxRegExp)); 858 let re = regExpGetGlobalNative(dart.as(from, JSSyntaxRegExp));
787 return stringReplaceJS(receiver, re, to); 859 return stringReplaceJS(receiver, re, to);
788 } else { 860 } else {
789 checkNull(from); 861 checkNull(from);
790 throw "String.replaceAll(Pattern) UNIMPLEMENTED"; 862 throw "String.replaceAll(Pattern) UNIMPLEMENTED";
791 } 863 }
792 } 864 }
793 // Function _matchString: (Match) → String 865 dart.fn(stringReplaceAllUnchecked);
794 function _matchString(match) { 866 function _matchString(match) {
795 return match.get(0); 867 return match.get(0);
796 } 868 }
797 // Function _stringIdentity: (String) → String 869 dart.fn(_matchString, core.String, [core.Match]);
798 function _stringIdentity(string) { 870 function _stringIdentity(string) {
799 return string; 871 return string;
800 } 872 }
801 // Function stringReplaceAllFuncUnchecked: (dynamic, dynamic, dynamic, dynamic ) → dynamic 873 dart.fn(_stringIdentity, core.String, [core.String]);
802 function stringReplaceAllFuncUnchecked(receiver, pattern, onMatch, onNonMatch) { 874 function stringReplaceAllFuncUnchecked(receiver, pattern, onMatch, onNonMatch) {
803 if (!dart.is(pattern, core.Pattern)) { 875 if (!dart.is(pattern, core.Pattern)) {
804 throw new core.ArgumentError(`${pattern} is not a Pattern`); 876 throw new core.ArgumentError(`${pattern} is not a Pattern`);
805 } 877 }
806 if (onMatch == null) 878 if (onMatch == null)
807 onMatch = _matchString; 879 onMatch = _matchString;
808 if (onNonMatch == null) 880 if (onNonMatch == null)
809 onNonMatch = _stringIdentity; 881 onNonMatch = _stringIdentity;
810 if (typeof pattern == 'string') { 882 if (typeof pattern == 'string') {
811 return stringReplaceAllStringFuncUnchecked(receiver, pattern, onMatch, onN onMatch); 883 return stringReplaceAllStringFuncUnchecked(receiver, pattern, onMatch, onN onMatch);
812 } 884 }
813 let buffer = new core.StringBuffer(); 885 let buffer = new core.StringBuffer();
814 let startIndex = 0; 886 let startIndex = 0;
815 for (let match of dart.as(dart.dsend(pattern, 'allMatches', receiver), core. Iterable$(core.Match))) { 887 for (let match of dart.as(dart.dsend(pattern, 'allMatches', receiver), core. Iterable$(core.Match))) {
816 buffer.write(dart.dcall(onNonMatch, dart.dsend(receiver, 'substring', star tIndex, match.start))); 888 buffer.write(dart.dcall(onNonMatch, dart.dsend(receiver, 'substring', star tIndex, match.start)));
817 buffer.write(dart.dcall(onMatch, match)); 889 buffer.write(dart.dcall(onMatch, match));
818 startIndex = match.end; 890 startIndex = match.end;
819 } 891 }
820 buffer.write(dart.dcall(onNonMatch, dart.dsend(receiver, 'substring', startI ndex))); 892 buffer.write(dart.dcall(onNonMatch, dart.dsend(receiver, 'substring', startI ndex)));
821 return dart.toString(buffer); 893 return dart.toString(buffer);
822 } 894 }
823 // Function stringReplaceAllEmptyFuncUnchecked: (dynamic, dynamic, dynamic) → dynamic 895 dart.fn(stringReplaceAllFuncUnchecked);
824 function stringReplaceAllEmptyFuncUnchecked(receiver, onMatch, onNonMatch) { 896 function stringReplaceAllEmptyFuncUnchecked(receiver, onMatch, onNonMatch) {
825 let buffer = new core.StringBuffer(); 897 let buffer = new core.StringBuffer();
826 let length = dart.as(dart.dload(receiver, 'length'), core.int); 898 let length = dart.as(dart.dload(receiver, 'length'), core.int);
827 let i = 0; 899 let i = 0;
828 buffer.write(dart.dcall(onNonMatch, "")); 900 buffer.write(dart.dcall(onNonMatch, ""));
829 while (dart.notNull(i) < dart.notNull(length)) { 901 while (dart.notNull(i) < dart.notNull(length)) {
830 buffer.write(dart.dcall(onMatch, new StringMatch(i, dart.as(receiver, core .String), ""))); 902 buffer.write(dart.dcall(onMatch, new StringMatch(i, dart.as(receiver, core .String), "")));
831 let code = dart.as(dart.dsend(receiver, 'codeUnitAt', i), core.int); 903 let code = dart.as(dart.dsend(receiver, 'codeUnitAt', i), core.int);
832 if ((dart.notNull(code) & ~1023) == 55296 && dart.notNull(length) > dart.n otNull(i) + 1) { 904 if ((dart.notNull(code) & ~1023) == 55296 && dart.notNull(length) > dart.n otNull(i) + 1) {
833 code = dart.as(dart.dsend(receiver, 'codeUnitAt', dart.notNull(i) + 1), core.int); 905 code = dart.as(dart.dsend(receiver, 'codeUnitAt', dart.notNull(i) + 1), core.int);
834 if ((dart.notNull(code) & ~1023) == 56320) { 906 if ((dart.notNull(code) & ~1023) == 56320) {
835 buffer.write(dart.dcall(onNonMatch, dart.dsend(receiver, 'substring', i, dart.notNull(i) + 2))); 907 buffer.write(dart.dcall(onNonMatch, dart.dsend(receiver, 'substring', i, dart.notNull(i) + 2)));
836 i = dart.notNull(i) + 2; 908 i = dart.notNull(i) + 2;
837 continue; 909 continue;
838 } 910 }
839 } 911 }
840 buffer.write(dart.dcall(onNonMatch, dart.dindex(receiver, i))); 912 buffer.write(dart.dcall(onNonMatch, dart.dindex(receiver, i)));
841 i = dart.notNull(i) + 1; 913 i = dart.notNull(i) + 1;
842 } 914 }
843 buffer.write(dart.dcall(onMatch, new StringMatch(i, dart.as(receiver, core.S tring), ""))); 915 buffer.write(dart.dcall(onMatch, new StringMatch(i, dart.as(receiver, core.S tring), "")));
844 buffer.write(dart.dcall(onNonMatch, "")); 916 buffer.write(dart.dcall(onNonMatch, ""));
845 return dart.toString(buffer); 917 return dart.toString(buffer);
846 } 918 }
847 // Function stringReplaceAllStringFuncUnchecked: (dynamic, dynamic, dynamic, d ynamic) → dynamic 919 dart.fn(stringReplaceAllEmptyFuncUnchecked);
848 function stringReplaceAllStringFuncUnchecked(receiver, pattern, onMatch, onNon Match) { 920 function stringReplaceAllStringFuncUnchecked(receiver, pattern, onMatch, onNon Match) {
849 let patternLength = dart.as(dart.dload(pattern, 'length'), core.int); 921 let patternLength = dart.as(dart.dload(pattern, 'length'), core.int);
850 if (patternLength == 0) { 922 if (patternLength == 0) {
851 return stringReplaceAllEmptyFuncUnchecked(receiver, onMatch, onNonMatch); 923 return stringReplaceAllEmptyFuncUnchecked(receiver, onMatch, onNonMatch);
852 } 924 }
853 let length = dart.as(dart.dload(receiver, 'length'), core.int); 925 let length = dart.as(dart.dload(receiver, 'length'), core.int);
854 let buffer = new core.StringBuffer(); 926 let buffer = new core.StringBuffer();
855 let startIndex = 0; 927 let startIndex = 0;
856 while (dart.notNull(startIndex) < dart.notNull(length)) { 928 while (dart.notNull(startIndex) < dart.notNull(length)) {
857 let position = dart.as(dart.dsend(receiver, 'indexOf', pattern, startIndex ), core.int); 929 let position = dart.as(dart.dsend(receiver, 'indexOf', pattern, startIndex ), core.int);
858 if (position == -1) { 930 if (position == -1) {
859 break; 931 break;
860 } 932 }
861 buffer.write(dart.dcall(onNonMatch, dart.dsend(receiver, 'substring', star tIndex, position))); 933 buffer.write(dart.dcall(onNonMatch, dart.dsend(receiver, 'substring', star tIndex, position)));
862 buffer.write(dart.dcall(onMatch, new StringMatch(position, dart.as(receive r, core.String), dart.as(pattern, core.String)))); 934 buffer.write(dart.dcall(onMatch, new StringMatch(position, dart.as(receive r, core.String), dart.as(pattern, core.String))));
863 startIndex = dart.notNull(position) + dart.notNull(patternLength); 935 startIndex = dart.notNull(position) + dart.notNull(patternLength);
864 } 936 }
865 buffer.write(dart.dcall(onNonMatch, dart.dsend(receiver, 'substring', startI ndex))); 937 buffer.write(dart.dcall(onNonMatch, dart.dsend(receiver, 'substring', startI ndex)));
866 return dart.toString(buffer); 938 return dart.toString(buffer);
867 } 939 }
868 // Function stringReplaceFirstUnchecked: (dynamic, dynamic, dynamic, [int]) → dynamic 940 dart.fn(stringReplaceAllStringFuncUnchecked);
869 function stringReplaceFirstUnchecked(receiver, from, to, startIndex) { 941 function stringReplaceFirstUnchecked(receiver, from, to, startIndex) {
870 if (startIndex === void 0) 942 if (startIndex === void 0)
871 startIndex = 0; 943 startIndex = 0;
872 if (typeof from == 'string') { 944 if (typeof from == 'string') {
873 let index = dart.dsend(receiver, 'indexOf', from, startIndex); 945 let index = dart.dsend(receiver, 'indexOf', from, startIndex);
874 if (dart.dsend(index, '<', 0)) 946 if (dart.dsend(index, '<', 0))
875 return receiver; 947 return receiver;
876 return `${dart.dsend(receiver, 'substring', 0, index)}${to}` + `${dart.dse nd(receiver, 'substring', dart.dsend(index, '+', dart.dload(from, 'length')))}`; 948 return `${dart.dsend(receiver, 'substring', 0, index)}${to}` + `${dart.dse nd(receiver, 'substring', dart.dsend(index, '+', dart.dload(from, 'length')))}`;
877 } else if (dart.is(from, JSSyntaxRegExp)) { 949 } else if (dart.is(from, JSSyntaxRegExp)) {
878 return startIndex == 0 ? stringReplaceJS(receiver, regExpGetNative(dart.as (from, JSSyntaxRegExp)), to) : stringReplaceFirstRE(receiver, from, to, startInd ex); 950 return startIndex == 0 ? stringReplaceJS(receiver, regExpGetNative(dart.as (from, JSSyntaxRegExp)), to) : stringReplaceFirstRE(receiver, from, to, startInd ex);
879 } else { 951 } else {
880 checkNull(from); 952 checkNull(from);
881 throw "String.replace(Pattern) UNIMPLEMENTED"; 953 throw "String.replace(Pattern) UNIMPLEMENTED";
882 } 954 }
883 } 955 }
884 // Function stringJoinUnchecked: (dynamic, dynamic) → dynamic 956 dart.fn(stringReplaceFirstUnchecked, dart.dynamic, [dart.dynamic, dart.dynamic , dart.dynamic], [core.int]);
885 function stringJoinUnchecked(array, separator) { 957 function stringJoinUnchecked(array, separator) {
886 return array.join(separator); 958 return array.join(separator);
887 } 959 }
888 // Function createRuntimeType: (String) → Type 960 dart.fn(stringJoinUnchecked);
889 function createRuntimeType(name) { 961 function createRuntimeType(name) {
890 return new TypeImpl(name); 962 return new TypeImpl(name);
891 } 963 }
964 dart.fn(createRuntimeType, core.Type, [core.String]);
892 let _typeName = Symbol('_typeName'); 965 let _typeName = Symbol('_typeName');
893 let _unmangledName = Symbol('_unmangledName'); 966 let _unmangledName = Symbol('_unmangledName');
894 class TypeImpl extends core.Object { 967 class TypeImpl extends core.Object {
895 TypeImpl(typeName) { 968 TypeImpl(typeName) {
896 this[_typeName] = typeName; 969 this[_typeName] = typeName;
897 this[_unmangledName] = null; 970 this[_unmangledName] = null;
898 } 971 }
899 toString() { 972 toString() {
900 if (this[_unmangledName] != null) 973 if (this[_unmangledName] != null)
901 return this[_unmangledName]; 974 return this[_unmangledName];
902 let unmangledName = unmangleAllIdentifiersIfPreservedAnyways(this[_typeNam e]); 975 let unmangledName = unmangleAllIdentifiersIfPreservedAnyways(this[_typeNam e]);
903 return this[_unmangledName] = unmangledName; 976 return this[_unmangledName] = unmangledName;
904 } 977 }
905 get hashCode() { 978 get hashCode() {
906 return dart.hashCode(this[_typeName]); 979 return dart.hashCode(this[_typeName]);
907 } 980 }
908 ['=='](other) { 981 ['=='](other) {
909 return dart.is(other, TypeImpl) && dart.equals(this[_typeName], dart.dload (other, _typeName)); 982 return dart.is(other, TypeImpl) && dart.equals(this[_typeName], dart.dload (other, _typeName));
910 } 983 }
911 } 984 }
912 TypeImpl[dart.implements] = () => [core.Type]; 985 TypeImpl[dart.implements] = () => [core.Type];
986 dart.setSignature(TypeImpl, {
987 methods: () => ({
988 toString: dart.functionType(core.String, []),
989 '==': dart.functionType(core.bool, [dart.dynamic])
990 })
991 });
913 class TypeVariable extends core.Object { 992 class TypeVariable extends core.Object {
914 TypeVariable(owner, name, bound) { 993 TypeVariable(owner, name, bound) {
915 this.owner = owner; 994 this.owner = owner;
916 this.name = name; 995 this.name = name;
917 this.bound = bound; 996 this.bound = bound;
918 } 997 }
919 } 998 }
920 // Function getMangledTypeName: (TypeImpl) → dynamic 999 dart.setSignature(TypeVariable, {});
921 function getMangledTypeName(type) { 1000 function getMangledTypeName(type) {
922 return type[_typeName]; 1001 return type[_typeName];
923 } 1002 }
924 // Function setRuntimeTypeInfo: (Object, dynamic) → Object 1003 dart.fn(getMangledTypeName, dart.dynamic, [TypeImpl]);
925 function setRuntimeTypeInfo(target, typeInfo) { 1004 function setRuntimeTypeInfo(target, typeInfo) {
926 dart.assert(dart.notNull(typeInfo == null) || dart.notNull(isJsArray(typeInf o))); 1005 dart.assert(dart.notNull(typeInfo == null) || dart.notNull(isJsArray(typeInf o)));
927 if (target != null) 1006 if (target != null)
928 target.$builtinTypeInfo = typeInfo; 1007 target.$builtinTypeInfo = typeInfo;
929 return target; 1008 return target;
930 } 1009 }
931 // Function getRuntimeTypeInfo: (Object) → dynamic 1010 dart.fn(setRuntimeTypeInfo, core.Object, [core.Object, dart.dynamic]);
932 function getRuntimeTypeInfo(target) { 1011 function getRuntimeTypeInfo(target) {
933 if (target == null) 1012 if (target == null)
934 return null; 1013 return null;
935 return target.$builtinTypeInfo; 1014 return target.$builtinTypeInfo;
936 } 1015 }
937 // Function getRuntimeTypeArguments: (dynamic, dynamic) → dynamic 1016 dart.fn(getRuntimeTypeInfo, dart.dynamic, [core.Object]);
938 function getRuntimeTypeArguments(target, substitutionName) { 1017 function getRuntimeTypeArguments(target, substitutionName) {
939 let substitution = getField(target, `${_foreign_helper.JS_OPERATOR_AS_PREFIX ()}${substitutionName}`); 1018 let substitution = getField(target, `${_foreign_helper.JS_OPERATOR_AS_PREFIX ()}${substitutionName}`);
940 return substitute(substitution, getRuntimeTypeInfo(target)); 1019 return substitute(substitution, getRuntimeTypeInfo(target));
941 } 1020 }
942 // Function getRuntimeTypeArgument: (Object, String, int) → dynamic 1021 dart.fn(getRuntimeTypeArguments);
943 function getRuntimeTypeArgument(target, substitutionName, index) { 1022 function getRuntimeTypeArgument(target, substitutionName, index) {
944 let arguments$ = getRuntimeTypeArguments(target, substitutionName); 1023 let arguments$ = getRuntimeTypeArguments(target, substitutionName);
945 return arguments$ == null ? null : getIndex(arguments$, index); 1024 return arguments$ == null ? null : getIndex(arguments$, index);
946 } 1025 }
947 // Function getTypeArgumentByIndex: (Object, int) → dynamic 1026 dart.fn(getRuntimeTypeArgument, dart.dynamic, [core.Object, core.String, core. int]);
948 function getTypeArgumentByIndex(target, index) { 1027 function getTypeArgumentByIndex(target, index) {
949 let rti = getRuntimeTypeInfo(target); 1028 let rti = getRuntimeTypeInfo(target);
950 return rti == null ? null : getIndex(rti, index); 1029 return rti == null ? null : getIndex(rti, index);
951 } 1030 }
952 // Function copyTypeArguments: (Object, Object) → void 1031 dart.fn(getTypeArgumentByIndex, dart.dynamic, [core.Object, core.int]);
953 function copyTypeArguments(source, target) { 1032 function copyTypeArguments(source, target) {
954 target.$builtinTypeInfo = source.$builtinTypeInfo; 1033 target.$builtinTypeInfo = source.$builtinTypeInfo;
955 } 1034 }
956 // Function getClassName: (dynamic) → String 1035 dart.fn(copyTypeArguments, dart.void, [core.Object, core.Object]);
957 function getClassName(object) { 1036 function getClassName(object) {
958 return _interceptors.getInterceptor(object).constructor.builtin$cls; 1037 return _interceptors.getInterceptor(object).constructor.builtin$cls;
959 } 1038 }
960 // Function getRuntimeTypeAsString: (dynamic, {onTypeVariable: (int) → String} ) → String 1039 dart.fn(getClassName, core.String, [dart.dynamic]);
961 function getRuntimeTypeAsString(runtimeType, opts) { 1040 function getRuntimeTypeAsString(runtimeType, opts) {
962 let onTypeVariable = opts && 'onTypeVariable' in opts ? opts.onTypeVariable : null; 1041 let onTypeVariable = opts && 'onTypeVariable' in opts ? opts.onTypeVariable : null;
963 dart.assert(isJsArray(runtimeType)); 1042 dart.assert(isJsArray(runtimeType));
964 let className = getConstructorName(getIndex(runtimeType, 0)); 1043 let className = getConstructorName(getIndex(runtimeType, 0));
965 return `${className}` + `${joinArguments(runtimeType, 1, {onTypeVariable: on TypeVariable})}`; 1044 return `${className}` + `${joinArguments(runtimeType, 1, {onTypeVariable: on TypeVariable})}`;
966 } 1045 }
967 // Function getConstructorName: (dynamic) → String 1046 dart.fn(getRuntimeTypeAsString, core.String, [dart.dynamic], {nTypeVariabl: da rt.functionType(core.String, [core.int])});
968 function getConstructorName(type) { 1047 function getConstructorName(type) {
969 return type.builtin$cls; 1048 return type.builtin$cls;
970 } 1049 }
971 // Function runtimeTypeToString: (dynamic, {onTypeVariable: (int) → String}) → String 1050 dart.fn(getConstructorName, core.String, [dart.dynamic]);
972 function runtimeTypeToString(type, opts) { 1051 function runtimeTypeToString(type, opts) {
973 let onTypeVariable = opts && 'onTypeVariable' in opts ? opts.onTypeVariable : null; 1052 let onTypeVariable = opts && 'onTypeVariable' in opts ? opts.onTypeVariable : null;
974 if (type == null) { 1053 if (type == null) {
975 return 'dynamic'; 1054 return 'dynamic';
976 } else if (isJsArray(type)) { 1055 } else if (isJsArray(type)) {
977 return getRuntimeTypeAsString(type, {onTypeVariable: onTypeVariable}); 1056 return getRuntimeTypeAsString(type, {onTypeVariable: onTypeVariable});
978 } else if (isJsFunction(type)) { 1057 } else if (isJsFunction(type)) {
979 return getConstructorName(type); 1058 return getConstructorName(type);
980 } else if (typeof type == 'number') { 1059 } else if (typeof type == 'number') {
981 if (onTypeVariable == null) { 1060 if (onTypeVariable == null) {
982 return dart.toString(type); 1061 return dart.toString(type);
983 } else { 1062 } else {
984 return onTypeVariable(dart.as(type, core.int)); 1063 return onTypeVariable(dart.as(type, core.int));
985 } 1064 }
986 } else { 1065 } else {
987 return null; 1066 return null;
988 } 1067 }
989 } 1068 }
990 // Function joinArguments: (dynamic, int, {onTypeVariable: (int) → String}) → String 1069 dart.fn(runtimeTypeToString, core.String, [dart.dynamic], {nTypeVariabl: dart. functionType(core.String, [core.int])});
991 function joinArguments(types, startIndex, opts) { 1070 function joinArguments(types, startIndex, opts) {
992 let onTypeVariable = opts && 'onTypeVariable' in opts ? opts.onTypeVariable : null; 1071 let onTypeVariable = opts && 'onTypeVariable' in opts ? opts.onTypeVariable : null;
993 if (types == null) 1072 if (types == null)
994 return ''; 1073 return '';
995 dart.assert(isJsArray(types)); 1074 dart.assert(isJsArray(types));
996 let firstArgument = true; 1075 let firstArgument = true;
997 let allDynamic = true; 1076 let allDynamic = true;
998 let buffer = new core.StringBuffer(); 1077 let buffer = new core.StringBuffer();
999 for (let index = startIndex; dart.notNull(index) < dart.notNull(getLength(ty pes)); index = dart.notNull(index) + 1) { 1078 for (let index = startIndex; dart.notNull(index) < dart.notNull(getLength(ty pes)); index = dart.notNull(index) + 1) {
1000 if (firstArgument) { 1079 if (firstArgument) {
1001 firstArgument = false; 1080 firstArgument = false;
1002 } else { 1081 } else {
1003 buffer.write(', '); 1082 buffer.write(', ');
1004 } 1083 }
1005 let argument = getIndex(types, index); 1084 let argument = getIndex(types, index);
1006 if (argument != null) { 1085 if (argument != null) {
1007 allDynamic = false; 1086 allDynamic = false;
1008 } 1087 }
1009 buffer.write(runtimeTypeToString(argument, {onTypeVariable: onTypeVariable })); 1088 buffer.write(runtimeTypeToString(argument, {onTypeVariable: onTypeVariable }));
1010 } 1089 }
1011 return allDynamic ? '' : `<${buffer}>`; 1090 return allDynamic ? '' : `<${buffer}>`;
1012 } 1091 }
1013 // Function getRuntimeTypeString: (dynamic) → String 1092 dart.fn(joinArguments, core.String, [dart.dynamic, core.int], {nTypeVariabl: d art.functionType(core.String, [core.int])});
1014 function getRuntimeTypeString(object) { 1093 function getRuntimeTypeString(object) {
1015 let className = getClassName(object); 1094 let className = getClassName(object);
1016 if (object == null) 1095 if (object == null)
1017 return className; 1096 return className;
1018 let typeInfo = object.$builtinTypeInfo; 1097 let typeInfo = object.$builtinTypeInfo;
1019 return `${className}${joinArguments(typeInfo, 0)}`; 1098 return `${className}${joinArguments(typeInfo, 0)}`;
1020 } 1099 }
1021 // Function getRuntimeType: (dynamic) → Type 1100 dart.fn(getRuntimeTypeString, core.String, [dart.dynamic]);
1022 function getRuntimeType(object) { 1101 function getRuntimeType(object) {
1023 let type = getRuntimeTypeString(object); 1102 let type = getRuntimeTypeString(object);
1024 return new TypeImpl(type); 1103 return new TypeImpl(type);
1025 } 1104 }
1026 // Function substitute: (dynamic, dynamic) → dynamic 1105 dart.fn(getRuntimeType, core.Type, [dart.dynamic]);
1027 function substitute(substitution, arguments$) { 1106 function substitute(substitution, arguments$) {
1028 dart.assert(dart.notNull(substitution == null) || dart.notNull(isJsFunction( substitution))); 1107 dart.assert(dart.notNull(substitution == null) || dart.notNull(isJsFunction( substitution)));
1029 dart.assert(dart.notNull(arguments$ == null) || dart.notNull(isJsArray(argum ents$))); 1108 dart.assert(dart.notNull(arguments$ == null) || dart.notNull(isJsArray(argum ents$)));
1030 if (isJsFunction(substitution)) { 1109 if (isJsFunction(substitution)) {
1031 substitution = invoke(substitution, arguments$); 1110 substitution = invoke(substitution, arguments$);
1032 if (isJsArray(substitution)) { 1111 if (isJsArray(substitution)) {
1033 arguments$ = substitution; 1112 arguments$ = substitution;
1034 } else if (isJsFunction(substitution)) { 1113 } else if (isJsFunction(substitution)) {
1035 arguments$ = invoke(substitution, arguments$); 1114 arguments$ = invoke(substitution, arguments$);
1036 } 1115 }
1037 } 1116 }
1038 return arguments$; 1117 return arguments$;
1039 } 1118 }
1040 // Function checkSubtype: (Object, String, List<dynamic>, String) → bool 1119 dart.fn(substitute);
1041 function checkSubtype(object, isField, checks, asField) { 1120 function checkSubtype(object, isField, checks, asField) {
1042 if (object == null) 1121 if (object == null)
1043 return false; 1122 return false;
1044 let arguments$ = getRuntimeTypeInfo(object); 1123 let arguments$ = getRuntimeTypeInfo(object);
1045 let interceptor = _interceptors.getInterceptor(object); 1124 let interceptor = _interceptors.getInterceptor(object);
1046 let isSubclass = getField(interceptor, isField); 1125 let isSubclass = getField(interceptor, isField);
1047 if (isSubclass == null) 1126 if (isSubclass == null)
1048 return false; 1127 return false;
1049 let substitution = getField(interceptor, asField); 1128 let substitution = getField(interceptor, asField);
1050 return checkArguments(substitution, arguments$, checks); 1129 return checkArguments(substitution, arguments$, checks);
1051 } 1130 }
1052 // Function computeTypeName: (String, List<dynamic>) → String 1131 dart.fn(checkSubtype, core.bool, [core.Object, core.String, core.List, core.St ring]);
1053 function computeTypeName(isField, arguments$) { 1132 function computeTypeName(isField, arguments$) {
1054 let prefixLength = _foreign_helper.JS_OPERATOR_IS_PREFIX().length; 1133 let prefixLength = _foreign_helper.JS_OPERATOR_IS_PREFIX().length;
1055 return Primitives.formatType(isField.substring(prefixLength, isField.length) , arguments$); 1134 return Primitives.formatType(isField.substring(prefixLength, isField.length) , arguments$);
1056 } 1135 }
1057 // Function subtypeCast: (Object, String, List<dynamic>, String) → Object 1136 dart.fn(computeTypeName, core.String, [core.String, core.List]);
1058 function subtypeCast(object, isField, checks, asField) { 1137 function subtypeCast(object, isField, checks, asField) {
1059 if (dart.notNull(object != null) && !dart.notNull(checkSubtype(object, isFie ld, checks, asField))) { 1138 if (dart.notNull(object != null) && !dart.notNull(checkSubtype(object, isFie ld, checks, asField))) {
1060 let actualType = Primitives.objectTypeName(object); 1139 let actualType = Primitives.objectTypeName(object);
1061 let typeName = computeTypeName(isField, checks); 1140 let typeName = computeTypeName(isField, checks);
1062 throw new CastErrorImplementation(actualType, typeName); 1141 throw new CastErrorImplementation(actualType, typeName);
1063 } 1142 }
1064 return object; 1143 return object;
1065 } 1144 }
1066 // Function assertSubtype: (Object, String, List<dynamic>, String) → Object 1145 dart.fn(subtypeCast, core.Object, [core.Object, core.String, core.List, core.S tring]);
1067 function assertSubtype(object, isField, checks, asField) { 1146 function assertSubtype(object, isField, checks, asField) {
1068 if (dart.notNull(object != null) && !dart.notNull(checkSubtype(object, isFie ld, checks, asField))) { 1147 if (dart.notNull(object != null) && !dart.notNull(checkSubtype(object, isFie ld, checks, asField))) {
1069 let typeName = computeTypeName(isField, checks); 1148 let typeName = computeTypeName(isField, checks);
1070 throw new TypeErrorImplementation(object, typeName); 1149 throw new TypeErrorImplementation(object, typeName);
1071 } 1150 }
1072 return object; 1151 return object;
1073 } 1152 }
1074 // Function assertIsSubtype: (dynamic, dynamic, String) → dynamic 1153 dart.fn(assertSubtype, core.Object, [core.Object, core.String, core.List, core .String]);
1075 function assertIsSubtype(subtype, supertype, message) { 1154 function assertIsSubtype(subtype, supertype, message) {
1076 if (!dart.notNull(isSubtype(subtype, supertype))) { 1155 if (!dart.notNull(isSubtype(subtype, supertype))) {
1077 throwTypeError(message); 1156 throwTypeError(message);
1078 } 1157 }
1079 } 1158 }
1080 // Function throwTypeError: (dynamic) → dynamic 1159 dart.fn(assertIsSubtype, dart.dynamic, [dart.dynamic, dart.dynamic, core.Strin g]);
1081 function throwTypeError(message) { 1160 function throwTypeError(message) {
1082 throw new TypeErrorImplementation.fromMessage(dart.as(message, core.String)) ; 1161 throw new TypeErrorImplementation.fromMessage(dart.as(message, core.String)) ;
1083 } 1162 }
1084 // Function checkArguments: (dynamic, dynamic, dynamic) → bool 1163 dart.fn(throwTypeError);
1085 function checkArguments(substitution, arguments$, checks) { 1164 function checkArguments(substitution, arguments$, checks) {
1086 return areSubtypes(substitute(substitution, arguments$), checks); 1165 return areSubtypes(substitute(substitution, arguments$), checks);
1087 } 1166 }
1088 // Function areSubtypes: (dynamic, dynamic) → bool 1167 dart.fn(checkArguments, core.bool, [dart.dynamic, dart.dynamic, dart.dynamic]) ;
1089 function areSubtypes(s, t) { 1168 function areSubtypes(s, t) {
1090 if (dart.notNull(s == null) || dart.notNull(t == null)) 1169 if (dart.notNull(s == null) || dart.notNull(t == null))
1091 return true; 1170 return true;
1092 dart.assert(isJsArray(s)); 1171 dart.assert(isJsArray(s));
1093 dart.assert(isJsArray(t)); 1172 dart.assert(isJsArray(t));
1094 dart.assert(getLength(s) == getLength(t)); 1173 dart.assert(getLength(s) == getLength(t));
1095 let len = getLength(s); 1174 let len = getLength(s);
1096 for (let i = 0; dart.notNull(i) < dart.notNull(len); i = dart.notNull(i) + 1 ) { 1175 for (let i = 0; dart.notNull(i) < dart.notNull(len); i = dart.notNull(i) + 1 ) {
1097 if (!dart.notNull(isSubtype(getIndex(s, i), getIndex(t, i)))) { 1176 if (!dart.notNull(isSubtype(getIndex(s, i), getIndex(t, i)))) {
1098 return false; 1177 return false;
1099 } 1178 }
1100 } 1179 }
1101 return true; 1180 return true;
1102 } 1181 }
1103 // Function computeSignature: (dynamic, dynamic, dynamic) → dynamic 1182 dart.fn(areSubtypes, core.bool, [dart.dynamic, dart.dynamic]);
1104 function computeSignature(signature, context, contextName) { 1183 function computeSignature(signature, context, contextName) {
1105 let typeArguments = getRuntimeTypeArguments(context, contextName); 1184 let typeArguments = getRuntimeTypeArguments(context, contextName);
1106 return invokeOn(signature, context, typeArguments); 1185 return invokeOn(signature, context, typeArguments);
1107 } 1186 }
1108 // Function isSupertypeOfNull: (dynamic) → bool 1187 dart.fn(computeSignature);
1109 function isSupertypeOfNull(type) { 1188 function isSupertypeOfNull(type) {
1110 return dart.notNull(type == null) || getConstructorName(type) == _foreign_he lper.JS_OBJECT_CLASS_NAME() || getConstructorName(type) == _foreign_helper.JS_NU LL_CLASS_NAME(); 1189 return dart.notNull(type == null) || getConstructorName(type) == _foreign_he lper.JS_OBJECT_CLASS_NAME() || getConstructorName(type) == _foreign_helper.JS_NU LL_CLASS_NAME();
1111 } 1190 }
1112 // Function checkSubtypeOfRuntimeType: (dynamic, dynamic) → bool 1191 dart.fn(isSupertypeOfNull, core.bool, [dart.dynamic]);
1113 function checkSubtypeOfRuntimeType(o, t) { 1192 function checkSubtypeOfRuntimeType(o, t) {
1114 if (o == null) 1193 if (o == null)
1115 return isSupertypeOfNull(t); 1194 return isSupertypeOfNull(t);
1116 if (t == null) 1195 if (t == null)
1117 return true; 1196 return true;
1118 let rti = getRuntimeTypeInfo(o); 1197 let rti = getRuntimeTypeInfo(o);
1119 o = _interceptors.getInterceptor(o); 1198 o = _interceptors.getInterceptor(o);
1120 let type = o.constructor; 1199 let type = o.constructor;
1121 if (rti != null) { 1200 if (rti != null) {
1122 rti = rti.slice(); 1201 rti = rti.slice();
1123 rti.splice(0, 0, type); 1202 rti.splice(0, 0, type);
1124 type = rti; 1203 type = rti;
1125 } else if (hasField(t, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`)) { 1204 } else if (hasField(t, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`)) {
1126 let signatureName = `${_foreign_helper.JS_OPERATOR_IS_PREFIX()}_${getField (t, _foreign_helper.JS_FUNCTION_TYPE_TAG())}`; 1205 let signatureName = `${_foreign_helper.JS_OPERATOR_IS_PREFIX()}_${getField (t, _foreign_helper.JS_FUNCTION_TYPE_TAG())}`;
1127 if (hasField(o, signatureName)) 1206 if (hasField(o, signatureName))
1128 return true; 1207 return true;
1129 let targetSignatureFunction = getField(o, `${_foreign_helper.JS_SIGNATURE_ NAME()}`); 1208 let targetSignatureFunction = getField(o, `${_foreign_helper.JS_SIGNATURE_ NAME()}`);
1130 if (targetSignatureFunction == null) 1209 if (targetSignatureFunction == null)
1131 return false; 1210 return false;
1132 type = invokeOn(targetSignatureFunction, o, null); 1211 type = invokeOn(targetSignatureFunction, o, null);
1133 return isFunctionSubtype(type, t); 1212 return isFunctionSubtype(type, t);
1134 } 1213 }
1135 return isSubtype(type, t); 1214 return isSubtype(type, t);
1136 } 1215 }
1137 // Function subtypeOfRuntimeTypeCast: (Object, dynamic) → Object 1216 dart.fn(checkSubtypeOfRuntimeType, core.bool, [dart.dynamic, dart.dynamic]);
1138 function subtypeOfRuntimeTypeCast(object, type) { 1217 function subtypeOfRuntimeTypeCast(object, type) {
1139 if (dart.notNull(object != null) && !dart.notNull(checkSubtypeOfRuntimeType( object, type))) { 1218 if (dart.notNull(object != null) && !dart.notNull(checkSubtypeOfRuntimeType( object, type))) {
1140 let actualType = Primitives.objectTypeName(object); 1219 let actualType = Primitives.objectTypeName(object);
1141 throw new CastErrorImplementation(actualType, runtimeTypeToString(type)); 1220 throw new CastErrorImplementation(actualType, runtimeTypeToString(type));
1142 } 1221 }
1143 return object; 1222 return object;
1144 } 1223 }
1145 // Function assertSubtypeOfRuntimeType: (Object, dynamic) → Object 1224 dart.fn(subtypeOfRuntimeTypeCast, core.Object, [core.Object, dart.dynamic]);
1146 function assertSubtypeOfRuntimeType(object, type) { 1225 function assertSubtypeOfRuntimeType(object, type) {
1147 if (dart.notNull(object != null) && !dart.notNull(checkSubtypeOfRuntimeType( object, type))) { 1226 if (dart.notNull(object != null) && !dart.notNull(checkSubtypeOfRuntimeType( object, type))) {
1148 throw new TypeErrorImplementation(object, runtimeTypeToString(type)); 1227 throw new TypeErrorImplementation(object, runtimeTypeToString(type));
1149 } 1228 }
1150 return object; 1229 return object;
1151 } 1230 }
1152 // Function getArguments: (dynamic) → dynamic 1231 dart.fn(assertSubtypeOfRuntimeType, core.Object, [core.Object, dart.dynamic]);
1153 function getArguments(type) { 1232 function getArguments(type) {
1154 return isJsArray(type) ? type.slice(1) : null; 1233 return isJsArray(type) ? type.slice(1) : null;
1155 } 1234 }
1156 // Function isSubtype: (dynamic, dynamic) → bool 1235 dart.fn(getArguments);
1157 function isSubtype(s, t) { 1236 function isSubtype(s, t) {
1158 if (isIdentical(s, t)) 1237 if (isIdentical(s, t))
1159 return true; 1238 return true;
1160 if (dart.notNull(s == null) || dart.notNull(t == null)) 1239 if (dart.notNull(s == null) || dart.notNull(t == null))
1161 return true; 1240 return true;
1162 if (hasField(t, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`)) { 1241 if (hasField(t, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`)) {
1163 return isFunctionSubtype(s, t); 1242 return isFunctionSubtype(s, t);
1164 } 1243 }
1165 if (hasField(s, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`)) { 1244 if (hasField(s, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`)) {
1166 return getConstructorName(t) == _foreign_helper.JS_FUNCTION_CLASS_NAME(); 1245 return getConstructorName(t) == _foreign_helper.JS_FUNCTION_CLASS_NAME();
1167 } 1246 }
1168 let typeOfS = isJsArray(s) ? getIndex(s, 0) : s; 1247 let typeOfS = isJsArray(s) ? getIndex(s, 0) : s;
1169 let typeOfT = isJsArray(t) ? getIndex(t, 0) : t; 1248 let typeOfT = isJsArray(t) ? getIndex(t, 0) : t;
1170 let name = runtimeTypeToString(typeOfT); 1249 let name = runtimeTypeToString(typeOfT);
1171 let substitution = null; 1250 let substitution = null;
1172 if (isNotIdentical(typeOfT, typeOfS)) { 1251 if (isNotIdentical(typeOfT, typeOfS)) {
1173 let test = `${_foreign_helper.JS_OPERATOR_IS_PREFIX()}${name}`; 1252 let test = `${_foreign_helper.JS_OPERATOR_IS_PREFIX()}${name}`;
1174 let typeOfSPrototype = typeOfS.prototype; 1253 let typeOfSPrototype = typeOfS.prototype;
1175 if (hasNoField(typeOfSPrototype, test)) 1254 if (hasNoField(typeOfSPrototype, test))
1176 return false; 1255 return false;
1177 let field = `${_foreign_helper.JS_OPERATOR_AS_PREFIX()}${runtimeTypeToStri ng(typeOfT)}`; 1256 let field = `${_foreign_helper.JS_OPERATOR_AS_PREFIX()}${runtimeTypeToStri ng(typeOfT)}`;
1178 substitution = getField(typeOfSPrototype, field); 1257 substitution = getField(typeOfSPrototype, field);
1179 } 1258 }
1180 if (!dart.notNull(isJsArray(s)) && dart.notNull(substitution == null) || !da rt.notNull(isJsArray(t))) { 1259 if (!dart.notNull(isJsArray(s)) && dart.notNull(substitution == null) || !da rt.notNull(isJsArray(t))) {
1181 return true; 1260 return true;
1182 } 1261 }
1183 return checkArguments(substitution, getArguments(s), getArguments(t)); 1262 return checkArguments(substitution, getArguments(s), getArguments(t));
1184 } 1263 }
1185 // Function isAssignable: (dynamic, dynamic) → bool 1264 dart.fn(isSubtype, core.bool, [dart.dynamic, dart.dynamic]);
1186 function isAssignable(s, t) { 1265 function isAssignable(s, t) {
1187 return dart.notNull(isSubtype(s, t)) || dart.notNull(isSubtype(t, s)); 1266 return dart.notNull(isSubtype(s, t)) || dart.notNull(isSubtype(t, s));
1188 } 1267 }
1189 // Function areAssignable: (List<dynamic>, List, bool) → bool 1268 dart.fn(isAssignable, core.bool, [dart.dynamic, dart.dynamic]);
1190 function areAssignable(s, t, allowShorter) { 1269 function areAssignable(s, t, allowShorter) {
1191 if (dart.notNull(t == null) && dart.notNull(s == null)) 1270 if (dart.notNull(t == null) && dart.notNull(s == null))
1192 return true; 1271 return true;
1193 if (t == null) 1272 if (t == null)
1194 return allowShorter; 1273 return allowShorter;
1195 if (s == null) 1274 if (s == null)
1196 return false; 1275 return false;
1197 dart.assert(isJsArray(s)); 1276 dart.assert(isJsArray(s));
1198 dart.assert(isJsArray(t)); 1277 dart.assert(isJsArray(t));
1199 let sLength = getLength(s); 1278 let sLength = getLength(s);
1200 let tLength = getLength(t); 1279 let tLength = getLength(t);
1201 if (allowShorter) { 1280 if (allowShorter) {
1202 if (dart.notNull(sLength) < dart.notNull(tLength)) 1281 if (dart.notNull(sLength) < dart.notNull(tLength))
1203 return false; 1282 return false;
1204 } else { 1283 } else {
1205 if (sLength != tLength) 1284 if (sLength != tLength)
1206 return false; 1285 return false;
1207 } 1286 }
1208 for (let i = 0; dart.notNull(i) < dart.notNull(tLength); i = dart.notNull(i) + 1) { 1287 for (let i = 0; dart.notNull(i) < dart.notNull(tLength); i = dart.notNull(i) + 1) {
1209 if (!dart.notNull(isAssignable(getIndex(s, i), getIndex(t, i)))) { 1288 if (!dart.notNull(isAssignable(getIndex(s, i), getIndex(t, i)))) {
1210 return false; 1289 return false;
1211 } 1290 }
1212 } 1291 }
1213 return true; 1292 return true;
1214 } 1293 }
1215 // Function areAssignableMaps: (dynamic, dynamic) → bool 1294 dart.fn(areAssignable, core.bool, [core.List, core.List, core.bool]);
1216 function areAssignableMaps(s, t) { 1295 function areAssignableMaps(s, t) {
1217 if (t == null) 1296 if (t == null)
1218 return true; 1297 return true;
1219 if (s == null) 1298 if (s == null)
1220 return false; 1299 return false;
1221 dart.assert(isJsObject(s)); 1300 dart.assert(isJsObject(s));
1222 dart.assert(isJsObject(t)); 1301 dart.assert(isJsObject(t));
1223 let names = _interceptors.JSArray.markFixedList(dart.as(Object.getOwnPropert yNames(t), core.List)); 1302 let names = _interceptors.JSArray.markFixedList(dart.as(Object.getOwnPropert yNames(t), core.List));
1224 for (let i = 0; dart.notNull(i) < dart.notNull(names[core.$length]); i = dar t.notNull(i) + 1) { 1303 for (let i = 0; dart.notNull(i) < dart.notNull(names[core.$length]); i = dar t.notNull(i) + 1) {
1225 let name = names[core.$get](i); 1304 let name = names[core.$get](i);
1226 if (!Object.hasOwnProperty.call(s, name)) { 1305 if (!Object.hasOwnProperty.call(s, name)) {
1227 return false; 1306 return false;
1228 } 1307 }
1229 let tType = t[name]; 1308 let tType = t[name];
1230 let sType = s[name]; 1309 let sType = s[name];
1231 if (!dart.notNull(isAssignable(tType, sType))) 1310 if (!dart.notNull(isAssignable(tType, sType)))
1232 return false; 1311 return false;
1233 } 1312 }
1234 return true; 1313 return true;
1235 } 1314 }
1236 // Function isFunctionSubtype: (dynamic, dynamic) → bool 1315 dart.fn(areAssignableMaps, core.bool, [dart.dynamic, dart.dynamic]);
1237 function isFunctionSubtype(s, t) { 1316 function isFunctionSubtype(s, t) {
1238 dart.assert(hasField(t, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`)); 1317 dart.assert(hasField(t, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`));
1239 if (hasNoField(s, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`)) 1318 if (hasNoField(s, `${_foreign_helper.JS_FUNCTION_TYPE_TAG()}`))
1240 return false; 1319 return false;
1241 if (hasField(s, `${_foreign_helper.JS_FUNCTION_TYPE_VOID_RETURN_TAG()}`)) { 1320 if (hasField(s, `${_foreign_helper.JS_FUNCTION_TYPE_VOID_RETURN_TAG()}`)) {
1242 if (dart.dsend(hasNoField(t, `${_foreign_helper.JS_FUNCTION_TYPE_VOID_RETU RN_TAG()}`), '&&', hasField(t, `${_foreign_helper.JS_FUNCTION_TYPE_RETURN_TYPE_T AG()}`))) { 1321 if (dart.dsend(hasNoField(t, `${_foreign_helper.JS_FUNCTION_TYPE_VOID_RETU RN_TAG()}`), '&&', hasField(t, `${_foreign_helper.JS_FUNCTION_TYPE_RETURN_TYPE_T AG()}`))) {
1243 return false; 1322 return false;
1244 } 1323 }
1245 } else if (hasNoField(t, `${_foreign_helper.JS_FUNCTION_TYPE_VOID_RETURN_TAG ()}`)) { 1324 } else if (hasNoField(t, `${_foreign_helper.JS_FUNCTION_TYPE_VOID_RETURN_TAG ()}`)) {
1246 let sReturnType = getField(s, `${_foreign_helper.JS_FUNCTION_TYPE_RETURN_T YPE_TAG()}`); 1325 let sReturnType = getField(s, `${_foreign_helper.JS_FUNCTION_TYPE_RETURN_T YPE_TAG()}`);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
1286 for (; dart.notNull(tPos) < dart.notNull(tOptionalParametersLen); sPos = d art.notNull(sPos) + 1, tPos = dart.notNull(tPos) + 1) { 1365 for (; dart.notNull(tPos) < dart.notNull(tOptionalParametersLen); sPos = d art.notNull(sPos) + 1, tPos = dart.notNull(tPos) + 1) {
1287 if (!dart.notNull(isAssignable(getIndex(sOptionalParameterTypes, sPos), getIndex(tOptionalParameterTypes, tPos)))) { 1366 if (!dart.notNull(isAssignable(getIndex(sOptionalParameterTypes, sPos), getIndex(tOptionalParameterTypes, tPos)))) {
1288 return false; 1367 return false;
1289 } 1368 }
1290 } 1369 }
1291 } 1370 }
1292 let sNamedParameters = getField(s, `${_foreign_helper.JS_FUNCTION_TYPE_NAMED _PARAMETERS_TAG()}`); 1371 let sNamedParameters = getField(s, `${_foreign_helper.JS_FUNCTION_TYPE_NAMED _PARAMETERS_TAG()}`);
1293 let tNamedParameters = getField(t, `${_foreign_helper.JS_FUNCTION_TYPE_NAMED _PARAMETERS_TAG()}`); 1372 let tNamedParameters = getField(t, `${_foreign_helper.JS_FUNCTION_TYPE_NAMED _PARAMETERS_TAG()}`);
1294 return areAssignableMaps(sNamedParameters, tNamedParameters); 1373 return areAssignableMaps(sNamedParameters, tNamedParameters);
1295 } 1374 }
1296 // Function invoke: (dynamic, dynamic) → dynamic 1375 dart.fn(isFunctionSubtype, core.bool, [dart.dynamic, dart.dynamic]);
1297 function invoke(func, arguments$) { 1376 function invoke(func, arguments$) {
1298 return invokeOn(func, null, arguments$); 1377 return invokeOn(func, null, arguments$);
1299 } 1378 }
1300 // Function invokeOn: (dynamic, dynamic, dynamic) → Object 1379 dart.fn(invoke);
1301 function invokeOn(func, receiver, arguments$) { 1380 function invokeOn(func, receiver, arguments$) {
1302 dart.assert(isJsFunction(func)); 1381 dart.assert(isJsFunction(func));
1303 dart.assert(dart.notNull(arguments$ == null) || dart.notNull(isJsArray(argum ents$))); 1382 dart.assert(dart.notNull(arguments$ == null) || dart.notNull(isJsArray(argum ents$)));
1304 return func.apply(receiver, arguments$); 1383 return func.apply(receiver, arguments$);
1305 } 1384 }
1306 // Function call: (dynamic, String) → dynamic 1385 dart.fn(invokeOn, core.Object, [dart.dynamic, dart.dynamic, dart.dynamic]);
1307 function call(object, name) { 1386 function call(object, name) {
1308 return object[name](); 1387 return object[name]();
1309 } 1388 }
1310 // Function getField: (dynamic, String) → dynamic 1389 dart.fn(call, dart.dynamic, [dart.dynamic, core.String]);
1311 function getField(object, name) { 1390 function getField(object, name) {
1312 return object[name]; 1391 return object[name];
1313 } 1392 }
1314 // Function getIndex: (dynamic, int) → dynamic 1393 dart.fn(getField, dart.dynamic, [dart.dynamic, core.String]);
1315 function getIndex(array, index) { 1394 function getIndex(array, index) {
1316 dart.assert(isJsArray(array)); 1395 dart.assert(isJsArray(array));
1317 return array[index]; 1396 return array[index];
1318 } 1397 }
1319 // Function getLength: (dynamic) → int 1398 dart.fn(getIndex, dart.dynamic, [dart.dynamic, core.int]);
1320 function getLength(array) { 1399 function getLength(array) {
1321 dart.assert(isJsArray(array)); 1400 dart.assert(isJsArray(array));
1322 return array.length; 1401 return array.length;
1323 } 1402 }
1324 // Function isJsArray: (dynamic) → bool 1403 dart.fn(getLength, core.int, [dart.dynamic]);
1325 function isJsArray(value) { 1404 function isJsArray(value) {
1326 return dart.is(value, _interceptors.JSArray); 1405 return dart.is(value, _interceptors.JSArray);
1327 } 1406 }
1328 // Function hasField: (dynamic, dynamic) → dynamic 1407 dart.fn(isJsArray, core.bool, [dart.dynamic]);
1329 function hasField(object, name) { 1408 function hasField(object, name) {
1330 return name in object; 1409 return name in object;
1331 } 1410 }
1332 // Function hasNoField: (dynamic, dynamic) → dynamic 1411 dart.fn(hasField);
1333 function hasNoField(object, name) { 1412 function hasNoField(object, name) {
1334 return dart.dsend(hasField(object, name), '!'); 1413 return dart.dsend(hasField(object, name), '!');
1335 } 1414 }
1336 // Function isJsFunction: (dynamic) → bool 1415 dart.fn(hasNoField);
1337 function isJsFunction(o) { 1416 function isJsFunction(o) {
1338 return typeof o == "function"; 1417 return typeof o == "function";
1339 } 1418 }
1340 // Function isJsObject: (dynamic) → bool 1419 dart.fn(isJsFunction, core.bool, [dart.dynamic]);
1341 function isJsObject(o) { 1420 function isJsObject(o) {
1342 return typeof o == 'object'; 1421 return typeof o == 'object';
1343 } 1422 }
1344 // Function isIdentical: (dynamic, dynamic) → bool 1423 dart.fn(isJsObject, core.bool, [dart.dynamic]);
1345 function isIdentical(s, t) { 1424 function isIdentical(s, t) {
1346 return s === t; 1425 return s === t;
1347 } 1426 }
1348 // Function isNotIdentical: (dynamic, dynamic) → bool 1427 dart.fn(isIdentical, core.bool, [dart.dynamic, dart.dynamic]);
1349 function isNotIdentical(s, t) { 1428 function isNotIdentical(s, t) {
1350 return s !== t; 1429 return s !== t;
1351 } 1430 }
1352 // Function unmangleGlobalNameIfPreservedAnyways: (String) → String 1431 dart.fn(isNotIdentical, core.bool, [dart.dynamic, dart.dynamic]);
1353 function unmangleGlobalNameIfPreservedAnyways(str) { 1432 function unmangleGlobalNameIfPreservedAnyways(str) {
1354 return str; 1433 return str;
1355 } 1434 }
1356 // Function unmangleAllIdentifiersIfPreservedAnyways: (String) → String 1435 dart.fn(unmangleGlobalNameIfPreservedAnyways, core.String, [core.String]);
1357 function unmangleAllIdentifiersIfPreservedAnyways(str) { 1436 function unmangleAllIdentifiersIfPreservedAnyways(str) {
1358 return str; 1437 return str;
1359 } 1438 }
1439 dart.fn(unmangleAllIdentifiersIfPreservedAnyways, core.String, [core.String]);
1360 class _Patch extends core.Object { 1440 class _Patch extends core.Object {
1361 _Patch() { 1441 _Patch() {
1362 } 1442 }
1363 } 1443 }
1444 dart.setSignature(_Patch, {});
1364 let patch = dart.const(new _Patch()); 1445 let patch = dart.const(new _Patch());
1365 class InternalMap extends core.Object {} 1446 class InternalMap extends core.Object {}
1366 // Function requiresPreamble: () → dynamic 1447 dart.setSignature(InternalMap, {});
1367 function requiresPreamble() { 1448 function requiresPreamble() {
1368 } 1449 }
1369 // Function isJsIndexable: (dynamic, dynamic) → bool 1450 dart.fn(requiresPreamble);
1370 function isJsIndexable(object, record) { 1451 function isJsIndexable(object, record) {
1371 if (record != null) { 1452 if (record != null) {
1372 let result = _interceptors.dispatchRecordIndexability(record); 1453 let result = _interceptors.dispatchRecordIndexability(record);
1373 if (result != null) 1454 if (result != null)
1374 return dart.as(result, core.bool); 1455 return dart.as(result, core.bool);
1375 } 1456 }
1376 return dart.is(object, exports.JavaScriptIndexingBehavior); 1457 return dart.is(object, exports.JavaScriptIndexingBehavior);
1377 } 1458 }
1378 // Function S: (dynamic) → String 1459 dart.fn(isJsIndexable, core.bool, [dart.dynamic, dart.dynamic]);
1379 function S(value) { 1460 function S(value) {
1380 if (typeof value == 'string') 1461 if (typeof value == 'string')
1381 return dart.as(value, core.String); 1462 return dart.as(value, core.String);
1382 if (dart.is(value, core.num)) { 1463 if (dart.is(value, core.num)) {
1383 if (!dart.equals(value, 0)) { 1464 if (!dart.equals(value, 0)) {
1384 return "" + value; 1465 return "" + value;
1385 } 1466 }
1386 } else if (dart.equals(true, value)) { 1467 } else if (dart.equals(true, value)) {
1387 return 'true'; 1468 return 'true';
1388 } else if (dart.equals(false, value)) { 1469 } else if (dart.equals(false, value)) {
1389 return 'false'; 1470 return 'false';
1390 } else if (value == null) { 1471 } else if (value == null) {
1391 return 'null'; 1472 return 'null';
1392 } 1473 }
1393 let res = dart.toString(value); 1474 let res = dart.toString(value);
1394 if (!(typeof res == 'string')) 1475 if (!(typeof res == 'string'))
1395 throw new core.ArgumentError(value); 1476 throw new core.ArgumentError(value);
1396 return res; 1477 return res;
1397 } 1478 }
1398 // Function createInvocationMirror: (String, dynamic, dynamic, dynamic, dynami c) → dynamic 1479 dart.fn(S, core.String, [dart.dynamic]);
1399 function createInvocationMirror(name, internalName, kind, arguments$, argument Names) { 1480 function createInvocationMirror(name, internalName, kind, arguments$, argument Names) {
1400 return new JSInvocationMirror(name, dart.as(internalName, core.String), dart .as(kind, core.int), dart.as(arguments$, core.List), dart.as(argumentNames, core .List)); 1481 return new JSInvocationMirror(name, dart.as(internalName, core.String), dart .as(kind, core.int), dart.as(arguments$, core.List), dart.as(argumentNames, core .List));
1401 } 1482 }
1402 // Function createUnmangledInvocationMirror: (Symbol, dynamic, dynamic, dynami c, dynamic) → dynamic 1483 dart.fn(createInvocationMirror, dart.dynamic, [core.String, dart.dynamic, dart .dynamic, dart.dynamic, dart.dynamic]);
1403 function createUnmangledInvocationMirror(symbol, internalName, kind, arguments $, argumentNames) { 1484 function createUnmangledInvocationMirror(symbol, internalName, kind, arguments $, argumentNames) {
1404 return new JSInvocationMirror(symbol, dart.as(internalName, core.String), da rt.as(kind, core.int), dart.as(arguments$, core.List), dart.as(argumentNames, co re.List)); 1485 return new JSInvocationMirror(symbol, dart.as(internalName, core.String), da rt.as(kind, core.int), dart.as(arguments$, core.List), dart.as(argumentNames, co re.List));
1405 } 1486 }
1406 // Function throwInvalidReflectionError: (String) → void 1487 dart.fn(createUnmangledInvocationMirror, dart.dynamic, [core.Symbol, dart.dyna mic, dart.dynamic, dart.dynamic, dart.dynamic]);
1407 function throwInvalidReflectionError(memberName) { 1488 function throwInvalidReflectionError(memberName) {
1408 throw new core.UnsupportedError(`Can't use '${memberName}' in reflection ` + "because it is not included in a @MirrorsUsed annotation."); 1489 throw new core.UnsupportedError(`Can't use '${memberName}' in reflection ` + "because it is not included in a @MirrorsUsed annotation.");
1409 } 1490 }
1410 // Function traceHelper: (String) → void 1491 dart.fn(throwInvalidReflectionError, dart.void, [core.String]);
1411 function traceHelper(method) { 1492 function traceHelper(method) {
1412 if (!this.cache) { 1493 if (!this.cache) {
1413 this.cache = Object.create(null); 1494 this.cache = Object.create(null);
1414 } 1495 }
1415 if (!this.cache[method]) { 1496 if (!this.cache[method]) {
1416 console.log(method); 1497 console.log(method);
1417 this.cache[method] = true; 1498 this.cache[method] = true;
1418 } 1499 }
1419 } 1500 }
1501 dart.fn(traceHelper, dart.void, [core.String]);
1420 let _memberName = Symbol('_memberName'); 1502 let _memberName = Symbol('_memberName');
1421 let _internalName = Symbol('_internalName'); 1503 let _internalName = Symbol('_internalName');
1422 let _kind = Symbol('_kind'); 1504 let _kind = Symbol('_kind');
1423 let _arguments = Symbol('_arguments'); 1505 let _arguments = Symbol('_arguments');
1424 let _namedArgumentNames = Symbol('_namedArgumentNames'); 1506 let _namedArgumentNames = Symbol('_namedArgumentNames');
1425 let _namedIndices = Symbol('_namedIndices'); 1507 let _namedIndices = Symbol('_namedIndices');
1426 let _getCachedInvocation = Symbol('_getCachedInvocation'); 1508 let _getCachedInvocation = Symbol('_getCachedInvocation');
1427 class JSInvocationMirror extends core.Object { 1509 class JSInvocationMirror extends core.Object {
1428 JSInvocationMirror(memberName, internalName, kind, arguments$, namedArgument Names) { 1510 JSInvocationMirror(memberName, internalName, kind, arguments$, namedArgument Names) {
1429 this[_memberName] = memberName; 1511 this[_memberName] = memberName;
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1533 return dart.dsend(cached, 'invokeOn', victim, invocation); 1615 return dart.dsend(cached, 'invokeOn', victim, invocation);
1534 } else { 1616 } else {
1535 return dart.dsend(cached, 'invokeOn', victim, invocation[_arguments]); 1617 return dart.dsend(cached, 'invokeOn', victim, invocation[_arguments]);
1536 } 1618 }
1537 } 1619 }
1538 static getCachedInvocation(invocation, victim) { 1620 static getCachedInvocation(invocation, victim) {
1539 return invocation[_getCachedInvocation](victim); 1621 return invocation[_getCachedInvocation](victim);
1540 } 1622 }
1541 } 1623 }
1542 JSInvocationMirror[dart.implements] = () => [core.Invocation]; 1624 JSInvocationMirror[dart.implements] = () => [core.Invocation];
1625 dart.setSignature(JSInvocationMirror, {
1626 methods: () => ({[_getCachedInvocation]: dart.functionType(dart.dynamic, [co re.Object])}),
1627 statics: () => ({
1628 invokeFromMirror: dart.functionType(dart.dynamic, [JSInvocationMirror, cor e.Object]),
1629 getCachedInvocation: dart.functionType(dart.dynamic, [JSInvocationMirror, core.Object])
1630 }),
1631 names: ['invokeFromMirror', 'getCachedInvocation']
1632 });
1543 JSInvocationMirror.METHOD = 0; 1633 JSInvocationMirror.METHOD = 0;
1544 JSInvocationMirror.GETTER = 1; 1634 JSInvocationMirror.GETTER = 1;
1545 JSInvocationMirror.SETTER = 2; 1635 JSInvocationMirror.SETTER = 2;
1546 class CachedInvocation extends core.Object { 1636 class CachedInvocation extends core.Object {
1547 CachedInvocation(mangledName, jsFunction, isIntercepted, cachedInterceptor) { 1637 CachedInvocation(mangledName, jsFunction, isIntercepted, cachedInterceptor) {
1548 this.mangledName = mangledName; 1638 this.mangledName = mangledName;
1549 this.jsFunction = jsFunction; 1639 this.jsFunction = jsFunction;
1550 this.isIntercepted = isIntercepted; 1640 this.isIntercepted = isIntercepted;
1551 this.cachedInterceptor = cachedInterceptor; 1641 this.cachedInterceptor = cachedInterceptor;
1552 } 1642 }
(...skipping 11 matching lines...) Expand all
1564 } else { 1654 } else {
1565 let _ = [victim]; 1655 let _ = [victim];
1566 _[core.$addAll](arguments$); 1656 _[core.$addAll](arguments$);
1567 arguments$ = _; 1657 arguments$ = _;
1568 if (this.cachedInterceptor != null) 1658 if (this.cachedInterceptor != null)
1569 receiver = this.cachedInterceptor; 1659 receiver = this.cachedInterceptor;
1570 } 1660 }
1571 return this.jsFunction.apply(receiver, arguments$); 1661 return this.jsFunction.apply(receiver, arguments$);
1572 } 1662 }
1573 } 1663 }
1664 dart.setSignature(CachedInvocation, {
1665 methods: () => ({invokeOn: dart.functionType(dart.dynamic, [core.Object, cor e.List])})
1666 });
1574 class CachedCatchAllInvocation extends CachedInvocation { 1667 class CachedCatchAllInvocation extends CachedInvocation {
1575 CachedCatchAllInvocation(name, jsFunction, isIntercepted, cachedInterceptor) { 1668 CachedCatchAllInvocation(name, jsFunction, isIntercepted, cachedInterceptor) {
1576 this.info = new ReflectionInfo(jsFunction); 1669 this.info = new ReflectionInfo(jsFunction);
1577 super.CachedInvocation(name, jsFunction, isIntercepted, cachedInterceptor) ; 1670 super.CachedInvocation(name, jsFunction, isIntercepted, cachedInterceptor) ;
1578 } 1671 }
1579 get isGetterStub() { 1672 get isGetterStub() {
1580 return false; 1673 return false;
1581 } 1674 }
1582 invokeOn(victim, arguments$) { 1675 invokeOn(victim, arguments$) {
1583 let receiver = victim; 1676 let receiver = victim;
(...skipping 23 matching lines...) Expand all
1607 throw new UnimplementedNoSuchMethodError(`Invocation of unstubbed method '${this.info.reflectionName}'` + ` with ${providedArgumentCount} arguments (too few).`); 1700 throw new UnimplementedNoSuchMethodError(`Invocation of unstubbed method '${this.info.reflectionName}'` + ` with ${providedArgumentCount} arguments (too few).`);
1608 } else if (dart.notNull(providedArgumentCount) > dart.notNull(fullParamete rCount)) { 1701 } else if (dart.notNull(providedArgumentCount) > dart.notNull(fullParamete rCount)) {
1609 throw new UnimplementedNoSuchMethodError(`Invocation of unstubbed method '${this.info.reflectionName}'` + ` with ${providedArgumentCount} arguments (too many).`); 1702 throw new UnimplementedNoSuchMethodError(`Invocation of unstubbed method '${this.info.reflectionName}'` + ` with ${providedArgumentCount} arguments (too many).`);
1610 } 1703 }
1611 for (let i = providedArgumentCount; dart.notNull(i) < dart.notNull(fullPar ameterCount); i = dart.notNull(i) + 1) { 1704 for (let i = providedArgumentCount; dart.notNull(i) < dart.notNull(fullPar ameterCount); i = dart.notNull(i) + 1) {
1612 arguments$[core.$add](getMetadata(this.info.defaultValue(i))); 1705 arguments$[core.$add](getMetadata(this.info.defaultValue(i)));
1613 } 1706 }
1614 return this.jsFunction.apply(receiver, arguments$); 1707 return this.jsFunction.apply(receiver, arguments$);
1615 } 1708 }
1616 } 1709 }
1710 dart.setSignature(CachedCatchAllInvocation, {
1711 methods: () => ({invokeOn: dart.functionType(dart.dynamic, [core.Object, cor e.List])})
1712 });
1617 class CachedNoSuchMethodInvocation extends core.Object { 1713 class CachedNoSuchMethodInvocation extends core.Object {
1618 CachedNoSuchMethodInvocation(interceptor) { 1714 CachedNoSuchMethodInvocation(interceptor) {
1619 this.interceptor = interceptor; 1715 this.interceptor = interceptor;
1620 } 1716 }
1621 get isNoSuchMethod() { 1717 get isNoSuchMethod() {
1622 return true; 1718 return true;
1623 } 1719 }
1624 get isGetterStub() { 1720 get isGetterStub() {
1625 return false; 1721 return false;
1626 } 1722 }
1627 invokeOn(victim, invocation) { 1723 invokeOn(victim, invocation) {
1628 let receiver = this.interceptor == null ? victim : this.interceptor; 1724 let receiver = this.interceptor == null ? victim : this.interceptor;
1629 return dart.dsend(receiver, 'noSuchMethod', invocation); 1725 return dart.dsend(receiver, 'noSuchMethod', invocation);
1630 } 1726 }
1631 } 1727 }
1728 dart.setSignature(CachedNoSuchMethodInvocation, {
1729 methods: () => ({invokeOn: dart.functionType(dart.dynamic, [core.Object, cor e.Invocation])})
1730 });
1632 class ReflectionInfo extends core.Object { 1731 class ReflectionInfo extends core.Object {
1633 internal(jsFunction, data, isAccessor, requiredParameterCount, optionalParam eterCount, areOptionalParametersNamed, functionType) { 1732 internal(jsFunction, data, isAccessor, requiredParameterCount, optionalParam eterCount, areOptionalParametersNamed, functionType) {
1634 this.jsFunction = jsFunction; 1733 this.jsFunction = jsFunction;
1635 this.data = data; 1734 this.data = data;
1636 this.isAccessor = isAccessor; 1735 this.isAccessor = isAccessor;
1637 this.requiredParameterCount = requiredParameterCount; 1736 this.requiredParameterCount = requiredParameterCount;
1638 this.optionalParameterCount = optionalParameterCount; 1737 this.optionalParameterCount = optionalParameterCount;
1639 this.areOptionalParametersNamed = areOptionalParametersNamed; 1738 this.areOptionalParametersNamed = areOptionalParametersNamed;
1640 this.functionType = functionType; 1739 this.functionType = functionType;
1641 this.cachedSortedIndices = null; 1740 this.cachedSortedIndices = null;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
1700 let positions = dart.map(); 1799 let positions = dart.map();
1701 for (let i = 0; dart.notNull(i) < dart.notNull(this.optionalParameterCou nt); i = dart.notNull(i) + 1) { 1800 for (let i = 0; dart.notNull(i) < dart.notNull(this.optionalParameterCou nt); i = dart.notNull(i) + 1) {
1702 let index = dart.notNull(this.requiredParameterCount) + dart.notNull(i ); 1801 let index = dart.notNull(this.requiredParameterCount) + dart.notNull(i );
1703 positions.set(this.parameterName(index), index); 1802 positions.set(this.parameterName(index), index);
1704 } 1803 }
1705 let index = 0; 1804 let index = 0;
1706 (() => { 1805 (() => {
1707 let _ = positions.keys[core.$toList](); 1806 let _ = positions.keys[core.$toList]();
1708 _[core.$sort](); 1807 _[core.$sort]();
1709 return _; 1808 return _;
1710 })()[core.$forEach]((name => { 1809 })()[core.$forEach](dart.fn((name => {
1711 this.cachedSortedIndices[core.$set]((() => { 1810 this.cachedSortedIndices[core.$set]((() => {
1712 let x = index; 1811 let x = index;
1713 index = dart.notNull(x) + 1; 1812 index = dart.notNull(x) + 1;
1714 return x; 1813 return x;
1715 })(), positions.get(name)); 1814 })(), positions.get(name));
1716 }).bind(this)); 1815 }).bind(this), dart.dynamic, [core.String]));
1717 } 1816 }
1718 return dart.as(this.cachedSortedIndices[core.$get](unsortedIndex), core.in t); 1817 return dart.as(this.cachedSortedIndices[core.$get](unsortedIndex), core.in t);
1719 } 1818 }
1720 computeFunctionRti(jsConstructor) { 1819 computeFunctionRti(jsConstructor) {
1721 if (typeof this.functionType == "number") { 1820 if (typeof this.functionType == "number") {
1722 return getMetadata(dart.as(this.functionType, core.int)); 1821 return getMetadata(dart.as(this.functionType, core.int));
1723 } else if (typeof this.functionType == "function") { 1822 } else if (typeof this.functionType == "function") {
1724 let fakeInstance = new jsConstructor(); 1823 let fakeInstance = new jsConstructor();
1725 setRuntimeTypeInfo(fakeInstance, fakeInstance["<>"]); 1824 setRuntimeTypeInfo(fakeInstance, fakeInstance["<>"]);
1726 return this.functionType.apply({$receiver: fakeInstance}); 1825 return this.functionType.apply({$receiver: fakeInstance});
1727 } else { 1826 } else {
1728 throw new RuntimeError('Unexpected function type'); 1827 throw new RuntimeError('Unexpected function type');
1729 } 1828 }
1730 } 1829 }
1731 get reflectionName() { 1830 get reflectionName() {
1732 return this.jsFunction.$reflectionName; 1831 return this.jsFunction.$reflectionName;
1733 } 1832 }
1734 } 1833 }
1735 dart.defineNamedConstructor(ReflectionInfo, 'internal'); 1834 dart.defineNamedConstructor(ReflectionInfo, 'internal');
1835 dart.setSignature(ReflectionInfo, {
1836 methods: () => ({
1837 parameterName: dart.functionType(core.String, [core.int]),
1838 parameterMetadataAnnotations: dart.functionType(core.List$(core.int), [cor e.int]),
1839 defaultValue: dart.functionType(core.int, [core.int]),
1840 defaultValueInOrder: dart.functionType(core.int, [core.int]),
1841 parameterNameInOrder: dart.functionType(core.String, [core.int]),
1842 sortedIndex: dart.functionType(core.int, [core.int]),
1843 computeFunctionRti: dart.functionType(dart.dynamic, [dart.dynamic])
1844 })
1845 });
1736 ReflectionInfo.REQUIRED_PARAMETERS_INFO = 0; 1846 ReflectionInfo.REQUIRED_PARAMETERS_INFO = 0;
1737 ReflectionInfo.OPTIONAL_PARAMETERS_INFO = 1; 1847 ReflectionInfo.OPTIONAL_PARAMETERS_INFO = 1;
1738 ReflectionInfo.FUNCTION_TYPE_INDEX = 2; 1848 ReflectionInfo.FUNCTION_TYPE_INDEX = 2;
1739 ReflectionInfo.FIRST_DEFAULT_ARGUMENT = 3; 1849 ReflectionInfo.FIRST_DEFAULT_ARGUMENT = 3;
1740 // Function getMetadata: (int) → dynamic
1741 function getMetadata(index) { 1850 function getMetadata(index) {
1742 let metadata = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names.MET ADATA); 1851 let metadata = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names.MET ADATA);
1743 return metadata[index]; 1852 return metadata[index];
1744 } 1853 }
1854 dart.fn(getMetadata, dart.dynamic, [core.int]);
1745 class Primitives extends core.Object { 1855 class Primitives extends core.Object {
1746 static initializeStatics(id) { 1856 static initializeStatics(id) {
1747 Primitives.mirrorFunctionCacheName = dart.notNull(Primitives.mirrorFunctio nCacheName) + `_${id}`; 1857 Primitives.mirrorFunctionCacheName = dart.notNull(Primitives.mirrorFunctio nCacheName) + `_${id}`;
1748 Primitives.mirrorInvokeCacheName = dart.notNull(Primitives.mirrorInvokeCac heName) + `_${id}`; 1858 Primitives.mirrorInvokeCacheName = dart.notNull(Primitives.mirrorInvokeCac heName) + `_${id}`;
1749 } 1859 }
1750 static objectHashCode(object) { 1860 static objectHashCode(object) {
1751 let hash = dart.as(object.$identityHash, core.int); 1861 let hash = dart.as(object.$identityHash, core.int);
1752 if (hash == null) { 1862 if (hash == null) {
1753 hash = Math.random() * 0x3fffffff | 0; 1863 hash = Math.random() * 0x3fffffff | 0;
1754 object.$identityHash = hash; 1864 object.$identityHash = hash;
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
1855 return; 1965 return;
1856 let window = window; 1966 let window = window;
1857 if (window == null) 1967 if (window == null)
1858 return; 1968 return;
1859 let performance = window.performance; 1969 let performance = window.performance;
1860 if (performance == null) 1970 if (performance == null)
1861 return; 1971 return;
1862 if (typeof performance.now != "function") 1972 if (typeof performance.now != "function")
1863 return; 1973 return;
1864 Primitives.timerFrequency = 1000000; 1974 Primitives.timerFrequency = 1000000;
1865 Primitives.timerTicks = () => (1000 * performance.now()).floor(); 1975 Primitives.timerTicks = dart.fn(() => (1000 * performance.now()).floor(), core.int, []);
1866 } 1976 }
1867 static get isD8() { 1977 static get isD8() {
1868 return typeof version == "function" && typeof os == "object" && "system" i n os; 1978 return typeof version == "function" && typeof os == "object" && "system" i n os;
1869 } 1979 }
1870 static get isJsshell() { 1980 static get isJsshell() {
1871 return typeof version == "function" && typeof system == "function"; 1981 return typeof version == "function" && typeof system == "function";
1872 } 1982 }
1873 static currentUri() { 1983 static currentUri() {
1874 requiresPreamble(); 1984 requiresPreamble();
1875 if (!!self.location) { 1985 if (!!self.location) {
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
2042 static functionNoSuchMethod(func, positionalArguments, namedArguments) { 2152 static functionNoSuchMethod(func, positionalArguments, namedArguments) {
2043 let argumentCount = 0; 2153 let argumentCount = 0;
2044 let arguments$ = []; 2154 let arguments$ = [];
2045 let namedArgumentList = []; 2155 let namedArgumentList = [];
2046 if (positionalArguments != null) { 2156 if (positionalArguments != null) {
2047 argumentCount = dart.notNull(argumentCount) + dart.notNull(positionalArg uments[core.$length]); 2157 argumentCount = dart.notNull(argumentCount) + dart.notNull(positionalArg uments[core.$length]);
2048 arguments$[core.$addAll](positionalArguments); 2158 arguments$[core.$addAll](positionalArguments);
2049 } 2159 }
2050 let names = ''; 2160 let names = '';
2051 if (dart.notNull(namedArguments != null) && !dart.notNull(namedArguments.i sEmpty)) { 2161 if (dart.notNull(namedArguments != null) && !dart.notNull(namedArguments.i sEmpty)) {
2052 namedArguments.forEach((name, argument) => { 2162 namedArguments.forEach(dart.fn((name, argument) => {
2053 names = `${names}$${name}`; 2163 names = `${names}$${name}`;
2054 namedArgumentList[core.$add](name); 2164 namedArgumentList[core.$add](name);
2055 arguments$[core.$add](argument); 2165 arguments$[core.$add](argument);
2056 argumentCount = dart.notNull(argumentCount) + 1; 2166 argumentCount = dart.notNull(argumentCount) + 1;
2057 }); 2167 }, dart.dynamic, [core.String, dart.dynamic]));
2058 } 2168 }
2059 let selectorName = `${_foreign_helper.JS_GET_NAME("CALL_PREFIX")}$${argume ntCount}${names}`; 2169 let selectorName = `${_foreign_helper.JS_GET_NAME("CALL_PREFIX")}$${argume ntCount}${names}`;
2060 return dart.dsend(func, 'noSuchMethod', createUnmangledInvocationMirror(da rt.const(new core.Symbol('call')), selectorName, JSInvocationMirror.METHOD, argu ments$, namedArgumentList)); 2170 return dart.dsend(func, 'noSuchMethod', createUnmangledInvocationMirror(da rt.const(new core.Symbol('call')), selectorName, JSInvocationMirror.METHOD, argu ments$, namedArgumentList));
2061 } 2171 }
2062 static applyFunction(func, positionalArguments, namedArguments) { 2172 static applyFunction(func, positionalArguments, namedArguments) {
2063 return namedArguments == null ? Primitives.applyFunctionWithPositionalArgu ments(func, positionalArguments) : Primitives.applyFunctionWithNamedArguments(fu nc, positionalArguments, namedArguments); 2173 return namedArguments == null ? Primitives.applyFunctionWithPositionalArgu ments(func, positionalArguments) : Primitives.applyFunctionWithNamedArguments(fu nc, positionalArguments, namedArguments);
2064 } 2174 }
2065 static applyFunctionWithPositionalArguments(func, positionalArguments) { 2175 static applyFunctionWithPositionalArguments(func, positionalArguments) {
2066 let argumentCount = 0; 2176 let argumentCount = 0;
2067 let arguments$ = null; 2177 let arguments$ = null;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
2105 } 2215 }
2106 let defaultArguments = new core.Map(); 2216 let defaultArguments = new core.Map();
2107 for (let i = 0; dart.notNull(i) < dart.notNull(info.optionalParameterCount ); i = dart.notNull(i) + 1) { 2217 for (let i = 0; dart.notNull(i) < dart.notNull(info.optionalParameterCount ); i = dart.notNull(i) + 1) {
2108 let index = dart.notNull(i) + dart.notNull(info.requiredParameterCount); 2218 let index = dart.notNull(i) + dart.notNull(info.requiredParameterCount);
2109 let parameterName = info.parameterNameInOrder(index); 2219 let parameterName = info.parameterNameInOrder(index);
2110 let value = info.defaultValueInOrder(index); 2220 let value = info.defaultValueInOrder(index);
2111 let defaultValue = getMetadata(value); 2221 let defaultValue = getMetadata(value);
2112 defaultArguments.set(parameterName, defaultValue); 2222 defaultArguments.set(parameterName, defaultValue);
2113 } 2223 }
2114 let bad = false; 2224 let bad = false;
2115 namedArguments.forEach((parameter, value) => { 2225 namedArguments.forEach(dart.fn((parameter, value) => {
2116 if (defaultArguments.containsKey(parameter)) { 2226 if (defaultArguments.containsKey(parameter)) {
2117 defaultArguments.set(parameter, value); 2227 defaultArguments.set(parameter, value);
2118 } else { 2228 } else {
2119 bad = true; 2229 bad = true;
2120 } 2230 }
2121 }); 2231 }, dart.dynamic, [core.String, dart.dynamic]));
2122 if (bad) { 2232 if (bad) {
2123 return Primitives.functionNoSuchMethod(func, positionalArguments, namedA rguments); 2233 return Primitives.functionNoSuchMethod(func, positionalArguments, namedA rguments);
2124 } 2234 }
2125 positionalArguments[core.$addAll](defaultArguments.values); 2235 positionalArguments[core.$addAll](defaultArguments.values);
2126 return jsFunction.apply(func, positionalArguments); 2236 return jsFunction.apply(func, positionalArguments);
2127 } 2237 }
2128 static _mangledNameMatchesType(mangledName, type) { 2238 static _mangledNameMatchesType(mangledName, type) {
2129 return mangledName == type[_typeName]; 2239 return mangledName == type[_typeName];
2130 } 2240 }
2131 static identicalImplementation(a, b) { 2241 static identicalImplementation(a, b) {
2132 return a == null ? b == null : a === b; 2242 return a == null ? b == null : a === b;
2133 } 2243 }
2134 static extractStackTrace(error) { 2244 static extractStackTrace(error) {
2135 return getTraceFromException(error.$thrownJsError); 2245 return getTraceFromException(error.$thrownJsError);
2136 } 2246 }
2137 } 2247 }
2248 dart.setSignature(Primitives, {
2249 statics: () => ({
2250 initializeStatics: dart.functionType(dart.void, [core.int]),
2251 objectHashCode: dart.functionType(core.int, [dart.dynamic]),
2252 _throwFormatException: dart.functionType(dart.dynamic, [core.String]),
2253 parseInt: dart.functionType(core.int, [core.String, core.int, dart.functio nType(core.int, [core.String])]),
2254 parseDouble: dart.functionType(core.double, [core.String, dart.functionTyp e(core.double, [core.String])]),
2255 formatType: dart.functionType(core.String, [core.String, core.List]),
2256 objectTypeName: dart.functionType(core.String, [core.Object]),
2257 objectToString: dart.functionType(core.String, [core.Object]),
2258 dateNow: dart.functionType(core.num, []),
2259 initTicker: dart.functionType(dart.void, []),
2260 currentUri: dart.functionType(core.String, []),
2261 _fromCharCodeApply: dart.functionType(core.String, [core.List$(core.int)]) ,
2262 stringFromCodePoints: dart.functionType(core.String, [dart.dynamic]),
2263 stringFromCharCodes: dart.functionType(core.String, [dart.dynamic]),
2264 stringFromCharCode: dart.functionType(core.String, [dart.dynamic]),
2265 stringConcatUnchecked: dart.functionType(core.String, [core.String, core.S tring]),
2266 flattenString: dart.functionType(core.String, [core.String]),
2267 getTimeZoneName: dart.functionType(core.String, [dart.dynamic]),
2268 getTimeZoneOffsetInMinutes: dart.functionType(core.int, [dart.dynamic]),
2269 valueFromDecomposedDate: dart.functionType(dart.dynamic, [dart.dynamic, da rt.dynamic, dart.dynamic, dart.dynamic, dart.dynamic, dart.dynamic, dart.dynamic , dart.dynamic]),
2270 patchUpY2K: dart.functionType(dart.dynamic, [dart.dynamic, dart.dynamic, d art.dynamic]),
2271 lazyAsJsDate: dart.functionType(dart.dynamic, [dart.dynamic]),
2272 getYear: dart.functionType(dart.dynamic, [dart.dynamic]),
2273 getMonth: dart.functionType(dart.dynamic, [dart.dynamic]),
2274 getDay: dart.functionType(dart.dynamic, [dart.dynamic]),
2275 getHours: dart.functionType(dart.dynamic, [dart.dynamic]),
2276 getMinutes: dart.functionType(dart.dynamic, [dart.dynamic]),
2277 getSeconds: dart.functionType(dart.dynamic, [dart.dynamic]),
2278 getMilliseconds: dart.functionType(dart.dynamic, [dart.dynamic]),
2279 getWeekday: dart.functionType(dart.dynamic, [dart.dynamic]),
2280 valueFromDateString: dart.functionType(dart.dynamic, [dart.dynamic]),
2281 getProperty: dart.functionType(dart.dynamic, [dart.dynamic, dart.dynamic]) ,
2282 setProperty: dart.functionType(dart.void, [dart.dynamic, dart.dynamic, dar t.dynamic]),
2283 functionNoSuchMethod: dart.functionType(dart.dynamic, [dart.dynamic, core. List, core.Map$(core.String, dart.dynamic)]),
2284 applyFunction: dart.functionType(dart.dynamic, [core.Function, core.List, core.Map$(core.String, dart.dynamic)]),
2285 applyFunctionWithPositionalArguments: dart.functionType(dart.dynamic, [cor e.Function, core.List]),
2286 applyFunctionWithNamedArguments: dart.functionType(dart.dynamic, [core.Fun ction, core.List, core.Map$(core.String, dart.dynamic)]),
2287 _mangledNameMatchesType: dart.functionType(dart.dynamic, [core.String, Typ eImpl]),
2288 identicalImplementation: dart.functionType(core.bool, [dart.dynamic, dart. dynamic]),
2289 extractStackTrace: dart.functionType(core.StackTrace, [core.Error])
2290 }),
2291 names: ['initializeStatics', 'objectHashCode', '_throwFormatException', 'par seInt', 'parseDouble', 'formatType', 'objectTypeName', 'objectToString', 'dateNo w', 'initTicker', 'currentUri', '_fromCharCodeApply', 'stringFromCodePoints', 's tringFromCharCodes', 'stringFromCharCode', 'stringConcatUnchecked', 'flattenStri ng', 'getTimeZoneName', 'getTimeZoneOffsetInMinutes', 'valueFromDecomposedDate', 'patchUpY2K', 'lazyAsJsDate', 'getYear', 'getMonth', 'getDay', 'getHours', 'get Minutes', 'getSeconds', 'getMilliseconds', 'getWeekday', 'valueFromDateString', 'getProperty', 'setProperty', 'functionNoSuchMethod', 'applyFunction', 'applyFun ctionWithPositionalArguments', 'applyFunctionWithNamedArguments', '_mangledNameM atchesType', 'identicalImplementation', 'extractStackTrace']
2292 });
2138 Primitives.mirrorFunctionCacheName = '$cachedFunction'; 2293 Primitives.mirrorFunctionCacheName = '$cachedFunction';
2139 Primitives.mirrorInvokeCacheName = '$cachedInvocation'; 2294 Primitives.mirrorInvokeCacheName = '$cachedInvocation';
2140 Primitives.DOLLAR_CHAR_VALUE = 36; 2295 Primitives.DOLLAR_CHAR_VALUE = 36;
2141 Primitives.timerFrequency = null; 2296 Primitives.timerFrequency = null;
2142 Primitives.timerTicks = null; 2297 Primitives.timerTicks = null;
2143 dart.defineLazyProperties(Primitives, { 2298 dart.defineLazyProperties(Primitives, {
2144 get constructorNameFallback() { 2299 get constructorNameFallback() {
2145 return function getTagFallback(o) { 2300 return function getTagFallback(o) {
2146 var constructor = o.constructor; 2301 var constructor = o.constructor;
2147 if (typeof constructor == "function") { 2302 if (typeof constructor == "function") {
(...skipping 15 matching lines...) Expand all
2163 delete result.x; 2318 delete result.x;
2164 return result; 2319 return result;
2165 } 2320 }
2166 static fetch(cache, key) { 2321 static fetch(cache, key) {
2167 return cache[key]; 2322 return cache[key];
2168 } 2323 }
2169 static update(cache, key, value) { 2324 static update(cache, key, value) {
2170 cache[key] = value; 2325 cache[key] = value;
2171 } 2326 }
2172 } 2327 }
2173 // Function iae: (dynamic) → dynamic 2328 dart.setSignature(JsCache, {
2329 statics: () => ({
2330 allocate: dart.functionType(dart.dynamic, []),
2331 fetch: dart.functionType(dart.dynamic, [dart.dynamic, core.String]),
2332 update: dart.functionType(dart.void, [dart.dynamic, core.String, dart.dyna mic])
2333 }),
2334 names: ['allocate', 'fetch', 'update']
2335 });
2174 function iae(argument) { 2336 function iae(argument) {
2175 throw new core.ArgumentError(argument); 2337 throw new core.ArgumentError(argument);
2176 } 2338 }
2177 // Function ioore: (dynamic, dynamic) → dynamic 2339 dart.fn(iae);
2178 function ioore(receiver, index) { 2340 function ioore(receiver, index) {
2179 if (receiver == null) 2341 if (receiver == null)
2180 dart.dload(receiver, 'length'); 2342 dart.dload(receiver, 'length');
2181 if (!(typeof index == 'number')) 2343 if (!(typeof index == 'number'))
2182 iae(index); 2344 iae(index);
2183 throw new core.RangeError.value(dart.as(index, core.num)); 2345 throw new core.RangeError.value(dart.as(index, core.num));
2184 } 2346 }
2185 // Function stringLastIndexOfUnchecked: (dynamic, dynamic, dynamic) → dynamic 2347 dart.fn(ioore);
2186 function stringLastIndexOfUnchecked(receiver, element, start) { 2348 function stringLastIndexOfUnchecked(receiver, element, start) {
2187 return receiver.lastIndexOf(element, start); 2349 return receiver.lastIndexOf(element, start);
2188 } 2350 }
2189 // Function checkNull: (dynamic) → dynamic 2351 dart.fn(stringLastIndexOfUnchecked);
2190 function checkNull(object) { 2352 function checkNull(object) {
2191 if (object == null) 2353 if (object == null)
2192 throw new core.ArgumentError(null); 2354 throw new core.ArgumentError(null);
2193 return object; 2355 return object;
2194 } 2356 }
2195 // Function checkNum: (dynamic) → dynamic 2357 dart.fn(checkNull);
2196 function checkNum(value) { 2358 function checkNum(value) {
2197 if (!dart.is(value, core.num)) { 2359 if (!dart.is(value, core.num)) {
2198 throw new core.ArgumentError(value); 2360 throw new core.ArgumentError(value);
2199 } 2361 }
2200 return value; 2362 return value;
2201 } 2363 }
2202 // Function checkInt: (dynamic) → dynamic 2364 dart.fn(checkNum);
2203 function checkInt(value) { 2365 function checkInt(value) {
2204 if (!(typeof value == 'number')) { 2366 if (!(typeof value == 'number')) {
2205 throw new core.ArgumentError(value); 2367 throw new core.ArgumentError(value);
2206 } 2368 }
2207 return value; 2369 return value;
2208 } 2370 }
2209 // Function checkBool: (dynamic) → dynamic 2371 dart.fn(checkInt);
2210 function checkBool(value) { 2372 function checkBool(value) {
2211 if (!(typeof value == 'boolean')) { 2373 if (!(typeof value == 'boolean')) {
2212 throw new core.ArgumentError(value); 2374 throw new core.ArgumentError(value);
2213 } 2375 }
2214 return value; 2376 return value;
2215 } 2377 }
2216 // Function checkString: (dynamic) → dynamic 2378 dart.fn(checkBool);
2217 function checkString(value) { 2379 function checkString(value) {
2218 if (!(typeof value == 'string')) { 2380 if (!(typeof value == 'string')) {
2219 throw new core.ArgumentError(value); 2381 throw new core.ArgumentError(value);
2220 } 2382 }
2221 return value; 2383 return value;
2222 } 2384 }
2223 // Function wrapException: (dynamic) → dynamic 2385 dart.fn(checkString);
2224 function wrapException(ex) { 2386 function wrapException(ex) {
2225 if (ex == null) 2387 if (ex == null)
2226 ex = new core.NullThrownError(); 2388 ex = new core.NullThrownError();
2227 let wrapper = new Error(); 2389 let wrapper = new Error();
2228 wrapper.dartException = ex; 2390 wrapper.dartException = ex;
2229 if ("defineProperty" in Object) { 2391 if ("defineProperty" in Object) {
2230 Object.defineProperty(wrapper, "message", {get: _foreign_helper.DART_CLOSU RE_TO_JS(toStringWrapper)}); 2392 Object.defineProperty(wrapper, "message", {get: _foreign_helper.DART_CLOSU RE_TO_JS(toStringWrapper)});
2231 wrapper.name = ""; 2393 wrapper.name = "";
2232 } else { 2394 } else {
2233 wrapper.toString = _foreign_helper.DART_CLOSURE_TO_JS(toStringWrapper); 2395 wrapper.toString = _foreign_helper.DART_CLOSURE_TO_JS(toStringWrapper);
2234 } 2396 }
2235 return wrapper; 2397 return wrapper;
2236 } 2398 }
2237 // Function toStringWrapper: () → dynamic 2399 dart.fn(wrapException);
2238 function toStringWrapper() { 2400 function toStringWrapper() {
2239 return dart.toString(this.dartException); 2401 return dart.toString(this.dartException);
2240 } 2402 }
2241 // Function throwExpression: (dynamic) → dynamic 2403 dart.fn(toStringWrapper);
2242 function throwExpression(ex) { 2404 function throwExpression(ex) {
2243 throw wrapException(ex); 2405 throw wrapException(ex);
2244 } 2406 }
2245 // Function makeLiteralListConst: (dynamic) → dynamic 2407 dart.fn(throwExpression);
2246 function makeLiteralListConst(list) { 2408 function makeLiteralListConst(list) {
2247 list.immutable$list = true; 2409 list.immutable$list = true;
2248 list.fixed$length = true; 2410 list.fixed$length = true;
2249 return list; 2411 return list;
2250 } 2412 }
2251 // Function throwRuntimeError: (dynamic) → dynamic 2413 dart.fn(makeLiteralListConst);
2252 function throwRuntimeError(message) { 2414 function throwRuntimeError(message) {
2253 throw new RuntimeError(message); 2415 throw new RuntimeError(message);
2254 } 2416 }
2255 // Function throwAbstractClassInstantiationError: (dynamic) → dynamic 2417 dart.fn(throwRuntimeError);
2256 function throwAbstractClassInstantiationError(className) { 2418 function throwAbstractClassInstantiationError(className) {
2257 throw new core.AbstractClassInstantiationError(dart.as(className, core.Strin g)); 2419 throw new core.AbstractClassInstantiationError(dart.as(className, core.Strin g));
2258 } 2420 }
2421 dart.fn(throwAbstractClassInstantiationError);
2259 let _argumentsExpr = Symbol('_argumentsExpr'); 2422 let _argumentsExpr = Symbol('_argumentsExpr');
2260 let _expr = Symbol('_expr'); 2423 let _expr = Symbol('_expr');
2261 let _method = Symbol('_method'); 2424 let _method = Symbol('_method');
2262 let _receiver = Symbol('_receiver'); 2425 let _receiver = Symbol('_receiver');
2263 let _pattern = Symbol('_pattern'); 2426 let _pattern = Symbol('_pattern');
2264 class TypeErrorDecoder extends core.Object { 2427 class TypeErrorDecoder extends core.Object {
2265 TypeErrorDecoder(arguments$, argumentsExpr, expr, method, receiver, pattern) { 2428 TypeErrorDecoder(arguments$, argumentsExpr, expr, method, receiver, pattern) {
2266 this[_arguments] = arguments$; 2429 this[_arguments] = arguments$;
2267 this[_argumentsExpr] = argumentsExpr; 2430 this[_argumentsExpr] = argumentsExpr;
2268 this[_expr] = expr; 2431 this[_expr] = expr;
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
2384 try { 2547 try {
2385 (void 0).$method$; 2548 (void 0).$method$;
2386 } catch (e) { 2549 } catch (e) {
2387 return e.message; 2550 return e.message;
2388 } 2551 }
2389 2552
2390 }; 2553 };
2391 return func(); 2554 return func();
2392 } 2555 }
2393 } 2556 }
2557 dart.setSignature(TypeErrorDecoder, {
2558 methods: () => ({matchTypeError: dart.functionType(dart.dynamic, [dart.dynam ic])}),
2559 statics: () => ({
2560 buildJavaScriptObject: dart.functionType(dart.dynamic, []),
2561 buildJavaScriptObjectWithNonClosure: dart.functionType(dart.dynamic, []),
2562 extractPattern: dart.functionType(dart.dynamic, [core.String]),
2563 provokeCallErrorOn: dart.functionType(core.String, [dart.dynamic]),
2564 provokeCallErrorOnNull: dart.functionType(core.String, []),
2565 provokeCallErrorOnUndefined: dart.functionType(core.String, []),
2566 provokePropertyErrorOn: dart.functionType(core.String, [dart.dynamic]),
2567 provokePropertyErrorOnNull: dart.functionType(core.String, []),
2568 provokePropertyErrorOnUndefined: dart.functionType(core.String, [])
2569 }),
2570 names: ['buildJavaScriptObject', 'buildJavaScriptObjectWithNonClosure', 'ext ractPattern', 'provokeCallErrorOn', 'provokeCallErrorOnNull', 'provokeCallErrorO nUndefined', 'provokePropertyErrorOn', 'provokePropertyErrorOnNull', 'provokePro pertyErrorOnUndefined']
2571 });
2394 dart.defineLazyProperties(TypeErrorDecoder, { 2572 dart.defineLazyProperties(TypeErrorDecoder, {
2395 get noSuchMethodPattern() { 2573 get noSuchMethodPattern() {
2396 return dart.as(TypeErrorDecoder.extractPattern(TypeErrorDecoder.provokeCal lErrorOn(TypeErrorDecoder.buildJavaScriptObject())), TypeErrorDecoder); 2574 return dart.as(TypeErrorDecoder.extractPattern(TypeErrorDecoder.provokeCal lErrorOn(TypeErrorDecoder.buildJavaScriptObject())), TypeErrorDecoder);
2397 }, 2575 },
2398 get notClosurePattern() { 2576 get notClosurePattern() {
2399 return dart.as(TypeErrorDecoder.extractPattern(TypeErrorDecoder.provokeCal lErrorOn(TypeErrorDecoder.buildJavaScriptObjectWithNonClosure())), TypeErrorDeco der); 2577 return dart.as(TypeErrorDecoder.extractPattern(TypeErrorDecoder.provokeCal lErrorOn(TypeErrorDecoder.buildJavaScriptObjectWithNonClosure())), TypeErrorDeco der);
2400 }, 2578 },
2401 get nullCallPattern() { 2579 get nullCallPattern() {
2402 return dart.as(TypeErrorDecoder.extractPattern(TypeErrorDecoder.provokeCal lErrorOn(null)), TypeErrorDecoder); 2580 return dart.as(TypeErrorDecoder.extractPattern(TypeErrorDecoder.provokeCal lErrorOn(null)), TypeErrorDecoder);
2403 }, 2581 },
(...skipping 26 matching lines...) Expand all
2430 this[_method] = match == null ? null : dart.as(match.method, core.String); 2608 this[_method] = match == null ? null : dart.as(match.method, core.String);
2431 super.Error(); 2609 super.Error();
2432 } 2610 }
2433 toString() { 2611 toString() {
2434 if (this[_method] == null) 2612 if (this[_method] == null)
2435 return `NullError: ${this[_message]}`; 2613 return `NullError: ${this[_message]}`;
2436 return `NullError: Cannot call "${this[_method]}" on null`; 2614 return `NullError: Cannot call "${this[_method]}" on null`;
2437 } 2615 }
2438 } 2616 }
2439 NullError[dart.implements] = () => [core.NoSuchMethodError]; 2617 NullError[dart.implements] = () => [core.NoSuchMethodError];
2618 dart.setSignature(NullError, {
2619 methods: () => ({toString: dart.functionType(core.String, [])})
2620 });
2440 class JsNoSuchMethodError extends core.Error { 2621 class JsNoSuchMethodError extends core.Error {
2441 JsNoSuchMethodError(message, match) { 2622 JsNoSuchMethodError(message, match) {
2442 this[_message] = message; 2623 this[_message] = message;
2443 this[_method] = match == null ? null : dart.as(match.method, core.String); 2624 this[_method] = match == null ? null : dart.as(match.method, core.String);
2444 this[_receiver] = match == null ? null : dart.as(match.receiver, core.Stri ng); 2625 this[_receiver] = match == null ? null : dart.as(match.receiver, core.Stri ng);
2445 super.Error(); 2626 super.Error();
2446 } 2627 }
2447 toString() { 2628 toString() {
2448 if (this[_method] == null) 2629 if (this[_method] == null)
2449 return `NoSuchMethodError: ${this[_message]}`; 2630 return `NoSuchMethodError: ${this[_message]}`;
2450 if (this[_receiver] == null) { 2631 if (this[_receiver] == null) {
2451 return `NoSuchMethodError: Cannot call "${this[_method]}" (${this[_messa ge]})`; 2632 return `NoSuchMethodError: Cannot call "${this[_method]}" (${this[_messa ge]})`;
2452 } 2633 }
2453 return `NoSuchMethodError: Cannot call "${this[_method]}" on "${this[_rece iver]}" ` + `(${this[_message]})`; 2634 return `NoSuchMethodError: Cannot call "${this[_method]}" on "${this[_rece iver]}" ` + `(${this[_message]})`;
2454 } 2635 }
2455 } 2636 }
2456 JsNoSuchMethodError[dart.implements] = () => [core.NoSuchMethodError]; 2637 JsNoSuchMethodError[dart.implements] = () => [core.NoSuchMethodError];
2638 dart.setSignature(JsNoSuchMethodError, {
2639 methods: () => ({toString: dart.functionType(core.String, [])})
2640 });
2457 class UnknownJsTypeError extends core.Error { 2641 class UnknownJsTypeError extends core.Error {
2458 UnknownJsTypeError(message) { 2642 UnknownJsTypeError(message) {
2459 this[_message] = message; 2643 this[_message] = message;
2460 super.Error(); 2644 super.Error();
2461 } 2645 }
2462 toString() { 2646 toString() {
2463 return this[_message].isEmpty ? 'Error' : `Error: ${this[_message]}`; 2647 return this[_message].isEmpty ? 'Error' : `Error: ${this[_message]}`;
2464 } 2648 }
2465 } 2649 }
2466 // Function unwrapException: (dynamic) → dynamic 2650 dart.setSignature(UnknownJsTypeError, {
2651 methods: () => ({toString: dart.functionType(core.String, [])})
2652 });
2467 function unwrapException(ex) { 2653 function unwrapException(ex) {
2468 // Function saveStackTrace: (dynamic) → dynamic
2469 let saveStackTrace = error => { 2654 let saveStackTrace = error => {
2470 if (dart.is(error, core.Error)) { 2655 if (dart.is(error, core.Error)) {
2471 let thrownStackTrace = error.$thrownJsError; 2656 let thrownStackTrace = error.$thrownJsError;
2472 if (thrownStackTrace == null) { 2657 if (thrownStackTrace == null) {
2473 error.$thrownJsError = ex; 2658 error.$thrownJsError = ex;
2474 } 2659 }
2475 } 2660 }
2476 return error; 2661 return error;
2477 }; 2662 };
2663 dart.fn(saveStackTrace);
2478 if (ex == null) 2664 if (ex == null)
2479 return null; 2665 return null;
2480 if (typeof ex !== "object") 2666 if (typeof ex !== "object")
2481 return ex; 2667 return ex;
2482 if ("dartException" in ex) { 2668 if ("dartException" in ex) {
2483 return saveStackTrace(ex.dartException); 2669 return saveStackTrace(ex.dartException);
2484 } else if (!("message" in ex)) { 2670 } else if (!("message" in ex)) {
2485 return ex; 2671 return ex;
2486 } 2672 }
2487 let message = ex.message; 2673 let message = ex.message;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
2531 } 2717 }
2532 return saveStackTrace(new core.ArgumentError()); 2718 return saveStackTrace(new core.ArgumentError());
2533 } 2719 }
2534 if (typeof InternalError == "function" && ex instanceof InternalError) { 2720 if (typeof InternalError == "function" && ex instanceof InternalError) {
2535 if (typeof message == 'string' && dart.notNull(dart.equals(message, 'too m uch recursion'))) { 2721 if (typeof message == 'string' && dart.notNull(dart.equals(message, 'too m uch recursion'))) {
2536 return new core.StackOverflowError(); 2722 return new core.StackOverflowError();
2537 } 2723 }
2538 } 2724 }
2539 return ex; 2725 return ex;
2540 } 2726 }
2541 // Function getTraceFromException: (dynamic) → StackTrace 2727 dart.fn(unwrapException);
2542 function getTraceFromException(exception) { 2728 function getTraceFromException(exception) {
2543 return new _StackTrace(exception); 2729 return new _StackTrace(exception);
2544 } 2730 }
2731 dart.fn(getTraceFromException, core.StackTrace, [dart.dynamic]);
2545 let _exception = Symbol('_exception'); 2732 let _exception = Symbol('_exception');
2546 let _trace = Symbol('_trace'); 2733 let _trace = Symbol('_trace');
2547 class _StackTrace extends core.Object { 2734 class _StackTrace extends core.Object {
2548 _StackTrace(exception) { 2735 _StackTrace(exception) {
2549 this[_exception] = exception; 2736 this[_exception] = exception;
2550 this[_trace] = null; 2737 this[_trace] = null;
2551 } 2738 }
2552 toString() { 2739 toString() {
2553 if (this[_trace] != null) 2740 if (this[_trace] != null)
2554 return this[_trace]; 2741 return this[_trace];
2555 let trace = null; 2742 let trace = null;
2556 if (typeof this[_exception] === "object") { 2743 if (typeof this[_exception] === "object") {
2557 trace = dart.as(this[_exception].stack, core.String); 2744 trace = dart.as(this[_exception].stack, core.String);
2558 } 2745 }
2559 return this[_trace] = trace == null ? '' : trace; 2746 return this[_trace] = trace == null ? '' : trace;
2560 } 2747 }
2561 } 2748 }
2562 _StackTrace[dart.implements] = () => [core.StackTrace]; 2749 _StackTrace[dart.implements] = () => [core.StackTrace];
2563 // Function objectHashCode: (dynamic) → int 2750 dart.setSignature(_StackTrace, {
2751 methods: () => ({toString: dart.functionType(core.String, [])})
2752 });
2564 function objectHashCode(object) { 2753 function objectHashCode(object) {
2565 if (dart.notNull(object == null) || typeof object != 'object') { 2754 if (dart.notNull(object == null) || typeof object != 'object') {
2566 return dart.hashCode(object); 2755 return dart.hashCode(object);
2567 } else { 2756 } else {
2568 return Primitives.objectHashCode(object); 2757 return Primitives.objectHashCode(object);
2569 } 2758 }
2570 } 2759 }
2571 // Function fillLiteralMap: (dynamic, Map<dynamic, dynamic>) → dynamic 2760 dart.fn(objectHashCode, core.int, [dart.dynamic]);
2572 function fillLiteralMap(keyValuePairs, result) { 2761 function fillLiteralMap(keyValuePairs, result) {
2573 let index = 0; 2762 let index = 0;
2574 let length = getLength(keyValuePairs); 2763 let length = getLength(keyValuePairs);
2575 while (dart.notNull(index) < dart.notNull(length)) { 2764 while (dart.notNull(index) < dart.notNull(length)) {
2576 let key = getIndex(keyValuePairs, (() => { 2765 let key = getIndex(keyValuePairs, (() => {
2577 let x = index; 2766 let x = index;
2578 index = dart.notNull(x) + 1; 2767 index = dart.notNull(x) + 1;
2579 return x; 2768 return x;
2580 })()); 2769 })());
2581 let value = getIndex(keyValuePairs, (() => { 2770 let value = getIndex(keyValuePairs, (() => {
2582 let x = index; 2771 let x = index;
2583 index = dart.notNull(x) + 1; 2772 index = dart.notNull(x) + 1;
2584 return x; 2773 return x;
2585 })()); 2774 })());
2586 result.set(key, value); 2775 result.set(key, value);
2587 } 2776 }
2588 return result; 2777 return result;
2589 } 2778 }
2590 // Function invokeClosure: (Function, dynamic, int, dynamic, dynamic, dynamic, dynamic) → dynamic 2779 dart.fn(fillLiteralMap, dart.dynamic, [dart.dynamic, core.Map]);
2591 function invokeClosure(closure, isolate, numberOfArguments, arg1, arg2, arg3, arg4) { 2780 function invokeClosure(closure, isolate, numberOfArguments, arg1, arg2, arg3, arg4) {
2592 if (numberOfArguments == 0) { 2781 if (numberOfArguments == 0) {
2593 return _foreign_helper.JS_CALL_IN_ISOLATE(isolate, () => dart.dcall(closur e)); 2782 return _foreign_helper.JS_CALL_IN_ISOLATE(isolate, dart.fn(() => dart.dcal l(closure)));
2594 } else if (numberOfArguments == 1) { 2783 } else if (numberOfArguments == 1) {
2595 return _foreign_helper.JS_CALL_IN_ISOLATE(isolate, () => dart.dcall(closur e, arg1)); 2784 return _foreign_helper.JS_CALL_IN_ISOLATE(isolate, dart.fn(() => dart.dcal l(closure, arg1)));
2596 } else if (numberOfArguments == 2) { 2785 } else if (numberOfArguments == 2) {
2597 return _foreign_helper.JS_CALL_IN_ISOLATE(isolate, () => dart.dcall(closur e, arg1, arg2)); 2786 return _foreign_helper.JS_CALL_IN_ISOLATE(isolate, dart.fn(() => dart.dcal l(closure, arg1, arg2)));
2598 } else if (numberOfArguments == 3) { 2787 } else if (numberOfArguments == 3) {
2599 return _foreign_helper.JS_CALL_IN_ISOLATE(isolate, () => dart.dcall(closur e, arg1, arg2, arg3)); 2788 return _foreign_helper.JS_CALL_IN_ISOLATE(isolate, dart.fn(() => dart.dcal l(closure, arg1, arg2, arg3)));
2600 } else if (numberOfArguments == 4) { 2789 } else if (numberOfArguments == 4) {
2601 return _foreign_helper.JS_CALL_IN_ISOLATE(isolate, () => dart.dcall(closur e, arg1, arg2, arg3, arg4)); 2790 return _foreign_helper.JS_CALL_IN_ISOLATE(isolate, dart.fn(() => dart.dcal l(closure, arg1, arg2, arg3, arg4)));
2602 } else { 2791 } else {
2603 throw new core.Exception('Unsupported number of arguments for wrapped clos ure'); 2792 throw new core.Exception('Unsupported number of arguments for wrapped clos ure');
2604 } 2793 }
2605 } 2794 }
2606 // Function convertDartClosureToJS: (dynamic, int) → dynamic 2795 dart.fn(invokeClosure, dart.dynamic, [core.Function, dart.dynamic, core.int, d art.dynamic, dart.dynamic, dart.dynamic, dart.dynamic]);
2607 function convertDartClosureToJS(closure, arity) { 2796 function convertDartClosureToJS(closure, arity) {
2608 return closure; 2797 return closure;
2609 } 2798 }
2799 dart.fn(convertDartClosureToJS, dart.dynamic, [dart.dynamic, core.int]);
2610 class Closure extends core.Object { 2800 class Closure extends core.Object {
2611 Closure() { 2801 Closure() {
2612 } 2802 }
2613 static fromTearOff(receiver, functions, reflectionInfo, isStatic, jsArgument s, propertyName) { 2803 static fromTearOff(receiver, functions, reflectionInfo, isStatic, jsArgument s, propertyName) {
2614 _foreign_helper.JS_EFFECT(() => { 2804 _foreign_helper.JS_EFFECT(dart.fn(() => {
2615 BoundClosure.receiverOf(dart.as(void 0, BoundClosure)); 2805 BoundClosure.receiverOf(dart.as(void 0, BoundClosure));
2616 BoundClosure.selfOf(dart.as(void 0, BoundClosure)); 2806 BoundClosure.selfOf(dart.as(void 0, BoundClosure));
2617 }); 2807 }));
2618 let func = functions[0]; 2808 let func = functions[0];
2619 let name = dart.as(func.$stubName, core.String); 2809 let name = dart.as(func.$stubName, core.String);
2620 let callName = dart.as(func.$callName, core.String); 2810 let callName = dart.as(func.$callName, core.String);
2621 func.$reflectionInfo = reflectionInfo; 2811 func.$reflectionInfo = reflectionInfo;
2622 let info = new ReflectionInfo(func); 2812 let info = new ReflectionInfo(func);
2623 let functionType = info.functionType; 2813 let functionType = info.functionType;
2624 let prototype = isStatic ? Object.create(new TearOffClosure().constructor. prototype) : Object.create(new BoundClosure(null, null, null, null).constructor. prototype); 2814 let prototype = isStatic ? Object.create(new TearOffClosure().constructor. prototype) : Object.create(new BoundClosure(null, null, null, null).constructor. prototype);
2625 prototype.$initialize = prototype.constructor; 2815 prototype.$initialize = prototype.constructor;
2626 let constructor = isStatic ? function() { 2816 let constructor = isStatic ? function() {
2627 this.$initialize(); 2817 this.$initialize();
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
2860 let x = Closure.functionCounter; 3050 let x = Closure.functionCounter;
2861 Closure.functionCounter = dart.notNull(x) + 1; 3051 Closure.functionCounter = dart.notNull(x) + 1;
2862 return x; 3052 return x;
2863 })()}` + '}')(); 3053 })()}` + '}')();
2864 } 3054 }
2865 toString() { 3055 toString() {
2866 return "Closure"; 3056 return "Closure";
2867 } 3057 }
2868 } 3058 }
2869 Closure[dart.implements] = () => [core.Function]; 3059 Closure[dart.implements] = () => [core.Function];
3060 dart.setSignature(Closure, {
3061 methods: () => ({toString: dart.functionType(core.String, [])}),
3062 statics: () => ({
3063 fromTearOff: dart.functionType(dart.dynamic, [dart.dynamic, core.List, cor e.List, core.bool, dart.dynamic, core.String]),
3064 cspForwardCall: dart.functionType(dart.dynamic, [core.int, core.bool, core .String, dart.dynamic]),
3065 forwardCallTo: dart.functionType(dart.dynamic, [dart.dynamic, dart.dynamic , core.bool]),
3066 cspForwardInterceptedCall: dart.functionType(dart.dynamic, [core.int, core .bool, core.String, dart.dynamic]),
3067 forwardInterceptedCallTo: dart.functionType(dart.dynamic, [dart.dynamic, d art.dynamic])
3068 }),
3069 names: ['fromTearOff', 'cspForwardCall', 'forwardCallTo', 'cspForwardInterce ptedCall', 'forwardInterceptedCallTo']
3070 });
2870 Closure.FUNCTION_INDEX = 0; 3071 Closure.FUNCTION_INDEX = 0;
2871 Closure.NAME_INDEX = 1; 3072 Closure.NAME_INDEX = 1;
2872 Closure.CALL_NAME_INDEX = 2; 3073 Closure.CALL_NAME_INDEX = 2;
2873 Closure.REQUIRED_PARAMETER_INDEX = 3; 3074 Closure.REQUIRED_PARAMETER_INDEX = 3;
2874 Closure.OPTIONAL_PARAMETER_INDEX = 4; 3075 Closure.OPTIONAL_PARAMETER_INDEX = 4;
2875 Closure.DEFAULT_ARGUMENTS_INDEX = 5; 3076 Closure.DEFAULT_ARGUMENTS_INDEX = 5;
2876 Closure.functionCounter = 0; 3077 Closure.functionCounter = 0;
2877 // Function closureFromTearOff: (dynamic, dynamic, dynamic, dynamic, dynamic, dynamic) → dynamic
2878 function closureFromTearOff(receiver, functions, reflectionInfo, isStatic, jsA rguments, name) { 3078 function closureFromTearOff(receiver, functions, reflectionInfo, isStatic, jsA rguments, name) {
2879 return Closure.fromTearOff(receiver, _interceptors.JSArray.markFixedList(dar t.as(functions, core.List)), _interceptors.JSArray.markFixedList(dart.as(reflect ionInfo, core.List)), !!isStatic, jsArguments, name); 3079 return Closure.fromTearOff(receiver, _interceptors.JSArray.markFixedList(dar t.as(functions, core.List)), _interceptors.JSArray.markFixedList(dart.as(reflect ionInfo, core.List)), !!isStatic, jsArguments, name);
2880 } 3080 }
3081 dart.fn(closureFromTearOff);
2881 class TearOffClosure extends Closure { 3082 class TearOffClosure extends Closure {
2882 TearOffClosure() { 3083 TearOffClosure() {
2883 super.Closure(); 3084 super.Closure();
2884 } 3085 }
2885 } 3086 }
3087 dart.setSignature(TearOffClosure, {});
2886 let _self = Symbol('_self'); 3088 let _self = Symbol('_self');
2887 let _target = Symbol('_target'); 3089 let _target = Symbol('_target');
2888 let _name = Symbol('_name'); 3090 let _name = Symbol('_name');
2889 class BoundClosure extends TearOffClosure { 3091 class BoundClosure extends TearOffClosure {
2890 BoundClosure(self, target, receiver, name) { 3092 BoundClosure(self, target, receiver, name) {
2891 this[_self] = self; 3093 this[_self] = self;
2892 this[_target] = target; 3094 this[_target] = target;
2893 this[_receiver] = receiver; 3095 this[_receiver] = receiver;
2894 this[_name] = name; 3096 this[_name] = name;
2895 } 3097 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
2939 let template = new BoundClosure('self', 'target', 'receiver', 'name'); 3141 let template = new BoundClosure('self', 'target', 'receiver', 'name');
2940 let names = _interceptors.JSArray.markFixedList(dart.as(Object.getOwnPrope rtyNames(template), core.List)); 3142 let names = _interceptors.JSArray.markFixedList(dart.as(Object.getOwnPrope rtyNames(template), core.List));
2941 for (let i = 0; dart.notNull(i) < dart.notNull(names[core.$length]); i = d art.notNull(i) + 1) { 3143 for (let i = 0; dart.notNull(i) < dart.notNull(names[core.$length]); i = d art.notNull(i) + 1) {
2942 let name = names[core.$get](i); 3144 let name = names[core.$get](i);
2943 if (template[name] === fieldName) { 3145 if (template[name] === fieldName) {
2944 return name; 3146 return name;
2945 } 3147 }
2946 } 3148 }
2947 } 3149 }
2948 } 3150 }
3151 dart.setSignature(BoundClosure, {
3152 methods: () => ({'==': dart.functionType(core.bool, [dart.dynamic])}),
3153 statics: () => ({
3154 selfOf: dart.functionType(dart.dynamic, [BoundClosure]),
3155 targetOf: dart.functionType(dart.dynamic, [BoundClosure]),
3156 receiverOf: dart.functionType(dart.dynamic, [BoundClosure]),
3157 nameOf: dart.functionType(dart.dynamic, [BoundClosure]),
3158 selfFieldName: dart.functionType(core.String, []),
3159 receiverFieldName: dart.functionType(core.String, []),
3160 computeFieldNamed: dart.functionType(core.String, [core.String])
3161 }),
3162 names: ['selfOf', 'targetOf', 'receiverOf', 'nameOf', 'selfFieldName', 'rece iverFieldName', 'computeFieldNamed']
3163 });
2949 BoundClosure.selfFieldNameCache = null; 3164 BoundClosure.selfFieldNameCache = null;
2950 BoundClosure.receiverFieldNameCache = null; 3165 BoundClosure.receiverFieldNameCache = null;
2951 // Function jsHasOwnProperty: (dynamic, String) → bool
2952 function jsHasOwnProperty(jsObject, property) { 3166 function jsHasOwnProperty(jsObject, property) {
2953 return jsObject.hasOwnProperty(property); 3167 return jsObject.hasOwnProperty(property);
2954 } 3168 }
2955 // Function jsPropertyAccess: (dynamic, String) → dynamic 3169 dart.fn(jsHasOwnProperty, core.bool, [dart.dynamic, core.String]);
2956 function jsPropertyAccess(jsObject, property) { 3170 function jsPropertyAccess(jsObject, property) {
2957 return jsObject[property]; 3171 return jsObject[property];
2958 } 3172 }
2959 // Function getFallThroughError: () → dynamic 3173 dart.fn(jsPropertyAccess, dart.dynamic, [dart.dynamic, core.String]);
2960 function getFallThroughError() { 3174 function getFallThroughError() {
2961 return new FallThroughErrorImplementation(); 3175 return new FallThroughErrorImplementation();
2962 } 3176 }
3177 dart.fn(getFallThroughError);
2963 class Creates extends core.Object { 3178 class Creates extends core.Object {
2964 Creates(types) { 3179 Creates(types) {
2965 this.types = types; 3180 this.types = types;
2966 } 3181 }
2967 } 3182 }
3183 dart.setSignature(Creates, {});
2968 class Returns extends core.Object { 3184 class Returns extends core.Object {
2969 Returns(types) { 3185 Returns(types) {
2970 this.types = types; 3186 this.types = types;
2971 } 3187 }
2972 } 3188 }
3189 dart.setSignature(Returns, {});
2973 class JSName extends core.Object { 3190 class JSName extends core.Object {
2974 JSName(name) { 3191 JSName(name) {
2975 this.name = name; 3192 this.name = name;
2976 } 3193 }
2977 } 3194 }
2978 // Function boolConversionCheck: (dynamic) → dynamic 3195 dart.setSignature(JSName, {});
2979 function boolConversionCheck(value) { 3196 function boolConversionCheck(value) {
2980 if (typeof value == 'boolean') 3197 if (typeof value == 'boolean')
2981 return value; 3198 return value;
2982 boolTypeCheck(value); 3199 boolTypeCheck(value);
2983 dart.assert(value != null); 3200 dart.assert(value != null);
2984 return false; 3201 return false;
2985 } 3202 }
2986 // Function stringTypeCheck: (dynamic) → dynamic 3203 dart.fn(boolConversionCheck);
2987 function stringTypeCheck(value) { 3204 function stringTypeCheck(value) {
2988 if (value == null) 3205 if (value == null)
2989 return value; 3206 return value;
2990 if (typeof value == 'string') 3207 if (typeof value == 'string')
2991 return value; 3208 return value;
2992 throw new TypeErrorImplementation(value, 'String'); 3209 throw new TypeErrorImplementation(value, 'String');
2993 } 3210 }
2994 // Function stringTypeCast: (dynamic) → dynamic 3211 dart.fn(stringTypeCheck);
2995 function stringTypeCast(value) { 3212 function stringTypeCast(value) {
2996 if (typeof value == 'string' || dart.notNull(value == null)) 3213 if (typeof value == 'string' || dart.notNull(value == null))
2997 return value; 3214 return value;
2998 throw new CastErrorImplementation(Primitives.objectTypeName(value), 'String' ); 3215 throw new CastErrorImplementation(Primitives.objectTypeName(value), 'String' );
2999 } 3216 }
3000 // Function doubleTypeCheck: (dynamic) → dynamic 3217 dart.fn(stringTypeCast);
3001 function doubleTypeCheck(value) { 3218 function doubleTypeCheck(value) {
3002 if (value == null) 3219 if (value == null)
3003 return value; 3220 return value;
3004 if (typeof value == 'number') 3221 if (typeof value == 'number')
3005 return value; 3222 return value;
3006 throw new TypeErrorImplementation(value, 'double'); 3223 throw new TypeErrorImplementation(value, 'double');
3007 } 3224 }
3008 // Function doubleTypeCast: (dynamic) → dynamic 3225 dart.fn(doubleTypeCheck);
3009 function doubleTypeCast(value) { 3226 function doubleTypeCast(value) {
3010 if (typeof value == 'number' || dart.notNull(value == null)) 3227 if (typeof value == 'number' || dart.notNull(value == null))
3011 return value; 3228 return value;
3012 throw new CastErrorImplementation(Primitives.objectTypeName(value), 'double' ); 3229 throw new CastErrorImplementation(Primitives.objectTypeName(value), 'double' );
3013 } 3230 }
3014 // Function numTypeCheck: (dynamic) → dynamic 3231 dart.fn(doubleTypeCast);
3015 function numTypeCheck(value) { 3232 function numTypeCheck(value) {
3016 if (value == null) 3233 if (value == null)
3017 return value; 3234 return value;
3018 if (dart.is(value, core.num)) 3235 if (dart.is(value, core.num))
3019 return value; 3236 return value;
3020 throw new TypeErrorImplementation(value, 'num'); 3237 throw new TypeErrorImplementation(value, 'num');
3021 } 3238 }
3022 // Function numTypeCast: (dynamic) → dynamic 3239 dart.fn(numTypeCheck);
3023 function numTypeCast(value) { 3240 function numTypeCast(value) {
3024 if (dart.is(value, core.num) || dart.notNull(value == null)) 3241 if (dart.is(value, core.num) || dart.notNull(value == null))
3025 return value; 3242 return value;
3026 throw new CastErrorImplementation(Primitives.objectTypeName(value), 'num'); 3243 throw new CastErrorImplementation(Primitives.objectTypeName(value), 'num');
3027 } 3244 }
3028 // Function boolTypeCheck: (dynamic) → dynamic 3245 dart.fn(numTypeCast);
3029 function boolTypeCheck(value) { 3246 function boolTypeCheck(value) {
3030 if (value == null) 3247 if (value == null)
3031 return value; 3248 return value;
3032 if (typeof value == 'boolean') 3249 if (typeof value == 'boolean')
3033 return value; 3250 return value;
3034 throw new TypeErrorImplementation(value, 'bool'); 3251 throw new TypeErrorImplementation(value, 'bool');
3035 } 3252 }
3036 // Function boolTypeCast: (dynamic) → dynamic 3253 dart.fn(boolTypeCheck);
3037 function boolTypeCast(value) { 3254 function boolTypeCast(value) {
3038 if (typeof value == 'boolean' || dart.notNull(value == null)) 3255 if (typeof value == 'boolean' || dart.notNull(value == null))
3039 return value; 3256 return value;
3040 throw new CastErrorImplementation(Primitives.objectTypeName(value), 'bool'); 3257 throw new CastErrorImplementation(Primitives.objectTypeName(value), 'bool');
3041 } 3258 }
3042 // Function intTypeCheck: (dynamic) → dynamic 3259 dart.fn(boolTypeCast);
3043 function intTypeCheck(value) { 3260 function intTypeCheck(value) {
3044 if (value == null) 3261 if (value == null)
3045 return value; 3262 return value;
3046 if (typeof value == 'number') 3263 if (typeof value == 'number')
3047 return value; 3264 return value;
3048 throw new TypeErrorImplementation(value, 'int'); 3265 throw new TypeErrorImplementation(value, 'int');
3049 } 3266 }
3050 // Function intTypeCast: (dynamic) → dynamic 3267 dart.fn(intTypeCheck);
3051 function intTypeCast(value) { 3268 function intTypeCast(value) {
3052 if (typeof value == 'number' || dart.notNull(value == null)) 3269 if (typeof value == 'number' || dart.notNull(value == null))
3053 return value; 3270 return value;
3054 throw new CastErrorImplementation(Primitives.objectTypeName(value), 'int'); 3271 throw new CastErrorImplementation(Primitives.objectTypeName(value), 'int');
3055 } 3272 }
3056 // Function propertyTypeError: (dynamic, dynamic) → void 3273 dart.fn(intTypeCast);
3057 function propertyTypeError(value, property) { 3274 function propertyTypeError(value, property) {
3058 let name = dart.as(dart.dsend(property, 'substring', 3, dart.dload(property, 'length')), core.String); 3275 let name = dart.as(dart.dsend(property, 'substring', 3, dart.dload(property, 'length')), core.String);
3059 throw new TypeErrorImplementation(value, name); 3276 throw new TypeErrorImplementation(value, name);
3060 } 3277 }
3061 // Function propertyTypeCastError: (dynamic, dynamic) → void 3278 dart.fn(propertyTypeError, dart.void, [dart.dynamic, dart.dynamic]);
3062 function propertyTypeCastError(value, property) { 3279 function propertyTypeCastError(value, property) {
3063 let actualType = Primitives.objectTypeName(value); 3280 let actualType = Primitives.objectTypeName(value);
3064 let expectedType = dart.as(dart.dsend(property, 'substring', 3, dart.dload(p roperty, 'length')), core.String); 3281 let expectedType = dart.as(dart.dsend(property, 'substring', 3, dart.dload(p roperty, 'length')), core.String);
3065 throw new CastErrorImplementation(actualType, expectedType); 3282 throw new CastErrorImplementation(actualType, expectedType);
3066 } 3283 }
3067 // Function propertyTypeCheck: (dynamic, dynamic) → dynamic 3284 dart.fn(propertyTypeCastError, dart.void, [dart.dynamic, dart.dynamic]);
3068 function propertyTypeCheck(value, property) { 3285 function propertyTypeCheck(value, property) {
3069 if (value == null) 3286 if (value == null)
3070 return value; 3287 return value;
3071 if (!!value[property]) 3288 if (!!value[property])
3072 return value; 3289 return value;
3073 propertyTypeError(value, property); 3290 propertyTypeError(value, property);
3074 } 3291 }
3075 // Function propertyTypeCast: (dynamic, dynamic) → dynamic 3292 dart.fn(propertyTypeCheck);
3076 function propertyTypeCast(value, property) { 3293 function propertyTypeCast(value, property) {
3077 if (dart.notNull(value == null) || !!value[property]) 3294 if (dart.notNull(value == null) || !!value[property])
3078 return value; 3295 return value;
3079 propertyTypeCastError(value, property); 3296 propertyTypeCastError(value, property);
3080 } 3297 }
3081 // Function interceptedTypeCheck: (dynamic, dynamic) → dynamic 3298 dart.fn(propertyTypeCast);
3082 function interceptedTypeCheck(value, property) { 3299 function interceptedTypeCheck(value, property) {
3083 if (value == null) 3300 if (value == null)
3084 return value; 3301 return value;
3085 if (dart.notNull(core.identical(typeof value, 'object')) && _interceptors.ge tInterceptor(value)[property]) { 3302 if (dart.notNull(core.identical(typeof value, 'object')) && _interceptors.ge tInterceptor(value)[property]) {
3086 return value; 3303 return value;
3087 } 3304 }
3088 propertyTypeError(value, property); 3305 propertyTypeError(value, property);
3089 } 3306 }
3090 // Function interceptedTypeCast: (dynamic, dynamic) → dynamic 3307 dart.fn(interceptedTypeCheck);
3091 function interceptedTypeCast(value, property) { 3308 function interceptedTypeCast(value, property) {
3092 if (dart.notNull(value == null) || typeof value === "object" && _interceptor s.getInterceptor(value)[property]) { 3309 if (dart.notNull(value == null) || typeof value === "object" && _interceptor s.getInterceptor(value)[property]) {
3093 return value; 3310 return value;
3094 } 3311 }
3095 propertyTypeCastError(value, property); 3312 propertyTypeCastError(value, property);
3096 } 3313 }
3097 // Function numberOrStringSuperTypeCheck: (dynamic, dynamic) → dynamic 3314 dart.fn(interceptedTypeCast);
3098 function numberOrStringSuperTypeCheck(value, property) { 3315 function numberOrStringSuperTypeCheck(value, property) {
3099 if (value == null) 3316 if (value == null)
3100 return value; 3317 return value;
3101 if (typeof value == 'string') 3318 if (typeof value == 'string')
3102 return value; 3319 return value;
3103 if (dart.is(value, core.num)) 3320 if (dart.is(value, core.num))
3104 return value; 3321 return value;
3105 if (!!value[property]) 3322 if (!!value[property])
3106 return value; 3323 return value;
3107 propertyTypeError(value, property); 3324 propertyTypeError(value, property);
3108 } 3325 }
3109 // Function numberOrStringSuperTypeCast: (dynamic, dynamic) → dynamic 3326 dart.fn(numberOrStringSuperTypeCheck);
3110 function numberOrStringSuperTypeCast(value, property) { 3327 function numberOrStringSuperTypeCast(value, property) {
3111 if (typeof value == 'string') 3328 if (typeof value == 'string')
3112 return value; 3329 return value;
3113 if (dart.is(value, core.num)) 3330 if (dart.is(value, core.num))
3114 return value; 3331 return value;
3115 return propertyTypeCast(value, property); 3332 return propertyTypeCast(value, property);
3116 } 3333 }
3117 // Function numberOrStringSuperNativeTypeCheck: (dynamic, dynamic) → dynamic 3334 dart.fn(numberOrStringSuperTypeCast);
3118 function numberOrStringSuperNativeTypeCheck(value, property) { 3335 function numberOrStringSuperNativeTypeCheck(value, property) {
3119 if (value == null) 3336 if (value == null)
3120 return value; 3337 return value;
3121 if (typeof value == 'string') 3338 if (typeof value == 'string')
3122 return value; 3339 return value;
3123 if (dart.is(value, core.num)) 3340 if (dart.is(value, core.num))
3124 return value; 3341 return value;
3125 if (_interceptors.getInterceptor(value)[property]) 3342 if (_interceptors.getInterceptor(value)[property])
3126 return value; 3343 return value;
3127 propertyTypeError(value, property); 3344 propertyTypeError(value, property);
3128 } 3345 }
3129 // Function numberOrStringSuperNativeTypeCast: (dynamic, dynamic) → dynamic 3346 dart.fn(numberOrStringSuperNativeTypeCheck);
3130 function numberOrStringSuperNativeTypeCast(value, property) { 3347 function numberOrStringSuperNativeTypeCast(value, property) {
3131 if (value == null) 3348 if (value == null)
3132 return value; 3349 return value;
3133 if (typeof value == 'string') 3350 if (typeof value == 'string')
3134 return value; 3351 return value;
3135 if (dart.is(value, core.num)) 3352 if (dart.is(value, core.num))
3136 return value; 3353 return value;
3137 if (_interceptors.getInterceptor(value)[property]) 3354 if (_interceptors.getInterceptor(value)[property])
3138 return value; 3355 return value;
3139 propertyTypeCastError(value, property); 3356 propertyTypeCastError(value, property);
3140 } 3357 }
3141 // Function stringSuperTypeCheck: (dynamic, dynamic) → dynamic 3358 dart.fn(numberOrStringSuperNativeTypeCast);
3142 function stringSuperTypeCheck(value, property) { 3359 function stringSuperTypeCheck(value, property) {
3143 if (value == null) 3360 if (value == null)
3144 return value; 3361 return value;
3145 if (typeof value == 'string') 3362 if (typeof value == 'string')
3146 return value; 3363 return value;
3147 if (!!value[property]) 3364 if (!!value[property])
3148 return value; 3365 return value;
3149 propertyTypeError(value, property); 3366 propertyTypeError(value, property);
3150 } 3367 }
3151 // Function stringSuperTypeCast: (dynamic, dynamic) → dynamic 3368 dart.fn(stringSuperTypeCheck);
3152 function stringSuperTypeCast(value, property) { 3369 function stringSuperTypeCast(value, property) {
3153 if (typeof value == 'string') 3370 if (typeof value == 'string')
3154 return value; 3371 return value;
3155 return propertyTypeCast(value, property); 3372 return propertyTypeCast(value, property);
3156 } 3373 }
3157 // Function stringSuperNativeTypeCheck: (dynamic, dynamic) → dynamic 3374 dart.fn(stringSuperTypeCast);
3158 function stringSuperNativeTypeCheck(value, property) { 3375 function stringSuperNativeTypeCheck(value, property) {
3159 if (value == null) 3376 if (value == null)
3160 return value; 3377 return value;
3161 if (typeof value == 'string') 3378 if (typeof value == 'string')
3162 return value; 3379 return value;
3163 if (_interceptors.getInterceptor(value)[property]) 3380 if (_interceptors.getInterceptor(value)[property])
3164 return value; 3381 return value;
3165 propertyTypeError(value, property); 3382 propertyTypeError(value, property);
3166 } 3383 }
3167 // Function stringSuperNativeTypeCast: (dynamic, dynamic) → dynamic 3384 dart.fn(stringSuperNativeTypeCheck);
3168 function stringSuperNativeTypeCast(value, property) { 3385 function stringSuperNativeTypeCast(value, property) {
3169 if (typeof value == 'string' || dart.notNull(value == null)) 3386 if (typeof value == 'string' || dart.notNull(value == null))
3170 return value; 3387 return value;
3171 if (_interceptors.getInterceptor(value)[property]) 3388 if (_interceptors.getInterceptor(value)[property])
3172 return value; 3389 return value;
3173 propertyTypeCastError(value, property); 3390 propertyTypeCastError(value, property);
3174 } 3391 }
3175 // Function listTypeCheck: (dynamic) → dynamic 3392 dart.fn(stringSuperNativeTypeCast);
3176 function listTypeCheck(value) { 3393 function listTypeCheck(value) {
3177 if (value == null) 3394 if (value == null)
3178 return value; 3395 return value;
3179 if (dart.is(value, core.List)) 3396 if (dart.is(value, core.List))
3180 return value; 3397 return value;
3181 throw new TypeErrorImplementation(value, 'List'); 3398 throw new TypeErrorImplementation(value, 'List');
3182 } 3399 }
3183 // Function listTypeCast: (dynamic) → dynamic 3400 dart.fn(listTypeCheck);
3184 function listTypeCast(value) { 3401 function listTypeCast(value) {
3185 if (dart.is(value, core.List) || dart.notNull(value == null)) 3402 if (dart.is(value, core.List) || dart.notNull(value == null))
3186 return value; 3403 return value;
3187 throw new CastErrorImplementation(Primitives.objectTypeName(value), 'List'); 3404 throw new CastErrorImplementation(Primitives.objectTypeName(value), 'List');
3188 } 3405 }
3189 // Function listSuperTypeCheck: (dynamic, dynamic) → dynamic 3406 dart.fn(listTypeCast);
3190 function listSuperTypeCheck(value, property) { 3407 function listSuperTypeCheck(value, property) {
3191 if (value == null) 3408 if (value == null)
3192 return value; 3409 return value;
3193 if (dart.is(value, core.List)) 3410 if (dart.is(value, core.List))
3194 return value; 3411 return value;
3195 if (!!value[property]) 3412 if (!!value[property])
3196 return value; 3413 return value;
3197 propertyTypeError(value, property); 3414 propertyTypeError(value, property);
3198 } 3415 }
3199 // Function listSuperTypeCast: (dynamic, dynamic) → dynamic 3416 dart.fn(listSuperTypeCheck);
3200 function listSuperTypeCast(value, property) { 3417 function listSuperTypeCast(value, property) {
3201 if (dart.is(value, core.List)) 3418 if (dart.is(value, core.List))
3202 return value; 3419 return value;
3203 return propertyTypeCast(value, property); 3420 return propertyTypeCast(value, property);
3204 } 3421 }
3205 // Function listSuperNativeTypeCheck: (dynamic, dynamic) → dynamic 3422 dart.fn(listSuperTypeCast);
3206 function listSuperNativeTypeCheck(value, property) { 3423 function listSuperNativeTypeCheck(value, property) {
3207 if (value == null) 3424 if (value == null)
3208 return value; 3425 return value;
3209 if (dart.is(value, core.List)) 3426 if (dart.is(value, core.List))
3210 return value; 3427 return value;
3211 if (_interceptors.getInterceptor(value)[property]) 3428 if (_interceptors.getInterceptor(value)[property])
3212 return value; 3429 return value;
3213 propertyTypeError(value, property); 3430 propertyTypeError(value, property);
3214 } 3431 }
3215 // Function listSuperNativeTypeCast: (dynamic, dynamic) → dynamic 3432 dart.fn(listSuperNativeTypeCheck);
3216 function listSuperNativeTypeCast(value, property) { 3433 function listSuperNativeTypeCast(value, property) {
3217 if (dart.is(value, core.List) || dart.notNull(value == null)) 3434 if (dart.is(value, core.List) || dart.notNull(value == null))
3218 return value; 3435 return value;
3219 if (_interceptors.getInterceptor(value)[property]) 3436 if (_interceptors.getInterceptor(value)[property])
3220 return value; 3437 return value;
3221 propertyTypeCastError(value, property); 3438 propertyTypeCastError(value, property);
3222 } 3439 }
3223 // Function voidTypeCheck: (dynamic) → dynamic 3440 dart.fn(listSuperNativeTypeCast);
3224 function voidTypeCheck(value) { 3441 function voidTypeCheck(value) {
3225 if (value == null) 3442 if (value == null)
3226 return value; 3443 return value;
3227 throw new TypeErrorImplementation(value, 'void'); 3444 throw new TypeErrorImplementation(value, 'void');
3228 } 3445 }
3229 // Function checkMalformedType: (dynamic, dynamic) → dynamic 3446 dart.fn(voidTypeCheck);
3230 function checkMalformedType(value, message) { 3447 function checkMalformedType(value, message) {
3231 if (value == null) 3448 if (value == null)
3232 return value; 3449 return value;
3233 throw new TypeErrorImplementation.fromMessage(dart.as(message, core.String)) ; 3450 throw new TypeErrorImplementation.fromMessage(dart.as(message, core.String)) ;
3234 } 3451 }
3235 // Function checkDeferredIsLoaded: (String, String) → void 3452 dart.fn(checkMalformedType);
3236 function checkDeferredIsLoaded(loadId, uri) { 3453 function checkDeferredIsLoaded(loadId, uri) {
3237 if (!dart.notNull(exports._loadedLibraries[core.$contains](loadId))) { 3454 if (!dart.notNull(exports._loadedLibraries[core.$contains](loadId))) {
3238 throw new DeferredNotLoadedError(uri); 3455 throw new DeferredNotLoadedError(uri);
3239 } 3456 }
3240 } 3457 }
3458 dart.fn(checkDeferredIsLoaded, dart.void, [core.String, core.String]);
3241 dart.defineLazyClass(exports, { 3459 dart.defineLazyClass(exports, {
3242 get JavaScriptIndexingBehavior() { 3460 get JavaScriptIndexingBehavior() {
3243 class JavaScriptIndexingBehavior extends _interceptors.JSMutableIndexable {} 3461 class JavaScriptIndexingBehavior extends _interceptors.JSMutableIndexable {}
3462 dart.setSignature(JavaScriptIndexingBehavior, {});
3244 return JavaScriptIndexingBehavior; 3463 return JavaScriptIndexingBehavior;
3245 } 3464 }
3246 }); 3465 });
3247 class TypeErrorImplementation extends core.Error { 3466 class TypeErrorImplementation extends core.Error {
3248 TypeErrorImplementation(value, type) { 3467 TypeErrorImplementation(value, type) {
3249 this.message = `type '${Primitives.objectTypeName(value)}' is not a subtyp e ` + `of type '${type}'`; 3468 this.message = `type '${Primitives.objectTypeName(value)}' is not a subtyp e ` + `of type '${type}'`;
3250 super.Error(); 3469 super.Error();
3251 } 3470 }
3252 fromMessage(message) { 3471 fromMessage(message) {
3253 this.message = message; 3472 this.message = message;
3254 super.Error(); 3473 super.Error();
3255 } 3474 }
3256 toString() { 3475 toString() {
3257 return this.message; 3476 return this.message;
3258 } 3477 }
3259 } 3478 }
3260 TypeErrorImplementation[dart.implements] = () => [core.TypeError]; 3479 TypeErrorImplementation[dart.implements] = () => [core.TypeError];
3261 dart.defineNamedConstructor(TypeErrorImplementation, 'fromMessage'); 3480 dart.defineNamedConstructor(TypeErrorImplementation, 'fromMessage');
3481 dart.setSignature(TypeErrorImplementation, {
3482 methods: () => ({toString: dart.functionType(core.String, [])})
3483 });
3262 class CastErrorImplementation extends core.Error { 3484 class CastErrorImplementation extends core.Error {
3263 CastErrorImplementation(actualType, expectedType) { 3485 CastErrorImplementation(actualType, expectedType) {
3264 this.message = `CastError: Casting value of type ${actualType} to` + ` inc ompatible type ${expectedType}`; 3486 this.message = `CastError: Casting value of type ${actualType} to` + ` inc ompatible type ${expectedType}`;
3265 super.Error(); 3487 super.Error();
3266 } 3488 }
3267 toString() { 3489 toString() {
3268 return this.message; 3490 return this.message;
3269 } 3491 }
3270 } 3492 }
3271 CastErrorImplementation[dart.implements] = () => [core.CastError]; 3493 CastErrorImplementation[dart.implements] = () => [core.CastError];
3494 dart.setSignature(CastErrorImplementation, {
3495 methods: () => ({toString: dart.functionType(core.String, [])})
3496 });
3272 class FallThroughErrorImplementation extends core.FallThroughError { 3497 class FallThroughErrorImplementation extends core.FallThroughError {
3273 FallThroughErrorImplementation() { 3498 FallThroughErrorImplementation() {
3274 super.FallThroughError(); 3499 super.FallThroughError();
3275 } 3500 }
3276 toString() { 3501 toString() {
3277 return "Switch case fall-through."; 3502 return "Switch case fall-through.";
3278 } 3503 }
3279 } 3504 }
3280 // Function assertHelper: (dynamic) → void 3505 dart.setSignature(FallThroughErrorImplementation, {
3506 methods: () => ({toString: dart.functionType(core.String, [])})
3507 });
3281 function assertHelper(condition) { 3508 function assertHelper(condition) {
3282 if (!(typeof condition == 'boolean')) { 3509 if (!(typeof condition == 'boolean')) {
3283 if (dart.is(condition, core.Function)) 3510 if (dart.is(condition, core.Function))
3284 condition = dart.dcall(condition); 3511 condition = dart.dcall(condition);
3285 if (!(typeof condition == 'boolean')) { 3512 if (!(typeof condition == 'boolean')) {
3286 throw new TypeErrorImplementation(condition, 'bool'); 3513 throw new TypeErrorImplementation(condition, 'bool');
3287 } 3514 }
3288 } 3515 }
3289 if (!dart.equals(true, condition)) 3516 if (!dart.equals(true, condition))
3290 throw new core.AssertionError(); 3517 throw new core.AssertionError();
3291 } 3518 }
3292 // Function throwNoSuchMethod: (dynamic, dynamic, dynamic, dynamic) → void 3519 dart.fn(assertHelper, dart.void, [dart.dynamic]);
3293 function throwNoSuchMethod(obj, name, arguments$, expectedArgumentNames) { 3520 function throwNoSuchMethod(obj, name, arguments$, expectedArgumentNames) {
3294 let memberName = new _internal.Symbol.unvalidated(dart.as(name, core.String) ); 3521 let memberName = new _internal.Symbol.unvalidated(dart.as(name, core.String) );
3295 throw new core.NoSuchMethodError(obj, memberName, dart.as(arguments$, core.L ist), new (core.Map$(core.Symbol, dart.dynamic))(), dart.as(expectedArgumentName s, core.List)); 3522 throw new core.NoSuchMethodError(obj, memberName, dart.as(arguments$, core.L ist), new (core.Map$(core.Symbol, dart.dynamic))(), dart.as(expectedArgumentName s, core.List));
3296 } 3523 }
3297 // Function throwCyclicInit: (String) → void 3524 dart.fn(throwNoSuchMethod, dart.void, [dart.dynamic, dart.dynamic, dart.dynami c, dart.dynamic]);
3298 function throwCyclicInit(staticName) { 3525 function throwCyclicInit(staticName) {
3299 throw new core.CyclicInitializationError(`Cyclic initialization for static $ {staticName}`); 3526 throw new core.CyclicInitializationError(`Cyclic initialization for static $ {staticName}`);
3300 } 3527 }
3528 dart.fn(throwCyclicInit, dart.void, [core.String]);
3301 class RuntimeError extends core.Error { 3529 class RuntimeError extends core.Error {
3302 RuntimeError(message) { 3530 RuntimeError(message) {
3303 this.message = message; 3531 this.message = message;
3304 super.Error(); 3532 super.Error();
3305 } 3533 }
3306 toString() { 3534 toString() {
3307 return `RuntimeError: ${this.message}`; 3535 return `RuntimeError: ${this.message}`;
3308 } 3536 }
3309 } 3537 }
3538 dart.setSignature(RuntimeError, {
3539 methods: () => ({toString: dart.functionType(core.String, [])})
3540 });
3310 class DeferredNotLoadedError extends core.Error { 3541 class DeferredNotLoadedError extends core.Error {
3311 DeferredNotLoadedError(libraryName) { 3542 DeferredNotLoadedError(libraryName) {
3312 this.libraryName = libraryName; 3543 this.libraryName = libraryName;
3313 super.Error(); 3544 super.Error();
3314 } 3545 }
3315 toString() { 3546 toString() {
3316 return `Deferred library ${this.libraryName} was not loaded.`; 3547 return `Deferred library ${this.libraryName} was not loaded.`;
3317 } 3548 }
3318 } 3549 }
3319 DeferredNotLoadedError[dart.implements] = () => [core.NoSuchMethodError]; 3550 DeferredNotLoadedError[dart.implements] = () => [core.NoSuchMethodError];
3551 dart.setSignature(DeferredNotLoadedError, {
3552 methods: () => ({toString: dart.functionType(core.String, [])})
3553 });
3320 class RuntimeType extends core.Object { 3554 class RuntimeType extends core.Object {
3321 RuntimeType() { 3555 RuntimeType() {
3322 } 3556 }
3323 } 3557 }
3558 dart.setSignature(RuntimeType, {});
3324 let _isTest = Symbol('_isTest'); 3559 let _isTest = Symbol('_isTest');
3325 let _extractFunctionTypeObjectFrom = Symbol('_extractFunctionTypeObjectFrom'); 3560 let _extractFunctionTypeObjectFrom = Symbol('_extractFunctionTypeObjectFrom');
3326 let _asCheck = Symbol('_asCheck'); 3561 let _asCheck = Symbol('_asCheck');
3327 let _check = Symbol('_check'); 3562 let _check = Symbol('_check');
3328 let _assertCheck = Symbol('_assertCheck'); 3563 let _assertCheck = Symbol('_assertCheck');
3329 class RuntimeFunctionType extends RuntimeType { 3564 class RuntimeFunctionType extends RuntimeType {
3330 RuntimeFunctionType(returnType, parameterTypes, optionalParameterTypes, name dParameters) { 3565 RuntimeFunctionType(returnType, parameterTypes, optionalParameterTypes, name dParameters) {
3331 this.returnType = returnType; 3566 this.returnType = returnType;
3332 this.parameterTypes = parameterTypes; 3567 this.parameterTypes = parameterTypes;
3333 this.optionalParameterTypes = optionalParameterTypes; 3568 this.optionalParameterTypes = optionalParameterTypes;
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
3455 let rti = dart.dsend(this.namedParameters[name], 'toRti'); 3690 let rti = dart.dsend(this.namedParameters[name], 'toRti');
3456 result = dart.notNull(result) + `${rti} ${name}`; 3691 result = dart.notNull(result) + `${rti} ${name}`;
3457 needsComma = true; 3692 needsComma = true;
3458 } 3693 }
3459 result = dart.notNull(result) + '}'; 3694 result = dart.notNull(result) + '}';
3460 } 3695 }
3461 result = dart.notNull(result) + `) -> ${this.returnType}`; 3696 result = dart.notNull(result) + `) -> ${this.returnType}`;
3462 return result; 3697 return result;
3463 } 3698 }
3464 } 3699 }
3700 dart.setSignature(RuntimeFunctionType, {
3701 methods: () => ({
3702 [_isTest]: dart.functionType(core.bool, [dart.dynamic]),
3703 [_asCheck]: dart.functionType(dart.dynamic, [dart.dynamic]),
3704 [_assertCheck]: dart.functionType(dart.dynamic, [dart.dynamic]),
3705 [_check]: dart.functionType(dart.dynamic, [dart.dynamic, core.bool]),
3706 [_extractFunctionTypeObjectFrom]: dart.functionType(dart.dynamic, [dart.dy namic]),
3707 toRti: dart.functionType(dart.dynamic, []),
3708 toString: dart.functionType(core.String, [])
3709 }),
3710 statics: () => ({listToRti: dart.functionType(dart.dynamic, [dart.dynamic])} ),
3711 names: ['listToRti']
3712 });
3465 RuntimeFunctionType.inAssert = false; 3713 RuntimeFunctionType.inAssert = false;
3466 // Function buildFunctionType: (dynamic, dynamic, dynamic) → RuntimeFunctionTy pe
3467 function buildFunctionType(returnType, parameterTypes, optionalParameterTypes) { 3714 function buildFunctionType(returnType, parameterTypes, optionalParameterTypes) {
3468 return new RuntimeFunctionType(dart.as(returnType, RuntimeType), dart.as(par ameterTypes, core.List$(RuntimeType)), dart.as(optionalParameterTypes, core.List $(RuntimeType)), null); 3715 return new RuntimeFunctionType(dart.as(returnType, RuntimeType), dart.as(par ameterTypes, core.List$(RuntimeType)), dart.as(optionalParameterTypes, core.List $(RuntimeType)), null);
3469 } 3716 }
3470 // Function buildNamedFunctionType: (dynamic, dynamic, dynamic) → RuntimeFunct ionType 3717 dart.fn(buildFunctionType, RuntimeFunctionType, [dart.dynamic, dart.dynamic, d art.dynamic]);
3471 function buildNamedFunctionType(returnType, parameterTypes, namedParameters) { 3718 function buildNamedFunctionType(returnType, parameterTypes, namedParameters) {
3472 return new RuntimeFunctionType(dart.as(returnType, RuntimeType), dart.as(par ameterTypes, core.List$(RuntimeType)), null, namedParameters); 3719 return new RuntimeFunctionType(dart.as(returnType, RuntimeType), dart.as(par ameterTypes, core.List$(RuntimeType)), null, namedParameters);
3473 } 3720 }
3474 // Function buildInterfaceType: (dynamic, dynamic) → RuntimeType 3721 dart.fn(buildNamedFunctionType, RuntimeFunctionType, [dart.dynamic, dart.dynam ic, dart.dynamic]);
3475 function buildInterfaceType(rti, typeArguments) { 3722 function buildInterfaceType(rti, typeArguments) {
3476 let name = dart.as(rti.name, core.String); 3723 let name = dart.as(rti.name, core.String);
3477 if ((typeArguments == null)['||'](dart.dload(typeArguments, 'isEmpty'))) { 3724 if ((typeArguments == null)['||'](dart.dload(typeArguments, 'isEmpty'))) {
3478 return new RuntimeTypePlain(name); 3725 return new RuntimeTypePlain(name);
3479 } 3726 }
3480 return new RuntimeTypeGeneric(name, dart.as(typeArguments, core.List$(Runtim eType)), null); 3727 return new RuntimeTypeGeneric(name, dart.as(typeArguments, core.List$(Runtim eType)), null);
3481 } 3728 }
3729 dart.fn(buildInterfaceType, RuntimeType, [dart.dynamic, dart.dynamic]);
3482 class DynamicRuntimeType extends RuntimeType { 3730 class DynamicRuntimeType extends RuntimeType {
3483 DynamicRuntimeType() { 3731 DynamicRuntimeType() {
3484 super.RuntimeType(); 3732 super.RuntimeType();
3485 } 3733 }
3486 toString() { 3734 toString() {
3487 return 'dynamic'; 3735 return 'dynamic';
3488 } 3736 }
3489 toRti() { 3737 toRti() {
3490 return null; 3738 return null;
3491 } 3739 }
3492 } 3740 }
3493 // Function getDynamicRuntimeType: () → RuntimeType 3741 dart.setSignature(DynamicRuntimeType, {
3742 methods: () => ({
3743 toString: dart.functionType(core.String, []),
3744 toRti: dart.functionType(dart.dynamic, [])
3745 })
3746 });
3494 function getDynamicRuntimeType() { 3747 function getDynamicRuntimeType() {
3495 return dart.const(new DynamicRuntimeType()); 3748 return dart.const(new DynamicRuntimeType());
3496 } 3749 }
3750 dart.fn(getDynamicRuntimeType, RuntimeType, []);
3497 class VoidRuntimeType extends RuntimeType { 3751 class VoidRuntimeType extends RuntimeType {
3498 VoidRuntimeType() { 3752 VoidRuntimeType() {
3499 super.RuntimeType(); 3753 super.RuntimeType();
3500 } 3754 }
3501 toString() { 3755 toString() {
3502 return 'void'; 3756 return 'void';
3503 } 3757 }
3504 toRti() { 3758 toRti() {
3505 return dart.throw_('internal error'); 3759 return dart.throw_('internal error');
3506 } 3760 }
3507 } 3761 }
3508 // Function getVoidRuntimeType: () → RuntimeType 3762 dart.setSignature(VoidRuntimeType, {
3763 methods: () => ({
3764 toString: dart.functionType(core.String, []),
3765 toRti: dart.functionType(dart.dynamic, [])
3766 })
3767 });
3509 function getVoidRuntimeType() { 3768 function getVoidRuntimeType() {
3510 return dart.const(new VoidRuntimeType()); 3769 return dart.const(new VoidRuntimeType());
3511 } 3770 }
3512 // Function functionTypeTestMetaHelper: () → dynamic 3771 dart.fn(getVoidRuntimeType, RuntimeType, []);
3513 function functionTypeTestMetaHelper() { 3772 function functionTypeTestMetaHelper() {
3514 let dyn = x; 3773 let dyn = x;
3515 let dyn2 = x; 3774 let dyn2 = x;
3516 let fixedListOrNull = dart.as(x, core.List); 3775 let fixedListOrNull = dart.as(x, core.List);
3517 let fixedListOrNull2 = dart.as(x, core.List); 3776 let fixedListOrNull2 = dart.as(x, core.List);
3518 let fixedList = dart.as(x, core.List); 3777 let fixedList = dart.as(x, core.List);
3519 let jsObject = x; 3778 let jsObject = x;
3520 buildFunctionType(dyn, fixedListOrNull, fixedListOrNull2); 3779 buildFunctionType(dyn, fixedListOrNull, fixedListOrNull2);
3521 buildNamedFunctionType(dyn, fixedList, jsObject); 3780 buildNamedFunctionType(dyn, fixedList, jsObject);
3522 buildInterfaceType(dyn, fixedListOrNull); 3781 buildInterfaceType(dyn, fixedListOrNull);
3523 getDynamicRuntimeType(); 3782 getDynamicRuntimeType();
3524 getVoidRuntimeType(); 3783 getVoidRuntimeType();
3525 convertRtiToRuntimeType(dyn); 3784 convertRtiToRuntimeType(dyn);
3526 dart.dsend(dyn, _isTest, dyn2); 3785 dart.dsend(dyn, _isTest, dyn2);
3527 dart.dsend(dyn, _asCheck, dyn2); 3786 dart.dsend(dyn, _asCheck, dyn2);
3528 dart.dsend(dyn, _assertCheck, dyn2); 3787 dart.dsend(dyn, _assertCheck, dyn2);
3529 } 3788 }
3530 // Function convertRtiToRuntimeType: (dynamic) → RuntimeType 3789 dart.fn(functionTypeTestMetaHelper);
3531 function convertRtiToRuntimeType(rti) { 3790 function convertRtiToRuntimeType(rti) {
3532 if (rti == null) { 3791 if (rti == null) {
3533 return getDynamicRuntimeType(); 3792 return getDynamicRuntimeType();
3534 } else if (typeof rti == "function") { 3793 } else if (typeof rti == "function") {
3535 return new RuntimeTypePlain(rti.name); 3794 return new RuntimeTypePlain(rti.name);
3536 } else if (rti.constructor == Array) { 3795 } else if (rti.constructor == Array) {
3537 let list = dart.as(rti, core.List); 3796 let list = dart.as(rti, core.List);
3538 let name = list[core.$get](0).name; 3797 let name = list[core.$get](0).name;
3539 let arguments$ = []; 3798 let arguments$ = [];
3540 for (let i = 1; dart.notNull(i) < dart.notNull(list[core.$length]); i = da rt.notNull(i) + 1) { 3799 for (let i = 1; dart.notNull(i) < dart.notNull(list[core.$length]); i = da rt.notNull(i) + 1) {
3541 arguments$[core.$add](convertRtiToRuntimeType(list[core.$get](i))); 3800 arguments$[core.$add](convertRtiToRuntimeType(list[core.$get](i)));
3542 } 3801 }
3543 return new RuntimeTypeGeneric(name, dart.as(arguments$, core.List$(Runtime Type)), rti); 3802 return new RuntimeTypeGeneric(name, dart.as(arguments$, core.List$(Runtime Type)), rti);
3544 } else if ("func" in rti) { 3803 } else if ("func" in rti) {
3545 return new FunctionTypeInfoDecoderRing(rti).toRuntimeType(); 3804 return new FunctionTypeInfoDecoderRing(rti).toRuntimeType();
3546 } else { 3805 } else {
3547 throw new RuntimeError("Cannot convert " + `'${JSON.stringify(rti)}' to Ru ntimeType.`); 3806 throw new RuntimeError("Cannot convert " + `'${JSON.stringify(rti)}' to Ru ntimeType.`);
3548 } 3807 }
3549 } 3808 }
3809 dart.fn(convertRtiToRuntimeType, RuntimeType, [dart.dynamic]);
3550 class RuntimeTypePlain extends RuntimeType { 3810 class RuntimeTypePlain extends RuntimeType {
3551 RuntimeTypePlain(name) { 3811 RuntimeTypePlain(name) {
3552 this.name = name; 3812 this.name = name;
3553 super.RuntimeType(); 3813 super.RuntimeType();
3554 } 3814 }
3555 toRti() { 3815 toRti() {
3556 let allClasses = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names .ALL_CLASSES); 3816 let allClasses = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names .ALL_CLASSES);
3557 let rti = allClasses[this.name]; 3817 let rti = allClasses[this.name];
3558 if (rti == null) 3818 if (rti == null)
3559 throw `no type for '${this.name}'`; 3819 throw `no type for '${this.name}'`;
3560 return rti; 3820 return rti;
3561 } 3821 }
3562 toString() { 3822 toString() {
3563 return this.name; 3823 return this.name;
3564 } 3824 }
3565 } 3825 }
3826 dart.setSignature(RuntimeTypePlain, {
3827 methods: () => ({
3828 toRti: dart.functionType(dart.dynamic, []),
3829 toString: dart.functionType(core.String, [])
3830 })
3831 });
3566 class RuntimeTypeGeneric extends RuntimeType { 3832 class RuntimeTypeGeneric extends RuntimeType {
3567 RuntimeTypeGeneric(name, arguments$, rti) { 3833 RuntimeTypeGeneric(name, arguments$, rti) {
3568 this.name = name; 3834 this.name = name;
3569 this.arguments = arguments$; 3835 this.arguments = arguments$;
3570 this.rti = rti; 3836 this.rti = rti;
3571 super.RuntimeType(); 3837 super.RuntimeType();
3572 } 3838 }
3573 toRti() { 3839 toRti() {
3574 if (this.rti != null) 3840 if (this.rti != null)
3575 return this.rti; 3841 return this.rti;
3576 let allClasses = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names .ALL_CLASSES); 3842 let allClasses = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names .ALL_CLASSES);
3577 let result = [allClasses[this.name]]; 3843 let result = [allClasses[this.name]];
3578 if (dart.dindex(result, 0) == null) { 3844 if (dart.dindex(result, 0) == null) {
3579 throw `no type for '${this.name}<...>'`; 3845 throw `no type for '${this.name}<...>'`;
3580 } 3846 }
3581 for (let argument of this.arguments) { 3847 for (let argument of this.arguments) {
3582 result.push(argument.toRti()); 3848 result.push(argument.toRti());
3583 } 3849 }
3584 return this.rti = result; 3850 return this.rti = result;
3585 } 3851 }
3586 toString() { 3852 toString() {
3587 return `${this.name}<${this.arguments[core.$join](", ")}>`; 3853 return `${this.name}<${this.arguments[core.$join](", ")}>`;
3588 } 3854 }
3589 } 3855 }
3856 dart.setSignature(RuntimeTypeGeneric, {
3857 methods: () => ({
3858 toRti: dart.functionType(dart.dynamic, []),
3859 toString: dart.functionType(core.String, [])
3860 })
3861 });
3590 let _typeData = Symbol('_typeData'); 3862 let _typeData = Symbol('_typeData');
3591 let _cachedToString = Symbol('_cachedToString'); 3863 let _cachedToString = Symbol('_cachedToString');
3592 let _hasReturnType = Symbol('_hasReturnType'); 3864 let _hasReturnType = Symbol('_hasReturnType');
3593 let _returnType = Symbol('_returnType'); 3865 let _returnType = Symbol('_returnType');
3594 let _isVoid = Symbol('_isVoid'); 3866 let _isVoid = Symbol('_isVoid');
3595 let _hasArguments = Symbol('_hasArguments'); 3867 let _hasArguments = Symbol('_hasArguments');
3596 let _hasOptionalArguments = Symbol('_hasOptionalArguments'); 3868 let _hasOptionalArguments = Symbol('_hasOptionalArguments');
3597 let _optionalArguments = Symbol('_optionalArguments'); 3869 let _optionalArguments = Symbol('_optionalArguments');
3598 let _hasNamedArguments = Symbol('_hasNamedArguments'); 3870 let _hasNamedArguments = Symbol('_hasNamedArguments');
3599 let _namedArguments = Symbol('_namedArguments'); 3871 let _namedArguments = Symbol('_namedArguments');
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
3680 if (this[_isVoid]) { 3952 if (this[_isVoid]) {
3681 s = dart.notNull(s) + 'void'; 3953 s = dart.notNull(s) + 'void';
3682 } else if (this[_hasReturnType]) { 3954 } else if (this[_hasReturnType]) {
3683 s = dart.notNull(s) + dart.notNull(this[_convert](this[_returnType])); 3955 s = dart.notNull(s) + dart.notNull(this[_convert](this[_returnType]));
3684 } else { 3956 } else {
3685 s = dart.notNull(s) + 'dynamic'; 3957 s = dart.notNull(s) + 'dynamic';
3686 } 3958 }
3687 return this[_cachedToString] = `${s}`; 3959 return this[_cachedToString] = `${s}`;
3688 } 3960 }
3689 } 3961 }
3962 dart.setSignature(FunctionTypeInfoDecoderRing, {
3963 methods: () => ({
3964 toRuntimeType: dart.functionType(RuntimeType, []),
3965 [_convert]: dart.functionType(core.String, [dart.dynamic]),
3966 toString: dart.functionType(core.String, [])
3967 })
3968 });
3690 class UnimplementedNoSuchMethodError extends core.Error { 3969 class UnimplementedNoSuchMethodError extends core.Error {
3691 UnimplementedNoSuchMethodError(message) { 3970 UnimplementedNoSuchMethodError(message) {
3692 this[_message] = message; 3971 this[_message] = message;
3693 super.Error(); 3972 super.Error();
3694 } 3973 }
3695 toString() { 3974 toString() {
3696 return `Unsupported operation: ${this[_message]}`; 3975 return `Unsupported operation: ${this[_message]}`;
3697 } 3976 }
3698 } 3977 }
3699 UnimplementedNoSuchMethodError[dart.implements] = () => [core.NoSuchMethodErro r]; 3978 UnimplementedNoSuchMethodError[dart.implements] = () => [core.NoSuchMethodErro r];
3700 // Function random64: () → int 3979 dart.setSignature(UnimplementedNoSuchMethodError, {
3980 methods: () => ({toString: dart.functionType(core.String, [])})
3981 });
3701 function random64() { 3982 function random64() {
3702 let int32a = Math.random() * 0x100000000 >>> 0; 3983 let int32a = Math.random() * 0x100000000 >>> 0;
3703 let int32b = Math.random() * 0x100000000 >>> 0; 3984 let int32b = Math.random() * 0x100000000 >>> 0;
3704 return dart.notNull(int32a) + dart.notNull(int32b) * 4294967296; 3985 return dart.notNull(int32a) + dart.notNull(int32b) * 4294967296;
3705 } 3986 }
3706 // Function jsonEncodeNative: (String) → String 3987 dart.fn(random64, core.int, []);
3707 function jsonEncodeNative(string) { 3988 function jsonEncodeNative(string) {
3708 return JSON.stringify(string); 3989 return JSON.stringify(string);
3709 } 3990 }
3710 // Function getIsolateAffinityTag: (String) → String 3991 dart.fn(jsonEncodeNative, core.String, [core.String]);
3711 function getIsolateAffinityTag(name) { 3992 function getIsolateAffinityTag(name) {
3712 let isolateTagGetter = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_n ames.GET_ISOLATE_TAG); 3993 let isolateTagGetter = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_n ames.GET_ISOLATE_TAG);
3713 return isolateTagGetter(name); 3994 return isolateTagGetter(name);
3714 } 3995 }
3996 dart.fn(getIsolateAffinityTag, core.String, [core.String]);
3715 let LoadLibraryFunctionType = dart.typedef('LoadLibraryFunctionType', () => da rt.functionType(async.Future$(core.Null), [])); 3997 let LoadLibraryFunctionType = dart.typedef('LoadLibraryFunctionType', () => da rt.functionType(async.Future$(core.Null), []));
3716 // Function _loadLibraryWrapper: (String) → () → Future<Null>
3717 function _loadLibraryWrapper(loadId) { 3998 function _loadLibraryWrapper(loadId) {
3718 return () => loadDeferredLibrary(loadId); 3999 return dart.fn(() => loadDeferredLibrary(loadId), async.Future$(core.Null), []);
3719 } 4000 }
4001 dart.fn(_loadLibraryWrapper, LoadLibraryFunctionType, [core.String]);
3720 dart.defineLazyProperties(exports, { 4002 dart.defineLazyProperties(exports, {
3721 get _loadingLibraries() { 4003 get _loadingLibraries() {
3722 return dart.map(); 4004 return dart.map();
3723 }, 4005 },
3724 get _loadedLibraries() { 4006 get _loadedLibraries() {
3725 return new (core.Set$(core.String))(); 4007 return new (core.Set$(core.String))();
3726 } 4008 }
3727 }); 4009 });
3728 let DeferredLoadCallback = dart.typedef('DeferredLoadCallback', () => dart.fun ctionType(dart.void, [])); 4010 let DeferredLoadCallback = dart.typedef('DeferredLoadCallback', () => dart.fun ctionType(dart.void, []));
3729 exports.deferredLoadHook = null; 4011 exports.deferredLoadHook = null;
3730 // Function loadDeferredLibrary: (String) → Future<Null>
3731 function loadDeferredLibrary(loadId) { 4012 function loadDeferredLibrary(loadId) {
3732 let urisMap = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names.DEFE RRED_LIBRARY_URIS); 4013 let urisMap = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names.DEFE RRED_LIBRARY_URIS);
3733 let uris = dart.as(urisMap[loadId], core.List$(core.String)); 4014 let uris = dart.as(urisMap[loadId], core.List$(core.String));
3734 let hashesMap = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names.DE FERRED_LIBRARY_HASHES); 4015 let hashesMap = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names.DE FERRED_LIBRARY_HASHES);
3735 let hashes = dart.as(hashesMap[loadId], core.List$(core.String)); 4016 let hashes = dart.as(hashesMap[loadId], core.List$(core.String));
3736 if (uris == null) 4017 if (uris == null)
3737 return new (async.Future$(core.Null)).value(null); 4018 return new (async.Future$(core.Null)).value(null);
3738 let indices = new (core.List$(core.int)).generate(uris[core.$length], i => d art.as(i, core.int)); 4019 let indices = new (core.List$(core.int)).generate(uris[core.$length], dart.f n(i => dart.as(i, core.int), core.int, [dart.dynamic]));
3739 let isHunkLoaded = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names .IS_HUNK_LOADED); 4020 let isHunkLoaded = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_names .IS_HUNK_LOADED);
3740 let isHunkInitialized = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_ names.IS_HUNK_INITIALIZED); 4021 let isHunkInitialized = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_ names.IS_HUNK_INITIALIZED);
3741 let indicesToLoad = indices[core.$where](i => !isHunkLoaded(hashes[core.$get ](i)))[core.$toList](); 4022 let indicesToLoad = indices[core.$where](dart.fn(i => !isHunkLoaded(hashes[c ore.$get](i)), core.bool, [core.int]))[core.$toList]();
3742 return dart.as(async.Future.wait(dart.as(indicesToLoad[core.$map](i => _load Hunk(uris[core.$get](i))), core.Iterable$(async.Future))).then(_ => { 4023 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(_ => {
3743 let indicesToInitialize = indices[core.$where](i => !isHunkInitialized(has hes[core.$get](i)))[core.$toList](); 4024 let indicesToInitialize = indices[core.$where](dart.fn(i => !isHunkInitial ized(hashes[core.$get](i)), core.bool, [core.int]))[core.$toList]();
3744 for (let i of indicesToInitialize) { 4025 for (let i of indicesToInitialize) {
3745 let initializer = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_na mes.INITIALIZE_LOADED_HUNK); 4026 let initializer = _foreign_helper.JS_EMBEDDED_GLOBAL('', _js_embedded_na mes.INITIALIZE_LOADED_HUNK);
3746 initializer(hashes[core.$get](i)); 4027 initializer(hashes[core.$get](i));
3747 } 4028 }
3748 let updated = exports._loadedLibraries.add(loadId); 4029 let updated = exports._loadedLibraries.add(loadId);
3749 if (dart.notNull(updated) && dart.notNull(exports.deferredLoadHook != null )) { 4030 if (dart.notNull(updated) && dart.notNull(exports.deferredLoadHook != null )) {
3750 exports.deferredLoadHook(); 4031 exports.deferredLoadHook();
3751 } 4032 }
3752 }), async.Future$(core.Null)); 4033 })), async.Future$(core.Null));
3753 } 4034 }
3754 // Function _loadHunk: (String) → Future<Null> 4035 dart.fn(loadDeferredLibrary, async.Future$(core.Null), [core.String]);
3755 function _loadHunk(hunkName) { 4036 function _loadHunk(hunkName) {
3756 let future = exports._loadingLibraries.get(hunkName); 4037 let future = exports._loadingLibraries.get(hunkName);
3757 if (future != null) { 4038 if (future != null) {
3758 return dart.as(future.then(_ => null), async.Future$(core.Null)); 4039 return dart.as(future.then(dart.fn(_ => null, dart.bottom, [dart.dynamic]) ), async.Future$(core.Null));
3759 } 4040 }
3760 let uri = _isolate_helper.IsolateNatives.thisScript; 4041 let uri = _isolate_helper.IsolateNatives.thisScript;
3761 let index = uri.lastIndexOf('/'); 4042 let index = uri.lastIndexOf('/');
3762 uri = `${uri.substring(0, dart.notNull(index) + 1)}${hunkName}`; 4043 uri = `${uri.substring(0, dart.notNull(index) + 1)}${hunkName}`;
3763 if (dart.notNull(Primitives.isJsshell) || dart.notNull(Primitives.isD8)) { 4044 if (dart.notNull(Primitives.isJsshell) || dart.notNull(Primitives.isD8)) {
3764 return exports._loadingLibraries.set(hunkName, new (async.Future$(core.Nul l))(() => { 4045 return exports._loadingLibraries.set(hunkName, new (async.Future$(core.Nul l))(dart.fn(() => {
3765 try { 4046 try {
3766 new Function(`load("${uri}")`)(); 4047 new Function(`load("${uri}")`)();
3767 } catch (error) { 4048 } catch (error) {
3768 let stackTrace = dart.stackTrace(error); 4049 let stackTrace = dart.stackTrace(error);
3769 throw new async.DeferredLoadException(`Loading ${uri} failed.`); 4050 throw new async.DeferredLoadException(`Loading ${uri} failed.`);
3770 } 4051 }
3771 4052
3772 return null; 4053 return null;
3773 })); 4054 })));
3774 } else if (_isolate_helper.isWorker()) { 4055 } else if (_isolate_helper.isWorker()) {
3775 return exports._loadingLibraries.set(hunkName, new (async.Future$(core.Nul l))(() => { 4056 return exports._loadingLibraries.set(hunkName, new (async.Future$(core.Nul l))(dart.fn(() => {
3776 let completer = new (async.Completer$(core.Null))(); 4057 let completer = new (async.Completer$(core.Null))();
3777 _isolate_helper.enterJsAsync(); 4058 _isolate_helper.enterJsAsync();
3778 let leavingFuture = dart.as(completer.future.whenComplete(() => { 4059 let leavingFuture = dart.as(completer.future.whenComplete(dart.fn(() => {
3779 _isolate_helper.leaveJsAsync(); 4060 _isolate_helper.leaveJsAsync();
3780 }), async.Future$(core.Null)); 4061 })), async.Future$(core.Null));
3781 let index = uri.lastIndexOf('/'); 4062 let index = uri.lastIndexOf('/');
3782 uri = `${uri.substring(0, dart.notNull(index) + 1)}${hunkName}`; 4063 uri = `${uri.substring(0, dart.notNull(index) + 1)}${hunkName}`;
3783 let xhr = new XMLHttpRequest(); 4064 let xhr = new XMLHttpRequest();
3784 xhr.open("GET", uri); 4065 xhr.open("GET", uri);
3785 xhr.addEventListener("load", convertDartClosureToJS(event => { 4066 xhr.addEventListener("load", convertDartClosureToJS(dart.fn(event => {
3786 if (xhr.status != 200) { 4067 if (xhr.status != 200) {
3787 completer.completeError(new async.DeferredLoadException(`Loading ${u ri} failed.`)); 4068 completer.completeError(new async.DeferredLoadException(`Loading ${u ri} failed.`));
3788 return; 4069 return;
3789 } 4070 }
3790 let code = xhr.responseText; 4071 let code = xhr.responseText;
3791 try { 4072 try {
3792 new Function(code)(); 4073 new Function(code)();
3793 } catch (error) { 4074 } catch (error) {
3794 let stackTrace = dart.stackTrace(error); 4075 let stackTrace = dart.stackTrace(error);
3795 completer.completeError(new async.DeferredLoadException(`Evaluating ${uri} failed.`)); 4076 completer.completeError(new async.DeferredLoadException(`Evaluating ${uri} failed.`));
3796 return; 4077 return;
3797 } 4078 }
3798 4079
3799 completer.complete(null); 4080 completer.complete(null);
3800 }, 1), false); 4081 }), 1), false);
3801 let fail = convertDartClosureToJS(event => { 4082 let fail = convertDartClosureToJS(dart.fn(event => {
3802 new async.DeferredLoadException(`Loading ${uri} failed.`); 4083 new async.DeferredLoadException(`Loading ${uri} failed.`);
3803 }, 1); 4084 }), 1);
3804 xhr.addEventListener("error", fail, false); 4085 xhr.addEventListener("error", fail, false);
3805 xhr.addEventListener("abort", fail, false); 4086 xhr.addEventListener("abort", fail, false);
3806 xhr.send(); 4087 xhr.send();
3807 return leavingFuture; 4088 return leavingFuture;
3808 })); 4089 })));
3809 } 4090 }
3810 return exports._loadingLibraries.set(hunkName, new (async.Future$(core.Null) )(() => { 4091 return exports._loadingLibraries.set(hunkName, new (async.Future$(core.Null) )(dart.fn(() => {
3811 let completer = new (async.Completer$(core.Null))(); 4092 let completer = new (async.Completer$(core.Null))();
3812 let script = document.createElement("script"); 4093 let script = document.createElement("script");
3813 script.type = "text/javascript"; 4094 script.type = "text/javascript";
3814 script.src = uri; 4095 script.src = uri;
3815 script.addEventListener("load", convertDartClosureToJS(event => { 4096 script.addEventListener("load", convertDartClosureToJS(dart.fn(event => {
3816 completer.complete(null); 4097 completer.complete(null);
3817 }, 1), false); 4098 }), 1), false);
3818 script.addEventListener("error", convertDartClosureToJS(event => { 4099 script.addEventListener("error", convertDartClosureToJS(dart.fn(event => {
3819 completer.completeError(new async.DeferredLoadException(`Loading ${uri} failed.`)); 4100 completer.completeError(new async.DeferredLoadException(`Loading ${uri} failed.`));
3820 }, 1), false); 4101 }), 1), false);
3821 document.body.appendChild(script); 4102 document.body.appendChild(script);
3822 return completer.future; 4103 return completer.future;
3823 })); 4104 })));
3824 } 4105 }
4106 dart.fn(_loadHunk, async.Future$(core.Null), [core.String]);
3825 class MainError extends core.Error { 4107 class MainError extends core.Error {
3826 MainError(message) { 4108 MainError(message) {
3827 this[_message] = message; 4109 this[_message] = message;
3828 super.Error(); 4110 super.Error();
3829 } 4111 }
3830 toString() { 4112 toString() {
3831 return `NoSuchMethodError: ${this[_message]}`; 4113 return `NoSuchMethodError: ${this[_message]}`;
3832 } 4114 }
3833 } 4115 }
3834 MainError[dart.implements] = () => [core.NoSuchMethodError]; 4116 MainError[dart.implements] = () => [core.NoSuchMethodError];
3835 // Function missingMain: () → void 4117 dart.setSignature(MainError, {
4118 methods: () => ({toString: dart.functionType(core.String, [])})
4119 });
3836 function missingMain() { 4120 function missingMain() {
3837 throw new MainError("No top-level function named 'main'."); 4121 throw new MainError("No top-level function named 'main'.");
3838 } 4122 }
3839 // Function badMain: () → void 4123 dart.fn(missingMain, dart.void, []);
3840 function badMain() { 4124 function badMain() {
3841 throw new MainError("'main' is not a function."); 4125 throw new MainError("'main' is not a function.");
3842 } 4126 }
3843 // Function mainHasTooManyParameters: () → void 4127 dart.fn(badMain, dart.void, []);
3844 function mainHasTooManyParameters() { 4128 function mainHasTooManyParameters() {
3845 throw new MainError("'main' expects too many parameters."); 4129 throw new MainError("'main' expects too many parameters.");
3846 } 4130 }
4131 dart.fn(mainHasTooManyParameters, dart.void, []);
3847 let __CastType0 = dart.typedef('__CastType0', () => dart.functionType(core.int , [core.String])); 4132 let __CastType0 = dart.typedef('__CastType0', () => dart.functionType(core.int , [core.String]));
3848 let __CastType2 = dart.typedef('__CastType2', () => dart.functionType(core.dou ble, [core.String])); 4133 let __CastType2 = dart.typedef('__CastType2', () => dart.functionType(core.dou ble, [core.String]));
3849 // Exports: 4134 // Exports:
3850 exports.NoSideEffects = NoSideEffects; 4135 exports.NoSideEffects = NoSideEffects;
3851 exports.NoThrows = NoThrows; 4136 exports.NoThrows = NoThrows;
3852 exports.NoInline = NoInline; 4137 exports.NoInline = NoInline;
3853 exports.IrRepresentation = IrRepresentation; 4138 exports.IrRepresentation = IrRepresentation;
3854 exports.Native = Native; 4139 exports.Native = Native;
3855 exports.ConstantMap$ = ConstantMap$; 4140 exports.ConstantMap$ = ConstantMap$;
3856 exports.ConstantMap = ConstantMap; 4141 exports.ConstantMap = ConstantMap;
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
4072 exports.jsonEncodeNative = jsonEncodeNative; 4357 exports.jsonEncodeNative = jsonEncodeNative;
4073 exports.getIsolateAffinityTag = getIsolateAffinityTag; 4358 exports.getIsolateAffinityTag = getIsolateAffinityTag;
4074 exports.LoadLibraryFunctionType = LoadLibraryFunctionType; 4359 exports.LoadLibraryFunctionType = LoadLibraryFunctionType;
4075 exports.DeferredLoadCallback = DeferredLoadCallback; 4360 exports.DeferredLoadCallback = DeferredLoadCallback;
4076 exports.loadDeferredLibrary = loadDeferredLibrary; 4361 exports.loadDeferredLibrary = loadDeferredLibrary;
4077 exports.MainError = MainError; 4362 exports.MainError = MainError;
4078 exports.missingMain = missingMain; 4363 exports.missingMain = missingMain;
4079 exports.badMain = badMain; 4364 exports.badMain = badMain;
4080 exports.mainHasTooManyParameters = mainHasTooManyParameters; 4365 exports.mainHasTooManyParameters = mainHasTooManyParameters;
4081 })(_js_helper, core, collection, _internal, _foreign_helper, _js_embedded_names, _interceptors, _js_names, async, _isolate_helper); 4366 })(_js_helper, core, collection, _internal, _foreign_helper, _js_embedded_names, _interceptors, _js_names, async, _isolate_helper);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698