Interface VariableTree

All Superinterfaces:
StatementTree, Tree

public interface VariableTree extends StatementTree
A tree node for a variable declaration statement. For example:
   var name [ initializer ] ;
   var binding_pattern [ initializer ];
 
Since:
9
  • Method Details

    • getBinding

      ExpressionTree getBinding()
      Returns the binding of this declaration. This is an IdentifierTree for a binding identifier case (simple variable declaration). This is an ObjectLiteralTree or a ArrayLiteralTree for a destructuring declaration.
      Returns:
      the binding expression of this declaration
    • getInitializer

      ExpressionTree getInitializer()
      Returns the initial value expression for this variable. This is null if no initial value for this variable.
      Returns:
      the initial value expression
    • isConst

      boolean isConst()
      Is this a const declaration?
      Returns:
      true if this is a const declaration
    • isLet

      boolean isLet()
      Is this a let declaration?
      Returns:
      true if this is a let declaration