michael@0: /* michael@0: * Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/licenses/publicdomain/ michael@0: */ michael@0: michael@0: //----------------------------------------------------------------------------- michael@0: var BUGNUMBER = 657585; michael@0: var summary = michael@0: 'Guard against infinite recursion when converting |this| to string for the ' + michael@0: 'String.prototype.* methods'; michael@0: michael@0: print(BUGNUMBER + ": " + summary); michael@0: michael@0: /************** michael@0: * BEGIN TEST * michael@0: **************/ michael@0: michael@0: try michael@0: { michael@0: var obj = {}; michael@0: obj.toString = String.prototype.charAt; michael@0: "" + obj; michael@0: throw new Error("should have thrown"); michael@0: } michael@0: catch (e) michael@0: { michael@0: assertEq(e instanceof InternalError, true, michael@0: "should have thrown InternalError for over-recursion, got: " + e); michael@0: } michael@0: michael@0: /******************************************************************************/ michael@0: michael@0: if (typeof reportCompare === "function") michael@0: reportCompare(true, true); michael@0: michael@0: print("All tests passed!");