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

Unified Diff: pkg/compiler/lib/src/tree/nodes.dart

Issue 1783053005: Fix all for-in warnings in dart2js (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 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 | « pkg/compiler/lib/src/js_emitter/type_test_registry.dart ('k') | pkg/compiler/lib/src/util/link.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/tree/nodes.dart
diff --git a/pkg/compiler/lib/src/tree/nodes.dart b/pkg/compiler/lib/src/tree/nodes.dart
index 6eb072163acb07219144fc405b3fa72b20607d95..8b9234df38d987bdd904b55b2adec7d07e87bb5e 100644
--- a/pkg/compiler/lib/src/tree/nodes.dart
+++ b/pkg/compiler/lib/src/tree/nodes.dart
@@ -572,7 +572,7 @@ class NewExpression extends Expression {
Token getEndToken() => send.getEndToken();
}
-class NodeList extends Node {
+class NodeList extends Node with IterableMixin<Node> {
final Link<Node> nodes;
final Token beginToken;
final Token endToken;
@@ -588,6 +588,13 @@ class NodeList extends Node {
NodeList asNodeList() => this;
+ // Override [IterableMixin.toString] with same code as [Node.toString].
+ toString() => unparse(this);
+
+ get length {
+ throw new UnsupportedError('use slowLength() instead of get:length');
+ }
+
int slowLength() {
int result = 0;
for (Link<Node> cursor = nodes; !cursor.isEmpty; cursor = cursor.tail) {
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/type_test_registry.dart ('k') | pkg/compiler/lib/src/util/link.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698