michael@0: // Constructing calls should throw if !callee->isInterpretedConstructor(). michael@0: // This tests the polymorphic call path. michael@0: michael@0: for (var i=0; i<20; i++) michael@0: Function.prototype(); michael@0: michael@0: var funs = [ michael@0: function() { return 1; }, michael@0: function() { return 2; }, michael@0: function() { return 3; }, michael@0: function() { return 4; }, michael@0: function() { return 5; }, michael@0: function() { return 6; }, michael@0: function() { return 7; }, michael@0: function() { return 8; }, michael@0: function() { return 9; }, michael@0: function() { return 10; }, michael@0: Function.prototype michael@0: ]; michael@0: michael@0: function f(callee) { michael@0: new callee; michael@0: } michael@0: function g() { michael@0: var c = 0; michael@0: for (var i=0; i<50; i++) { michael@0: try { michael@0: f(funs[i % funs.length]); michael@0: } catch (e) { michael@0: assertEq(e.message.contains("not a constructor"), true); michael@0: c++; michael@0: } michael@0: } michael@0: assertEq(c, 4); michael@0: } michael@0: g();