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 = 635389; michael@0: var summary = 'Infinite recursion via [].{toString,toLocaleString,join}'; 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 x = []; michael@0: x.join = Array.prototype.toString; michael@0: "" + x; 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 for over-recursion"); michael@0: } michael@0: michael@0: try michael@0: { michael@0: var x = { toString: Array.prototype.toString, join: Array.prototype.toString }; michael@0: "" + x; 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 for over-recursion"); 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!");