Imported Upstream version 1.0.0
[platform/upstream/js.git] / js / src / jit-test / tests / basic / testHolesAndIndexPropertiesOnThePrototype.js
1 function f(x,y,z) {
2     return x + y + z;
3 }
4
5 Array.prototype[1] = 10;
6
7 function g() {
8     var arr = [1, ,3,4,5,6];
9
10     for (var i = 0; i < 10; ++i) {
11         assertEq(f.apply(null, arr), 14);
12     }
13 }
14 g();
15
16 Object.prototype[1] = 20;
17
18 function h() {
19     delete arguments[1];
20     return f.apply(null, arguments);
21 }
22 assertEq(h(1,2,3), 24);
23
24 function i() {
25     o = arguments;
26     delete o[1];
27     return f.apply(null, o);
28 }
29 assertEq(i(1,2,3), 24);