Examples of UncajoledModule


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

    children.add(js(
        testPath == null ?
        fromString(caja, is) :
        testPath));
    String cajoledJs = render(rewriteTopLevelNode(
        new UncajoledModule(new Block(FilePosition.UNKNOWN, children))));

    assertNoErrors();

    final String[] assertFunctions = new String[] {
        "fail",
View Full Code Here

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

  public class Caja {
    public String cajole(String source) throws ParseException {
      List<Statement> children = Lists.newArrayList();
      children.add(js(fromString(source, is)));
      String cajoledJs = render(rewriteTopLevelNode(
          new UncajoledModule(new Block(FilePosition.UNKNOWN, children))));
      // TODO: return code to construct the appropriate error object when there
      // are errors during translation.
      return cajoledJs;
    }
View Full Code Here

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

    mq.getMessages().clear();

    List<Statement> children = Lists.newArrayList();
    children.add(js(fromString(caja, is)));
    String cajoledJs = render(rewriteTopLevelNode(
        new UncajoledModule(new Block(FilePosition.UNKNOWN, children))));

    assertNoErrors();

    final String[] assertFunctions = new String[] {
        "fail",
View Full Code Here

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

  }

  // TODO(ihab.awad): Refactor tests to use checkAddsMessage(...) instead
  protected void checkFails(String input, String error) throws Exception {
    mq.getMessages().clear();
    getRewriter().expand(new UncajoledModule(new Block(
        FilePosition.UNKNOWN, Arrays.asList(js(fromString(input, is))))));

    assertFalse(
        "Expected error, found none: " + error,
        mq.getMessages().isEmpty());
View Full Code Here

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

      PluginMeta pm = new PluginMeta();
      pm.setPrecajoleMap(null);
      ModuleManager mgr = new ModuleManager(
          pm, BuildInfo.getInstance(),
          UriFetcher.NULL_NETWORK, mq);
      UncajoledModule input = uncajoled(text, name, mq);

      // TODO(felix8a): maybe should use compilation pipeline
      ArrayIndexOptimization.optimize(input);
      ParseTreeNode result = new ExpressionSanitizerCaja(mgr, null)
          .sanitize(input);
View Full Code Here

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

          .withInput(new InputSource(inputUri))
          .withInput(ContentType.JS)
          .withInput(cp)
          .build();

      UncajoledModule ucm = new UncajoledModule(input);
      Rewriter esrw = new ES53Rewriter(buildInfo, mq, false /* logging */);
      cajoledModule = (CajoledModule) esrw.expand(ucm);
    } catch (ParseException e) {
      e.toMessageQueue(mq);
    } catch (IllegalStateException e) {
View Full Code Here

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

    }
  };

  public final void testCajoledModuleContents() {
    CajoledModule trivialCajoledModule = (CajoledModule) makeRewriter().expand(
        new UncajoledModule(new Block()));
    assertNoErrors();

    Map<String, ParseTreeNode> bindings = Maps.newHashMap();

    assertTrue(QuasiBuilder.match(
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.