Index: test/mjsunit/regress/regress-crbug-162085.js |
diff --git a/test/mjsunit/regress/regress-crbug-162085.js b/test/mjsunit/regress/regress-crbug-162085.js |
index f26c711f7ad5bbafc36dcfc4e719c95b64737027..a53b2c9987f47a953ff78c166592ba33aecc40fc 100644 |
--- a/test/mjsunit/regress/regress-crbug-162085.js |
+++ b/test/mjsunit/regress/regress-crbug-162085.js |
@@ -30,6 +30,7 @@ |
var a = [1,2,3]; |
a.length = 0; |
a[0] = 1.4; |
+assertEquals(1.4, a[0]); |
assertEquals(undefined, a[1]); |
assertEquals(undefined, a[2]); |
assertEquals(undefined, a[3]); |
@@ -43,6 +44,7 @@ var a2 = [1.3]; |
grow_store(a2,1,1.4); |
a2.length = 0; |
grow_store(a2,0,1.5); |
+assertEquals(1.5, a2[0]); |
assertEquals(undefined, a2[1]); |
assertEquals(undefined, a2[2]); |
assertEquals(undefined, a2[3]); |
@@ -53,3 +55,17 @@ var o = {}; |
grow_store(a3, 1, o); |
assertEquals(1.3, a3[0]); |
assertEquals(o, a3[1]); |
+ |
+// Ensure the double array growstub initializes the array with holes. |
+function grow_store2(a,i,v) { |
+ a[i] = v; |
+} |
+ |
+var a4 = [1.3]; |
+grow_store2(a4,1,1.4); |
+a4.length = 0; |
+grow_store2(a4,0,1); |
+assertEquals(1, a4[0]); |
+assertEquals(undefined, a4[1]); |
+assertEquals(undefined, a4[2]); |
+assertEquals(undefined, a4[3]); |