Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit 90ea3f2

Browse files
[ECMA-402] Implement Intl.ListFormat
https://bugs.webkit.org/show_bug.cgi?id=209775 Reviewed by Ross Kirsling. JSTests: * stress/intl-listformat.js: Added. (shouldBe): (shouldNotThrow): (shouldThrow): (test.DerivedListFormat): (test.get shouldThrow): (test): Source/JavaScriptCore: This patch implements Intl.ListFormat. Intl.ListFormat requires ulistfmt_openForType. But it is available after ICU 67, and it is draft (unstable) API in ICU 67. But now, this function is stable in ICU 68 without signature change and no major change happened to this API. Thus, we can assume that this API signature won't be changed. We specially undef U_HIDE_DRAFT_API for unicode/ulistformatter.h to use this draft (but stable) APIs. While macOS / iOS shipping ICU (AppleICU) is ICU 66, AppleICU has ulistfmt_openForType and related APIs even in ICU 66. We use these APIs in AppleICU 66 to implement Intl.ListFormat. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * runtime/CommonIdentifiers.h: * runtime/IntlDisplayNames.cpp: (JSC::IntlDisplayNames::initializeDisplayNames): * runtime/IntlListFormat.cpp: Added. (JSC::UListFormatterDeleter::operator()): (JSC::IntlListFormat::create): (JSC::IntlListFormat::createStructure): (JSC::IntlListFormat::IntlListFormat): (JSC::IntlListFormat::finishCreation): (JSC::IntlListFormat::initializeListFormat): (JSC::stringListFromIterable): (JSC::ListFormatInput::ListFormatInput): (JSC::ListFormatInput::size const): (JSC::ListFormatInput::stringPointers const): (JSC::ListFormatInput::stringLengths const): (JSC::IntlListFormat::format const): (JSC::IntlListFormat::formatToParts const): (JSC::IntlListFormat::resolvedOptions const): (JSC::IntlListFormat::styleString): (JSC::IntlListFormat::typeString): * runtime/IntlListFormat.h: Added. * runtime/IntlListFormatConstructor.cpp: Added. (JSC::IntlListFormatConstructor::create): (JSC::IntlListFormatConstructor::createStructure): (JSC::IntlListFormatConstructor::IntlListFormatConstructor): (JSC::IntlListFormatConstructor::finishCreation): (JSC::JSC_DEFINE_HOST_FUNCTION): * runtime/IntlListFormatConstructor.h: Added. * runtime/IntlListFormatPrototype.cpp: Added. (JSC::IntlListFormatPrototype::create): (JSC::IntlListFormatPrototype::createStructure): (JSC::IntlListFormatPrototype::IntlListFormatPrototype): (JSC::IntlListFormatPrototype::finishCreation): (JSC::JSC_DEFINE_HOST_FUNCTION): * runtime/IntlListFormatPrototype.h: Added. * runtime/IntlObject.cpp: (JSC::createListFormatConstructor): (JSC::IntlObject::finishCreation): * runtime/IntlObject.h: (JSC::intlListFormatAvailableLocales): * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::init): (JSC::JSGlobalObject::visitChildren): * runtime/JSGlobalObject.h: (JSC::JSGlobalObject::listFormatStructure): * runtime/VM.cpp: (JSC::VM::VM): * runtime/VM.h: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@268956 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 4b3f8d1 commit 90ea3f2

23 files changed

+1195
-3
lines changed

JSTests/ChangeLog

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
2020-10-24 Yusuke Suzuki <[email protected]>
2+
3+
[ECMA-402] Implement Intl.ListFormat
4+
https://bugs.webkit.org/show_bug.cgi?id=209775
5+
6+
Reviewed by Ross Kirsling.
7+
8+
* stress/intl-listformat.js: Added.
9+
(shouldBe):
10+
(shouldNotThrow):
11+
(shouldThrow):
12+
(test.DerivedListFormat):
13+
(test.get shouldThrow):
14+
(test):
15+
116
2020-10-24 Caio Lima <[email protected]>
217

318
[EWS][ARMv7] Flaky test stress/json-stringify-stack-overflow.js

JSTests/stress/intl-listformat.js

Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
function shouldBe(actual, expected) {
2+
if (actual !== expected)
3+
throw new Error(`expected ${expected} but got ${actual}`);
4+
}
5+
6+
function shouldNotThrow(func) {
7+
func();
8+
}
9+
10+
function shouldThrow(func, errorType) {
11+
let error;
12+
try {
13+
func();
14+
} catch (e) {
15+
error = e;
16+
}
17+
18+
if (!(error instanceof errorType))
19+
throw new Error(`Expected ${errorType.name}!`);
20+
}
21+
22+
function test() {
23+
{
24+
// https://tc39.github.io/ecma402/#pluralrules-objects
25+
// The Intl.ListFormat Constructor
26+
27+
// The ListFormat constructor is the %ListFormat% intrinsic object and a standard built-in property of the Intl object.
28+
shouldBe(Intl.ListFormat instanceof Function, true);
29+
30+
// Intl.ListFormat ([ locales [, options ] ])
31+
32+
// If NewTarget is undefined, throw a TypeError exception.
33+
shouldThrow(() => Intl.ListFormat(), TypeError);
34+
shouldThrow(() => Intl.ListFormat.call({}), TypeError);
35+
36+
shouldThrow(() => new Intl.ListFormat('$'), RangeError);
37+
shouldThrow(() => new Intl.ListFormat('en', null), TypeError);
38+
shouldBe(new Intl.ListFormat() instanceof Intl.ListFormat, true);
39+
40+
// Subclassable
41+
{
42+
class DerivedListFormat extends Intl.ListFormat {};
43+
shouldBe((new DerivedListFormat) instanceof DerivedListFormat, true);
44+
shouldBe((new DerivedListFormat) instanceof Intl.ListFormat, true);
45+
shouldBe(new DerivedListFormat('en').format(['Orange', 'Apple', 'Lemon']), 'Orange, Apple, and Lemon');
46+
shouldBe(Object.getPrototypeOf(new DerivedListFormat), DerivedListFormat.prototype);
47+
shouldBe(Object.getPrototypeOf(Object.getPrototypeOf(new DerivedListFormat)), Intl.ListFormat.prototype);
48+
}
49+
50+
// Properties of the Intl.ListFormat Constructor
51+
52+
// length property (whose value is 0)
53+
shouldBe(Intl.ListFormat.length, 0);
54+
55+
// Intl.ListFormat.prototype
56+
57+
// This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
58+
shouldBe(Object.getOwnPropertyDescriptor(Intl.ListFormat, 'prototype').writable, false);
59+
shouldBe(Object.getOwnPropertyDescriptor(Intl.ListFormat, 'prototype').enumerable, false);
60+
shouldBe(Object.getOwnPropertyDescriptor(Intl.ListFormat, 'prototype').configurable, false);
61+
62+
// Intl.ListFormat.supportedLocalesOf (locales [, options ])
63+
64+
// The value of the length property of the supportedLocalesOf method is 1.
65+
shouldBe(Intl.ListFormat.supportedLocalesOf.length, 1);
66+
67+
// Returns SupportedLocales
68+
shouldBe(Intl.ListFormat.supportedLocalesOf() instanceof Array, true);
69+
// Doesn't care about `this`.
70+
shouldBe(JSON.stringify(Intl.ListFormat.supportedLocalesOf.call(null, 'en')), '["en"]');
71+
shouldBe(JSON.stringify(Intl.ListFormat.supportedLocalesOf.call({}, 'en')), '["en"]');
72+
shouldBe(JSON.stringify(Intl.ListFormat.supportedLocalesOf.call(1, 'en')), '["en"]');
73+
// Ignores non-object, non-string list.
74+
shouldBe(JSON.stringify(Intl.ListFormat.supportedLocalesOf(9)), '[]');
75+
// Makes an array of tags.
76+
shouldBe(JSON.stringify(Intl.ListFormat.supportedLocalesOf('en')), '["en"]');
77+
// Handles array-like objects with holes.
78+
shouldBe(JSON.stringify(Intl.ListFormat.supportedLocalesOf({ length: 4, 1: 'en', 0: 'es', 3: 'de' })), '["es","en","de"]');
79+
// Deduplicates tags.
80+
shouldBe(JSON.stringify(Intl.ListFormat.supportedLocalesOf([ 'en', 'pt', 'en', 'es' ])), '["en","pt","es"]');
81+
// Canonicalizes tags.
82+
shouldBe(
83+
JSON.stringify(Intl.ListFormat.supportedLocalesOf('En-laTn-us-variAnt-fOObar-1abc-U-kn-tRue-A-aa-aaa-x-RESERVED')),
84+
$vm.icuVersion() >= 67
85+
? '["en-Latn-US-1abc-foobar-variant-a-aa-aaa-u-kn-x-reserved"]'
86+
: '["en-Latn-US-variant-foobar-1abc-a-aa-aaa-u-kn-x-reserved"]'
87+
);
88+
// Throws on problems with length, get, or toString.
89+
shouldThrow(() => Intl.ListFormat.supportedLocalesOf(Object.create(null, { length: { get() { throw new Error(); } } })), Error);
90+
shouldThrow(() => Intl.ListFormat.supportedLocalesOf(Object.create(null, { length: { value: 1 }, 0: { get() { throw new Error(); } } })), Error);
91+
shouldThrow(() => Intl.ListFormat.supportedLocalesOf([ { toString() { throw new Error(); } } ]), Error);
92+
// Throws on bad tags.
93+
shouldThrow(() => Intl.ListFormat.supportedLocalesOf('no-bok'), RangeError);
94+
shouldThrow(() => Intl.ListFormat.supportedLocalesOf('x-some-thing'), RangeError);
95+
shouldThrow(() => Intl.ListFormat.supportedLocalesOf([ 5 ]), TypeError);
96+
shouldThrow(() => Intl.ListFormat.supportedLocalesOf(''), RangeError);
97+
shouldThrow(() => Intl.ListFormat.supportedLocalesOf('a'), RangeError);
98+
shouldThrow(() => Intl.ListFormat.supportedLocalesOf('abcdefghij'), RangeError);
99+
shouldThrow(() => Intl.ListFormat.supportedLocalesOf('#$'), RangeError);
100+
shouldThrow(() => Intl.ListFormat.supportedLocalesOf('en-@-abc'), RangeError);
101+
shouldThrow(() => Intl.ListFormat.supportedLocalesOf('en-u'), RangeError);
102+
shouldThrow(() => Intl.ListFormat.supportedLocalesOf('en-u-kn-true-u-ko-true'), RangeError);
103+
shouldThrow(() => Intl.ListFormat.supportedLocalesOf('en-x'), RangeError);
104+
shouldThrow(() => Intl.ListFormat.supportedLocalesOf('en-*'), RangeError);
105+
shouldThrow(() => Intl.ListFormat.supportedLocalesOf('en-'), RangeError);
106+
shouldThrow(() => Intl.ListFormat.supportedLocalesOf('en--US'), RangeError);
107+
shouldThrow(() => Intl.ListFormat.supportedLocalesOf('i-klingon'), RangeError); // grandfathered tag is not accepted by IsStructurallyValidLanguageTag
108+
shouldThrow(() => Intl.ListFormat.supportedLocalesOf('x-en-US-12345'), RangeError);
109+
shouldThrow(() => Intl.ListFormat.supportedLocalesOf('x-12345-12345-en-US'), RangeError);
110+
shouldThrow(() => Intl.ListFormat.supportedLocalesOf('x-en-US-12345-12345'), RangeError);
111+
shouldThrow(() => Intl.ListFormat.supportedLocalesOf('x-en-u-foo'), RangeError);
112+
shouldThrow(() => Intl.ListFormat.supportedLocalesOf('x-en-u-foo-u-bar'), RangeError);
113+
114+
// Accepts valid tags
115+
var validLanguageTags = [
116+
'de', // ISO 639 language code
117+
'de-DE', // + ISO 3166-1 country code
118+
'DE-de', // tags are case-insensitive
119+
'cmn', // ISO 639 language code
120+
'cmn-Hans', // + script code
121+
'CMN-hANS', // tags are case-insensitive
122+
'cmn-hans-cn', // + ISO 3166-1 country code
123+
'es-419', // + UN M.49 region code
124+
'es-419-u-nu-latn-cu-bob', // + Unicode locale extension sequence
125+
'cmn-hans-cn-t-ca-u-ca-x-t-u', // singleton subtags can also be used as private use subtags
126+
'enochian-enochian', // language and variant subtags may be the same
127+
'de-gregory-u-ca-gregory', // variant and extension subtags may be the same
128+
'aa-a-foo-x-a-foo-bar', // variant subtags can also be used as private use subtags
129+
];
130+
for (var validLanguageTag of validLanguageTags)
131+
shouldNotThrow(() => Intl.ListFormat.supportedLocalesOf(validLanguageTag));
132+
133+
// Properties of the Intl.ListFormat Prototype Object
134+
135+
// The Intl.ListFormat prototype object is itself an ordinary object.
136+
shouldBe(Object.getPrototypeOf(Intl.ListFormat.prototype), Object.prototype);
137+
138+
// Intl.ListFormat.prototype.constructor
139+
// The initial value of Intl.ListFormat.prototype.constructor is the intrinsic object %ListFormat%.
140+
shouldBe(Intl.ListFormat.prototype.constructor, Intl.ListFormat);
141+
142+
// Intl.ListFormat.prototype [ @@toStringTag ]
143+
// The initial value of the @@toStringTag property is the string value "Intl.ListFormat".
144+
shouldBe(Intl.ListFormat.prototype[Symbol.toStringTag], 'Intl.ListFormat');
145+
shouldBe(Object.prototype.toString.call(Intl.ListFormat.prototype), '[object Intl.ListFormat]');
146+
// This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
147+
shouldBe(Object.getOwnPropertyDescriptor(Intl.ListFormat.prototype, Symbol.toStringTag).writable, false);
148+
shouldBe(Object.getOwnPropertyDescriptor(Intl.ListFormat.prototype, Symbol.toStringTag).enumerable, false);
149+
shouldBe(Object.getOwnPropertyDescriptor(Intl.ListFormat.prototype, Symbol.toStringTag).configurable, true);
150+
}
151+
{
152+
const lf = new Intl.ListFormat("en", {
153+
localeMatcher: "best fit",
154+
type: "conjunction",
155+
style: "long",
156+
});
157+
shouldBe(lf.format(['Motorcycle', 'Truck' , 'Car']), `Motorcycle, Truck, and Car`);
158+
shouldBe(lf.format([]), ``);
159+
shouldBe(lf.format(), ``);
160+
shouldBe(lf.format(undefined), ``);
161+
shouldBe(lf.format("Apple"), `A, p, p, l, and e`);
162+
shouldThrow(() => lf.format(42), TypeError);
163+
shouldThrow(() => lf.format(null), TypeError);
164+
shouldThrow(() => lf.format([null]), TypeError);
165+
shouldBe(JSON.stringify(lf.resolvedOptions()), `{"locale":"en","type":"conjunction","style":"long"}`);
166+
shouldBe(JSON.stringify(Reflect.getOwnPropertyDescriptor(Intl.ListFormat.prototype, Symbol.toStringTag)), `{"value":"Intl.ListFormat","writable":false,"enumerable":false,"configurable":true}`);
167+
}
168+
{
169+
const list = ['Motorcycle', 'Bus', 'Car'];
170+
shouldBe(new Intl.ListFormat('en-GB', { style: 'long', type: 'conjunction' }).format(list), `Motorcycle, Bus and Car`);
171+
shouldBe(new Intl.ListFormat('en-GB', { style: 'short', type: 'conjunction' }).format(list), `Motorcycle, Bus and Car`);
172+
shouldBe(new Intl.ListFormat('en-GB', { style: 'narrow', type: 'conjunction' }).format(list), `Motorcycle, Bus, Car`);
173+
shouldBe(new Intl.ListFormat('en-GB', { style: 'long', type: 'disjunction' }).format(list), `Motorcycle, Bus or Car`);
174+
shouldBe(new Intl.ListFormat('en-GB', { style: 'short', type: 'disjunction' }).format(list), `Motorcycle, Bus or Car`);
175+
shouldBe(new Intl.ListFormat('en-GB', { style: 'narrow', type: 'disjunction' }).format(list), `Motorcycle, Bus or Car`);
176+
shouldBe(new Intl.ListFormat('en-GB', { style: 'long', type: 'unit' }).format(list), `Motorcycle, Bus, Car`);
177+
shouldBe(new Intl.ListFormat('en-GB', { style: 'short', type: 'unit' }).format(list), `Motorcycle, Bus, Car`);
178+
shouldBe(new Intl.ListFormat('en-GB', { style: 'narrow', type: 'unit' }).format(list), `Motorcycle Bus Car`);
179+
}
180+
{
181+
const list = ['バイク', 'バス', '車'];
182+
shouldBe(new Intl.ListFormat('ja-JP', { style: 'long', type: 'conjunction' }).format(list), `バイク、バス、車`);
183+
shouldBe(new Intl.ListFormat('ja-JP', { style: 'short', type: 'conjunction' }).format(list), `バイク、バス、車`);
184+
shouldBe(new Intl.ListFormat('ja-JP', { style: 'narrow', type: 'conjunction' }).format(list), `バイク、バス、車`);
185+
shouldBe(new Intl.ListFormat('ja-JP', { style: 'long', type: 'disjunction' }).format(list), `バイク、バス、または車`);
186+
shouldBe(new Intl.ListFormat('ja-JP', { style: 'short', type: 'disjunction' }).format(list), `バイク、バス、または車`);
187+
shouldBe(new Intl.ListFormat('ja-JP', { style: 'narrow', type: 'disjunction' }).format(list), `バイク、バス、または車`);
188+
shouldBe(new Intl.ListFormat('ja-JP', { style: 'long', type: 'unit' }).format(list), `バイク バス 車`);
189+
shouldBe(new Intl.ListFormat('ja-JP', { style: 'short', type: 'unit' }).format(list), `バイク バス 車`);
190+
shouldBe(new Intl.ListFormat('ja-JP', { style: 'narrow', type: 'unit' }).format(list), `バイクバス車`);
191+
}
192+
{
193+
const list = ['Motorcycle', 'Bus', 'Car'];
194+
const expected = [
195+
{ "type": "element", "value": "Motorcycle" },
196+
{ "type": "literal", "value": ", " },
197+
{ "type": "element", "value": "Bus" },
198+
{ "type": "literal", "value": " and " },
199+
{ "type": "element", "value": "Car" }
200+
];
201+
202+
const lf = new Intl.ListFormat('en-GB', { style: 'long', type: 'conjunction' });
203+
const parts = lf.formatToParts(list);
204+
shouldBe(parts.length, expected.length);
205+
for (let i = 0; i < parts.length; ++i) {
206+
shouldBe(parts[i].type, expected[i].type);
207+
shouldBe(parts[i].value, expected[i].value);
208+
}
209+
210+
shouldBe(JSON.stringify(lf.formatToParts([])), `[]`);
211+
shouldBe(JSON.stringify(lf.formatToParts()), `[]`);
212+
shouldBe(JSON.stringify(lf.formatToParts(undefined)), `[]`);
213+
shouldBe(JSON.stringify(lf.formatToParts("Apple")), `[{"type":"element","value":"A"},{"type":"literal","value":", "},{"type":"element","value":"p"},{"type":"literal","value":", "},{"type":"element","value":"p"},{"type":"literal","value":", "},{"type":"element","value":"l"},{"type":"literal","value":" and "},{"type":"element","value":"e"}]`);
214+
shouldThrow(() => lf.formatToParts(42), TypeError);
215+
shouldThrow(() => lf.formatToParts(null), TypeError);
216+
shouldThrow(() => lf.formatToParts([null]), TypeError);
217+
}
218+
}
219+
220+
if (typeof Intl.ListFormat !== 'undefined')
221+
test();

Source/JavaScriptCore/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ set(JavaScriptCore_OBJECT_LUT_SOURCES
7272
runtime/IntlDateTimeFormatPrototype.cpp
7373
runtime/IntlDisplayNamesConstructor.cpp
7474
runtime/IntlDisplayNamesPrototype.cpp
75+
runtime/IntlListFormatConstructor.cpp
76+
runtime/IntlListFormatPrototype.cpp
7577
runtime/IntlLocalePrototype.cpp
7678
runtime/IntlNumberFormatConstructor.cpp
7779
runtime/IntlNumberFormatPrototype.cpp

Source/JavaScriptCore/ChangeLog

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,74 @@
1+
2020-10-24 Yusuke Suzuki <[email protected]>
2+
3+
[ECMA-402] Implement Intl.ListFormat
4+
https://bugs.webkit.org/show_bug.cgi?id=209775
5+
6+
Reviewed by Ross Kirsling.
7+
8+
This patch implements Intl.ListFormat. Intl.ListFormat requires ulistfmt_openForType.
9+
But it is available after ICU 67, and it is draft (unstable) API in ICU 67.
10+
But now, this function is stable in ICU 68 without signature change and no major
11+
change happened to this API. Thus, we can assume that this API signature won't be changed.
12+
We specially undef U_HIDE_DRAFT_API for unicode/ulistformatter.h to use this draft (but stable) APIs.
13+
14+
While macOS / iOS shipping ICU (AppleICU) is ICU 66, AppleICU has ulistfmt_openForType and related APIs
15+
even in ICU 66. We use these APIs in AppleICU 66 to implement Intl.ListFormat.
16+
17+
* CMakeLists.txt:
18+
* DerivedSources-input.xcfilelist:
19+
* DerivedSources-output.xcfilelist:
20+
* DerivedSources.make:
21+
* JavaScriptCore.xcodeproj/project.pbxproj:
22+
* Sources.txt:
23+
* runtime/CommonIdentifiers.h:
24+
* runtime/IntlDisplayNames.cpp:
25+
(JSC::IntlDisplayNames::initializeDisplayNames):
26+
* runtime/IntlListFormat.cpp: Added.
27+
(JSC::UListFormatterDeleter::operator()):
28+
(JSC::IntlListFormat::create):
29+
(JSC::IntlListFormat::createStructure):
30+
(JSC::IntlListFormat::IntlListFormat):
31+
(JSC::IntlListFormat::finishCreation):
32+
(JSC::IntlListFormat::initializeListFormat):
33+
(JSC::stringListFromIterable):
34+
(JSC::ListFormatInput::ListFormatInput):
35+
(JSC::ListFormatInput::size const):
36+
(JSC::ListFormatInput::stringPointers const):
37+
(JSC::ListFormatInput::stringLengths const):
38+
(JSC::IntlListFormat::format const):
39+
(JSC::IntlListFormat::formatToParts const):
40+
(JSC::IntlListFormat::resolvedOptions const):
41+
(JSC::IntlListFormat::styleString):
42+
(JSC::IntlListFormat::typeString):
43+
* runtime/IntlListFormat.h: Added.
44+
* runtime/IntlListFormatConstructor.cpp: Added.
45+
(JSC::IntlListFormatConstructor::create):
46+
(JSC::IntlListFormatConstructor::createStructure):
47+
(JSC::IntlListFormatConstructor::IntlListFormatConstructor):
48+
(JSC::IntlListFormatConstructor::finishCreation):
49+
(JSC::JSC_DEFINE_HOST_FUNCTION):
50+
* runtime/IntlListFormatConstructor.h: Added.
51+
* runtime/IntlListFormatPrototype.cpp: Added.
52+
(JSC::IntlListFormatPrototype::create):
53+
(JSC::IntlListFormatPrototype::createStructure):
54+
(JSC::IntlListFormatPrototype::IntlListFormatPrototype):
55+
(JSC::IntlListFormatPrototype::finishCreation):
56+
(JSC::JSC_DEFINE_HOST_FUNCTION):
57+
* runtime/IntlListFormatPrototype.h: Added.
58+
* runtime/IntlObject.cpp:
59+
(JSC::createListFormatConstructor):
60+
(JSC::IntlObject::finishCreation):
61+
* runtime/IntlObject.h:
62+
(JSC::intlListFormatAvailableLocales):
63+
* runtime/JSGlobalObject.cpp:
64+
(JSC::JSGlobalObject::init):
65+
(JSC::JSGlobalObject::visitChildren):
66+
* runtime/JSGlobalObject.h:
67+
(JSC::JSGlobalObject::listFormatStructure):
68+
* runtime/VM.cpp:
69+
(JSC::VM::VM):
70+
* runtime/VM.h:
71+
172
2020-10-23 Keith Miller <[email protected]>
273

374
Using WASM function size as the cap for choosing a register allocator causes performance regressions.

Source/JavaScriptCore/DerivedSources-input.xcfilelist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ $(PROJECT_DIR)/runtime/IntlDateTimeFormatConstructor.cpp
139139
$(PROJECT_DIR)/runtime/IntlDateTimeFormatPrototype.cpp
140140
$(PROJECT_DIR)/runtime/IntlDisplayNamesConstructor.cpp
141141
$(PROJECT_DIR)/runtime/IntlDisplayNamesPrototype.cpp
142+
$(PROJECT_DIR)/runtime/IntlListFormatConstructor.cpp
143+
$(PROJECT_DIR)/runtime/IntlListFormatPrototype.cpp
142144
$(PROJECT_DIR)/runtime/IntlLocalePrototype.cpp
143145
$(PROJECT_DIR)/runtime/IntlNumberFormatConstructor.cpp
144146
$(PROJECT_DIR)/runtime/IntlNumberFormatPrototype.cpp

Source/JavaScriptCore/DerivedSources-output.xcfilelist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ $(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/IntlDateTimeFormatConstructo
2929
$(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/IntlDateTimeFormatPrototype.lut.h
3030
$(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/IntlDisplayNamesConstructor.lut.h
3131
$(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/IntlDisplayNamesPrototype.lut.h
32+
$(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/IntlListFormatConstructor.lut.h
33+
$(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/IntlListFormatPrototype.lut.h
3234
$(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/IntlLocalePrototype.lut.h
3335
$(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/IntlNumberFormatConstructor.lut.h
3436
$(BUILT_PRODUCTS_DIR)/DerivedSources/JavaScriptCore/IntlNumberFormatPrototype.lut.h

Source/JavaScriptCore/DerivedSources.make

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ OBJECT_LUT_HEADERS = \
160160
IntlDateTimeFormatPrototype.lut.h \
161161
IntlDisplayNamesConstructor.lut.h \
162162
IntlDisplayNamesPrototype.lut.h \
163+
IntlListFormatConstructor.lut.h \
164+
IntlListFormatPrototype.lut.h \
163165
IntlLocalePrototype.lut.h \
164166
IntlNumberFormatConstructor.lut.h \
165167
IntlNumberFormatPrototype.lut.h \

0 commit comments

Comments
 (0)