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

Unified Diff: sdk/lib/_internal/compiler/implementation/js/nodes.dart

Issue 260233003: Remove js.Sequence and use binary comma operator instead. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js/printer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/js/nodes.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js/nodes.dart b/sdk/lib/_internal/compiler/implementation/js/nodes.dart
index d19ae570374b7285b0c73088aea1b23fe04a5958..db260dbdccb1bc9f10e561bdf05d86b0d89467a9 100644
--- a/sdk/lib/_internal/compiler/implementation/js/nodes.dart
+++ b/sdk/lib/_internal/compiler/implementation/js/nodes.dart
@@ -31,7 +31,6 @@ abstract class NodeVisitor<T> {
T visitBlob(Blob node);
T visitLiteralExpression(LiteralExpression node);
T visitVariableDeclarationList(VariableDeclarationList node);
- T visitSequence(Sequence node);
T visitAssignment(Assignment node);
T visitVariableInitialization(VariableInitialization node);
T visitConditional(Conditional cond);
@@ -113,7 +112,6 @@ class BaseVisitor<T> implements NodeVisitor<T> {
T visitLiteralExpression(LiteralExpression node) => visitExpression(node);
T visitVariableDeclarationList(VariableDeclarationList node)
=> visitExpression(node);
- T visitSequence(Sequence node) => visitExpression(node);
T visitAssignment(Assignment node) => visitExpression(node);
T visitVariableInitialization(VariableInitialization node) {
if (node.value != null) {
@@ -205,6 +203,8 @@ abstract class Node {
VariableUse asVariableUse() => null;
+ bool get isCommaOperator => false;
+
Statement toStatement() {
throw new UnsupportedError('toStatement');
}
@@ -601,22 +601,6 @@ class VariableDeclarationList extends Expression {
int get precedenceLevel => EXPRESSION;
}
-class Sequence extends Expression {
- final List<Expression> expressions;
-
- Sequence(this.expressions);
-
- accept(NodeVisitor visitor) => visitor.visitSequence(this);
-
- void visitChildren(NodeVisitor visitor) {
- for (Expression expr in expressions) expr.accept(visitor);
- }
-
- Sequence _clone() => new Sequence(expressions);
-
- int get precedenceLevel => EXPRESSION;
-}
-
class Assignment extends Expression {
final Expression leftHandSide;
final String op; // Null, if the assignment is not compound.
@@ -716,6 +700,8 @@ class Binary extends Expression {
right.accept(visitor);
}
+ bool get isCommaOperator => op == ',';
+
int get precedenceLevel {
// TODO(floitsch): switch to constant map.
switch (op) {
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js/printer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698