Add newtarget support AsyncFunction (#4560)

JerryScript-DCO-1.0-Signed-off-by: bence gabor kis kisbg@inf.u-szeged.hu
This commit is contained in:
kisbg 2021-02-04 14:30:11 +01:00 committed by GitHub
parent dd698f8d83
commit e9df2ca814
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 14 deletions

View File

@ -492,28 +492,28 @@ ecma_op_create_dynamic_function (const ecma_value_t *arguments_list_p, /**< argu
#if ENABLED (JERRY_ESNEXT)
ecma_object_t *new_target_p = JERRY_CONTEXT (current_new_target_p);
ecma_builtin_id_t fallback_ctor = ECMA_BUILTIN_ID_FUNCTION;
if (JERRY_UNLIKELY (parse_opts & (ECMA_PARSE_GENERATOR_FUNCTION | ECMA_PARSE_ASYNC_FUNCTION)))
{
fallback_proto = ECMA_BUILTIN_ID_GENERATOR;
fallback_proto = ECMA_BUILTIN_ID_ASYNC_GENERATOR;
fallback_ctor = ECMA_BUILTIN_ID_ASYNC_GENERATOR_FUNCTION;
if (parse_opts & ECMA_PARSE_ASYNC_FUNCTION)
if (!(parse_opts & ECMA_PARSE_GENERATOR_FUNCTION))
{
fallback_proto = ECMA_BUILTIN_ID_ASYNC_GENERATOR;
if (new_target_p == NULL)
{
new_target_p = ecma_builtin_get (ECMA_BUILTIN_ID_ASYNC_GENERATOR_FUNCTION);
}
fallback_proto = ECMA_BUILTIN_ID_ASYNC_FUNCTION_PROTOTYPE;
fallback_ctor = ECMA_BUILTIN_ID_ASYNC_FUNCTION;
}
else if (new_target_p == NULL)
else if (!(parse_opts & ECMA_PARSE_ASYNC_FUNCTION))
{
new_target_p = ecma_builtin_get (ECMA_BUILTIN_ID_GENERATOR_FUNCTION);
fallback_proto = ECMA_BUILTIN_ID_GENERATOR;
fallback_ctor = ECMA_BUILTIN_ID_GENERATOR_FUNCTION;
}
}
else if (new_target_p == NULL)
if (new_target_p == NULL)
{
new_target_p = ecma_builtin_get (ECMA_BUILTIN_ID_FUNCTION);
new_target_p = ecma_builtin_get (fallback_ctor);
}
ecma_object_t *proto = ecma_op_get_prototype_from_constructor (new_target_p, fallback_proto);

View File

@ -8487,7 +8487,6 @@
<test id="annexB/language/statements/const/dstr/object-pattern-emulates-undefined.js"><reason></reason></test>
<test id="annexB/language/statements/for-of/iterator-close-return-emulates-undefined-throws-when-called.js"><reason></reason></test>
<test id="annexB/language/statements/function/default-parameters-emulates-undefined.js"><reason></reason></test>
<test id="built-ins/AsyncFunction/proto-from-ctor-realm.js"><reason></reason></test>
<test id="built-ins/Atomics/notify/bigint/notify-all-on-loc.js"><reason></reason></test>
<test id="built-ins/Atomics/notify/count-defaults-to-infinity-missing.js"><reason></reason></test>
<test id="built-ins/Atomics/notify/count-defaults-to-infinity-undefined.js"><reason></reason></test>
@ -8738,5 +8737,4 @@
<test id="built-ins/TypedArrayConstructors/internals/Set/detached-buffer.js"><reason></reason></test>
<test id="built-ins/TypedArrayConstructors/internals/Set/tonumber-value-detached-buffer.js"><reason></reason></test>
<!-- END - Missing test262 support in JerryScript REPL - missing $262.detachArrayBuffer function -->
</excludeList>