Index: test/mjsunit/compiler/regress-628403.js |
diff --git a/test/mjsunit/compiler/regress-621423.js b/test/mjsunit/compiler/regress-628403.js |
similarity index 50% |
copy from test/mjsunit/compiler/regress-621423.js |
copy to test/mjsunit/compiler/regress-628403.js |
index 962176ffbff75281ae55fed8a05fb40158f0d6f1..4096ac32aee4692487618fc53f6b7bcf703a9098 100644 |
--- a/test/mjsunit/compiler/regress-621423.js |
+++ b/test/mjsunit/compiler/regress-628403.js |
@@ -4,18 +4,24 @@ |
// Flags: --allow-natives-syntax |
-var a = [0, ""]; |
-a[0] = 0; |
+var dothrow = false; |
-function g(array) { |
- array[1] = undefined; |
+function g() { |
+ if (dothrow) throw 1; |
} |
-function f() { |
- g(function() {}); |
- g(a); |
+function f(a) { |
+ try { |
+ g(); |
+ } catch(e) { |
+ if (typeof e !== 'number' && e !== 1) throw e; |
+ return a[0]; |
+ } |
} |
+%NeverOptimizeFunction(g); |
f(); |
-%OptimizeFunctionOnNextCall(f); |
f(); |
+%OptimizeFunctionOnNextCall(f); |
+dothrow = true; |
+assertEquals(42, f([42])); |