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

Side by Side Diff: pkg/js_ast/lib/src/nodes.dart

Issue 972063003: Make sure to bind a method to its receiver if it is stored in a temporary. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Avoid using JavaScript bind. Rely on functions never changing 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of js_ast; 5 part of js_ast;
6 6
7 abstract class NodeVisitor<T> { 7 abstract class NodeVisitor<T> {
8 T visitProgram(Program node); 8 T visitProgram(Program node);
9 9
10 T visitBlock(Block node); 10 T visitBlock(Block node);
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 236
237 accept(NodeVisitor visitor) => visitor.visitBlock(this); 237 accept(NodeVisitor visitor) => visitor.visitBlock(this);
238 void visitChildren(NodeVisitor visitor) { 238 void visitChildren(NodeVisitor visitor) {
239 for (Statement statement in statements) statement.accept(visitor); 239 for (Statement statement in statements) statement.accept(visitor);
240 } 240 }
241 Block _clone() => new Block(statements); 241 Block _clone() => new Block(statements);
242 } 242 }
243 243
244 class ExpressionStatement extends Statement { 244 class ExpressionStatement extends Statement {
245 final Expression expression; 245 final Expression expression;
246 ExpressionStatement(this.expression); 246 ExpressionStatement(this.expression) {
247 assert(this.expression != null);
248 }
247 249
248 accept(NodeVisitor visitor) => visitor.visitExpressionStatement(this); 250 accept(NodeVisitor visitor) => visitor.visitExpressionStatement(this);
249 void visitChildren(NodeVisitor visitor) { expression.accept(visitor); } 251 void visitChildren(NodeVisitor visitor) { expression.accept(visitor); }
250 ExpressionStatement _clone() => new ExpressionStatement(expression); 252 ExpressionStatement _clone() => new ExpressionStatement(expression);
251 } 253 }
252 254
253 class EmptyStatement extends Statement { 255 class EmptyStatement extends Statement {
254 EmptyStatement(); 256 EmptyStatement();
255 257
256 accept(NodeVisitor visitor) => visitor.visitEmptyStatement(this); 258 accept(NodeVisitor visitor) => visitor.visitEmptyStatement(this);
(...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after
1170 class Comment extends Statement { 1172 class Comment extends Statement {
1171 final String comment; 1173 final String comment;
1172 1174
1173 Comment(this.comment); 1175 Comment(this.comment);
1174 1176
1175 accept(NodeVisitor visitor) => visitor.visitComment(this); 1177 accept(NodeVisitor visitor) => visitor.visitComment(this);
1176 Comment _clone() => new Comment(comment); 1178 Comment _clone() => new Comment(comment);
1177 1179
1178 void visitChildren(NodeVisitor visitor) {} 1180 void visitChildren(NodeVisitor visitor) {}
1179 } 1181 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698