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

Side by Side Diff: lib/src/js/nodes.dart

Issue 1083763003: refactor emitMemberName to be used more consistently (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 years, 8 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
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 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 /** 1071 /**
1072 * Constructs a LiteralString from a string value. 1072 * Constructs a LiteralString from a string value.
1073 * 1073 *
1074 * The constructor does not add the required quotes. If [value] is not 1074 * The constructor does not add the required quotes. If [value] is not
1075 * surrounded by quotes and property escaped, the resulting object is invalid 1075 * surrounded by quotes and property escaped, the resulting object is invalid
1076 * as a JS value. 1076 * as a JS value.
1077 * 1077 *
1078 * TODO(sra): Introduce variants for known valid strings that don't allocate a 1078 * TODO(sra): Introduce variants for known valid strings that don't allocate a
1079 * new string just to add quotes. 1079 * new string just to add quotes.
1080 */ 1080 */
1081 LiteralString(this.value); 1081 LiteralString(this.value) {
1082 assert(value != '"_nextCallback="');
Jacob 2015/04/13 23:19:36 this seems like an oddly specific assert.
Jennifer Messerly 2015/04/14 21:21:00 eeeep. Good catch! I didn't follow my own conventi
1083 }
1082 1084
1083 accept(NodeVisitor visitor) => visitor.visitLiteralString(this); 1085 accept(NodeVisitor visitor) => visitor.visitLiteralString(this);
1084 LiteralString _clone() => new LiteralString(value); 1086 LiteralString _clone() => new LiteralString(value);
1085 } 1087 }
1086 1088
1087 class LiteralNumber extends Literal { 1089 class LiteralNumber extends Literal {
1088 final String value; // Must be a valid JavaScript number literal. 1090 final String value; // Must be a valid JavaScript number literal.
1089 1091
1090 LiteralNumber(this.value); 1092 LiteralNumber(this.value);
1091 1093
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
1431 final Expression expression; 1433 final Expression expression;
1432 1434
1433 CommentExpression(this.comment, this.expression); 1435 CommentExpression(this.comment, this.expression);
1434 1436
1435 int get precedenceLevel => PRIMARY; 1437 int get precedenceLevel => PRIMARY;
1436 accept(NodeVisitor visitor) => visitor.visitCommentExpression(this); 1438 accept(NodeVisitor visitor) => visitor.visitCommentExpression(this);
1437 CommentExpression _clone() => new CommentExpression(comment, expression); 1439 CommentExpression _clone() => new CommentExpression(comment, expression);
1438 1440
1439 void visitChildren(NodeVisitor visitor) => expression.accept(visitor); 1441 void visitChildren(NodeVisitor visitor) => expression.accept(visitor);
1440 } 1442 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698