本文整理汇总了Java中com.google.javascript.jscomp.CompilerOptions.setVariableRenaming方法的典型用法代码示例。如果您正苦于以下问题:Java CompilerOptions.setVariableRenaming方法的具体用法?Java CompilerOptions.setVariableRenaming怎么用?Java CompilerOptions.setVariableRenaming使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.javascript.jscomp.CompilerOptions
的用法示例。
在下文中一共展示了CompilerOptions.setVariableRenaming方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: setOptions
import com.google.javascript.jscomp.CompilerOptions; //导入方法依赖的package包/类
@Override
protected void setOptions(CompilerOptions options) {
options.coalesceVariableNames = false;
options.setLanguageOut(CompilerOptions.LanguageMode.ECMASCRIPT5);
// The next two options together sum to the deprecated ECMASCRIPT6, and
// mimic historical behavior of this class.
options.setLanguageIn(CompilerOptions.LanguageMode.ECMASCRIPT_2015);
options.setStrictModeInput(false);
options.setShadowVariables(false);
// Setting the path to any non-null value will trigger source map generation.
// CompilerBasedTransformer attachs the sourcemap to the result.
options.setSourceMapOutputPath("/dev/null");
options.setVariableRenaming(VariableRenamingPolicy.OFF);
options.instrumentForCoverage = true;
options.setInstrumentForCoverageOnly(true);
}
示例3: 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);
}