michael@0: // Handle bailing from a constructor. michael@0: michael@0: var confuzzle = 0; michael@0: michael@0: function BailFromConstructor() { michael@0: this.x = "cats"; michael@0: this.y = confuzzle + 5; michael@0: return 4; michael@0: } michael@0: michael@0: function f() { michael@0: var x; michael@0: for (var i = 0; i < 100; i++) { michael@0: if (i == 99) michael@0: confuzzle = undefined; michael@0: x = new BailFromConstructor(); michael@0: assertEq(typeof(x), "object"); michael@0: } michael@0: } michael@0: michael@0: f();