aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/regress/regress-crbug-417508.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/mjsunit/regress/regress-crbug-417508.js')
-rw-r--r--deps/v8/test/mjsunit/regress/regress-crbug-417508.js50
1 files changed, 39 insertions, 11 deletions
diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-417508.js b/deps/v8/test/mjsunit/regress/regress-crbug-417508.js
index 589fb88443..705ab3609d 100644
--- a/deps/v8/test/mjsunit/regress/regress-crbug-417508.js
+++ b/deps/v8/test/mjsunit/regress/regress-crbug-417508.js
@@ -7,23 +7,51 @@
function foo(x) {
var k = "value";
return x[k] = 1;
-}
+};
+%PrepareFunctionForOptimization(foo);
var obj = {};
-Object.defineProperty(obj, "value", {set: function(x) { throw "nope"; }});
-try { foo(obj); } catch(e) {}
-try { foo(obj); } catch(e) {}
+Object.defineProperty(obj, 'value', {
+ set: function(x) {
+ throw 'nope';
+ }
+});
+try {
+ foo(obj);
+} catch (e) {
+}
+try {
+ foo(obj);
+} catch (e) {
+}
%OptimizeFunctionOnNextCall(foo);
-try { foo(obj); } catch(e) {}
+try {
+ foo(obj);
+} catch (e) {
+}
function bar(x) {
var k = "value";
return (x[k] = 1) ? "ok" : "nope";
-}
+};
+%PrepareFunctionForOptimization(bar);
var obj2 = {};
-Object.defineProperty(obj2, "value",
- {set: function(x) { throw "nope"; return true; } });
+Object.defineProperty(obj2, 'value', {
+ set: function(x) {
+ throw 'nope';
+ return true;
+ }
+});
-try { bar(obj2); } catch(e) {}
-try { bar(obj2); } catch(e) {}
+try {
+ bar(obj2);
+} catch (e) {
+}
+try {
+ bar(obj2);
+} catch (e) {
+}
%OptimizeFunctionOnNextCall(bar);
-try { bar(obj2); } catch(e) {}
+try {
+ bar(obj2);
+} catch (e) {
+}