Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /*
2 * Any copyright is dedicated to the Public Domain.
3 * http://creativecommons.org/licenses/publicdomain/
4 * Contributor:
5 * Jeff Walden <jwalden+code@mit.edu>
6 */
8 //-----------------------------------------------------------------------------
9 var BUGNUMBER = 562446;
10 var summary = 'ES5: Array.prototype.toLocaleString';
12 print(BUGNUMBER + ": " + summary);
14 /**************
15 * BEGIN TEST *
16 **************/
18 var o;
20 o = { length: 2, 0: 7, 1: { toLocaleString: function() { return "baz" } } };
21 assertEq(Array.prototype.toLocaleString.call(o), "7,baz");
23 o = {};
24 assertEq(Array.prototype.toLocaleString.call(o), "");
26 var log = '';
27 arr = {length: {valueOf: function () { log += "L"; return 2; }},
28 0: "x", 1: "z"};
29 assertEq(Array.prototype.toLocaleString.call(arr), "x,z");
30 assertEq(log, "L");
32 /******************************************************************************/
34 reportCompare(true, true);
36 print("All tests passed!");