Examples of disableThreads()


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

        options.setOutputCharset(OUTPUT_CHARSET);
        options.setWarningLevel(DiagnosticGroups.CHECK_VARIABLES, CheckLevel.WARNING);

        Compiler compiler = new Compiler();

        compiler.disableThreads();

        SourceFile input = SourceFile.fromInputStream(resource.toString(), resource.openStream());

        List<SourceFile> inputs = Collections.singletonList(input);
View Full Code Here

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

  }

  private Compiler createCompiler(List<SourceFile> inputs, List<SourceFile> externs) {
    CompilerOptions options = getCompilerOptions();
    Compiler compiler = new Compiler();
    compiler.disableThreads();
    compiler.compile(externs, inputs, options);
    return compiler;
  }

  @VisibleForTesting
View Full Code Here

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

    return getCompiler("", jsInput);
  }

  private Compiler getCompiler(String externs, String jsInput) {
    Compiler compiler = new Compiler();
    compiler.disableThreads();
    CompilerOptions options = RefactoringDriver.getCompilerOptions();
    compiler.compile(
        ImmutableList.of(SourceFile.fromCode("externs", externs)),
        ImmutableList.of(SourceFile.fromCode("test", jsInput)),
        options);
View Full Code Here

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

    jsModule.add(input);

    Compiler.setLoggingLevel(level.getLevel());
    Compiler compiler = new Compiler();
    compiler.setTimeout(30);
    compiler.disableThreads();
    return compiler.compileModules(
        CommandLineRunner.getDefaultExterns(),
        Arrays.asList(jsModule), getOptions());
  }
View Full Code Here

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

    Writer out = new OutputStreamWriter(baos, charset);
    CompilerOptions options = new CompilerOptions();
    CompilationLevel.SIMPLE_OPTIMIZATIONS.setOptionsForCompilationLevel(options);
    Compiler.setLoggingLevel(Level.OFF);
    Compiler compiler = new Compiler();
    compiler.disableThreads();
    Result result = compiler.compile(new JSSourceFile[] {},
      new JSSourceFile[] { JSSourceFile.fromInputStream("is", is) }, options);
    if (result.success) {
      Pattern pattern = Pattern.compile("^/\\*.*?\\*/\\s?", Pattern.DOTALL);
      Matcher matcher = pattern.matcher(new String(content, charset));
View Full Code Here

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

      List<SourceFile> externs) throws CompilerException {

    Compiler compiler = new Compiler(getErrorManager()); // We shouldn't reuse compilers

    // disable JS Closure Compiler internal thread
    compiler.disableThreads();

    SourceFile source = SourceFile.fromCode(content.getSource(), content.get());
    Result result = compiler.compile(externs, Lists.newArrayList(source), options);

    if (result.errors.length > 0) {
View Full Code Here

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

        options.setOutputCharset("utf-8");
        options.setWarningLevel(DiagnosticGroups.CHECK_VARIABLES, CheckLevel.WARNING);

        Compiler compiler = new Compiler();

        compiler.disableThreads();

        SourceFile input = SourceFile.fromInputStream(resource.toString(), resource.openStream());

        List<SourceFile> inputs = Collections.singletonList(input);
View Full Code Here

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

      List<SourceFile> externs) throws CompilerException {

    Compiler compiler = new Compiler(getErrorManager()); // We shouldn't reuse compilers

    // disable JS Closure Compiler internal thread
    compiler.disableThreads();

    SourceFile source = SourceFile.fromCode(content.getSource(), content.get());
    Result result = compiler.compile(externs, Lists.newArrayList(source), options);

    if (result.errors.length > 0) {
View Full Code Here

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

      List<SourceFile> externs) throws CompilerException {

    Compiler compiler = new Compiler(getErrorManager()); // We shouldn't reuse compilers

    // disable JS Closure Compiler internal thread
    compiler.disableThreads();

    SourceFile source = SourceFile.fromCode(content.getSource(), content.get());
    Result result = compiler.compile(externs, Lists.newArrayList(source), options);

    if (result.errors.length > 0) {
View Full Code Here

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

  private Compiler newCompiler(final CompilerOptions compilerOptions) {
    Compiler.setLoggingLevel(Level.SEVERE);
    final Compiler compiler = new Compiler();
    compilationLevel.setOptionsForCompilationLevel(compilerOptions);
    // make it play nice with GAE
    compiler.disableThreads();
    compiler.initOptions(compilerOptions);
    return compiler;
  }

  /**
 
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.