@Override public Scriptable construct(Context cx, Scriptable scope, Object[] args) { throw Context.reportRuntimeError0("msg.script.is.not.constructor"); }
@Override public void put(int index, Scriptable start, Object value) { throw Context.reportRuntimeError0("msg.pkg.int"); }
public static RegExpProxy checkRegExpProxy(Context cx) { RegExpProxy result = getRegExpProxy(cx); if (result == null) { throw Context.reportRuntimeError0("msg.no.regexp"); } return result; }
throw Context.reportRuntimeError0("msg.bad.uri"); int B = unHex(str.charAt(k + 1), str.charAt(k + 2)); if (B < 0) throw Context.reportRuntimeError0("msg.bad.uri"); k += 3; if ((B & 0x80) == 0) { throw Context.reportRuntimeError0("msg.bad.uri"); } else if ((B & 0x20) == 0) { utf8Tail = 1; ucs4Char = B & 0x1F; throw Context.reportRuntimeError0("msg.bad.uri"); throw Context.reportRuntimeError0("msg.bad.uri"); for (int j = 0; j != utf8Tail; j++) { if (str.charAt(k) != '%') throw Context.reportRuntimeError0("msg.bad.uri"); B = unHex(str.charAt(k + 1), str.charAt(k + 2)); if (B < 0 || (B & 0xC0) != 0x80) throw Context.reportRuntimeError0("msg.bad.uri"); ucs4Char = (ucs4Char << 6) | (B & 0x3F); k += 3; ucs4Char -= 0x10000; if (ucs4Char > 0xFFFFF) throw Context.reportRuntimeError0("msg.bad.uri"); char H = (char)((ucs4Char >>> 10) + 0xD800); C = (char)((ucs4Char & 0x3FF) + 0xDC00);
private Scriptable js_getClass(Context cx, Scriptable scope, Object[] args) { if (args.length > 0 && args[0] instanceof Wrapper) { Scriptable result = this; Class<?> cl = ((Wrapper) args[0]).unwrap().getClass(); // Evaluate the class name by getting successive properties of // the string to find the appropriate NativeJavaClass object String name = cl.getName(); int offset = 0; for (;;) { int index = name.indexOf('.', offset); String propName = index == -1 ? name.substring(offset) : name.substring(offset, index); Object prop = result.get(propName, result); if (!(prop instanceof Scriptable)) break; // fall through to error result = (Scriptable) prop; if (index == -1) return result; offset = index+1; } } throw Context.reportRuntimeError0("msg.not.java.obj"); }
throw Context.reportRuntimeError0("msg.bad.uri"); k++; if (k == length) { throw Context.reportRuntimeError0("msg.bad.uri"); throw Context.reportRuntimeError0("msg.bad.uri");
0 != (mask & ~(URL_XALPHAS | URL_XPALPHAS | URL_PATH))) throw Context.reportRuntimeError0("msg.bad.esc.mask");
public Scriptable construct(Context cx, Scriptable scope, Object[] args) { ClassLoader loader = null; if (args.length != 0) { Object arg = args[0]; if (arg instanceof Wrapper) { arg = ((Wrapper)arg).unwrap(); } if (arg instanceof ClassLoader) { loader = (ClassLoader)arg; } } if (loader == null) { Context.reportRuntimeError0("msg.not.classloader"); return null; } NativeJavaPackage pkg = new NativeJavaPackage(true, "", loader); ScriptRuntime.setObjectProtoAndParent(pkg, scope); return pkg; }
converterName = "doubleValue"; } else { throw Context.reportRuntimeError0("msg.default.value");
throw Context.reportRuntimeError0("msg.empty.array.reduce");
/** * See ECMA 15.4.1,2 */ private static Object jsConstructor(Context cx, Scriptable scope, Object[] args) { if (args.length == 0) return new NativeArray(0); // Only use 1 arg as first element for version 1.2; for // any other version (including 1.3) follow ECMA and use it as // a length. if (cx.getLanguageVersion() == Context.VERSION_1_2) { return new NativeArray(args); } else { Object arg0 = args[0]; if (args.length > 1 || !(arg0 instanceof Number)) { return new NativeArray(args); } else { long len = ScriptRuntime.toUint32(arg0); if (len != ((Number)arg0).doubleValue()) throw Context.reportRuntimeError0("msg.arraylength.bad"); return new NativeArray(len); } } }
long longVal = ScriptRuntime.toUint32(d); if (longVal != d) throw Context.reportRuntimeError0("msg.arraylength.bad");
throw Context.reportRuntimeError0( "JavaAdapter can not subclass methods with more then" +" 64 arguments.");
cx.hasFeature(Context.FEATURE_STRICT_EVAL)) throw Context.reportRuntimeError0("msg.eval.nonstring.strict");