From 7686bceecff17f91758c8c6547a78e71ff3a8c38 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sun, 13 Aug 2017 14:44:53 +0200 Subject: Add pluralrules to JS Intl --- .../resolvedOptions-overridden-species.js | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 js/src/tests/Intl/PluralRules/resolvedOptions-overridden-species.js (limited to 'js/src/tests/Intl/PluralRules') diff --git a/js/src/tests/Intl/PluralRules/resolvedOptions-overridden-species.js b/js/src/tests/Intl/PluralRules/resolvedOptions-overridden-species.js new file mode 100644 index 000000000..f5f5b62a8 --- /dev/null +++ b/js/src/tests/Intl/PluralRules/resolvedOptions-overridden-species.js @@ -0,0 +1,27 @@ +// |reftest| skip-if(!this.hasOwnProperty("Intl")||!this.hasOwnProperty("addIntlExtras")) + +// Tests the PluralRules.resolvedOptions function for overriden Array[Symbol.species]. + +addIntlExtras(Intl); + +var pl = new Intl.PluralRules("de"); + +Object.defineProperty(Array, Symbol.species, { + value: function() { + return new Proxy(["?"], { + get(t, pk, r) { + return Reflect.get(t, pk, r); + }, + defineProperty(t, pk) { + return true; + } + }); + } +}); + +var pluralCategories = pl.resolvedOptions().pluralCategories; + +assertEqArray(pluralCategories, ["one", "other"]); + +if (typeof reportCompare === "function") + reportCompare(0, 0); -- cgit v1.2.3