michael@0: // Array.of passes the number of arguments to the constructor it calls. michael@0: michael@0: var hits = 0; michael@0: function Herd(n) { michael@0: assertEq(arguments.length, 1); michael@0: assertEq(n, 5); michael@0: hits++; michael@0: } michael@0: Herd.of = Array.of; michael@0: Herd.of("sheep", "cattle", "elephants", "whales", "seals"); michael@0: assertEq(hits, 1);