OLD | NEW |
1 dart_library.library('dart/html_common', null, /* Imports */[ | 1 dart_library.library('dart/html_common', null, /* Imports */[ |
2 'dart/_runtime', | 2 'dart/_runtime', |
3 'dart/_metadata', | 3 'dart/_metadata', |
4 'dart/core', | 4 'dart/core', |
5 'dart/html', | 5 'dart/html', |
6 'dart/typed_data', | 6 'dart/typed_data', |
7 'dart/_js_helper', | 7 'dart/_js_helper', |
8 'dart/_native_typed_data', | 8 'dart/_native_typed_data', |
9 'dart/async', | 9 'dart/async', |
10 'dart/collection', | 10 'dart/collection', |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 } | 98 } |
99 remove(value) { | 99 remove(value) { |
100 this[_validateToken](dart.as(value, core.String)); | 100 this[_validateToken](dart.as(value, core.String)); |
101 if (!(typeof value == 'string')) return false; | 101 if (!(typeof value == 'string')) return false; |
102 let s = this.readClasses(); | 102 let s = this.readClasses(); |
103 let result = s.remove(value); | 103 let result = s.remove(value); |
104 this.writeClasses(s); | 104 this.writeClasses(s); |
105 return result; | 105 return result; |
106 } | 106 } |
107 addAll(iterable) { | 107 addAll(iterable) { |
108 this.modify(dart.fn((s => s.addAll(iterable[dartx.map](dart.bind(this, _va
lidateToken)))).bind(this), dart.void, [core.Set$(core.String)])); | 108 this.modify(dart.fn(s => s.addAll(iterable[dartx.map](dart.bind(this, _val
idateToken))), dart.void, [core.Set$(core.String)])); |
109 } | 109 } |
110 removeAll(iterable) { | 110 removeAll(iterable) { |
111 this.modify(dart.fn((s => s.removeAll(iterable[dartx.map](dart.as(dart.bin
d(this, _validateToken), __CastType0)))).bind(this), dart.void, [core.Set$(core.
String)])); | 111 this.modify(dart.fn(s => s.removeAll(iterable[dartx.map](dart.as(dart.bind
(this, _validateToken), __CastType0))), dart.void, [core.Set$(core.String)])); |
112 } | 112 } |
113 toggleAll(iterable, shouldAdd) { | 113 toggleAll(iterable, shouldAdd) { |
114 if (shouldAdd === void 0) shouldAdd = null; | 114 if (shouldAdd === void 0) shouldAdd = null; |
115 iterable[dartx.forEach](dart.fn((e => this.toggle(e, shouldAdd)).bind(this
), core.bool, [core.String])); | 115 iterable[dartx.forEach](dart.fn(e => this.toggle(e, shouldAdd), core.bool,
[core.String])); |
116 } | 116 } |
117 retainAll(iterable) { | 117 retainAll(iterable) { |
118 this.modify(dart.fn(s => s.retainAll(iterable), dart.void, [core.Set$(core
.String)])); | 118 this.modify(dart.fn(s => s.retainAll(iterable), dart.void, [core.Set$(core
.String)])); |
119 } | 119 } |
120 removeWhere(test) { | 120 removeWhere(test) { |
121 this.modify(dart.fn(s => s.removeWhere(test), dart.void, [core.Set$(core.S
tring)])); | 121 this.modify(dart.fn(s => s.removeWhere(test), dart.void, [core.Set$(core.S
tring)])); |
122 } | 122 } |
123 retainWhere(test) { | 123 retainWhere(test) { |
124 this.modify(dart.fn(s => s.retainWhere(test), dart.void, [core.Set$(core.S
tring)])); | 124 this.modify(dart.fn(s => s.retainWhere(test), dart.void, [core.Set$(core.S
tring)])); |
125 } | 125 } |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 if (dart.is(e, dart.dynamic)) return e; | 308 if (dart.is(e, dart.dynamic)) return e; |
309 if (dart.is(e, dart.dynamic)) return e; | 309 if (dart.is(e, dart.dynamic)) return e; |
310 if (dart.is(e, dart.dynamic)) return e; | 310 if (dart.is(e, dart.dynamic)) return e; |
311 if (dart.notNull(this.cloneNotRequired(e))) return e; | 311 if (dart.notNull(this.cloneNotRequired(e))) return e; |
312 if (dart.is(e, core.Map)) { | 312 if (dart.is(e, core.Map)) { |
313 let slot = this.findSlot(e); | 313 let slot = this.findSlot(e); |
314 let copy = this.readSlot(slot); | 314 let copy = this.readSlot(slot); |
315 if (copy != null) return copy; | 315 if (copy != null) return copy; |
316 copy = this.newJsMap(); | 316 copy = this.newJsMap(); |
317 this.writeSlot(slot, copy); | 317 this.writeSlot(slot, copy); |
318 e.forEach(dart.fn(((key, value) => { | 318 e.forEach(dart.fn((key, value) => { |
319 this.putIntoMap(copy, key, this.walk(value)); | 319 this.putIntoMap(copy, key, this.walk(value)); |
320 }).bind(this), dart.void, [dart.dynamic, dart.dynamic])); | 320 }, dart.void, [dart.dynamic, dart.dynamic])); |
321 return copy; | 321 return copy; |
322 } | 322 } |
323 if (dart.is(e, core.List)) { | 323 if (dart.is(e, core.List)) { |
324 let slot = this.findSlot(e); | 324 let slot = this.findSlot(e); |
325 let copy = this.readSlot(slot); | 325 let copy = this.readSlot(slot); |
326 if (copy != null) return copy; | 326 if (copy != null) return copy; |
327 copy = this.copyList(e, slot); | 327 copy = this.copyList(e, slot); |
328 return copy; | 328 return copy; |
329 } | 329 } |
330 dart.throw(new core.UnimplementedError('structured clone of other type')); | 330 dart.throw(new core.UnimplementedError('structured clone of other type')); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 } | 390 } |
391 if (dart.notNull(isJavaScriptPromise(e))) { | 391 if (dart.notNull(isJavaScriptPromise(e))) { |
392 return convertNativePromiseToDartFuture(e); | 392 return convertNativePromiseToDartFuture(e); |
393 } | 393 } |
394 if (dart.notNull(isJavaScriptSimpleObject(e))) { | 394 if (dart.notNull(isJavaScriptSimpleObject(e))) { |
395 let slot = this.findSlot(e); | 395 let slot = this.findSlot(e); |
396 let copy = this.readSlot(slot); | 396 let copy = this.readSlot(slot); |
397 if (copy != null) return copy; | 397 if (copy != null) return copy; |
398 copy = dart.map(); | 398 copy = dart.map(); |
399 this.writeSlot(slot, copy); | 399 this.writeSlot(slot, copy); |
400 this.forEachJsField(e, dart.fn(((key, value) => dart.dsetindex(copy, key
, this.walk(value))).bind(this))); | 400 this.forEachJsField(e, dart.fn((key, value) => dart.dsetindex(copy, key,
this.walk(value)))); |
401 return copy; | 401 return copy; |
402 } | 402 } |
403 if (dart.notNull(isJavaScriptArray(e))) { | 403 if (dart.notNull(isJavaScriptArray(e))) { |
404 let slot = this.findSlot(e); | 404 let slot = this.findSlot(e); |
405 let copy = this.readSlot(slot); | 405 let copy = this.readSlot(slot); |
406 if (copy != null) return copy; | 406 if (copy != null) return copy; |
407 let length = dart.as(dart.dload(e, 'length'), core.int); | 407 let length = dart.as(dart.dload(e, 'length'), core.int); |
408 copy = dart.notNull(this.mustCopy) ? this.newDartList(length) : e; | 408 copy = dart.notNull(this.mustCopy) ? this.newDartList(length) : e; |
409 this.writeSlot(slot, copy); | 409 this.writeSlot(slot, copy); |
410 for (let i = 0; i < dart.notNull(length); i++) { | 410 for (let i = 0; i < dart.notNull(length); i++) { |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 exports.isJavaScriptArray = isJavaScriptArray; | 921 exports.isJavaScriptArray = isJavaScriptArray; |
922 exports.isJavaScriptSimpleObject = isJavaScriptSimpleObject; | 922 exports.isJavaScriptSimpleObject = isJavaScriptSimpleObject; |
923 exports.isImmutableJavaScriptArray = isImmutableJavaScriptArray; | 923 exports.isImmutableJavaScriptArray = isImmutableJavaScriptArray; |
924 exports.isJavaScriptPromise = isJavaScriptPromise; | 924 exports.isJavaScriptPromise = isJavaScriptPromise; |
925 exports.convertNativePromiseToDartFuture = convertNativePromiseToDartFuture; | 925 exports.convertNativePromiseToDartFuture = convertNativePromiseToDartFuture; |
926 exports.Device = Device; | 926 exports.Device = Device; |
927 exports.FilteredElementList = FilteredElementList; | 927 exports.FilteredElementList = FilteredElementList; |
928 exports.Lists = Lists; | 928 exports.Lists = Lists; |
929 exports.NodeListWrapper = NodeListWrapper; | 929 exports.NodeListWrapper = NodeListWrapper; |
930 }); | 930 }); |
OLD | NEW |