michael@0: /* michael@0: * Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommonn.org/licenses/publicdomain/ michael@0: */ michael@0: michael@0: var BUGNUMBER = 647385; michael@0: var summary = michael@0: "Number.prototype.toString should use ToInteger on the radix and should " + michael@0: "throw a RangeError if the radix is bad"; michael@0: michael@0: print(BUGNUMBER + ": " + summary); michael@0: michael@0: /************** michael@0: * BEGIN TEST * michael@0: **************/ michael@0: michael@0: function test(r) michael@0: { michael@0: try michael@0: { michael@0: 5..toString(r); michael@0: throw "should have thrown"; michael@0: } michael@0: catch (e) michael@0: { michael@0: assertEq(e instanceof RangeError, true, "expected a RangeError, got " + e); michael@0: } michael@0: } michael@0: test(Math.pow(2, 32) + 10); michael@0: test(55); 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!");