com.google.dart.compiler.backend.js
Class JsConstructExpressionVisitor

java.lang.Object
  extended by com.google.dart.compiler.backend.js.ast.JsVisitor
      extended by com.google.dart.compiler.backend.js.ast.RecursiveJsVisitor
          extended by com.google.dart.compiler.backend.js.JsConstructExpressionVisitor

public class JsConstructExpressionVisitor
extends RecursiveJsVisitor

Searches for method invocations in constructor expressions that would not normally be surrounded by parentheses.


Method Summary
<T extends JsNode>
void
accept(T node)
          We only look at nodes that would not normally be surrounded by parentheses.
static boolean exec(JsExpression expression)
           
 void visitArray(JsArrayLiteral x)
          Array literals have their own scoping.
 void visitArrayAccess(JsArrayAccess x)
          We only look at the array expression since the index has its own scope.
 void visitFunction(JsFunction x)
          Functions have their own scoping.
 void visitInvocation(JsInvocation invocation)
           
 void visitNameRef(JsNameRef nameRef)
           
 void visitNew(JsNew x)
          New constructs bind to the nearest set of parentheses.
 void visitObjectLiteral(JsObjectLiteral x)
          Object literals have their own scope.
 
Methods inherited from class com.google.dart.compiler.backend.js.ast.RecursiveJsVisitor
visitElement
 
Methods inherited from class com.google.dart.compiler.backend.js.ast.JsVisitor
acceptList, acceptLvalue, acceptWithInsertRemove, visit, visit, visitBinaryExpression, visitBlock, visitBoolean, visitBreak, visitCase, visitCatch, visitConditional, visitContinue, visitDebugger, visitDefault, visitDocComment, visitDouble, visitDoWhile, visitEmpty, visitExpressionStatement, visitFor, visitForIn, visitIf, visitInt, visitLabel, visitNull, visitParameter, visitPostfixOperation, visitPrefixOperation, visitProgram, visitProgramFragment, visitPropertyInitializer, visitRegExp, visitReturn, visitString, visitThis, visitThrow, visitTry, visitVars, visitWhile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

exec

public static boolean exec(JsExpression expression)

visitArrayAccess

public void visitArrayAccess(JsArrayAccess x)
We only look at the array expression since the index has its own scope.

Overrides:
visitArrayAccess in class JsVisitor

visitArray

public void visitArray(JsArrayLiteral x)
Array literals have their own scoping.

Overrides:
visitArray in class JsVisitor

visitFunction

public void visitFunction(JsFunction x)
Functions have their own scoping.

Overrides:
visitFunction in class JsVisitor

visitInvocation

public void visitInvocation(JsInvocation invocation)
Overrides:
visitInvocation in class JsVisitor

visitNameRef

public void visitNameRef(JsNameRef nameRef)
Overrides:
visitNameRef in class JsVisitor

visitNew

public void visitNew(JsNew x)
New constructs bind to the nearest set of parentheses.

Overrides:
visitNew in class JsVisitor

visitObjectLiteral

public void visitObjectLiteral(JsObjectLiteral x)
Object literals have their own scope.

Overrides:
visitObjectLiteral in class JsVisitor

accept

public <T extends JsNode> void accept(T node)
We only look at nodes that would not normally be surrounded by parentheses.

Overrides:
accept in class JsVisitor