1 2 3 4 5 6 7 8 9 10 11
function f(a) { this.a = a; assertEq(arguments[1], 'x'); } for (var x = 0; x < 9; ++x) { f.prototype = {}; var obj = new f(x, 'x'); // more than f.length arguments assertEq(obj.a, x); assertEq(Object.getPrototypeOf(obj), f.prototype); }