RESOLVED DUPLICATE of bug 201910 189470
Fail to throw TypeError when setting function.length in Array.prototype.unshift
https://bugs.webkit.org/show_bug.cgi?id=189470
Summary Fail to throw TypeError when setting function.length in Array.prototype.unshift
sunlili
Reported 2018-09-10 00:22:42 PDT
Hello, executing following code: ----------------------------------- var f = function func1() {}; var a=[]; print(f.length); a.unshift.call(f,1,2,3) print(f.length); ----------------------------------- Output of jsc is: 0 0 However, since function's length property is readonly, a TypeError should be thrown in unshift() execution. BT group 2018.09.10
Attachments
Alexey Shvayka
Comment 1 2020-06-07 06:39:52 PDT
(In reply to sunlili from comment #0) > However, since function's length property is readonly, a TypeError should be > thrown in unshift() execution. r250275 fixed putLength() with unsuccessful [[Set]], including Array.prototype.unshift case. test262 coverage: https://github.com/tc39/test262/pull/2463. *** This bug has been marked as a duplicate of bug 201910 ***
Note You need to log in before you can comment on or make changes to this bug.