com.google.javascript.jscomp.Compiler.getPassConfig()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 JavaScript  
字(6.9k)|赞(0)|评价(0)|浏览(144)

本文整理了Java中com.google.javascript.jscomp.Compiler.getPassConfig()方法的一些代码示例,展示了Compiler.getPassConfig()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Compiler.getPassConfig()方法的具体详情如下:
包路径:com.google.javascript.jscomp.Compiler
类名称:Compiler
方法名:getPassConfig

Compiler.getPassConfig介绍

暂无

代码示例

代码示例来源:origin: com.google.javascript/closure-compiler

@SuppressWarnings("unchecked")
DefaultPassConfig ensureDefaultPassConfig() {
 PassConfig passes = getPassConfig().getBasePassConfig();
 checkState(
   passes instanceof DefaultPassConfig,
   "PassConfigs must eventually delegate to the DefaultPassConfig");
 return (DefaultPassConfig) passes;
}

代码示例来源:origin: com.google.javascript/closure-compiler

@Override
// Only used by jsdev
public TypedScopeCreator getTypedScopeCreator() {
 return getPassConfig().getTypedScopeCreator();
}

代码示例来源:origin: com.google.javascript/closure-compiler

@Override
public TypedScope getTopScope() {
 return getPassConfig().getTopScope();
}

代码示例来源:origin: org.scala-js/closure-compiler-java-6

@Override
// Only used by jsdev
public MemoizedScopeCreator getTypedScopeCreator() {
 return getPassConfig().getTypedScopeCreator();
}

代码示例来源:origin: org.scala-js/closure-compiler-java-6

@SuppressWarnings("unchecked")
DefaultPassConfig ensureDefaultPassConfig() {
 PassConfig passes = getPassConfig().getBasePassConfig();
 Preconditions.checkState(passes instanceof DefaultPassConfig,
   "PassConfigs must eventually delegate to the DefaultPassConfig");
 return (DefaultPassConfig) passes;
}

代码示例来源:origin: org.scala-js/closure-compiler-java-6

@Override
public TypedScope getTopScope() {
 return getPassConfig().getTopScope();
}

代码示例来源:origin: org.scala-js/closure-compiler-java-6

VariableMap getVariableMap() {
 return getPassConfig().getIntermediateState().variableMap;
}

代码示例来源:origin: org.scala-js/closure-compiler-java-6

VariableMap getPropertyMap() {
 return getPassConfig().getIntermediateState().propertyMap;
}

代码示例来源:origin: com.google.javascript/closure-compiler

void performOptimizations() {
 checkState(options.shouldOptimize());
 List<PassFactory> optimizations = getPassConfig().getOptimizations();
 if (optimizations.isEmpty()) {
  return;
 }
 phaseOptimizer = createPhaseOptimizer();
 phaseOptimizer.consume(optimizations);
 phaseOptimizer.process(externsRoot, jsRoot);
 phaseOptimizer = null;
}

代码示例来源:origin: org.scala-js/closure-compiler-java-6

/**
 * Returns the result of the compilation.
 */
public Result getResult() {
 PassConfig.State state = getPassConfig().getIntermediateState();
 return new Result(getErrors(), getWarnings(), debugLog.toString(),
   state.variableMap, state.propertyMap,
   state.anonymousFunctionNameMap, state.stringMap, functionInformationMap,
   sourceMap, externExports, state.cssNames, state.idGeneratorMap);
}

代码示例来源:origin: org.scala-js/closure-compiler-java-6

void recordFunctionInformation() {
 logger.fine("Recording function information");
 startPass("recordFunctionInformation");
 RecordFunctionInformation recordFunctionInfoPass =
   new RecordFunctionInformation(
     this, getPassConfig().getIntermediateState().functionNames);
 process(recordFunctionInfoPass);
 functionInformationMap = recordFunctionInfoPass.getMap();
 endPass();
}

代码示例来源:origin: org.scala-js/closure-compiler-java-6

public void whitespaceOnlyPasses() {
 Tracer t = newTracer("runWhitespaceOnlyPasses");
 try {
  for (PassFactory pf : getPassConfig().getWhitespaceOnlyPasses()) {
   pf.create(this).process(externsRoot, jsRoot);
  }
 } finally {
  stopTracer(t, "runWhitespaceOnlyPasses");
 }
}

代码示例来源:origin: com.google.javascript/closure-compiler

public void whitespaceOnlyPasses() {
 runCustomPasses(CustomPassExecutionTime.BEFORE_CHECKS);
 Tracer t = newTracer("runWhitespaceOnlyPasses");
 try {
  for (PassFactory pf : getPassConfig().getWhitespaceOnlyPasses()) {
   pf.create(this).process(externsRoot, jsRoot);
  }
 } finally {
  stopTracer(t, "runWhitespaceOnlyPasses");
 }
}

代码示例来源:origin: com.google.javascript/closure-compiler

public void transpileAndDontCheck() {
 Tracer t = newTracer("runTranspileOnlyPasses");
 try {
  for (PassFactory pf : getPassConfig().getTranspileOnlyPasses()) {
   if (hasErrors()) {
    return;
   }
   pf.create(this).process(externsRoot, jsRoot);
  }
 } finally {
  stopTracer(t, "runTranspileOnlyPasses");
 }
}

代码示例来源:origin: org.scala-js/closure-compiler-java-6

public void check() {
 runCustomPasses(CustomPassExecutionTime.BEFORE_CHECKS);
 // We are currently only interested in check-passes for progress reporting
 // as it is used for IDEs, that's why the maximum progress is set to 1.0.
 phaseOptimizer = new PhaseOptimizer(this, tracker,
   new PhaseOptimizer.ProgressRange(getProgress(), 1.0));
 if (options.devMode == DevMode.EVERY_PASS) {
  phaseOptimizer.setSanityCheck(sanityCheck);
 }
 if (options.getCheckDeterminism()) {
  phaseOptimizer.setPrintAstHashcodes(true);
 }
 phaseOptimizer.consume(getPassConfig().getChecks());
 phaseOptimizer.process(externsRoot, jsRoot);
 if (hasErrors()) {
  return;
 }
 if (options.getTweakProcessing().shouldStrip() ||
   !options.stripTypes.isEmpty() ||
   !options.stripNameSuffixes.isEmpty() ||
   !options.stripTypePrefixes.isEmpty() ||
   !options.stripNamePrefixes.isEmpty()) {
  stripCode(options.stripTypes, options.stripNameSuffixes,
    options.stripTypePrefixes, options.stripNamePrefixes);
 }
 runCustomPasses(CustomPassExecutionTime.BEFORE_OPTIMIZATIONS);
 phaseOptimizer = null;
}

代码示例来源:origin: org.scala-js/closure-compiler-java-6

public void optimize() {
 List<PassFactory> optimizations = getPassConfig().getOptimizations();
 if (optimizations.isEmpty()) {
  return;
 }
 // Ideally, this pass should be the first pass run, however:
 // 1) VariableReferenceCheck reports unexpected warnings if Normalize
 // is done first.
 // 2) ReplaceMessages, stripCode, and potentially custom passes rely on
 // unmodified local names.
 normalize();
 // Create extern exports after the normalize because externExports depends on unique names.
 if (options.isExternExportsEnabled()
   || options.externExportsPath != null) {
  externExports();
 }
 phaseOptimizer = new PhaseOptimizer(this, tracker, null);
 if (options.devMode == DevMode.EVERY_PASS) {
  phaseOptimizer.setSanityCheck(sanityCheck);
 }
 if (options.getCheckDeterminism()) {
  phaseOptimizer.setPrintAstHashcodes(true);
 }
 phaseOptimizer.consume(optimizations);
 phaseOptimizer.process(externsRoot, jsRoot);
 phaseOptimizer = null;
}

代码示例来源:origin: com.google.javascript/closure-compiler

void check() {
 runCustomPasses(CustomPassExecutionTime.BEFORE_CHECKS);
 // We are currently only interested in check-passes for progress reporting
 // as it is used for IDEs, that's why the maximum progress is set to 1.0.
 phaseOptimizer = createPhaseOptimizer().withProgress(
   new PhaseOptimizer.ProgressRange(getProgress(), 1.0));
 phaseOptimizer.consume(getPassConfig().getChecks());
 phaseOptimizer.process(externsRoot, jsRoot);
 if (hasErrors()) {
  return;
 }
 runCustomPasses(CustomPassExecutionTime.BEFORE_OPTIMIZATIONS);
 phaseOptimizer = null;
}

代码示例来源:origin: org.scala-js/closure-compiler-java-6

Appendable jsOutput = createDefaultOutput();
jsOutput.append(
  DotFormatter.toDot(compiler.getPassConfig().getPassGraph()));
jsOutput.append('\n');
closeAppendable(jsOutput);

代码示例来源:origin: com.google.javascript/closure-compiler

Appendable jsOutput = createDefaultOutput();
jsOutput.append(
  DotFormatter.toDot(compiler.getPassConfig().getPassGraph()));
jsOutput.append('\n');
closeAppendable(jsOutput);

相关文章

Compiler类方法