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

Unified Diff: lib/runtime/dart/_js_helper.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/_isolate_helper.js ('k') | lib/runtime/dart/_js_names.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart/_js_helper.js
diff --git a/lib/runtime/dart/_js_helper.js b/lib/runtime/dart/_js_helper.js
index cab7987ccae426a01360b196ca6468518d2c38e2..52c29ccb4c7662d790f578befe427e339c797719 100644
--- a/lib/runtime/dart/_js_helper.js
+++ b/lib/runtime/dart/_js_helper.js
@@ -797,7 +797,7 @@ var _js_helper;
}
let buffer = new core.StringBuffer();
let startIndex = 0;
- for (let match of dart.dinvoke(pattern, 'allMatches', receiver)) {
+ for (let match of dart.as(dart.dinvoke(pattern, 'allMatches', receiver), core.Iterable$(core.Match))) {
buffer.write(dart.dinvokef(onNonMatch, dart.dinvoke(receiver, 'substring', startIndex, match.start)));
buffer.write(dart.dinvokef(onMatch, match));
startIndex = match.end;
@@ -1871,7 +1871,7 @@ var _js_helper;
}
static stringFromCodePoints(codePoints) {
let a = new core.List$(core.int).from([]);
- for (let i of codePoints) {
+ for (let i of dart.as(codePoints, core.Iterable)) {
if (!(typeof i == 'number'))
throw new core.ArgumentError(i);
if (dart.dbinary(i, '<=', 65535)) {
@@ -1886,7 +1886,7 @@ var _js_helper;
return Primitives[_fromCharCodeApply](a);
}
static stringFromCharCodes(charCodes) {
- for (let i of charCodes) {
+ for (let i of dart.as(charCodes, core.Iterable)) {
if (!(typeof i == 'number'))
throw new core.ArgumentError(i);
if (dart.dbinary(i, '<', 0))
« no previous file with comments | « lib/runtime/dart/_isolate_helper.js ('k') | lib/runtime/dart/_js_names.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698