int argc, JSValueConst *argv)
{
JSBoundFunction *bf;
- JSValue func_obj, name1, len_val;
+ JSValue func_obj, name1, len_val, proto;
JSObject *p;
int arg_count, i, ret;
if (check_function(ctx, this_val))
return JS_EXCEPTION;
- func_obj = JS_NewObjectProtoClass(ctx, ctx->function_proto,
+ proto = JS_GetPrototype(ctx, this_val);
+ if (JS_IsException(proto))
+ return JS_EXCEPTION;
+ func_obj = JS_NewObjectProtoClass(ctx, proto,
JS_CLASS_BOUND_FUNCTION);
+ JS_FreeValue(ctx, proto);
if (JS_IsException(func_obj))
return JS_EXCEPTION;
p = JS_VALUE_GET_OBJ(func_obj);
test262/test/staging/sm/Function/function-bind.js:24: Test262Error: Conforms to NativeFunction Syntax: "function bound unbound() {\n [native code]\n}"
test262/test/staging/sm/Function/implicit-this-in-parameter-expression.js:12: Test262Error: Expected SameValue(«[object Object]», «undefined») to be true
test262/test/staging/sm/Function/invalid-parameter-list.js:13: Test262Error: Expected a SyntaxError to be thrown but no exception was thrown at all
-test262/test/staging/sm/class/boundFunctionSubclassing.js:9: Test262Error: Expected SameValue(«false», «true») to be true
test262/test/staging/sm/class/strictExecution.js:13: Test262Error: Expected a TypeError to be thrown but no exception was thrown at all
test262/test/staging/sm/class/superPropOrdering.js:17: Test262Error: Expected a TypeError to be thrown but no exception was thrown at all
test262/test/staging/sm/lexical-environment/block-scoped-functions-annex-b-arguments.js:13: Test262Error: Expected SameValue(«"object"», «"function"») to be true