summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/arrayNatives.js
blob: 5bb2099b2cef66f0fd58944a9c19087635219612 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

/* Array natives applied to non-arrays. */

var oa = {};
Array.pop(oa);
assertEq(oa.length, 0);

var ob = {};
Array.push(ob, "twelve");
assertEq(ob.length, 1);

var oc = {};
Array.shift(oc);
assertEq(oc.length, 0);

var od = {};
Array.unshift(od, "eight");
assertEq(od.length, 1);