Package com.google.caja.parser.js

Examples of com.google.caja.parser.js.Operator


        }
        // If it's the LHS of an assignment, check the RHS
        if (gp.node instanceof Operation
            && use.parent.node == gp.node.children().get(0)) {
          Operation operation = gp.cast(Operation.class).node;
          Operator op = operation.getOperator();
          if (op == Operator.ASSIGN) {
            if (!isVisiblePropertyExpr(
                    operation.children().get(1), scopeTree,
                    identifiersExpanding)) {
              return false;
            }
          } else if (op.getAssignmentDelegate() != null) {
            if (!isNumberOrUndefOperator(op.getAssignmentDelegate())) {
              return false;
            }
          }
          // Although the increment/decrement operators are not handled here
          // and they do cause an assignment, they will always assign a numeric
View Full Code Here


    if (n instanceof Reference) {
      // Now that we're done with all the declaration in the scope, we can
      // tell whether a use corresponds to a declaration in the scope.
      String symbolName = id.node.getName();
      ScopeTree<S> defSite = definingSite(symbolName, s);
      Operator assignOperator = assignOperator(id);
      if (assignOperator == null) {
        listener.read(id, s.scopeImpl, scopeImpl(defSite));
      } else if (assignOperator == Operator.ASSIGN) {
        listener.assigned(id, s.scopeImpl, scopeImpl(defSite));
      } else // ++foo, foo++, foo += 1 all read before assignment
View Full Code Here

    AncestorChain<?> grandparent = ac.parent.parent;
    if (grandparent == null) { return null; }
    if (grandparent.node instanceof Operation) {
      // Handles ++ac, ac += ..., ac = ...
      Operation op = grandparent.cast(Operation.class).node;
      Operator operator = op.getOperator();
      return (operator.getCategory() == OperatorCategory.ASSIGNMENT
              && ac.parent.node == op.children().get(0)) ? operator : null;
    } else if (grandparent.node instanceof ExpressionStmt
               && grandparent.parent != null
               && grandparent.parent.node instanceof ForEachLoop) {
      // Handle
View Full Code Here

TOP

Related Classes of com.google.caja.parser.js.Operator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.