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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user