michael@0: /* michael@0: * Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/licenses/publicdomain/ michael@0: * Contributor: michael@0: * Jeff Walden michael@0: */ michael@0: michael@0: //----------------------------------------------------------------------------- michael@0: var BUGNUMBER = 562446; michael@0: var summary = 'ES5: Array.prototype.toLocaleString'; michael@0: michael@0: print(BUGNUMBER + ": " + summary); michael@0: michael@0: /************** michael@0: * BEGIN TEST * michael@0: **************/ michael@0: michael@0: var o; michael@0: michael@0: o = { length: 2, 0: 7, 1: { toLocaleString: function() { return "baz" } } }; michael@0: assertEq(Array.prototype.toLocaleString.call(o), "7,baz"); michael@0: michael@0: o = {}; michael@0: assertEq(Array.prototype.toLocaleString.call(o), ""); michael@0: michael@0: var log = ''; michael@0: arr = {length: {valueOf: function () { log += "L"; return 2; }}, michael@0: 0: "x", 1: "z"}; michael@0: assertEq(Array.prototype.toLocaleString.call(arr), "x,z"); michael@0: assertEq(log, "L"); michael@0: michael@0: /******************************************************************************/ michael@0: michael@0: reportCompare(true, true); michael@0: michael@0: print("All tests passed!");