]> git.saurik.com Git - apple/javascriptcore.git/blame - 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
CommitLineData
81345200
A
1function foo(s) {
2 return s[-1];
3}
4
5noInline(foo);
6
7String.prototype[-1] = "hello";
8
9for (var i = 0; i < 100000; ++i) {
10 var result = foo("hello");
11 if (result != "hello")
12 throw "Error: bad result: " + result;
13}
14