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

Examples of com.google.gwt.dev.js.ast.JsInvocation


              JsName jsName = names.get(field);
              assert (jsName != null);
              x.resolve(jsName);

              // See if we need to add a clinit call to a static field ref
              JsInvocation clinitCall = maybeCreateClinitCall(field);
              if (clinitCall != null) {
                JsExpression commaExpr = createCommaExpression(clinitCall, x);
                ctx.replaceMe(commaExpr);
              }
            } else {
View Full Code Here


      jsIf.setElseStmt(callBlock);
      jsTry.setTryBlock(callBlock);
      for (int i = 0; i < entryFuncs.size(); ++i) {
        JsFunction func = entryFuncs.get(i);
        if (func != null) {
          JsInvocation call = new JsInvocation();
          call.setQualifier(func.getName().makeRef());
          callBlock.getStatements().add(call.makeStmt());
        }
      }
      JsCatch jsCatch = new JsCatch(fnScope, "e");
      jsTry.getCatches().add(jsCatch);
      JsBlock catchBlock = new JsBlock();
      jsCatch.setBody(catchBlock);
      JsInvocation errCall = new JsInvocation();
      catchBlock.getStatements().add(errCall.makeStmt());
      errCall.setQualifier(errFn.makeRef());
      errCall.getArguments().add(modName.makeRef());
    }
View Full Code Here

        lhsName.setObfuscatable(false);
        JsNameRef lhs = lhsName.makeRef();
        lhs.setQualifier(globalTemp.makeRef());

        // rhs
        JsInvocation call = new JsInvocation();
        JsNameRef toStringRef = new JsNameRef(
            polymorphicNames.get(toStringMeth));
        toStringRef.setQualifier(new JsThisRef());
        call.setQualifier(toStringRef);
        JsReturn jsReturn = new JsReturn(call);
        JsFunction rhs = new JsFunction(topScope);
        JsBlock body = new JsBlock();
        body.getStatements().add(jsReturn);
        rhs.setBody(body);
View Full Code Here

          enclosingType)) {
        return null;
      }

      JMethod clinitMethod = enclosingType.methods.get(0);
      JsInvocation jsInvocation = new JsInvocation();
      jsInvocation.setQualifier(names.get(clinitMethod).makeRef());
      return jsInvocation;
    }
View Full Code Here

      if (x == enclosingType.methods.get(0)) {
        return null;
      }

      JMethod clinitMethod = enclosingType.methods.get(0);
      JsInvocation jsInvocation = new JsInvocation();
      jsInvocation.setQualifier(names.get(clinitMethod).makeRef());
      return jsInvocation;
    }
View Full Code Here

    JsNameRef oldTarget = (JsNameRef) ref.getQualifier();
    JsNameRef newTarget = new JsNameRef(oldTarget.getSourceInfo(),
        oldTarget.getName());
    newTarget.setQualifier(oldArgs.get(0));
    JsInvocation newCall = new JsInvocation(x.getSourceInfo(), newTarget,
        // Don't need to clone because the returned invocation is transient.
        oldArgs.subList(1, oldArgs.size()));
    return newCall;
  }
View Full Code Here

    public void endVisit(JsExpression x, JsContext ctx) {
      SourceInfo info = x.getSourceInfo();
      if (!instrumentableLines.containsEntry(info.getFileName(), info.getStartLine())) {
        return;
      }
      JsInvocation update = new JsInvocation(info,
          jsProgram.getIndexedFunction("CoverageUtil.cover"),
          new JsStringLiteral(info, info.getFileName()),
          new JsNumberLiteral(info, info.getStartLine()));
      ctx.replaceMe(new JsBinaryOperation(info, JsBinaryOperator.COMMA, update, x));
    }
View Full Code Here

      JsBinaryOperation op = (JsBinaryOperation) expr;
      if (!(op.getArg2() instanceof JsInvocation)) {
        return;
      }

      JsInvocation i = (JsInvocation) op.getArg2();
      JsExpression q = i.getQualifier();
      if (!(q instanceof JsNameRef)) {
        return;
      }

      JsName name = ((JsNameRef) q).getName();
View Full Code Here

        }

        // Use a clone instead of modifying the original JSNI
        // __gwt_makeTearOff(obj, dispId, paramCount)
        SourceInfo info = x.getSourceInfo();
        JsInvocation rewritten = new JsInvocation(info, new JsNameRef(info, "__gwt_makeTearOff"));

        List<JsExpression> arguments = rewritten.getArguments();
        if (q == null) {
          q = JsNullLiteral.INSTANCE;
        }
        arguments.add(q);
        arguments.add(new JsNumberLiteral(info, dispId));
View Full Code Here

            } else if (member instanceof Constructor<?>) {
              paramCount = ((Constructor<?>) member).getParameterTypes().length;
            }

            SourceInfo info = x.getSourceInfo();
            JsInvocation inner = new JsInvocation(info,
                new JsNameRef(info, "__gwt_makeJavaInvoke"), new JsNumberLiteral(info, paramCount));

            JsInvocation outer = new JsInvocation(info);
            outer.setQualifier(inner);
            JsExpression q = ref.getQualifier();
            if (q == null) {
              q = JsNullLiteral.INSTANCE;
            }
            List<JsExpression> arguments = outer.getArguments();
            arguments.add(q);
            arguments.add(new JsNumberLiteral(info, dispId));
            arguments.addAll(x.getArguments());

            accept(outer);
View Full Code Here

TOP

Related Classes of com.google.gwt.dev.js.ast.JsInvocation

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.