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

Unified Diff: pkg/compiler/lib/src/ssa/builder.dart

Issue 1689783002: Don't allow to iterate over strings. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | tests/language/for_in3_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/builder.dart
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index d06a002bc42b14a616f38d7f691a4fb2a759fb17..85fd58338a7e5e5b627034dbb009549182e4e9ba 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -7535,7 +7535,10 @@ class SsaBuilder extends ast.Visitor
TypeMask mask = elements.getIteratorTypeMask(node);
ClassWorld classWorld = compiler.world;
- if (mask != null && mask.satisfies(helpers.jsIndexableClass, classWorld)) {
+ if (mask != null &&
+ mask.satisfies(helpers.jsIndexableClass, classWorld) &&
+ // String is indexable but not iterable.
+ !mask.satisfies(helpers.jsStringClass, classWorld)) {
return buildSyncForInIndexable(node, mask);
}
buildSyncForInIterator(node);
« no previous file with comments | « no previous file | tests/language/for_in3_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698