X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/2d39b0e377c0896910ee49ae70082ba665faf986..ed1e77d3adeb83d26fd1dfb16dd84cabdcefd250:/tests/stress/repeat-put-to-scope-global-with-same-value-watchpoint-invalidate.js diff --git a/tests/stress/repeat-put-to-scope-global-with-same-value-watchpoint-invalidate.js b/tests/stress/repeat-put-to-scope-global-with-same-value-watchpoint-invalidate.js new file mode 100644 index 0000000..fce955b --- /dev/null +++ b/tests/stress/repeat-put-to-scope-global-with-same-value-watchpoint-invalidate.js @@ -0,0 +1,23 @@ +function foo(v) { + global = v; +} + +function bar() { + return global; +} + +noInline(foo); +noInline(bar); + +var value = 42; +for (var i = 0; i < 10; ++i) + foo(value); +var n = 100000; +var m = 100; +for (var i = 0; i < n; ++i) { + if (i == n - m) + foo(value = 53); + var result = bar(); + if (result != value) + throw "Error: on iteration " + i + " got: " + result; +}