]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/string-out-of-bounds-negative-proto-value.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / string-out-of-bounds-negative-proto-value.js
1 function foo(s) {
2 return s[-1];
3 }
4
5 noInline(foo);
6
7 String.prototype[-1] = "hello";
8
9 for (var i = 0; i < 100000; ++i) {
10 var result = foo("hello");
11 if (result != "hello")
12 throw "Error: bad result: " + result;
13 }
14