mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-22 18:31:13 +00:00
LibJS: Return undefined in Array.prototype.{pop,shift} for empty values
This commit is contained in:
parent
a220236cde
commit
d4ec38097f
Notes:
sideshowbarker
2024-07-19 07:11:59 +09:00
Author: https://github.com/linusg
Commit: d4ec38097f
Pull-request: https://github.com/SerenityOS/serenity/pull/2012
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