Skip to content

Commit da16ad5

Browse files
iamstoliswoess
authored andcommitted
Adding a regression test for an incorrect array hole handling.
1 parent 60a2338 commit da16ad5

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright (c) 2023, 2023, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
6+
*/
7+
8+
load("assert.js");
9+
10+
var array = [1,2,4];
11+
delete array[1];
12+
array.splice(2,0,3);
13+
array[2] = '3';
14+
assertSameContent([1,,'3',4], array);
15+
16+
var array = new Array(10);
17+
array[0] = 0;
18+
array[2] = 2;
19+
array.splice(1,0,1);
20+
array[1] = '1';
21+
assertSameContent([0,'1',,2,,,,,,,,], array);

0 commit comments

Comments
 (0)