michael@0: // Make sure new script properties can be invalidated on specialized prototype michael@0: // types while they are still being constructed. michael@0: michael@0: function Foo(a, b, c) { michael@0: this.x = a + b; michael@0: this.y = c; michael@0: } michael@0: michael@0: updated = false; michael@0: var o = {valueOf: function() { michael@0: Object.defineProperty(Object.prototype, 'y', {set:function() { updated = true; }}) michael@0: }}; michael@0: michael@0: function Bar() {} michael@0: Bar.prototype = new Foo(o, 1, 2); michael@0: assertEq(updated, true); michael@0: assertEq(Bar.prototype.y, undefined);