Skip to content

Commit 35fb984

Browse files
authored
Fix Array.fromAsync function prototype (#1062)
1 parent d0930a9 commit 35fb984

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

quickjs.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7494,6 +7494,11 @@ static JSValue js_bytecode_autoinit(JSContext *ctx, JSObject *p, JSAtom atom,
74947494
for (size_t i = 0; i < countof(args); i++)
74957495
JS_FreeValue(ctx, args[i]);
74967496
JS_FreeValue(ctx, fun);
7497+
if (JS_SetPrototypeInternal(ctx, result, ctx->function_proto,
7498+
/*throw_flag*/true) < 0) {
7499+
JS_FreeValue(ctx, result);
7500+
return JS_EXCEPTION;
7501+
}
74977502
return result;
74987503
}
74997504
}

test262_errors.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
test262/test/built-ins/Array/fromAsync/builtin.js:24: Test262Error: Prototype of Array.fromAsync is Function.prototype Expected SameValue(«[object AsyncFunction]», «function () {
2-
[native code]
3-
}») to be true
4-
test262/test/built-ins/Array/fromAsync/builtin.js:24: strict mode: Test262Error: Prototype of Array.fromAsync is Function.prototype Expected SameValue(«[object AsyncFunction]», «function () {
5-
[native code]
6-
}») to be true
71
test262/test/built-ins/AsyncFromSyncIteratorPrototype/next/iterator-result-poisoned-wrapper.js:64: TypeError: $DONE() not called
82
test262/test/built-ins/AsyncFromSyncIteratorPrototype/next/iterator-result-poisoned-wrapper.js:64: strict mode: TypeError: $DONE() not called
93
test262/test/built-ins/AsyncFromSyncIteratorPrototype/next/next-result-poisoned-wrapper.js:69: TypeError: $DONE() not called

0 commit comments

Comments
 (0)