本文整理汇总了Java中com.google.javascript.jscomp.CompilerOptions.LanguageMode.ECMASCRIPT5_STRICT属性的典型用法代码示例。如果您正苦于以下问题:Java LanguageMode.ECMASCRIPT5_STRICT属性的具体用法?Java LanguageMode.ECMASCRIPT5_STRICT怎么用?Java LanguageMode.ECMASCRIPT5_STRICT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.google.javascript.jscomp.CompilerOptions.LanguageMode
的用法示例。
在下文中一共展示了LanguageMode.ECMASCRIPT5_STRICT属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
@Override
protected CompilerPass create(AbstractCompiler compiler) {
boolean enableBlockInlining = !isInliningForbidden();
return new InlineFunctions(
compiler,
compiler.getUniqueNameIdSupplier(),
options.inlineFunctions,
options.inlineLocalFunctions,
enableBlockInlining,
options.assumeStrictThis()
|| options.getLanguageIn() == LanguageMode.ECMASCRIPT5_STRICT,
true /* assumeMinimumCapture */);
}
示例2: initOptions
/**
* Initialize the compiler options. Only necessary if you're not doing
* a normal compile() job.
*/
public void initOptions(CompilerOptions options) {
this.options = options;
if (errorManager == null) {
if (outStream == null) {
setErrorManager(
new LoggerErrorManager(createMessageFormatter(), logger));
} else {
PrintStreamErrorManager printer =
new PrintStreamErrorManager(createMessageFormatter(), outStream);
printer.setSummaryDetailLevel(options.summaryDetailLevel);
setErrorManager(printer);
}
}
// DiagnosticGroups override the plain checkTypes option.
if (options.enables(DiagnosticGroups.CHECK_TYPES)) {
options.checkTypes = true;
} else if (options.disables(DiagnosticGroups.CHECK_TYPES)) {
options.checkTypes = false;
} else if (!options.checkTypes) {
// If DiagnosticGroups did not override the plain checkTypes
// option, and checkTypes is enabled, then turn off the
// parser type warnings.
options.setWarningLevel(
DiagnosticGroup.forType(
RhinoErrorReporter.TYPE_PARSE_ERROR),
CheckLevel.OFF);
}
if (options.checkGlobalThisLevel.isOn() &&
!options.disables(DiagnosticGroups.GLOBAL_THIS)) {
options.setWarningLevel(
DiagnosticGroups.GLOBAL_THIS,
options.checkGlobalThisLevel);
}
if (options.getLanguageIn() == LanguageMode.ECMASCRIPT5_STRICT) {
options.setWarningLevel(
DiagnosticGroups.ES5_STRICT,
CheckLevel.ERROR);
}
// Initialize the warnings guard.
List<WarningsGuard> guards = Lists.newArrayList();
guards.add(
new SuppressDocWarningsGuard(
getDiagnosticGroups().getRegisteredGroups()));
guards.add(options.getWarningsGuard());
ComposeWarningsGuard composedGuards = new ComposeWarningsGuard(guards);
// All passes must run the variable check. This synthesizes
// variables later so that the compiler doesn't crash. It also
// checks the externs file for validity. If you don't want to warn
// about missing variable declarations, we shut that specific
// error off.
if (!options.checkSymbols &&
!composedGuards.enables(DiagnosticGroups.CHECK_VARIABLES)) {
composedGuards.addGuard(new DiagnosticGroupWarningsGuard(
DiagnosticGroups.CHECK_VARIABLES, CheckLevel.OFF));
}
this.warningsGuard = composedGuards;
}