Skip to content

Commit f4d70bb

Browse files
author
bence gabor kis
committed
Add newtarget support AsyncFunction
JerryScript-DCO-1.0-Signed-off-by: Bence Gabor Kis [email protected]
1 parent c82f184 commit f4d70bb

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

jerry-core/ecma/operations/ecma-function-object.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,16 @@ ecma_op_create_dynamic_function (const ecma_value_t *arguments_list_p, /**< argu
497497
{
498498
fallback_proto = ECMA_BUILTIN_ID_GENERATOR;
499499

500-
if (parse_opts & ECMA_PARSE_ASYNC_FUNCTION)
500+
if (parse_opts & ECMA_PARSE_ASYNC_FUNCTION && !(parse_opts & ECMA_PARSE_GENERATOR_FUNCTION))
501+
{
502+
fallback_proto = ECMA_BUILTIN_ID_ASYNC_FUNCTION_PROTOTYPE;
503+
504+
if (new_target_p == NULL)
505+
{
506+
new_target_p = ecma_builtin_get (ECMA_BUILTIN_ID_ASYNC_FUNCTION);
507+
}
508+
}
509+
else if (parse_opts & ECMA_PARSE_ASYNC_FUNCTION)
501510
{
502511
fallback_proto = ECMA_BUILTIN_ID_ASYNC_GENERATOR;
503512

tests/test262-esnext-excludelist.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8606,7 +8606,6 @@
86068606
<test id="annexB/language/statements/const/dstr/object-pattern-emulates-undefined.js"><reason></reason></test>
86078607
<test id="annexB/language/statements/for-of/iterator-close-return-emulates-undefined-throws-when-called.js"><reason></reason></test>
86088608
<test id="annexB/language/statements/function/default-parameters-emulates-undefined.js"><reason></reason></test>
8609-
<test id="built-ins/AsyncFunction/proto-from-ctor-realm.js"><reason></reason></test>
86108609
<test id="built-ins/Atomics/notify/bigint/notify-all-on-loc.js"><reason></reason></test>
86118610
<test id="built-ins/Atomics/notify/count-defaults-to-infinity-missing.js"><reason></reason></test>
86128611
<test id="built-ins/Atomics/notify/count-defaults-to-infinity-undefined.js"><reason></reason></test>

0 commit comments

Comments
 (0)