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

Unified Diff: lib/runtime/dart/collection.js

Issue 1048863003: Handle for-in loops (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Rebase Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/runtime/dart/_js_names.js ('k') | lib/src/checker/checker.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart/collection.js
diff --git a/lib/runtime/dart/collection.js b/lib/runtime/dart/collection.js
index 81ba132679b9ad7598f97c9934eda1cf8ce74455..5522c1ee9398c0de7e455a171ef5c4c3c3dafa48 100644
--- a/lib/runtime/dart/collection.js
+++ b/lib/runtime/dart/collection.js
@@ -350,7 +350,7 @@ var collection;
let result = this[_newSet]();
for (let element of this) {
if (!dart.notNull(other.contains(element)))
- result.add(dart.as(element, E));
+ result.add(element);
}
return result;
}
@@ -358,7 +358,7 @@ var collection;
let result = this[_newSet]();
for (let element of this) {
if (other.contains(element))
- result.add(dart.as(element, E));
+ result.add(element);
}
return result;
}
@@ -407,7 +407,7 @@ var collection;
}
from(elements) {
let result = new HashSet();
- for (let e of elements)
+ for (let e of dart.as(elements, core.Iterable$(E)))
result.add(e);
return result;
}
@@ -2145,7 +2145,7 @@ var collection;
}
from(elements) {
let list = dart.as(new DoubleLinkedQueue(), Queue$(E));
- for (let e of elements) {
+ for (let e of dart.as(elements, core.Iterable$(E))) {
list.addLast(e);
}
return dart.as(list, DoubleLinkedQueue$(E));
@@ -2328,7 +2328,7 @@ var collection;
capacity = elements.length;
}
let result = new ListQueue(capacity);
- for (let element of elements) {
+ for (let element of dart.as(elements, core.Iterable$(E))) {
result.addLast(element);
}
return result;
@@ -3180,7 +3180,7 @@ var collection;
if (isValidKey === void 0)
isValidKey = null;
let result = new SplayTreeSet(compare, isValidKey);
- for (let element of elements) {
+ for (let element of dart.as(elements, core.Iterable$(E))) {
result.add(element);
}
return result;
« no previous file with comments | « lib/runtime/dart/_js_names.js ('k') | lib/src/checker/checker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698