Package com.google.gwt.dev.js.ast

Examples of com.google.gwt.dev.js.ast.JsExpression.makeStmt()


      gwtOnLoad.setArtificiallyRescued(true);
      JsBlock gwtOnLoadFunctionBody = new JsBlock(sourceInfo);
      gwtOnLoad.setBody(gwtOnLoadFunctionBody);
      JsExpression gwtOnLoadAssignment =
          createAssignment(gwtOnLoadName.makeRef(sourceInfo), gwtOnLoad);
      createGwtOnLoadBody.getStatements().add(gwtOnLoadAssignment.makeStmt());
      JsScope fnScope = gwtOnLoad.getScope();
      List<JsParameter> gwtOnLoadParams = gwtOnLoad.getParameters();
      JsName errFn = fnScope.declareName("errFn");
      JsName modName = fnScope.declareName("modName");
      JsName modBase = fnScope.declareName("modBase");
View Full Code Here


      // $moduleName = modName;
      JsExpression moduleNameAssignment =
          createAssignment(topScope.findExistingUnobfuscatableName("$moduleName").makeRef(
              sourceInfo), modName.makeRef(sourceInfo));
      gwtOnLoadFunctionBody.getStatements().add(moduleNameAssignment.makeStmt());

      // $moduleBase = modBase;
      JsExpression moduleBaseAssignment =
          createAssignment(topScope.findExistingUnobfuscatableName("$moduleBase").makeRef(
              sourceInfo), modBase.makeRef(sourceInfo));
View Full Code Here

      // $moduleBase = modBase;
      JsExpression moduleBaseAssignment =
          createAssignment(topScope.findExistingUnobfuscatableName("$moduleBase").makeRef(
              sourceInfo), modBase.makeRef(sourceInfo));
      gwtOnLoadFunctionBody.getStatements().add(moduleBaseAssignment.makeStmt());

      // Assignment to CollapsedPropertyHolder.permutationId only if it's used
      // CollapsedPropertyHolder.permutationId = softPermutationId;
      JsName permutationIdFieldName =
          names.get(program.getIndexedField("CollapsedPropertyHolder.permutationId"));
View Full Code Here

          names.get(program.getIndexedField("CollapsedPropertyHolder.permutationId"));
      if (permutationIdFieldName != null) {
        JsExpression permutationIdAssignment =
            createAssignment(permutationIdFieldName.makeRef(sourceInfo), softPermutationId
                .makeRef(sourceInfo));
        gwtOnLoadFunctionBody.getStatements().add(permutationIdAssignment.makeStmt());
      }

      // if (errFn) {
      //   try {
      //     $entry(init)();
View Full Code Here

      JsNameRef ctmRef = castableTypeMapName.makeRef(x.getSourceInfo());

      JsExpression castMapLit = generateCastableTypeMap(x);
      JsExpression ctmAsg = createAssignment(ctmRef,
          castMapLit);
      JsExprStmt ctmAsgStmt = ctmAsg.makeStmt();
      globalStmts.add(ctmAsgStmt);
      typeForStatMap.put(ctmAsgStmt, x);
    }

    private void generateToStringAlias(JClassType x, List<JsStatement> globalStmts) {
View Full Code Here

        body.getStatements().add(jsReturn);
        rhs.setBody(body);

        // asg
        JsExpression asg = createAssignment(lhs, rhs);
        JsExprStmt stmt = asg.makeStmt();
        globalStmts.add(stmt);
        typeForStatMap.put(stmt, program.getTypeJavaLangObject());
      }
    }
View Full Code Here

      JsFunction emptyFunctionFn =
          indexedFunctions.get("JavaClassHierarchySetupUtil.emptyMethod");
      JsExpression asg = createAssignment(clinitFunc.getName().makeRef(sourceInfo),
          emptyFunctionFn.getName().makeRef(sourceInfo));
      statements.add(0, asg.makeStmt());
    }

    private boolean isMethodPotentiallyCalledAcrossClasses(JMethod method) {
      assert !hasWholeWorldKnowledge || crossClassTargets != null;
      return crossClassTargets == null || crossClassTargets.contains(method);
View Full Code Here

    }

    // @Override
    public void endVisit(JExpressionStatement x, Context ctx) {
      JsExpression expr = (JsExpression) pop(); // expr
      push(expr.makeStmt());
    }

    // @Override
    public void endVisit(JField x, Context ctx) {
      // if we need an initial value, create an assignment
View Full Code Here

      params.add(new JsParameter(modName));
      params.add(new JsParameter(modBase));
      JsExpression asg = createAssignment(
          topScope.findExistingUnobfuscatableName("$moduleName").makeRef(),
          modName.makeRef());
      body.getStatements().add(asg.makeStmt());
      asg = createAssignment(topScope.findExistingUnobfuscatableName(
          "$moduleBase").makeRef(), modBase.makeRef());
      body.getStatements().add(asg.makeStmt());
      JsIf jsIf = new JsIf();
      body.getStatements().add(jsIf);
View Full Code Here

          topScope.findExistingUnobfuscatableName("$moduleName").makeRef(),
          modName.makeRef());
      body.getStatements().add(asg.makeStmt());
      asg = createAssignment(topScope.findExistingUnobfuscatableName(
          "$moduleBase").makeRef(), modBase.makeRef());
      body.getStatements().add(asg.makeStmt());
      JsIf jsIf = new JsIf();
      body.getStatements().add(jsIf);
      jsIf.setIfExpr(errFn.makeRef());
      JsTry jsTry = new JsTry();
      jsIf.setThenStmt(jsTry);
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.