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

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

Issue 1052383003: Disable closure wrapping by default (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 8 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 collection; 1 var collection;
2 (function(exports) { 2 (function(exports) {
3 'use strict'; 3 'use strict';
4 let _source = Symbol('_source'); 4 let _source = Symbol('_source');
5 let UnmodifiableListView$ = dart.generic(function(E) { 5 let UnmodifiableListView$ = dart.generic(function(E) {
6 class UnmodifiableListView extends _internal.UnmodifiableListBase$(E) { 6 class UnmodifiableListView extends _internal.UnmodifiableListBase$(E) {
7 UnmodifiableListView(source) { 7 UnmodifiableListView(source) {
8 this[_source] = source; 8 this[_source] = source;
9 super.UnmodifiableListBase(); 9 super.UnmodifiableListBase();
10 } 10 }
(...skipping 29 matching lines...) Expand all
40 class HashMap extends core.Object { 40 class HashMap extends core.Object {
41 HashMap(opts) { 41 HashMap(opts) {
42 let equals = opts && 'equals' in opts ? opts.equals : null; 42 let equals = opts && 'equals' in opts ? opts.equals : null;
43 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null; 43 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null;
44 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null; 44 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null;
45 if (isValidKey == null) { 45 if (isValidKey == null) {
46 if (hashCode == null) { 46 if (hashCode == null) {
47 if (equals == null) { 47 if (equals == null) {
48 return new (_HashMap$(K, V))(); 48 return new (_HashMap$(K, V))();
49 } 49 }
50 hashCode = dart.closureWrap(_defaultHashCode, "(K) → int"); 50 hashCode = dart.as(_defaultHashCode, dart.throw_("Unimplemented type (K) → int"));
51 } else { 51 } else {
52 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) { 52 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) {
53 return new (_IdentityHashMap$(K, V))(); 53 return new (_IdentityHashMap$(K, V))();
54 } 54 }
55 if (equals == null) { 55 if (equals == null) {
56 equals = dart.closureWrap(_defaultEquals, "(K, K) → bool"); 56 equals = dart.as(_defaultEquals, dart.throw_("Unimplemented type ( K, K) → bool"));
57 } 57 }
58 } 58 }
59 } else { 59 } else {
60 if (hashCode == null) { 60 if (hashCode == null) {
61 hashCode = dart.closureWrap(_defaultHashCode, "(K) → int"); 61 hashCode = dart.as(_defaultHashCode, dart.throw_("Unimplemented type (K) → int"));
62 } 62 }
63 if (equals == null) { 63 if (equals == null) {
64 equals = dart.closureWrap(_defaultEquals, "(K, K) → bool"); 64 equals = dart.as(_defaultEquals, dart.throw_("Unimplemented type (K, K) → bool"));
65 } 65 }
66 } 66 }
67 return new (_CustomHashMap$(K, V))(equals, hashCode, isValidKey); 67 return new (_CustomHashMap$(K, V))(equals, hashCode, isValidKey);
68 } 68 }
69 identity() { 69 identity() {
70 return new (_IdentityHashMap$(K, V))(); 70 return new (_IdentityHashMap$(K, V))();
71 } 71 }
72 from(other) { 72 from(other) {
73 let result = new (HashMap$(K, V))(); 73 let result = new (HashMap$(K, V))();
74 other.forEach((k, v) => { 74 other.forEach((k, v) => {
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 class HashSet extends core.Object { 386 class HashSet extends core.Object {
387 HashSet(opts) { 387 HashSet(opts) {
388 let equals = opts && 'equals' in opts ? opts.equals : null; 388 let equals = opts && 'equals' in opts ? opts.equals : null;
389 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null; 389 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null;
390 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null; 390 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null;
391 if (isValidKey == null) { 391 if (isValidKey == null) {
392 if (hashCode == null) { 392 if (hashCode == null) {
393 if (equals == null) { 393 if (equals == null) {
394 return new (_HashSet$(E))(); 394 return new (_HashSet$(E))();
395 } 395 }
396 hashCode = dart.closureWrap(_defaultHashCode, "(E) → int"); 396 hashCode = dart.as(_defaultHashCode, dart.throw_("Unimplemented type (E) → int"));
397 } else { 397 } else {
398 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) { 398 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) {
399 return new (_IdentityHashSet$(E))(); 399 return new (_IdentityHashSet$(E))();
400 } 400 }
401 if (equals == null) { 401 if (equals == null) {
402 equals = dart.closureWrap(_defaultEquals, "(E, E) → bool"); 402 equals = dart.as(_defaultEquals, dart.throw_("Unimplemented type ( E, E) → bool"));
403 } 403 }
404 } 404 }
405 } else { 405 } else {
406 if (hashCode == null) { 406 if (hashCode == null) {
407 hashCode = dart.closureWrap(_defaultHashCode, "(E) → int"); 407 hashCode = dart.as(_defaultHashCode, dart.throw_("Unimplemented type (E) → int"));
408 } 408 }
409 if (equals == null) { 409 if (equals == null) {
410 equals = dart.closureWrap(_defaultEquals, "(E, E) → bool"); 410 equals = dart.as(_defaultEquals, dart.throw_("Unimplemented type (E, E) → bool"));
411 } 411 }
412 } 412 }
413 return new (_CustomHashSet$(E))(equals, hashCode, isValidKey); 413 return new (_CustomHashSet$(E))(equals, hashCode, isValidKey);
414 } 414 }
415 identity() { 415 identity() {
416 return new (_IdentityHashSet$(E))(); 416 return new (_IdentityHashSet$(E))();
417 } 417 }
418 from(elements) { 418 from(elements) {
419 let result = new (HashSet$(E))(); 419 let result = new (HashSet$(E))();
420 for (let e of dart.as(elements, core.Iterable$(E))) 420 for (let e of dart.as(elements, core.Iterable$(E)))
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after
1004 class LinkedHashMap extends core.Object { 1004 class LinkedHashMap extends core.Object {
1005 LinkedHashMap(opts) { 1005 LinkedHashMap(opts) {
1006 let equals = opts && 'equals' in opts ? opts.equals : null; 1006 let equals = opts && 'equals' in opts ? opts.equals : null;
1007 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null; 1007 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null;
1008 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null; 1008 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null;
1009 if (isValidKey == null) { 1009 if (isValidKey == null) {
1010 if (hashCode == null) { 1010 if (hashCode == null) {
1011 if (equals == null) { 1011 if (equals == null) {
1012 return new (_LinkedHashMap$(K, V))(); 1012 return new (_LinkedHashMap$(K, V))();
1013 } 1013 }
1014 hashCode = dart.closureWrap(_defaultHashCode, "(K) → int"); 1014 hashCode = dart.as(_defaultHashCode, dart.throw_("Unimplemented type (K) → int"));
1015 } else { 1015 } else {
1016 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) { 1016 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) {
1017 return new (_LinkedIdentityHashMap$(K, V))(); 1017 return new (_LinkedIdentityHashMap$(K, V))();
1018 } 1018 }
1019 if (equals == null) { 1019 if (equals == null) {
1020 equals = dart.closureWrap(_defaultEquals, "(K, K) → bool"); 1020 equals = dart.as(_defaultEquals, dart.throw_("Unimplemented type ( K, K) → bool"));
1021 } 1021 }
1022 } 1022 }
1023 } else { 1023 } else {
1024 if (hashCode == null) { 1024 if (hashCode == null) {
1025 hashCode = dart.closureWrap(_defaultHashCode, "(K) → int"); 1025 hashCode = dart.as(_defaultHashCode, dart.throw_("Unimplemented type (K) → int"));
1026 } 1026 }
1027 if (equals == null) { 1027 if (equals == null) {
1028 equals = dart.closureWrap(_defaultEquals, "(K, K) → bool"); 1028 equals = dart.as(_defaultEquals, dart.throw_("Unimplemented type (K, K) → bool"));
1029 } 1029 }
1030 } 1030 }
1031 return new (_LinkedCustomHashMap$(K, V))(equals, hashCode, isValidKey); 1031 return new (_LinkedCustomHashMap$(K, V))(equals, hashCode, isValidKey);
1032 } 1032 }
1033 identity() { 1033 identity() {
1034 return new (_LinkedIdentityHashMap$(K, V))(); 1034 return new (_LinkedIdentityHashMap$(K, V))();
1035 } 1035 }
1036 from(other) { 1036 from(other) {
1037 let result = new (LinkedHashMap$(K, V))(); 1037 let result = new (LinkedHashMap$(K, V))();
1038 other.forEach((k, v) => { 1038 other.forEach((k, v) => {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1073 class LinkedHashSet extends core.Object { 1073 class LinkedHashSet extends core.Object {
1074 LinkedHashSet(opts) { 1074 LinkedHashSet(opts) {
1075 let equals = opts && 'equals' in opts ? opts.equals : null; 1075 let equals = opts && 'equals' in opts ? opts.equals : null;
1076 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null; 1076 let hashCode = opts && 'hashCode' in opts ? opts.hashCode : null;
1077 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null; 1077 let isValidKey = opts && 'isValidKey' in opts ? opts.isValidKey : null;
1078 if (isValidKey == null) { 1078 if (isValidKey == null) {
1079 if (hashCode == null) { 1079 if (hashCode == null) {
1080 if (equals == null) { 1080 if (equals == null) {
1081 return new (_LinkedHashSet$(E))(); 1081 return new (_LinkedHashSet$(E))();
1082 } 1082 }
1083 hashCode = dart.closureWrap(_defaultHashCode, "(E) → int"); 1083 hashCode = dart.as(_defaultHashCode, dart.throw_("Unimplemented type (E) → int"));
1084 } else { 1084 } else {
1085 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) { 1085 if (dart.notNull(core.identical(core.identityHashCode, hashCode)) && dart.notNull(core.identical(core.identical, equals))) {
1086 return new (_LinkedIdentityHashSet$(E))(); 1086 return new (_LinkedIdentityHashSet$(E))();
1087 } 1087 }
1088 if (equals == null) { 1088 if (equals == null) {
1089 equals = dart.closureWrap(_defaultEquals, "(E, E) → bool"); 1089 equals = dart.as(_defaultEquals, dart.throw_("Unimplemented type ( E, E) → bool"));
1090 } 1090 }
1091 } 1091 }
1092 } else { 1092 } else {
1093 if (hashCode == null) { 1093 if (hashCode == null) {
1094 hashCode = dart.closureWrap(_defaultHashCode, "(E) → int"); 1094 hashCode = dart.as(_defaultHashCode, dart.throw_("Unimplemented type (E) → int"));
1095 } 1095 }
1096 if (equals == null) { 1096 if (equals == null) {
1097 equals = dart.closureWrap(_defaultEquals, "(E, E) → bool"); 1097 equals = dart.as(_defaultEquals, dart.throw_("Unimplemented type (E, E) → bool"));
1098 } 1098 }
1099 } 1099 }
1100 return new (_LinkedCustomHashSet$(E))(equals, hashCode, isValidKey); 1100 return new (_LinkedCustomHashSet$(E))(equals, hashCode, isValidKey);
1101 } 1101 }
1102 identity() { 1102 identity() {
1103 return new (_LinkedIdentityHashSet$(E))(); 1103 return new (_LinkedIdentityHashSet$(E))();
1104 } 1104 }
1105 from(elements) { 1105 from(elements) {
1106 let result = new (LinkedHashSet$(E))(); 1106 let result = new (LinkedHashSet$(E))();
1107 for (let element of elements) { 1107 for (let element of elements) {
(...skipping 2144 matching lines...) Expand 10 before | Expand all | Expand 10 after
3252 } 3252 }
3253 } 3253 }
3254 } 3254 }
3255 removeAll(elements) { 3255 removeAll(elements) {
3256 for (let element of elements) { 3256 for (let element of elements) {
3257 if (dart.dinvokef(this[_validKey], element)) 3257 if (dart.dinvokef(this[_validKey], element))
3258 this[_remove](dart.as(element, E)); 3258 this[_remove](dart.as(element, E));
3259 } 3259 }
3260 } 3260 }
3261 retainAll(elements) { 3261 retainAll(elements) {
3262 let retainSet = new (SplayTreeSet$(E))(dart.closureWrap(this[_comparator ], "(E, E) → int"), this[_validKey]); 3262 let retainSet = new (SplayTreeSet$(E))(dart.as(this[_comparator], dart.t hrow_("Unimplemented type (E, E) → int")), this[_validKey]);
3263 let modificationCount = this[_modificationCount]; 3263 let modificationCount = this[_modificationCount];
3264 for (let object of elements) { 3264 for (let object of elements) {
3265 if (modificationCount != this[_modificationCount]) { 3265 if (modificationCount != this[_modificationCount]) {
3266 throw new core.ConcurrentModificationError(this); 3266 throw new core.ConcurrentModificationError(this);
3267 } 3267 }
3268 if (dart.notNull(dart.dinvokef(this[_validKey], object)) && this[_spla y](dart.as(object, E)) == 0) 3268 if (dart.notNull(dart.dinvokef(this[_validKey], object)) && this[_spla y](dart.as(object, E)) == 0)
3269 retainSet.add(this[_root].key); 3269 retainSet.add(this[_root].key);
3270 } 3270 }
3271 if (retainSet[_count] != this[_count]) { 3271 if (retainSet[_count] != this[_count]) {
3272 this[_root] = retainSet[_root]; 3272 this[_root] = retainSet[_root];
3273 this[_count] = retainSet[_count]; 3273 this[_count] = retainSet[_count];
3274 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1; 3274 this[_modificationCount] = dart.notNull(this[_modificationCount]) + 1;
3275 } 3275 }
3276 } 3276 }
3277 lookup(object) { 3277 lookup(object) {
3278 if (!dart.notNull(dart.dinvokef(this[_validKey], object))) 3278 if (!dart.notNull(dart.dinvokef(this[_validKey], object)))
3279 return null; 3279 return null;
3280 let comp = this[_splay](dart.as(object, E)); 3280 let comp = this[_splay](dart.as(object, E));
3281 if (comp != 0) 3281 if (comp != 0)
3282 return null; 3282 return null;
3283 return this[_root].key; 3283 return this[_root].key;
3284 } 3284 }
3285 intersection(other) { 3285 intersection(other) {
3286 let result = new (SplayTreeSet$(E))(dart.closureWrap(this[_comparator], "(E, E) → int"), this[_validKey]); 3286 let result = new (SplayTreeSet$(E))(dart.as(this[_comparator], dart.thro w_("Unimplemented type (E, E) → int")), this[_validKey]);
3287 for (let element of this) { 3287 for (let element of this) {
3288 if (other.contains(element)) 3288 if (other.contains(element))
3289 result.add(element); 3289 result.add(element);
3290 } 3290 }
3291 return result; 3291 return result;
3292 } 3292 }
3293 difference(other) { 3293 difference(other) {
3294 let result = new (SplayTreeSet$(E))(dart.closureWrap(this[_comparator], "(E, E) → int"), this[_validKey]); 3294 let result = new (SplayTreeSet$(E))(dart.as(this[_comparator], dart.thro w_("Unimplemented type (E, E) → int")), this[_validKey]);
3295 for (let element of this) { 3295 for (let element of this) {
3296 if (!dart.notNull(other.contains(element))) 3296 if (!dart.notNull(other.contains(element)))
3297 result.add(element); 3297 result.add(element);
3298 } 3298 }
3299 return result; 3299 return result;
3300 } 3300 }
3301 union(other) { 3301 union(other) {
3302 return ((_) => { 3302 return ((_) => {
3303 _.addAll(other); 3303 _.addAll(other);
3304 return _; 3304 return _;
3305 })(this[_clone]()); 3305 })(this[_clone]());
3306 } 3306 }
3307 [_clone]() { 3307 [_clone]() {
3308 let set = new (SplayTreeSet$(E))(dart.closureWrap(this[_comparator], "(E , E) → int"), this[_validKey]); 3308 let set = new (SplayTreeSet$(E))(dart.as(this[_comparator], dart.throw_( "Unimplemented type (E, E) → int")), this[_validKey]);
3309 set[_count] = this[_count]; 3309 set[_count] = this[_count];
3310 set[_root] = this[_copyNode](this[_root]); 3310 set[_root] = this[_copyNode](this[_root]);
3311 return set; 3311 return set;
3312 } 3312 }
3313 [_copyNode](node) { 3313 [_copyNode](node) {
3314 if (node == null) 3314 if (node == null)
3315 return null; 3315 return null;
3316 return ((_) => { 3316 return ((_) => {
3317 _.left = this[_copyNode](node.left); 3317 _.left = this[_copyNode](node.left);
3318 _.right = this[_copyNode](node.right); 3318 _.right = this[_copyNode](node.right);
(...skipping 1624 matching lines...) Expand 10 before | Expand all | Expand 10 after
4943 exports.LinkedHashMapKeyIterable$ = LinkedHashMapKeyIterable$; 4943 exports.LinkedHashMapKeyIterable$ = LinkedHashMapKeyIterable$;
4944 exports.LinkedHashMapKeyIterable = LinkedHashMapKeyIterable; 4944 exports.LinkedHashMapKeyIterable = LinkedHashMapKeyIterable;
4945 exports.LinkedHashMapKeyIterator$ = LinkedHashMapKeyIterator$; 4945 exports.LinkedHashMapKeyIterator$ = LinkedHashMapKeyIterator$;
4946 exports.LinkedHashMapKeyIterator = LinkedHashMapKeyIterator; 4946 exports.LinkedHashMapKeyIterator = LinkedHashMapKeyIterator;
4947 exports.HashSetIterator$ = HashSetIterator$; 4947 exports.HashSetIterator$ = HashSetIterator$;
4948 exports.HashSetIterator = HashSetIterator; 4948 exports.HashSetIterator = HashSetIterator;
4949 exports.LinkedHashSetCell = LinkedHashSetCell; 4949 exports.LinkedHashSetCell = LinkedHashSetCell;
4950 exports.LinkedHashSetIterator$ = LinkedHashSetIterator$; 4950 exports.LinkedHashSetIterator$ = LinkedHashSetIterator$;
4951 exports.LinkedHashSetIterator = LinkedHashSetIterator; 4951 exports.LinkedHashSetIterator = LinkedHashSetIterator;
4952 })(collection || (collection = {})); 4952 })(collection || (collection = {}));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698