private void rangeCheck(int offset, int len) { if ((offset < 0) || ((offset + len) > byteLength)) { throw ScriptRuntime.constructError("RangeError", "offset out of range"); } }
private static void addCharacterToCharSet(RECharSet cs, char c) { int byteIndex = (c / 8); if (c >= cs.length) { throw ScriptRuntime.constructError("SyntaxError", "invalid range in character class"); } cs.bits[byteIndex] |= 1 << (c & 0x7); }
private static void addCharacterToCharSet(RECharSet cs, char c) { int byteIndex = (c / 8); if (c >= cs.length) { throw ScriptRuntime.constructError("SyntaxError", "invalid range in character class"); } cs.bits[byteIndex] |= 1 << (c & 0x7); }
private void checkValue(Object[] args, int pos) { if (args.length <= pos) { throw ScriptRuntime.constructError("TypeError", "missing required value parameter"); } if (Undefined.instance.equals(args[pos])) { throw ScriptRuntime.constructError("RangeError", "invalid value parameter"); } }
private void checkOffset(Object[] args, int pos) { if (args.length <= pos) { throw ScriptRuntime.constructError("TypeError", "missing required offset parameter"); } if (Undefined.instance.equals(args[pos])) { throw ScriptRuntime.constructError("RangeError", "invalid offset"); } }
public static EcmaError constructError(String error, String message) { int[] linep = new int[1]; String filename = Context.getSourcePositionFromStack(linep); return constructError(error, message, filename, linep[0], null, 0); }
private NativeDataView js_constructor(NativeArrayBuffer ab, int offset, int length) { if (length < 0) { throw ScriptRuntime.constructError("RangeError", "length out of range"); } if ((offset < 0) || ((offset + length) > ab.getLength())) { throw ScriptRuntime.constructError("RangeError", "offset out of range"); } return new NativeDataView(ab, offset, length); }
private static void reportError(String messageId, String arg) { String msg = ScriptRuntime.getMessage1(messageId, arg); throw ScriptRuntime.constructError("SyntaxError", msg); }
public static RuntimeException notFoundError(Scriptable object, String property) { // XXX: use object to improve the error message String msg = getMessage1("msg.is.not.defined", property); throw constructError("ReferenceError", msg); }
private String toISOString() { if (date == date) { synchronized (isoFormat) { return isoFormat.format(new Date((long) date)); } } String msg = ScriptRuntime.getMessage0("msg.invalid.date"); throw ScriptRuntime.constructError("RangeError", msg); }
private String toISOString() { if (date == date) { synchronized (isoFormat) { return isoFormat.format(new Date((long) date)); } } String msg = ScriptRuntime.getMessage0("msg.invalid.date"); throw ScriptRuntime.constructError("RangeError", msg); }
public static EcmaError constructError(String error, String message) { int[] linep = new int[1]; String filename = Context.getSourcePositionFromStack(linep); return constructError(error, message, filename, linep[0], null, 0); }
public static EcmaError constructError(String error, String message, int lineNumberDelta) { int[] linep = new int[1]; String filename = Context.getSourcePositionFromStack(linep); if (linep[0] != 0) { linep[0] += lineNumberDelta; } return constructError(error, message, filename, linep[0], null, 0); }
private static void reportError(String messageId, String arg) { String msg = ScriptRuntime.getMessage1(messageId, arg); throw ScriptRuntime.constructError("SyntaxError", msg); }
public static EcmaError constructError(String error, String message, int lineNumberDelta) { int[] linep = new int[1]; String filename = Context.getSourcePositionFromStack(linep); if (linep[0] != 0) { linep[0] += lineNumberDelta; } return constructError(error, message, filename, linep[0], null, 0); }
public static EcmaError constructError(String error, String message, int lineNumberDelta) { int[] linep = new int[1]; String filename = Context.getSourcePositionFromStack(linep); if (linep[0] != 0) { linep[0] += lineNumberDelta; } return constructError(error, message, filename, linep[0], null, 0); }
public static RuntimeException notFoundError(Scriptable object, String property) { // XXX: use object to improve the error message String msg = getMessage1("msg.is.not.defined", property); throw constructError("ReferenceError", msg); }
public static EcmaError constructError(String error, String message) { int[] linep = new int[1]; String filename = Context.getSourcePositionFromStack(linep); return constructError(error, message, filename, linep[0], null, 0); }
private static void reportError(String messageId, String arg) { String msg = ScriptRuntime.getMessage1(messageId, arg); throw ScriptRuntime.constructError("SyntaxError", msg); }
private static Object parse(Context cx, Scriptable scope, String jtext) { try { return new JsonParser(cx, scope).parseValue(jtext); } catch (JsonParser.ParseException ex) { throw ScriptRuntime.constructError("SyntaxError", ex.getMessage()); } }