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

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

Issue 1052693004: move => bind this workaround to js_ast (Closed) Base URL: git@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
« no previous file with comments | « lib/runtime/dart/async.js ('k') | lib/runtime/dart/core.js » ('j') | no next file with comments »
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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 for (let o of other) { 134 for (let o of other) {
135 if (!dart.notNull(this.contains(o))) 135 if (!dart.notNull(this.contains(o)))
136 return false; 136 return false;
137 } 137 }
138 return true; 138 return true;
139 } 139 }
140 union(other) { 140 union(other) {
141 return ((_) => { 141 return ((_) => {
142 _.addAll(other); 142 _.addAll(other);
143 return _; 143 return _;
144 }).bind(this)(this.toSet()); 144 })(this.toSet());
145 } 145 }
146 intersection(other) { 146 intersection(other) {
147 let result = this.toSet(); 147 let result = this.toSet();
148 for (let element of this) { 148 for (let element of this) {
149 if (!dart.notNull(other.contains(element))) 149 if (!dart.notNull(other.contains(element)))
150 result.remove(element); 150 result.remove(element);
151 } 151 }
152 return result; 152 return result;
153 } 153 }
154 difference(other) { 154 difference(other) {
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
826 try { 826 try {
827 IterableBase[_iterablePartsToStrings](iterable, parts); 827 IterableBase[_iterablePartsToStrings](iterable, parts);
828 } finally { 828 } finally {
829 dart.assert(core.identical(IterableBase[_toStringVisiting].last, itera ble)); 829 dart.assert(core.identical(IterableBase[_toStringVisiting].last, itera ble));
830 IterableBase[_toStringVisiting].removeLast(); 830 IterableBase[_toStringVisiting].removeLast();
831 } 831 }
832 return ((_) => { 832 return ((_) => {
833 _.writeAll(parts, ", "); 833 _.writeAll(parts, ", ");
834 _.write(rightDelimiter); 834 _.write(rightDelimiter);
835 return _; 835 return _;
836 }).bind(this)(new core.StringBuffer(leftDelimiter)).toString(); 836 })(new core.StringBuffer(leftDelimiter)).toString();
837 } 837 }
838 static iterableToFullString(iterable, leftDelimiter, rightDelimiter) { 838 static iterableToFullString(iterable, leftDelimiter, rightDelimiter) {
839 if (leftDelimiter === void 0) 839 if (leftDelimiter === void 0)
840 leftDelimiter = '('; 840 leftDelimiter = '(';
841 if (rightDelimiter === void 0) 841 if (rightDelimiter === void 0)
842 rightDelimiter = ')'; 842 rightDelimiter = ')';
843 if (IterableBase[_isToStringVisiting](iterable)) { 843 if (IterableBase[_isToStringVisiting](iterable)) {
844 return `${leftDelimiter}...${rightDelimiter}`; 844 return `${leftDelimiter}...${rightDelimiter}`;
845 } 845 }
846 let buffer = new core.StringBuffer(leftDelimiter); 846 let buffer = new core.StringBuffer(leftDelimiter);
(...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after
1999 } 1999 }
2000 static mapToString(m) { 2000 static mapToString(m) {
2001 if (IterableBase._isToStringVisiting(m)) { 2001 if (IterableBase._isToStringVisiting(m)) {
2002 return '{...}'; 2002 return '{...}';
2003 } 2003 }
2004 let result = new core.StringBuffer(); 2004 let result = new core.StringBuffer();
2005 try { 2005 try {
2006 IterableBase[_toStringVisiting].add(m); 2006 IterableBase[_toStringVisiting].add(m);
2007 result.write('{'); 2007 result.write('{');
2008 let first = true; 2008 let first = true;
2009 m.forEach(((k, v) => { 2009 m.forEach((k, v) => {
2010 if (!dart.notNull(first)) { 2010 if (!dart.notNull(first)) {
2011 result.write(', '); 2011 result.write(', ');
2012 } 2012 }
2013 first = false; 2013 first = false;
2014 result.write(k); 2014 result.write(k);
2015 result.write(': '); 2015 result.write(': ');
2016 result.write(v); 2016 result.write(v);
2017 }).bind(this)); 2017 });
2018 result.write('}'); 2018 result.write('}');
2019 } finally { 2019 } finally {
2020 dart.assert(core.identical(IterableBase[_toStringVisiting].last, m)); 2020 dart.assert(core.identical(IterableBase[_toStringVisiting].last, m));
2021 IterableBase[_toStringVisiting].removeLast(); 2021 IterableBase[_toStringVisiting].removeLast();
2022 } 2022 }
2023 return result.toString(); 2023 return result.toString();
2024 } 2024 }
2025 static [_id](x) { 2025 static [_id](x) {
2026 return x; 2026 return x;
2027 } 2027 }
(...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after
3283 for (let element of this) { 3283 for (let element of this) {
3284 if (!dart.notNull(other.contains(element))) 3284 if (!dart.notNull(other.contains(element)))
3285 result.add(element); 3285 result.add(element);
3286 } 3286 }
3287 return result; 3287 return result;
3288 } 3288 }
3289 union(other) { 3289 union(other) {
3290 return ((_) => { 3290 return ((_) => {
3291 _.addAll(other); 3291 _.addAll(other);
3292 return _; 3292 return _;
3293 }).bind(this)(this[_clone]()); 3293 })(this[_clone]());
3294 } 3294 }
3295 [_clone]() { 3295 [_clone]() {
3296 let set = new (SplayTreeSet$(E))(dart.closureWrap(this[_comparator], "(E , E) → int"), this[_validKey]); 3296 let set = new (SplayTreeSet$(E))(dart.closureWrap(this[_comparator], "(E , E) → int"), this[_validKey]);
3297 set[_count] = this[_count]; 3297 set[_count] = this[_count];
3298 set[_root] = this[_copyNode](this[_root]); 3298 set[_root] = this[_copyNode](this[_root]);
3299 return set; 3299 return set;
3300 } 3300 }
3301 [_copyNode](node) { 3301 [_copyNode](node) {
3302 if (node == null) 3302 if (node == null)
3303 return null; 3303 return null;
(...skipping 1626 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 | « lib/runtime/dart/async.js ('k') | lib/runtime/dart/core.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698