mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 01:57:35 +00:00
LibJS+LibWeb: Replace GlobalObject with Realm in Heap::allocate<T>()
This is a continuation of the previous three commits. Now that create() receives the allocating realm, we can simply forward that to allocate(), which accounts for the majority of these changes. Additionally, we can get rid of the realm_from_global_object() in one place, with one more remaining in VM::throw_completion().
This commit is contained in:
parent
b99cc7d050
commit
e992a9f469
82 changed files with 148 additions and 148 deletions
|
@ -13,7 +13,7 @@ namespace JS::Intl {
|
|||
|
||||
CollatorCompareFunction* CollatorCompareFunction::create(Realm& realm, Collator& collator)
|
||||
{
|
||||
return realm.heap().allocate<CollatorCompareFunction>(realm.global_object(), realm, collator);
|
||||
return realm.heap().allocate<CollatorCompareFunction>(realm, realm, collator);
|
||||
}
|
||||
|
||||
CollatorCompareFunction::CollatorCompareFunction(Realm& realm, Collator& collator)
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace JS::Intl {
|
|||
// 11.5.5 DateTime Format Functions, https://tc39.es/ecma402/#sec-datetime-format-functions
|
||||
DateTimeFormatFunction* DateTimeFormatFunction::create(Realm& realm, DateTimeFormat& date_time_format)
|
||||
{
|
||||
return realm.heap().allocate<DateTimeFormatFunction>(realm.global_object(), date_time_format, *realm.global_object().function_prototype());
|
||||
return realm.heap().allocate<DateTimeFormatFunction>(realm, date_time_format, *realm.global_object().function_prototype());
|
||||
}
|
||||
|
||||
DateTimeFormatFunction::DateTimeFormatFunction(DateTimeFormat& date_time_format, Object& prototype)
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace JS::Intl {
|
|||
|
||||
Locale* Locale::create(Realm& realm, Unicode::LocaleID const& locale_id)
|
||||
{
|
||||
return realm.heap().allocate<Locale>(realm.global_object(), locale_id, *realm.global_object().intl_locale_prototype());
|
||||
return realm.heap().allocate<Locale>(realm, locale_id, *realm.global_object().intl_locale_prototype());
|
||||
}
|
||||
|
||||
// 14 Locale Objects, https://tc39.es/ecma402/#locale-objects
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace JS::Intl {
|
|||
// 1.1.4 Number Format Functions, https://tc39.es/proposal-intl-numberformat-v3/out/numberformat/proposed.html#sec-number-format-functions
|
||||
NumberFormatFunction* NumberFormatFunction::create(Realm& realm, NumberFormat& number_format)
|
||||
{
|
||||
return realm.heap().allocate<NumberFormatFunction>(realm.global_object(), number_format, *realm.global_object().function_prototype());
|
||||
return realm.heap().allocate<NumberFormatFunction>(realm, number_format, *realm.global_object().function_prototype());
|
||||
}
|
||||
|
||||
NumberFormatFunction::NumberFormatFunction(NumberFormat& number_format, Object& prototype)
|
||||
|
|
|
@ -19,7 +19,7 @@ SegmentIterator* SegmentIterator::create(Realm& realm, Segmenter& segmenter, Utf
|
|||
// 4. Set iterator.[[IteratedString]] to string.
|
||||
// 5. Set iterator.[[IteratedStringNextSegmentCodeUnitIndex]] to 0.
|
||||
// 6. Return iterator.
|
||||
return realm.heap().allocate<SegmentIterator>(realm.global_object(), realm, segmenter, move(string), segments);
|
||||
return realm.heap().allocate<SegmentIterator>(realm, realm, segmenter, move(string), segments);
|
||||
}
|
||||
|
||||
// 18.6 Segment Iterator Objects, https://tc39.es/ecma402/#sec-segment-iterator-objects
|
||||
|
|
|
@ -18,7 +18,7 @@ Segments* Segments::create(Realm& realm, Segmenter& segmenter, Utf16String strin
|
|||
// 3. Set segments.[[SegmentsSegmenter]] to segmenter.
|
||||
// 4. Set segments.[[SegmentsString]] to string.
|
||||
// 5. Return segments.
|
||||
return realm.heap().allocate<Segments>(realm.global_object(), realm, segmenter, move(string));
|
||||
return realm.heap().allocate<Segments>(realm, realm, segmenter, move(string));
|
||||
}
|
||||
|
||||
// 18.5 Segments Objects, https://tc39.es/ecma402/#sec-segments-objects
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue