michael@0: function f(v) michael@0: { michael@0: return v.x + v.x + v.y; michael@0: } michael@0: michael@0: assertEq(f({ x: 1, y: 2 }), 4); michael@0: assertEq(f({ __proto__: {x: 1, y: 2} }), 4); michael@0: assertEq(f({ __proto__: {x: 0, y: 2}, x: 1 }), 4); michael@0: michael@0: // Ensure there is no aliasing. michael@0: var global = 1; michael@0: assertEq(f(Object.defineProperty({ y : 2 }, "x", { get : function(){ return global++; } })), 5);