Index: test/mjsunit/regress/regress-crbug-162085.js |
diff --git a/test/mjsunit/try-finally-continue.js b/test/mjsunit/regress/regress-crbug-162085.js |
similarity index 71% |
copy from test/mjsunit/try-finally-continue.js |
copy to test/mjsunit/regress/regress-crbug-162085.js |
index b55e7acc7815065456cdc3df61335c980b1e446b..f26c711f7ad5bbafc36dcfc4e719c95b64737027 100644 |
--- a/test/mjsunit/try-finally-continue.js |
+++ b/test/mjsunit/regress/regress-crbug-162085.js |
@@ -25,48 +25,31 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-// Test that we correctly restore the stack when continuing from a |
-// finally block inside a for-in. |
+// Ensure extending an empty packed smi array with a double initializes the |
+// array with holes. |
+var a = [1,2,3]; |
+a.length = 0; |
+a[0] = 1.4; |
+assertEquals(undefined, a[1]); |
+assertEquals(undefined, a[2]); |
+assertEquals(undefined, a[3]); |
-var f = 0; |
-var a = [1, 2, 3]; |
- |
-for (x in a) { |
- try{ |
- throw 'error'; |
- } finally { |
- f++; |
- continue; |
- } |
+// Ensure the double array growstub initializes the array with holes. |
+function grow_store(a,i,v) { |
+ a[i] = v; |
} |
-assertEquals(3, f); |
-f = 0; |
-for (x in a) { |
- try { |
- f++; |
- } finally { |
- f++; |
- continue; |
- } |
-} |
-assertEquals(6, f); |
+var a2 = [1.3]; |
+grow_store(a2,1,1.4); |
+a2.length = 0; |
+grow_store(a2,0,1.5); |
+assertEquals(undefined, a2[1]); |
+assertEquals(undefined, a2[2]); |
+assertEquals(undefined, a2[3]); |
-f = 0; |
-for (x in a) { |
- try { |
- f++; |
- } finally { |
- try { |
- throw 'error' |
- } finally { |
- try { |
- f++; |
- } finally { |
- f++; |
- continue; |
- } |
- } |
- } |
-} |
-assertEquals(9, f); |
+// Check storing objects using the double grow stub. |
+var a3 = [1.3]; |
+var o = {}; |
+grow_store(a3, 1, o); |
+assertEquals(1.3, a3[0]); |
+assertEquals(o, a3[1]); |