-1:000000000000 | 0:a6abbd3df4f6 |
---|---|
1 function f(v) | |
2 { | |
3 return v.x + v.x + v.y; | |
4 } | |
5 | |
6 assertEq(f({ x: 1, y: 2 }), 4); | |
7 assertEq(f({ __proto__: {x: 1, y: 2} }), 4); | |
8 assertEq(f({ __proto__: {x: 0, y: 2}, x: 1 }), 4); | |
9 | |
10 // Ensure there is no aliasing. | |
11 var global = 1; | |
12 assertEq(f(Object.defineProperty({ y : 2 }, "x", { get : function(){ return global++; } })), 5); |