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

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


      // declare all methods into the global scope
      for (int i = 0; i < jsFuncs.size(); ++i) {
        JsFunction func = jsFuncs.get(i);
        if (func != null) {
          globalStmts.add(func.makeStmt());
        }
      }

      if (typeOracle.isInstantiatedType(x) && !program.isJavaScriptObject(x)) {
        generateClassSetup(x, globalStmts);
View Full Code Here


      List<JsStatement> globalStmts = jsProgram.getGlobalBlock().getStatements();

      if (x.hasClinit()) {
        JsFunction clinitFunc = jsFuncs.get(0);
        handleClinit(clinitFunc, null);
        globalStmts.add(clinitFunc.makeStmt());
      }

      // setup fields
      JsVars vars = new JsVars(x.getSourceInfo());
      for (int i = 0; i < jsFields.size(); ++i) {
View Full Code Here

      JsName gwtOnLoadName = topScope.declareName("gwtOnLoad");
      gwtOnLoadName.setObfuscatable(false);
      JsFunction gwtOnLoad = new JsFunction(sourceInfo, topScope,
          gwtOnLoadName, true);
      globalStmts.add(gwtOnLoad.makeStmt());
      JsBlock body = new JsBlock(sourceInfo);
      gwtOnLoad.setBody(body);
      JsScope fnScope = gwtOnLoad.getScope();
      List<JsParameter> params = gwtOnLoad.getParameters();
      JsName errFn = fnScope.declareName("errFn");
View Full Code Here

          GenerateJavaScriptAST.class, "Null function");
      JsFunction nullFunc = new JsFunction(sourceInfo, topScope,
          nullMethodName, true);
      nullFunc.setBody(new JsBlock(sourceInfo));
      // Add it first, so that script-tag chunking in IFrameLinker works
      globalStatements.add(0, nullFunc.makeStmt());
    }

    private void generateSeedFuncAndPrototype(JClassType x,
        List<JsStatement> globalStmts) {
      SourceInfo sourceInfo = x.getSourceInfo().makeChild(
View Full Code Here

        JsFunction seedFunc = new JsFunction(sourceInfo, topScope,
            seedFuncName, true);
        seedFuncName.setStaticRef(seedFunc);
        JsBlock body = new JsBlock(sourceInfo);
        seedFunc.setBody(body);
        JsExprStmt seedFuncStmt = seedFunc.makeStmt();
        globalStmts.add(seedFuncStmt);
        typeForStatMap.put(seedFuncStmt, x);

        // setup prototype, assign to temp
        // _ = com_example_foo_Foo.prototype = new com_example_foo_FooSuper();
View Full Code Here

        // seed function
        // function com_example_foo_Foo() { }
        JsFunction seedFunc = new JsFunction(topScope, seedFuncName);
        JsBlock body = new JsBlock();
        seedFunc.setBody(body);
        globalStmts.add(seedFunc.makeStmt());

        // setup prototype, assign to temp
        // _ = com_example_foo_Foo.prototype = new com_example_foo_FooSuper();
        JsNameRef lhs = prototype.makeRef();
        lhs.setQualifier(seedFuncName.makeRef());
View Full Code Here

      // declare all methods into the global scope
      for (int i = 0; i < jsFuncs.size(); ++i) {
        JsFunction func = (JsFunction) jsFuncs.get(i);
        if (func != null) {
          globalStmts.add(func.makeStmt());
        }
      }

      if (typeOracle.isInstantiatedType(x)) {
        generateClassSetup(x, globalStmts);
View Full Code Here

      JsStatements globalStmts = jsProgram.getGlobalBlock().getStatements();

      if (typeOracle.hasDirectClinit(x)) {
        JsFunction clinitFunc = (JsFunction) jsFuncs.get(0);
        handleClinit(clinitFunc, null);
        globalStmts.add(clinitFunc.makeStmt());
      }

      // setup fields
      JsVars vars = new JsVars();
      for (int i = 0; i < jsFields.size(); ++i) {
View Full Code Here

      // Generate entry methods
      List/* <JsFunction> */entryFuncs = popList(x.entryMethods.size()); // entryMethods
      for (int i = 0; i < entryFuncs.size(); ++i) {
        JsFunction func = (JsFunction) entryFuncs.get(i);
        if (func != null) {
          globalStmts.add(func.makeStmt());
        }
      }

      generateGwtOnLoad(entryFuncs, globalStmts);

View Full Code Here

       *   }
       * }
       * </pre>
       */
      JsFunction gwtOnLoad = new JsFunction(topScope);
      globalStmts.add(gwtOnLoad.makeStmt());
      JsName gwtOnLoadName = topScope.declareName("gwtOnLoad");
      gwtOnLoadName.setObfuscatable(false);
      gwtOnLoad.setName(gwtOnLoadName);
      JsBlock body = new JsBlock();
      gwtOnLoad.setBody(body);
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.