blob: 203e58b008205cf95bb054a72f9a396aa19c23b2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
// Array.of passes the number of arguments to the constructor it calls.
var hits = 0;
function Herd(n) {
assertEq(arguments.length, 1);
assertEq(n, 5);
hits++;
}
Herd.of = Array.of;
Herd.of("sheep", "cattle", "elephants", "whales", "seals");
assertEq(hits, 1);
|