summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/intl402/Number/prototype/toLocaleString/default-options-object-prototype.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/intl402/Number/prototype/toLocaleString/default-options-object-prototype.js')
-rw-r--r--js/src/tests/test262/intl402/Number/prototype/toLocaleString/default-options-object-prototype.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/js/src/tests/test262/intl402/Number/prototype/toLocaleString/default-options-object-prototype.js b/js/src/tests/test262/intl402/Number/prototype/toLocaleString/default-options-object-prototype.js
new file mode 100644
index 0000000000..d6d1f0693c
--- /dev/null
+++ b/js/src/tests/test262/intl402/Number/prototype/toLocaleString/default-options-object-prototype.js
@@ -0,0 +1,21 @@
+// Copyright (C) 2017 Daniel Ehrenberg. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-initializenumberformat
+description: >
+ Monkey-patching Object.prototype does not change the default
+ options for NumberFormat as a null prototype is used.
+info: |
+ InitializeNumberFormat ( numberFormat, locales, options )
+
+ 1. If _options_ is *undefined*, then
+ 1. Let _options_ be ObjectCreate(*null*).
+---*/
+
+if (new Intl.NumberFormat("en").resolvedOptions().locale === "en") {
+ Object.prototype.maximumFractionDigits = 1;
+ assert.sameValue(1.23.toLocaleString("en"), "1.23");
+}
+
+reportCompare(0, 0);