Add name to the function property names (#4760)

Furthermore prototype should be the first property.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2021-09-03 12:42:06 +02:00
committed by GitHub
parent 1523ca3b26
commit fea10bb7e3
3 changed files with 36 additions and 13 deletions
@@ -44,3 +44,9 @@ assert(getProperties(bound_func) == "dummy caller arguments prototype");
// 'print' is an external function
Object.setPrototypeOf(print, prototype_obj);
assert(getProperties(print) == "dummy length caller arguments");
function f1() {}
assert(Reflect.ownKeys(f1).toString() === "prototype,length,name,caller,arguments")
async function f2() {}
assert(Reflect.ownKeys(f2).toString() === "length,name")
@@ -17,6 +17,7 @@ Object.preventExtensions(hasProp);
assert (Object.isSealed(hasProp) === false);
var keys = Object.getOwnPropertyNames(hasProp);
assert (keys.length === 1);
assert (keys[0] === "length");
assert (keys.length === 2);
/* Note: the order is currently wrong. */
assert (keys[0] === "name");
assert (keys[1] === "length");