Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 } |
| OLD | NEW |