Fix attributes of length property for function objects (#3570)
fix length property of function objects to be configurable (ECMA-262 v6, 19.2.4.1) JerryScript-DCO-1.0-Signed-off-by: HyukWoo Park hyukwoo.park@samsung.com
This commit is contained in:
@@ -100,3 +100,24 @@ var builtin_typedArrays = [
|
||||
assert(ta.hasOwnProperty('length') === false);
|
||||
}
|
||||
})();
|
||||
|
||||
(function () {
|
||||
/* test length property of function objects */
|
||||
var normal_func = function () {};
|
||||
var arrow_func = () => {};
|
||||
|
||||
var functions = [normal_func, arrow_func];
|
||||
|
||||
for (func of functions) {
|
||||
var desc = Object.getOwnPropertyDescriptor(func, 'length');
|
||||
assert(desc.writable === false);
|
||||
assert(desc.enumerable === false);
|
||||
assert(desc.configurable === true);
|
||||
}
|
||||
|
||||
for (func of functions) {
|
||||
assert(func.hasOwnProperty('length') === true);
|
||||
assert(delete func.length);
|
||||
assert(func.hasOwnProperty('length') === false);
|
||||
}
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user