/** * Returns representation of the [[ThrowTypeError]] object. * See ECMA 5 spec, 13.2.3 * * @deprecated {@link #typeErrorThrower(Context)} */ @Deprecated public static BaseFunction typeErrorThrower() { return typeErrorThrower(Context.getCurrentContext()); }
/** * Returns representation of the [[ThrowTypeError]] object. * See ECMA 5 spec, 13.2.3 * * @deprecated {@link #typeErrorThrower(Context)} */ @Deprecated public static BaseFunction typeErrorThrower() { return typeErrorThrower(Context.getCurrentContext()); }
public BoundFunction(Context cx, Scriptable scope, Callable targetFunction, Scriptable boundThis, Object[] boundArgs) { this.targetFunction = targetFunction; this.boundThis = boundThis; this.boundArgs = boundArgs; if (targetFunction instanceof BaseFunction) { length = Math.max(0, ((BaseFunction) targetFunction).getLength() - boundArgs.length); } else { length = 0; } ScriptRuntime.setFunctionProtoAndParent(this, scope); Function thrower = ScriptRuntime.typeErrorThrower(cx); NativeObject throwing = new NativeObject(); throwing.put("get", throwing, thrower); throwing.put("set", throwing, thrower); throwing.put("enumerable", throwing, false); throwing.put("configurable", throwing, false); throwing.preventExtensions(); this.defineOwnProperty(cx, "caller", throwing, false); this.defineOwnProperty(cx, "arguments", throwing, false); }
public BoundFunction(Context cx, Scriptable scope, Callable targetFunction, Scriptable boundThis, Object[] boundArgs) { this.targetFunction = targetFunction; this.boundThis = boundThis; this.boundArgs = boundArgs; if (targetFunction instanceof BaseFunction) { length = Math.max(0, ((BaseFunction) targetFunction).getLength() - boundArgs.length); } else { length = 0; } ScriptRuntime.setFunctionProtoAndParent(this, scope); Function thrower = ScriptRuntime.typeErrorThrower(); NativeObject throwing = new NativeObject(); throwing.put("get", throwing, thrower); throwing.put("set", throwing, thrower); throwing.put("enumerable", throwing, false); throwing.put("configurable", throwing, false); throwing.preventExtensions(); this.defineOwnProperty(cx, "caller", throwing, false); this.defineOwnProperty(cx, "arguments", throwing, false); }
public BoundFunction(Context cx, Scriptable scope, Callable targetFunction, Scriptable boundThis, Object[] boundArgs) { this.targetFunction = targetFunction; this.boundThis = boundThis; this.boundArgs = boundArgs; if (targetFunction instanceof BaseFunction) { length = Math.max(0, ((BaseFunction) targetFunction).getLength() - boundArgs.length); } else { length = 0; } ScriptRuntime.setFunctionProtoAndParent(this, scope); Function thrower = ScriptRuntime.typeErrorThrower(cx); NativeObject throwing = new NativeObject(); throwing.put("get", throwing, thrower); throwing.put("set", throwing, thrower); throwing.put("enumerable", throwing, false); throwing.put("configurable", throwing, false); throwing.preventExtensions(); this.defineOwnProperty(cx, "caller", throwing, false); this.defineOwnProperty(cx, "arguments", throwing, false); }
public BoundFunction(Context cx, Scriptable scope, Callable targetFunction, Scriptable boundThis, Object[] boundArgs) { this.targetFunction = targetFunction; this.boundThis = boundThis; this.boundArgs = boundArgs; if (targetFunction instanceof BaseFunction) { length = Math.max(0, ((BaseFunction) targetFunction).getLength() - boundArgs.length); } else { length = 0; } ScriptRuntime.setFunctionProtoAndParent(this, scope); Function thrower = ScriptRuntime.typeErrorThrower(); NativeObject throwing = new NativeObject(); throwing.put("get", throwing, thrower); throwing.put("set", throwing, thrower); throwing.put("enumerable", throwing, false); throwing.put("configurable", throwing, false); throwing.preventExtensions(); this.defineOwnProperty(cx, "caller", throwing, false); this.defineOwnProperty(cx, "arguments", throwing, false); }