public int getLength() { return delegate.getLength(); }
@Override protected Object getInstanceIdValue(int id) { switch (id) { case Id_length: return ScriptRuntime.wrapInt(getLength()); case Id_arity: return ScriptRuntime.wrapInt(getArity()); case Id_name: return getFunctionName(); case Id_prototype: return getPrototypeProperty(); case Id_arguments: return getArguments(); } return super.getInstanceIdValue(id); }
@Override protected Object getInstanceIdValue(int id) { switch (id) { case Id_length: return ScriptRuntime.wrapInt(getLength()); case Id_arity: return ScriptRuntime.wrapInt(getArity()); case Id_name: return getFunctionName(); case Id_prototype: return getPrototypeProperty(); case Id_arguments: return getArguments(); } return super.getInstanceIdValue(id); }
@Override protected Object getInstanceIdValue(int id) { switch (id) { case Id_length: return ScriptRuntime.wrapInt(getLength()); case Id_arity: return ScriptRuntime.wrapInt(getArity()); case Id_name: return getFunctionName(); case Id_prototype: return getPrototypeProperty(); case Id_arguments: return getArguments(); } return super.getInstanceIdValue(id); }
@Override protected Object getInstanceIdValue(int id) { switch (id) { case Id_length: return ScriptRuntime.wrapInt(getLength()); case Id_arity: return ScriptRuntime.wrapInt(getArity()); case Id_name: return getFunctionName(); case Id_prototype: return getPrototypeProperty(); case Id_arguments: return getArguments(); } return super.getInstanceIdValue(id); }
@Override protected Object getInstanceIdValue(int id) { switch (id) { case Id_length: return ScriptRuntime.wrapInt(getLength()); case Id_arity: return ScriptRuntime.wrapInt(getArity()); case Id_name: return getFunctionName(); case Id_prototype: return getPrototypeProperty(); case Id_arguments: return getArguments(); } return super.getInstanceIdValue(id); }
protected Object getInstanceIdValue(int id) { switch (id) { case Id_length: return ScriptRuntime.wrapInt(getLength()); case Id_arity: return ScriptRuntime.wrapInt(getArity()); case Id_name: return getFunctionName(); case Id_prototype: return getPrototypeProperty(); case Id_arguments: return getArguments(); } return super.getInstanceIdValue(id); }
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(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); }