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

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

Issue 1050703002: Downwards closure inference (Closed) Base URL: git@github.com:dart-lang/dart-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
« no previous file with comments | « no previous file | lib/src/checker/rules.dart » ('j') | lib/src/checker/rules.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 super.IterableBase(); 1123 super.IterableBase();
1124 this[_next] = this[_previous] = this; 1124 this[_next] = this[_previous] = this;
1125 } 1125 }
1126 addFirst(entry) { 1126 addFirst(entry) {
1127 this[_insertAfter](this, entry); 1127 this[_insertAfter](this, entry);
1128 } 1128 }
1129 add(entry) { 1129 add(entry) {
1130 this[_insertAfter](this[_previous], entry); 1130 this[_insertAfter](this[_previous], entry);
1131 } 1131 }
1132 addAll(entries) { 1132 addAll(entries) {
1133 entries.forEach(dart.closureWrap(((entry) => this[_insertAfter](this[_pr evious], dart.as(entry, E))).bind(this), "(E) → void")); 1133 entries.forEach(dart.as(((entry) => this[_insertAfter](this[_previous], dart.as(entry, E))).bind(this), dart.throw_("Unimplemented type (E) → void")));
1134 } 1134 }
1135 remove(entry) { 1135 remove(entry) {
1136 if (!dart.equals(entry[_list], this)) 1136 if (!dart.equals(entry[_list], this))
1137 return false; 1137 return false;
1138 this[_unlink](entry); 1138 this[_unlink](entry);
1139 return true; 1139 return true;
1140 } 1140 }
1141 get iterator() { 1141 get iterator() {
1142 return new _LinkedListIterator(this); 1142 return new _LinkedListIterator(this);
1143 } 1143 }
(...skipping 2211 matching lines...) Expand 10 before | Expand all | Expand 10 after
3355 get isEmpty() { 3355 get isEmpty() {
3356 return this[_length] == 0; 3356 return this[_length] == 0;
3357 } 3357 }
3358 get isNotEmpty() { 3358 get isNotEmpty() {
3359 return !dart.notNull(this.isEmpty); 3359 return !dart.notNull(this.isEmpty);
3360 } 3360 }
3361 get keys() { 3361 get keys() {
3362 return new HashMapKeyIterable(this); 3362 return new HashMapKeyIterable(this);
3363 } 3363 }
3364 get values() { 3364 get values() {
3365 return new _internal.MappedIterable(this.keys, dart.closureWrap(((each) => this.get(each)).bind(this), "(K) → V")); 3365 return new _internal.MappedIterable(this.keys, dart.as(((each) => this.g et(each)).bind(this), dart.throw_("Unimplemented type (K) → V")));
3366 } 3366 }
3367 containsKey(key) { 3367 containsKey(key) {
3368 if (_HashMap[_isStringKey](key)) { 3368 if (_HashMap[_isStringKey](key)) {
3369 let strings = this[_strings]; 3369 let strings = this[_strings];
3370 return strings == null ? false : _HashMap[_hasTableEntry](strings, key ); 3370 return strings == null ? false : _HashMap[_hasTableEntry](strings, key );
3371 } else if (_HashMap[_isNumericKey](key)) { 3371 } else if (_HashMap[_isNumericKey](key)) {
3372 let nums = this[_nums]; 3372 let nums = this[_nums];
3373 return nums == null ? false : _HashMap[_hasTableEntry](nums, key); 3373 return nums == null ? false : _HashMap[_hasTableEntry](nums, key);
3374 } else { 3374 } else {
3375 return this[_containsKey](key); 3375 return this[_containsKey](key);
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
3756 get isEmpty() { 3756 get isEmpty() {
3757 return this[_length] == 0; 3757 return this[_length] == 0;
3758 } 3758 }
3759 get isNotEmpty() { 3759 get isNotEmpty() {
3760 return !dart.notNull(this.isEmpty); 3760 return !dart.notNull(this.isEmpty);
3761 } 3761 }
3762 get keys() { 3762 get keys() {
3763 return new LinkedHashMapKeyIterable(this); 3763 return new LinkedHashMapKeyIterable(this);
3764 } 3764 }
3765 get values() { 3765 get values() {
3766 return new _internal.MappedIterable(this.keys, dart.closureWrap(((each) => this.get(each)).bind(this), "(K) → V")); 3766 return new _internal.MappedIterable(this.keys, dart.as(((each) => this.g et(each)).bind(this), dart.throw_("Unimplemented type (K) → V")));
3767 } 3767 }
3768 containsKey(key) { 3768 containsKey(key) {
3769 if (_LinkedHashMap[_isStringKey](key)) { 3769 if (_LinkedHashMap[_isStringKey](key)) {
3770 let strings = this[_strings]; 3770 let strings = this[_strings];
3771 if (strings == null) 3771 if (strings == null)
3772 return false; 3772 return false;
3773 let cell = dart.as(_LinkedHashMap[_getTableEntry](strings, key), Linke dHashMapCell); 3773 let cell = dart.as(_LinkedHashMap[_getTableEntry](strings, key), Linke dHashMapCell);
3774 return cell != null; 3774 return cell != null;
3775 } else if (_LinkedHashMap[_isNumericKey](key)) { 3775 } else if (_LinkedHashMap[_isNumericKey](key)) {
3776 let nums = this[_nums]; 3776 let nums = this[_nums];
3777 if (nums == null) 3777 if (nums == null)
3778 return false; 3778 return false;
3779 let cell = dart.as(_LinkedHashMap[_getTableEntry](nums, key), LinkedHa shMapCell); 3779 let cell = dart.as(_LinkedHashMap[_getTableEntry](nums, key), LinkedHa shMapCell);
3780 return cell != null; 3780 return cell != null;
3781 } else { 3781 } else {
3782 return this[_containsKey](key); 3782 return this[_containsKey](key);
3783 } 3783 }
3784 } 3784 }
3785 [_containsKey](key) { 3785 [_containsKey](key) {
3786 let rest = this[_rest]; 3786 let rest = this[_rest];
3787 if (rest == null) 3787 if (rest == null)
3788 return false; 3788 return false;
3789 let bucket = this[_getBucket](rest, key); 3789 let bucket = this[_getBucket](rest, key);
3790 return dart.notNull(this[_findBucketIndex](bucket, key)) >= 0; 3790 return dart.notNull(this[_findBucketIndex](bucket, key)) >= 0;
3791 } 3791 }
3792 containsValue(value) { 3792 containsValue(value) {
3793 return this.keys.any(dart.closureWrap(((each) => dart.equals(this.get(ea ch), value)).bind(this), "(K) → bool")); 3793 return this.keys.any(dart.as(((each) => dart.equals(this.get(each), valu e)).bind(this), dart.throw_("Unimplemented type (K) → bool")));
3794 } 3794 }
3795 addAll(other) { 3795 addAll(other) {
3796 other.forEach(((key, value) => { 3796 other.forEach(((key, value) => {
3797 this.set(key, value); 3797 this.set(key, value);
3798 }).bind(this)); 3798 }).bind(this));
3799 } 3799 }
3800 get(key) { 3800 get(key) {
3801 if (_LinkedHashMap[_isStringKey](key)) { 3801 if (_LinkedHashMap[_isStringKey](key)) {
3802 let strings = this[_strings]; 3802 let strings = this[_strings];
3803 if (strings == null) 3803 if (strings == null)
(...skipping 1126 matching lines...) Expand 10 before | Expand all | Expand 10 after
4930 exports.LinkedHashMapKeyIterable = LinkedHashMapKeyIterable; 4930 exports.LinkedHashMapKeyIterable = LinkedHashMapKeyIterable;
4931 exports.LinkedHashMapKeyIterable$ = LinkedHashMapKeyIterable$; 4931 exports.LinkedHashMapKeyIterable$ = LinkedHashMapKeyIterable$;
4932 exports.LinkedHashMapKeyIterator = LinkedHashMapKeyIterator; 4932 exports.LinkedHashMapKeyIterator = LinkedHashMapKeyIterator;
4933 exports.LinkedHashMapKeyIterator$ = LinkedHashMapKeyIterator$; 4933 exports.LinkedHashMapKeyIterator$ = LinkedHashMapKeyIterator$;
4934 exports.HashSetIterator = HashSetIterator; 4934 exports.HashSetIterator = HashSetIterator;
4935 exports.HashSetIterator$ = HashSetIterator$; 4935 exports.HashSetIterator$ = HashSetIterator$;
4936 exports.LinkedHashSetCell = LinkedHashSetCell; 4936 exports.LinkedHashSetCell = LinkedHashSetCell;
4937 exports.LinkedHashSetIterator = LinkedHashSetIterator; 4937 exports.LinkedHashSetIterator = LinkedHashSetIterator;
4938 exports.LinkedHashSetIterator$ = LinkedHashSetIterator$; 4938 exports.LinkedHashSetIterator$ = LinkedHashSetIterator$;
4939 })(collection || (collection = {})); 4939 })(collection || (collection = {}));
OLDNEW
« no previous file with comments | « no previous file | lib/src/checker/rules.dart » ('j') | lib/src/checker/rules.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698