本文整理汇总了Java中com.google.javascript.rhino.ScriptRuntime类的典型用法代码示例。如果您正苦于以下问题:Java ScriptRuntime类的具体用法?Java ScriptRuntime怎么用?Java ScriptRuntime使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ScriptRuntime类属于com.google.javascript.rhino包,在下文中一共展示了ScriptRuntime类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: RhinoErrorReporter
import com.google.javascript.rhino.ScriptRuntime; //导入依赖的package包/类
private RhinoErrorReporter(AbstractCompiler compiler) {
this.compiler = compiler;
typeMap = ImmutableMap.of(
// Extra @fileoverview
replacePlaceHolders(
ScriptRuntime.getMessage0("msg.jsdoc.fileoverview.extra")),
EXTRA_FILEOVERVIEW,
// Trailing comma
replacePlaceHolders(
com.google.javascript.jscomp.mozilla.rhino.ScriptRuntime
.getMessage0("msg.extra.trailing.comma")),
TRAILING_COMMA,
// Duplicate parameter
replacePlaceHolders(
com.google.javascript.jscomp.mozilla.rhino.ScriptRuntime
.getMessage0("msg.dup.parms")),
DUPLICATE_PARAM,
// Unknown @annotations.
replacePlaceHolders(ScriptRuntime.getMessage0("msg.bad.jsdoc.tag")),
BAD_JSDOC_ANNOTATION);
}
示例2: RhinoErrorReporter
import com.google.javascript.rhino.ScriptRuntime; //导入依赖的package包/类
private RhinoErrorReporter(AbstractCompiler compiler) {
this.compiler = compiler;
typeMap = ImmutableMap.of(
// Trailing comma
replacePlaceHolders(
com.google.javascript.rhino.head.ScriptRuntime
.getMessage0("msg.extra.trailing.comma")),
TRAILING_COMMA,
// Duplicate parameter
replacePlaceHolders(
com.google.javascript.rhino.head.ScriptRuntime
.getMessage0("msg.dup.parms")),
DUPLICATE_PARAM,
// Unknown @annotations.
replacePlaceHolders(ScriptRuntime.getMessage0("msg.bad.jsdoc.tag")),
BAD_JSDOC_ANNOTATION,
Pattern.compile("^Type annotations are not allowed here.*"),
MISPLACED_TYPE_ANNOTATION,
// Type annotation errors.
Pattern.compile("^Bad type annotation.*"),
TYPE_PARSE_ERROR
);
}
示例3: addTypeWarning
import com.google.javascript.rhino.ScriptRuntime; //导入依赖的package包/类
void addTypeWarning(String messageId, String messageArg, int lineno,
int charno) {
errorReporter.warning(
"Bad type annotation. " +
ScriptRuntime.getMessage1(messageId, messageArg),
getSourceName(), lineno, null, charno);
}
示例4: addWarning
import com.google.javascript.rhino.ScriptRuntime; //导入依赖的package包/类
void addWarning(String messageId, String messageArg, int lineno,
int charno) {
errorReporter.warning(ScriptRuntime.getMessage1(messageId, messageArg),
sourceName, lineno, null, charno);
}
示例5: addParserWarning
import com.google.javascript.rhino.ScriptRuntime; //导入依赖的package包/类
void addParserWarning(String messageId, String messageArg, int lineno,
int charno) {
errorReporter.warning(ScriptRuntime.getMessage1(messageId, messageArg),
getSourceName(), lineno, null, charno);
}