michael@0: michael@0: function Foo() { michael@0: var x = this.property; michael@0: this.property = 5; michael@0: glob = x; michael@0: } michael@0: Foo.prototype.property = 10; michael@0: for (var i = 0; i < 10; i++) { michael@0: new Foo(); michael@0: assertEq(glob, 10); michael@0: } michael@0: michael@0: function Bar() { michael@0: this.property; michael@0: this.other = 5; michael@0: } michael@0: Bar.prototype.other = 10; michael@0: Object.defineProperty(Bar.prototype, "property", { michael@0: get: function() { glob = this.other; } michael@0: }); michael@0: for (var i = 0; i < 10; i++) { michael@0: new Bar(); michael@0: assertEq(glob, 10); michael@0: }