]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/constant-closure-var-with-dynamic-invalidation.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / constant-closure-var-with-dynamic-invalidation.js
1 (function() {
2 var x = 42;
3 var result = 0;
4 var n = 100000;
5 var m = 100;
6 for (var i = 0; i < n; ++i) {
7 result += x;
8 (function() {
9 with ({}) {
10 if (i == n - m - 1)
11 x = 53;
12 }
13 })();
14 }
15 if (result != 42 * (n - m) + 53 * m)
16 throw "Error: bad result: " + result;
17 })();