Debian Codegraph @

js/src/tests/non262/Intl/PluralRules/cross-compartment.js

raw
1 // |reftest| skip-if(!this.hasOwnProperty("Intl"))
2
3 var otherGlobal = newGlobal();
4
5 var pluralRules = new Intl.PluralRules();
6 var ccwPluralRules = new otherGlobal.Intl.PluralRules();
7
8 // Test Intl.PluralRules.prototype.select with a CCW object.
9 var Intl_PluralRules_select = Intl.PluralRules.prototype.select;
10
11 assertEq(Intl_PluralRules_select.call(ccwPluralRules, 0),
12 Intl_PluralRules_select.call(pluralRules, 0));
13
14 // Test Intl.PluralRules.prototype.resolvedOptions with a CCW object.
15 var Intl_PluralRules_resolvedOptions = Intl.PluralRules.prototype.resolvedOptions;
16
17 assertEq(deepEqual(Intl_PluralRules_resolvedOptions.call(ccwPluralRules),
18 Intl_PluralRules_resolvedOptions.call(pluralRules)),
19 true);
20
21 if (typeof reportCompare === "function")
22 reportCompare(true, true);