diff --git a/quickjs.c b/quickjs.c index 8dbc83e82..b626be07e 100644 --- a/quickjs.c +++ b/quickjs.c @@ -7495,6 +7495,11 @@ static JSValue js_bytecode_autoinit(JSContext *ctx, JSObject *p, JSAtom atom, for (size_t i = 0; i < countof(args); i++) JS_FreeValue(ctx, args[i]); JS_FreeValue(ctx, fun); + if (JS_SetPrototypeInternal(ctx, result, ctx->function_proto, + /*throw_flag*/true) < 0) { + JS_FreeValue(ctx, result); + return JS_EXCEPTION; + } return result; } } diff --git a/test262_errors.txt b/test262_errors.txt index 98a30b229..bccaf233a 100644 --- a/test262_errors.txt +++ b/test262_errors.txt @@ -1,9 +1,3 @@ -test262/test/built-ins/Array/fromAsync/builtin.js:24: Test262Error: Prototype of Array.fromAsync is Function.prototype Expected SameValue(«[object AsyncFunction]», «function () { - [native code] -}») to be true -test262/test/built-ins/Array/fromAsync/builtin.js:24: strict mode: Test262Error: Prototype of Array.fromAsync is Function.prototype Expected SameValue(«[object AsyncFunction]», «function () { - [native code] -}») to be true test262/test/built-ins/AsyncFromSyncIteratorPrototype/next/iterator-result-poisoned-wrapper.js:64: TypeError: $DONE() not called test262/test/built-ins/AsyncFromSyncIteratorPrototype/next/iterator-result-poisoned-wrapper.js:64: strict mode: TypeError: $DONE() not called test262/test/built-ins/AsyncFromSyncIteratorPrototype/next/next-result-poisoned-wrapper.js:69: TypeError: $DONE() not called