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:
parent
a220236cde
commit
d4ec38097f
3 changed files with 6 additions and 2 deletions
|
@ -13,6 +13,8 @@ try {
|
|||
assert(value === undefined);
|
||||
assert(a.length === 0);
|
||||
|
||||
assert([,].pop() === undefined);
|
||||
|
||||
console.log("PASS");
|
||||
} catch (e) {
|
||||
console.log("FAIL: " + e);
|
||||
|
|
|
@ -13,6 +13,8 @@ try {
|
|||
assert(value === undefined);
|
||||
assert(a.length === 0);
|
||||
|
||||
assert([,].shift() === undefined);
|
||||
|
||||
console.log("PASS");
|
||||
} catch (e) {
|
||||
console.log("FAIL: " + e);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue