Java Code Examples for org.mozilla.javascript.ScriptRuntime#getMessage1()

The following examples show how to use org.mozilla.javascript.ScriptRuntime#getMessage1() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NativeRegExp.java    From JsDroidCmd with Mozilla Public License 2.0 5 votes vote down vote up
private static void reportWarning(Context cx, String messageId, String arg)
{
    if (cx.hasFeature(Context.FEATURE_STRICT_MODE)) {
        String msg = ScriptRuntime.getMessage1(messageId, arg);
        Context.reportWarning(msg);
    }
}
 
Example 2
Source File: NativeRegExp.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
private static void reportWarning(Context cx, String messageId, String arg)
{
    if (cx.hasFeature(Context.FEATURE_STRICT_MODE)) {
        String msg = ScriptRuntime.getMessage1(messageId, arg);
        Context.reportWarning(msg);
    }
}
 
Example 3
Source File: NativeRegExp.java    From JsDroidCmd with Mozilla Public License 2.0 4 votes vote down vote up
private static void reportError(String messageId, String arg)
{
    String msg = ScriptRuntime.getMessage1(messageId, arg);
    throw ScriptRuntime.constructError("SyntaxError", msg);
}
 
Example 4
Source File: NativeRegExp.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
private static void reportError(String messageId, String arg)
{
    String msg = ScriptRuntime.getMessage1(messageId, arg);
    throw ScriptRuntime.constructError("SyntaxError", msg);
}