Bug 1342648 - Only define PluralRules constructor when calling addIntlExtras in test262 PluralRules tests. r=gandalf
authorAndré Bargull <andre.bargull@gmail.com>
Sat, 25 Feb 2017 01:59:42 -0800
changeset 394110 5a989a69ea61d7b945d8b454b49c5ae2ed545edb
parent 394109 9a9362c9fcd9cf626b6107b571a469a8e47d2cb4
child 394111 c355a0ffcb10bdc459e56dde715f4b2c3335c90c
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgandalf
bugs1342648
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1342648 - Only define PluralRules constructor when calling addIntlExtras in test262 PluralRules tests. r=gandalf
js/src/tests/test262-intl-extras.js
js/src/tests/test262/intl402/PluralRules/shell.js
--- a/js/src/tests/test262-intl-extras.js
+++ b/js/src/tests/test262-intl-extras.js
@@ -1,7 +1,14 @@
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 // Call the shell helper to add experimental features to the Intl object.
-if (typeof addIntlExtras === "function")
-    addIntlExtras(Intl);
+if (typeof addIntlExtras === "function") {
+    let intlExtras = {};
+    addIntlExtras(intlExtras);
+
+    Object.defineProperty(Intl, "PluralRules", {
+        value: intlExtras.PluralRules,
+        writable: true, enumerable: false, configurable: true
+    });
+}
--- a/js/src/tests/test262/intl402/PluralRules/shell.js
+++ b/js/src/tests/test262/intl402/PluralRules/shell.js
@@ -1,8 +1,15 @@
 // file: test262-intl-extras.js
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 // Call the shell helper to add experimental features to the Intl object.
-if (typeof addIntlExtras === "function")
-    addIntlExtras(Intl);
+if (typeof addIntlExtras === "function") {
+    let intlExtras = {};
+    addIntlExtras(intlExtras);
+
+    Object.defineProperty(Intl, "PluralRules", {
+        value: intlExtras.PluralRules,
+        writable: true, enumerable: false, configurable: true
+    });
+}