1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:57:35 +00:00

LibJS: Return undefined in Array.prototype.{pop,shift} for empty values

This commit is contained in:
Linus Groh 2020-04-29 00:22:47 +01:00 committed by Andreas Kling
parent a220236cde
commit d4ec38097f
3 changed files with 6 additions and 2 deletions

View file

@ -13,6 +13,8 @@ try {
assert(value === undefined);
assert(a.length === 0);
assert([,].pop() === undefined);
console.log("PASS");
} catch (e) {
console.log("FAIL: " + e);

View file

@ -13,6 +13,8 @@ try {
assert(value === undefined);
assert(a.length === 0);
assert([,].shift() === undefined);
console.log("PASS");
} catch (e) {
console.log("FAIL: " + e);