michael@0: // |reftest| skip-if(!xulRuntime.shell) michael@0: // Any copyright is dedicated to the Public Domain. michael@0: // http://creativecommons.org/licenses/publicdomain/ michael@0: michael@0: //----------------------------------------------------------------------------- michael@0: var BUGNUMBER = 843004; michael@0: var summary = michael@0: "Use of an object that emulates |undefined| as the sole option must " + michael@0: "preclude imputing default values"; michael@0: michael@0: print(BUGNUMBER + ": " + summary); michael@0: michael@0: if (typeof Intl !== 'object' && typeof quit == 'function') { michael@0: print("Test skipped"); michael@0: reportCompare(true, true); michael@0: quit(0); michael@0: } michael@0: michael@0: /************** michael@0: * BEGIN TEST * michael@0: **************/ michael@0: michael@0: var opt = objectEmulatingUndefined(); michael@0: opt.toString = function() { return "long"; }; michael@0: michael@0: var str = new Date(2013, 12 - 1, 14).toLocaleString("en-US", { weekday: opt }); michael@0: michael@0: // Because "weekday" was present and not undefined (stringifying to "long"), michael@0: // this must be a string like "Saturday" (in this implementation, that is). michael@0: assertEq(str, "Saturday"); michael@0: michael@0: if (typeof reportCompare === "function") michael@0: reportCompare(true, true); michael@0: michael@0: print("Tests complete");