当前位置: 首页>>代码示例>>Java>>正文


Java CompilerOptions.setPropertyRenaming方法代码示例

本文整理汇总了Java中com.google.javascript.jscomp.CompilerOptions.setPropertyRenaming方法的典型用法代码示例。如果您正苦于以下问题:Java CompilerOptions.setPropertyRenaming方法的具体用法?Java CompilerOptions.setPropertyRenaming怎么用?Java CompilerOptions.setPropertyRenaming使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.javascript.jscomp.CompilerOptions的用法示例。


在下文中一共展示了CompilerOptions.setPropertyRenaming方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setOptions

import com.google.javascript.jscomp.CompilerOptions; //导入方法依赖的package包/类
protected void setOptions(CompilerOptions options) {
  options.setLanguageIn(LanguageMode.ECMASCRIPT_NEXT);
  // TODO(sdh): It would be nice to allow people to output code in
  // strict mode.  But currently we swallow all the input language
  // strictness checks, and there are various tests that are never
  // compiled and so are broken when we output 'use strict'.  We
  // could consider adding some sort of logging/warning/error in
  // cases where the input was not strict, though there could still
  // be semantic differences even if syntax is strict.  Possibly
  // the first step would be to allow the option of outputting strict
  // and then change the default and see what breaks.  b/33005948
  options.setLanguageOut(LanguageMode.ECMASCRIPT5);
  options.setQuoteKeywordProperties(true);
  options.setSkipNonTranspilationPasses(true);
  options.setVariableRenaming(VariableRenamingPolicy.OFF);
  options.setPropertyRenaming(PropertyRenamingPolicy.OFF);
  options.setWrapGoogModulesForWhitespaceOnly(false);
  options.setPrettyPrint(true);
  options.setSourceMapOutputPath("/dev/null");
  options.setSourceMapIncludeSourcesContent(true);
  options.setWarningLevel(ES5_WARNINGS, CheckLevel.OFF);
}
 
开发者ID:google,项目名称:closure-compiler,代码行数:23,代码来源:BaseTranspiler.java

示例2: setOptions

import com.google.javascript.jscomp.CompilerOptions; //导入方法依赖的package包/类
protected void setOptions(CompilerOptions options) {
  options.setLanguageIn(LanguageMode.ECMASCRIPT_2017);
    // TODO(sdh): It would be nice to allow people to output code in
    // strict mode.  But currently we swallow all the input language
    // strictness checks, and there are various tests that are never
    // compiled and so are broken when we output 'use strict'.  We
    // could consider adding some sort of logging/warning/error in
    // cases where the input was not strict, though there could still
    // be semantic differences even if syntax is strict.  Possibly
    // the first step would be to allow the option of outputting strict
    // and then change the default and see what breaks.  b/33005948
    options.setLanguageOut(LanguageMode.ECMASCRIPT5);
    options.setQuoteKeywordProperties(true);
    options.setSkipNonTranspilationPasses(true);
    options.setVariableRenaming(VariableRenamingPolicy.OFF);
    options.setPropertyRenaming(PropertyRenamingPolicy.OFF);
    options.setWrapGoogModulesForWhitespaceOnly(false);
    options.setPrettyPrint(true);
    options.setSourceMapOutputPath("/dev/null");
    options.setSourceMapIncludeSourcesContent(true);
    options.setWarningLevel(ES5_WARNINGS, CheckLevel.OFF);
}
 
开发者ID:google,项目名称:closure-compiler,代码行数:23,代码来源:CompilerBasedTransformer.java


注:本文中的com.google.javascript.jscomp.CompilerOptions.setPropertyRenaming方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。