Wrap `toSpliced` call with try-finally

This commit is contained in:
Sosuke Suzuki 2025-02-28 22:52:09 +09:00 committed by Ms2ger
parent 2ad7f321d7
commit 9d8efae5c2
1 changed files with 5 additions and 2 deletions

View File

@ -41,8 +41,11 @@ function test(otherGlobal) {
["toSpliced - array too long", () => {
var oldLen = arrayLike.length;
arrayLike.length = 2**53 - 1;
gToSpliced.call(arrayLike, 0, 0, 1);
arrayLike.length = oldLen;
try {
gToSpliced.call(arrayLike, 0, 0, 1);
} finally {
arrayLike.length = oldLen;
}
}]
]