Make Array.prototype.unshift method conform to ES11 (#4128)

Changes:
- Since ES6 Array.prototype.unshift shouldn't iterate
over the array elements if argument count is 0.
- Add proper guard for a check introduced in ES6.
- Update comments to reference to ES5.1 and ES11 specs too.

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác csaba.osztrogonac@h-lab.eu
This commit is contained in:
Csaba Osztrogonác
2020-08-13 10:09:25 +02:00
committed by GitHub
parent 5ce95be174
commit ea07052869
4 changed files with 96 additions and 47 deletions
-1
View File
@@ -170,7 +170,6 @@
<test id="built-ins/Array/prototype/splice/create-species.js"><reason></reason></test>
<test id="built-ins/Array/prototype/splice/property-traps-order-with-species.js"><reason></reason></test>
<test id="built-ins/Array/prototype/splice/throws-if-integer-limit-exceeded.js"><reason></reason></test>
<test id="built-ins/Array/prototype/unshift/clamps-to-integer-limit.js"><reason></reason></test>
<test id="built-ins/ArrayBuffer/data-allocation-after-object-creation.js"><reason></reason></test>
<test id="built-ins/ArrayBuffer/proto-from-ctor-realm.js"><reason></reason></test>
<test id="built-ins/ArrayBuffer/prototype-from-newtarget.js"><reason></reason></test>