summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/intl402/ch11/11.1/11.1.2.1_4.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/intl402/ch11/11.1/11.1.2.1_4.js')
-rw-r--r--js/src/tests/test262/intl402/ch11/11.1/11.1.2.1_4.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/js/src/tests/test262/intl402/ch11/11.1/11.1.2.1_4.js b/js/src/tests/test262/intl402/ch11/11.1/11.1.2.1_4.js
new file mode 100644
index 000000000..18b5b98fa
--- /dev/null
+++ b/js/src/tests/test262/intl402/ch11/11.1/11.1.2.1_4.js
@@ -0,0 +1,21 @@
+// Copyright 2012 Mozilla Corporation. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/**
+ * @description Tests that for non-object values passed as this to NumberFormat a
+ * wrapper object will be initialized and returned.
+ * @author Norbert Lindenberg
+ */
+
+var thisValues = [true, 42, "国際化"];
+
+thisValues.forEach(function (value) {
+ var format = Intl.NumberFormat.call(value);
+ // check that the returned object functions as a number format
+ var referenceFormat = new Intl.NumberFormat();
+ if (Intl.NumberFormat.prototype.format.call(format, 12.3456) !== referenceFormat.format(12.3456)) {
+ $ERROR("NumberFormat initialized from " + value + " doesn't behave like normal number format.");
+ }
+ return true;
+});
+