]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/int16-put-by-val-in-and-out-of-bounds.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / int16-put-by-val-in-and-out-of-bounds.js
CommitLineData
81345200
A
1function foo(a) {
2 a[42] = 95010;
3}
4
5noInline(foo);
6
7function test(length, expected) {
8 var a = new Int16Array(length);
9 foo(a);
10 var result = a[42];
11 if (result != expected)
12 throw "Error: bad value at a[42]: " + result;
13}
14
15for (var i = 0; i < 100000; ++i) {
16 test(10, void 0);
17 test(100, 29474);
18}