OLD | NEW |
1 dart_library.library('dart/js', null, /* Imports */[ | 1 dart_library.library('dart/js', null, /* Imports */[ |
2 "dart_runtime/dart", | 2 "dart_runtime/dart", |
3 'dart/core', | 3 'dart/core', |
4 'dart/collection', | 4 'dart/collection', |
5 'dart/_js_helper' | 5 'dart/_js_helper' |
6 ], /* Lazy imports */[ | 6 ], /* Lazy imports */[ |
7 ], function(exports, dart, core, collection, _js_helper) { | 7 ], function(exports, dart, core, collection, _js_helper) { |
8 'use strict'; | 8 'use strict'; |
9 let dartx = dart.dartx; | 9 let dartx = dart.dartx; |
10 dart.defineLazyProperties(exports, { | 10 dart.defineLazyProperties(exports, { |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 } | 194 } |
195 static _checkRange(start, end, length) { | 195 static _checkRange(start, end, length) { |
196 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(length
)) { | 196 if (dart.notNull(start) < 0 || dart.notNull(start) > dart.notNull(length
)) { |
197 dart.throw(new core.RangeError.range(start, 0, length)); | 197 dart.throw(new core.RangeError.range(start, 0, length)); |
198 } | 198 } |
199 if (dart.notNull(end) < dart.notNull(start) || dart.notNull(end) > dart.
notNull(length)) { | 199 if (dart.notNull(end) < dart.notNull(start) || dart.notNull(end) > dart.
notNull(length)) { |
200 dart.throw(new core.RangeError.range(end, start, length)); | 200 dart.throw(new core.RangeError.range(end, start, length)); |
201 } | 201 } |
202 } | 202 } |
203 get(index) { | 203 get(index) { |
204 if (dart.is(index, core.num) && dart.equals(index, dart.dsend(index, 'to
Int'))) { | 204 if (dart.is(index, core.num) && index == index[dartx.toInt]()) { |
205 this[_checkIndex](dart.as(index, core.int)); | 205 this[_checkIndex](index); |
206 } | 206 } |
207 return dart.as(super.get(index), E); | 207 return dart.as(super.get(index), E); |
208 } | 208 } |
209 set(index, value) { | 209 set(index, value) { |
210 dart.as(value, E); | 210 dart.as(value, E); |
211 if (dart.is(index, core.num) && dart.equals(index, dart.dsend(index, 'to
Int'))) { | 211 if (dart.is(index, core.num) && index == index[dartx.toInt]()) { |
212 this[_checkIndex](dart.as(index, core.int)); | 212 this[_checkIndex](index); |
213 } | 213 } |
214 super.set(index, value); | 214 super.set(index, value); |
215 } | 215 } |
216 get length() { | 216 get length() { |
217 let len = this[_jsObject].length; | 217 let len = this[_jsObject].length; |
218 if (typeof len === "number" && len >>> 0 === len) { | 218 if (typeof len === "number" && len >>> 0 === len) { |
219 return len; | 219 return len; |
220 } | 220 } |
221 dart.throw(new core.StateError('Bad JsArray length')); | 221 dart.throw(new core.StateError('Bad JsArray length')); |
222 } | 222 } |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 dart.defineNamedConstructor(JsArray, '_fromJs'); | 275 dart.defineNamedConstructor(JsArray, '_fromJs'); |
276 dart.setSignature(JsArray, { | 276 dart.setSignature(JsArray, { |
277 constructors: () => ({ | 277 constructors: () => ({ |
278 JsArray: [JsArray$(E), []], | 278 JsArray: [JsArray$(E), []], |
279 from: [JsArray$(E), [core.Iterable$(E)]], | 279 from: [JsArray$(E), [core.Iterable$(E)]], |
280 _fromJs: [JsArray$(E), [dart.dynamic]] | 280 _fromJs: [JsArray$(E), [dart.dynamic]] |
281 }), | 281 }), |
282 methods: () => ({ | 282 methods: () => ({ |
283 [_checkIndex]: [dart.dynamic, [core.int]], | 283 [_checkIndex]: [dart.dynamic, [core.int]], |
284 [_checkInsertIndex]: [dart.dynamic, [core.int]], | 284 [_checkInsertIndex]: [dart.dynamic, [core.int]], |
285 get: [E, [dart.dynamic]], | 285 get: [E, [core.int]], |
286 set: [dart.void, [dart.dynamic, E]], | 286 set: [dart.void, [core.int, E]], |
287 add: [dart.void, [E]], | 287 add: [dart.void, [E]], |
288 addAll: [dart.void, [core.Iterable$(E)]], | 288 addAll: [dart.void, [core.Iterable$(E)]], |
289 insert: [dart.void, [core.int, E]], | 289 insert: [dart.void, [core.int, E]], |
290 removeAt: [E, [core.int]], | 290 removeAt: [E, [core.int]], |
291 removeLast: [E, []], | 291 removeLast: [E, []], |
292 setRange: [dart.void, [core.int, core.int, core.Iterable$(E)], [core.int
]], | 292 setRange: [dart.void, [core.int, core.int, core.Iterable$(E)], [core.int
]], |
293 sort: [dart.void, [], [dart.functionType(core.int, [E, E])]] | 293 sort: [dart.void, [], [dart.functionType(core.int, [E, E])]] |
294 }), | 294 }), |
295 statics: () => ({_checkRange: [dart.dynamic, [core.int, core.int, core.int
]]}), | 295 statics: () => ({_checkRange: [dart.dynamic, [core.int, core.int, core.int
]]}), |
296 names: ['_checkRange'] | 296 names: ['_checkRange'] |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 let __CastType0 = dart.typedef('__CastType0', () => dart.functionType(dart.d
ynamic, [E])); | 392 let __CastType0 = dart.typedef('__CastType0', () => dart.functionType(dart.d
ynamic, [E])); |
393 return __CastType0; | 393 return __CastType0; |
394 }); | 394 }); |
395 let __CastType0 = __CastType0$(); | 395 let __CastType0 = __CastType0$(); |
396 // Exports: | 396 // Exports: |
397 exports.JsObject = JsObject; | 397 exports.JsObject = JsObject; |
398 exports.JsFunction = JsFunction; | 398 exports.JsFunction = JsFunction; |
399 exports.JsArray$ = JsArray$; | 399 exports.JsArray$ = JsArray$; |
400 exports.JsArray = JsArray; | 400 exports.JsArray = JsArray; |
401 }); | 401 }); |
OLD | NEW |