blob: bfc9d0a22fd41e340ba883fef9dca6ba683258ae [file] [log] [blame]
This test checks the behavior of Number.prototype.toLocaleString as described in the ECMAScript Internationalization API Specification (ECMA-402 2.0).
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS Number.prototype.toLocaleString.length is 0
PASS Object.getOwnPropertyDescriptor(Number.prototype, 'toLocaleString').enumerable is false
PASS Object.getOwnPropertyDescriptor(Number.prototype, 'toLocaleString').configurable is true
PASS Object.getOwnPropertyDescriptor(Number.prototype, 'toLocaleString').writable is true
PASS Number.prototype.toLocaleString.call(0) did not throw exception.
PASS Number.prototype.toLocaleString.call(NaN) did not throw exception.
PASS Number.prototype.toLocaleString.call(Infinity) did not throw exception.
PASS Number.prototype.toLocaleString.call(new Number) did not throw exception.
PASS Number.prototype.toLocaleString.call() threw exception TypeError: thisNumberValue called on incompatible undefined.
PASS Number.prototype.toLocaleString.call(undefined) threw exception TypeError: thisNumberValue called on incompatible undefined.
PASS Number.prototype.toLocaleString.call(null) threw exception TypeError: thisNumberValue called on incompatible object.
PASS Number.prototype.toLocaleString.call('1') threw exception TypeError: thisNumberValue called on incompatible string.
PASS Number.prototype.toLocaleString.call([]) threw exception TypeError: thisNumberValue called on incompatible object.
PASS Number.prototype.toLocaleString.call(Symbol()) threw exception TypeError: thisNumberValue called on incompatible symbol.
PASS (0).toLocaleString() is "0"
PASS new Number(1).toLocaleString() is "1"
PASS (0).toLocaleString('i') threw exception RangeError: invalid language tag: i.
PASS Infinity.toLocaleString() is "∞"
PASS (123456.789).toLocaleString('ar') is "١٢٣٬٤٥٦٫٧٨٩"
PASS (123456.789).toLocaleString('zh-Hans-CN-u-nu-hanidec') is "一二三,四五六.七八九"
PASS (123.456).toLocaleString('en', { maximumSignificantDigits: 3 }) is "123"
PASS successfullyParsed is true
TEST COMPLETE