Debian Codegraph @

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

raw
1 // |reftest| skip-if(!this.hasOwnProperty('Intl'))
2
3 var g = newGlobal();
4
5 var locale = "en";
6 var list = ["a", "b", "c"];
7
8 var listFormat = new Intl.ListFormat(locale);
9 var ccwListFormat = new g.Intl.ListFormat(locale);
10
11 // Intl.ListFormat.prototype.format
12 {
13 var fn = Intl.ListFormat.prototype.format;
14
15 var expectedValue = fn.call(listFormat, list);
16 var actualValue = fn.call(ccwListFormat, list);
17
18 assertEq(actualValue, expectedValue);
19 }
20
21 // Intl.ListFormat.prototype.formatToParts
22 {
23 var fn = Intl.ListFormat.prototype.formatToParts;
24
25 var expectedValue = fn.call(listFormat, list);
26 var actualValue = fn.call(ccwListFormat, list);
27
28 assertDeepEq(actualValue, expectedValue);
29 }
30
31 // Intl.ListFormat.prototype.resolvedOptions
32 {
33 var fn = Intl.ListFormat.prototype.resolvedOptions;
34
35 var expectedValue = fn.call(listFormat);
36 var actualValue = fn.call(ccwListFormat);
37
38 assertDeepEq(actualValue, expectedValue);
39 }
40
41 if (typeof reportCompare === "function")
42 reportCompare(0, 0);