Examples of toSource()


Examples of com.google.javascript.jscomp.Compiler.toSource()

      log("Compiling " + sources.length + " file(s) with " +
          externs.length + " extern(s)");

      Result result = compiler.compile(externs, sources, options);
      if (result.success) {
        writeResult(compiler.toSource());
      } else {
        throw new BuildException("Compilation failed.");
      }
    } else {
      log("None of the files changed. Compilation skipped.");
View Full Code Here

Examples of com.google.javascript.jscomp.Compiler.toSource()

            // compile() returns a Result, but it is not needed here.
            compiler.compile(externs, inputs, options);

            // The compiler is responsible for generating the compiled code; it
            // is not accessible via the Result.
            result = compiler.toSource();
        } catch (Exception e) {
            log.error("Not able to compress the given JavaScript", e);
        }
        return result;
    }
View Full Code Here

Examples of com.google.javascript.jscomp.Compiler.toSource()

        Result result = compiler.compile(EXTERNS, inputs, options);

        if (result.success)
        {
            return IOUtils.toInputStream(compiler.toSource());
        }

        throw new RuntimeException(String.format("Compilation failed: %s.",
                InternalUtils.join(CollectionFactory.newList(result.errors), ";")));
    }
View Full Code Here

Examples of com.google.javascript.jscomp.Compiler.toSource()

    }

    Result result = compiler.compile(EXTERNS, inputs, options);

    assertTrue("compilation failed", result.success);
    String source = compiler.toSource();

    StringBuilder sb = new StringBuilder();
    try {
      result.sourceMap.validate(true);
      result.sourceMap.appendTo(sb, "testcode");
View Full Code Here

Examples of com.google.javascript.jscomp.Compiler.toSource()

   
    Result result = compiler.compile(extern, input, options);
    if (result.success)
    {
      logger.debug(Messages.OUTPUT_FROM_MINIFIER, errorStream.toString());
      readers.add( new StringReader(compiler.toSource()) );
    }
    else
    {
      logger.error(Messages.ERROR_WHILE_BUNDLING_MSG, errorStream.toString());
      readers.add( new StringReader(String.format(Messages.ERROR_WHILE_BUNDLING_MSG, errorStream.toString())) );
View Full Code Here

Examples of com.google.javascript.jscomp.Compiler.toSource()

        // compile() returns a Result, but it is not needed here.
        compiler.compile(extern, input, options);

        // The compiler is responsible for generating the compiled code; it is not
        // accessible via the Result.
        return compiler.toSource();
    }

    /**
     * @return the externs to use when compiling
     */
 
View Full Code Here

Examples of net.sourceforge.htmlunit.corejs.javascript.ast.AstNode.toSource()

                    }
                } else if (parentType == WHILE || parentType == FOR || parentType == DO) {
                    ((Loop) parent).setBody(block);
                } else {
                    logger.warn("Cannot handle node with parent that has no children, parent class: {}, parent source:\n{}",
                            parent.getClass(), parent.toSource());
                }
            }

            data.addExecutableLine(getActualLineNumber(node));
        }
View Full Code Here

Examples of net.sourceforge.htmlunit.corejs.javascript.ast.AstRoot.toSource()

        final String sourceUriAsString = data.getSourceUriAsString();
        final AstRoot root = parser.parse(data.getSourceCode(), sourceUriAsString, lineNumber);
        root.visit(new InstrumentingNodeVisitor(data, lineNumber - 1));

        final String treeSource = root.toSource();
        final StringBuilder buf = new StringBuilder(
                INITIALIZING_CODE.length() +
                data.getNumberOfStatements() * ARRAY_INITIALIZER.length() +
                treeSource.length());

View Full Code Here

Examples of org.apache.camel.converter.jaxp.XmlConverter.toSource()

                        // Get the parameter list
                        Node node = in.getBody(Node.class);
                        assertNotNull(node);
                        XmlConverter xmlConverter = new XmlConverter();
                        // Put the result back
                        exchange.getOut().setBody(xmlConverter.toSource(RESPONSE));
                    }
                });
            }
        };
    }
View Full Code Here

Examples of org.apache.camel.converter.jaxp.XmlConverter.toSource()

        Map<String, String> namespaces = new HashMap<String, String>();
        visitNodesForNameSpace(element, namespaces);
        W3CDOMStreamWriter writer = new W3CDOMStreamWriter();
        writeElement(element, writer, namespaces);
        XmlConverter converter = new XmlConverter();
        return converter.toString(converter.toSource(writer.getDocument()), null);
    }
   
    private static void writeElement(Element e,
                                    XMLStreamWriter writer,                                   
                                    Map<String, String> namespaces)
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.