Class accessors shouldn't be enumerable. (#3961)

Reference:
https://www.ecma-international.org/ecma-262/11.0/index.html#sec-runtime-semantics-classdefinitionevaluation 21.a,b

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
This commit is contained in:
Csaba Osztrogonác 2020-07-01 12:03:49 +02:00 committed by GitHub
parent b57e9cbc27
commit 1064b19cfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 3 deletions

View File

@ -1215,6 +1215,7 @@ opfunc_set_class_attributes (ecma_object_t *obj_p, /**< object */
}
else if (ECMA_PROPERTY_GET_TYPE (property) == ECMA_PROPERTY_TYPE_NAMEDACCESSOR)
{
property_pair_p->header.types[index] = (uint8_t) (property & ~ECMA_PROPERTY_FLAG_ENUMERABLE);
ecma_property_value_t *accessor_objs_p = property_pair_p->values + index;
ecma_getter_setter_pointers_t *get_set_pair_p = ecma_get_named_accessor_property (accessor_objs_p);

View File

@ -344,11 +344,8 @@
<test id="language/object-literal/getter.js"><reason></reason></test>
<test id="language/object-literal/method.js"><reason></reason></test>
<test id="language/object-literal/setter.js"><reason></reason></test>
<test id="language/statements/class/definition/accessors.js"><reason></reason></test>
<test id="language/statements/class/definition/getters.js"><reason></reason></test>
<test id="language/statements/class/definition/methods.js"><reason></reason></test>
<test id="language/statements/class/definition/numeric-property-names.js"><reason></reason></test>
<test id="language/statements/class/definition/setters.js"><reason></reason></test>
<test id="language/statements/class/definition/this-access-restriction.js"><reason></reason></test>
<test id="language/statements/class/definition/this-check-ordering.js"><reason></reason></test>
<test id="language/statements/class/name-binding/in-extends-expression-assigned.js"><reason></reason></test>