1 2 3 4 5 6 7 8 9 10 11 12 13 14
"use strict"; Object.defineProperty(String.prototype, "toLocaleString", { get() { assertEq(typeof this, "string"); return function() { return typeof this; }; } }) assertEq(["test"].toLocaleString(), "string"); if (typeof reportCompare === "function") reportCompare(true, true);