bug1063878.js (526B)
1 function getx() { 2 return x; 3 } 4 function gety() { 5 return y; 6 } 7 function getz() { 8 return z; 9 } 10 11 function main() { 12 var proto = Object.getPrototypeOf(this); 13 Object.defineProperty(proto, "x", { value: 5}); 14 // not-scripted getter 15 Object.defineProperty(proto, "y", { get: String }); 16 // scripted getter 17 Object.defineProperty(proto, "z", { get: function () { return 7;} }); 18 for (var i=0; i<20; i++) { 19 assertEq(getx(), 5); 20 assertEq(gety(), ""); 21 assertEq(getz(), 7); 22 } 23 } 24 main();