Examples of copyInformationFromForTree()


Examples of com.google.javascript.rhino.Node.copyInformationFromForTree()

    for (CompilerInput input : module.getInputs()) {
      Node originalInputRoot = input.getAstRoot(compiler);

      Node copiedInputRoot = originalInputRoot.cloneTree();
      copiedInputRoot.copyInformationFromForTree(originalInputRoot);

      specializedInputRootsByOriginal.put(originalInputRoot,
          copiedInputRoot);

      matchTopLevelFunctions(originalInputRoot, copiedInputRoot);
View Full Code Here

Examples of com.google.javascript.rhino.Node.copyInformationFromForTree()

    }

    private Node copiedOriginalFunction() {
      // Copy of a copy
      Node copy = originalFunctionCopy.cloneTree();
      copy.copyInformationFromForTree(originalFunctionCopy);

      return copy;
    }

    /**
 
View Full Code Here

Examples of com.google.javascript.rhino.Node.copyInformationFromForTree()

     *
     * var name;
     */
    private Node generateDummyDeclaration() {
      Node declaration = NodeUtil.newVarNode(name, null);
      declaration.copyInformationFromForTree(originalFunctionCopy);

      return declaration;
    }
  }

View Full Code Here

Examples of com.google.javascript.rhino.Node.copyInformationFromForTree()

    Node newBlockNode = IR.block(IR.returnNode(valueNode));

    // TODO(user): checkTreeEqual is overkill. I am in process of rewriting
    // these functions.
    if (newBlockNode.checkTreeEquals(oldBlockNode) != null) {
      newBlockNode.copyInformationFromForTree(oldBlockNode);
      functionNode.replaceChild(oldBlockNode, newBlockNode);
      compiler.reportCodeChange();
    }
  }
View Full Code Here

Examples of com.google.javascript.rhino.Node.copyInformationFromForTree()

    if (!alreadyRequired.contains(moduleName)) {
      alreadyRequired.add(moduleName);
      Node require = IR.exprResult(IR.call(NodeUtil.newQName(
          compiler, "goog.require"),
          IR.string(moduleName)));
      require.copyInformationFromForTree(importDecl);
      script.addChildToFront(require);
      if (reportDependencies) {
        t.getInput().addRequire(moduleName);
      }
    }
View Full Code Here

Examples of com.google.javascript.rhino.Node.copyInformationFromForTree()

    for (String name : namesToRequire) {
      Node require = IR.exprResult(IR.call(NodeUtil.newQName(
          compiler, "goog.require"),
          IR.string(moduleName + "." + name)));
      require.copyInformationFromForTree(importDecl);
      script.addChildToFront(require);
      if (reportDependencies) {
        t.getInput().addRequire(moduleName + "." + name);
      }
    }
View Full Code Here

Examples of com.google.javascript.rhino.Node.copyInformationFromForTree()

    if (!exportMap.isEmpty()) {
      // Add goog.provide call.
      Node googProvide = IR.exprResult(
          IR.call(NodeUtil.newQName(compiler, "goog.provide"),
              IR.string(moduleName)));
      script.addChildToFront(googProvide.copyInformationFromForTree(script));
      if (reportDependencies) {
        t.getInput().addProvide(moduleName);
      }

      for (String name : exportMap.keySet()) {
View Full Code Here

Examples of com.google.javascript.rhino.Node.copyInformationFromForTree()

      for (String name : exportMap.keySet()) {
        String qualifiedName = moduleName + "." + name;
        Node newGoogProvide = IR.exprResult(
            IR.call(NodeUtil.newQName(compiler, "goog.provide"),
                IR.string(qualifiedName)));
        newGoogProvide.copyInformationFromForTree(script);
        if (name.equals("default")) {
          JSDocInfoBuilder jsDocInfo = script.getJSDocInfo() == null
              ? new JSDocInfoBuilder(false)
              : JSDocInfoBuilder.copyFrom(script.getJSDocInfo());
          jsDocInfo.recordSuppressions(ImmutableSet.of("invalidProvide"));
View Full Code Here

Examples of com.google.javascript.rhino.Node.copyInformationFromForTree()

      NodeTraversal t, String name, Node parent) {
    if (!providedNames.containsKey(name)) {
      // Record this provide created on a previous pass, and create a dummy
      // EXPR node as a placeholder to simulate an explicit provide.
      Node expr = new Node(Token.EXPR_RESULT);
      expr.copyInformationFromForTree(parent);
      parent.getParent().addChildBefore(expr, parent);
      compiler.reportCodeChange();

      JSModule module = t.getModule();
      registerAnyProvidedPrefixes(name, expr, module);
View Full Code Here

Examples of com.google.javascript.rhino.Node.copyInformationFromForTree()

  protected void processJsMessage(
      JsMessage message, JsMessageDefinition definition) {
    try {
      Node msgNode = definition.getMessageNode();
      Node newValue = getNewValueNode(msgNode, message);
      newValue.copyInformationFromForTree(msgNode);

      msgNode.getParent().replaceChild(msgNode, newValue);
      compiler.reportCodeChange();
    } catch (MalformedException e) {
      compiler.report(JSError.make(e.getNode(),
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.