if (!compiler.run()) {
throw new GadgetRewriteException("Gadget has compile errors");
}
StringBuilder scriptBody = new StringBuilder();
CajoledModule cajoled = compiler.getJavascript();
TokenConsumer tc = debug
? new JsPrettyPrinter(new Concatenator(scriptBody))
: new JsMinimalPrinter(new Concatenator(scriptBody));
cajoled.render(new RenderContext(tc)
.withAsciiOnly(true)
.withEmbeddable(true));
tc.noMoreTokens();
Node html = compiler.getStaticHtml();
Element script = doc.createElementNS(
Namespaces.HTML_NAMESPACE_URI, "script");