]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/array-fill-put-by-val.js
1 function shouldThrow(func
, message
) {
9 throw new Error("not thrown.");
10 if (String(error
) !== message
)
11 throw new Error("bad error: " + String(error
));
14 var array
= new Array(10);
16 for (var i
= 0; i
< 10; ++i
) {
20 Object
.defineProperty(Array
.prototype, index
, {
22 throw new Error('get is called.' + index
);
27 throw new Error('set is called.' + index
);
36 // No error, but all seenOnce becomes true.
39 // Ensures that all setter is called once.
40 for (var i
= 0; i
< 10; ++i
) {
41 shouldThrow(function () {
43 }, "Error: set is called." + i
);