Fix toSpliced mutate-while-iterating test

This commit is contained in:
Shu-yu Guo 2022-10-24 15:28:44 -07:00 committed by Ms2ger
parent c15d4bef28
commit ade328d530
1 changed files with 5 additions and 1 deletions

View File

@ -29,10 +29,14 @@ includes: [compareArray.js]
---*/
var arr = [0, 1, 2, 3];
var zerothElementStorage = arr[0];
Object.defineProperty(arr, "0", {
get() {
arr[1] = 42;
return 0;
return zerothElementStorage;
},
set(v) {
zerothElementStorage = v;
}
});
Object.defineProperty(arr, "2", {