diff --git a/Userland/Libraries/LibJS/Runtime/AbstractOperations.h b/Userland/Libraries/LibJS/Runtime/AbstractOperations.h index ab16d30c34..937872a2c4 100644 --- a/Userland/Libraries/LibJS/Runtime/AbstractOperations.h +++ b/Userland/Libraries/LibJS/Runtime/AbstractOperations.h @@ -131,11 +131,11 @@ ALWAYS_INLINE ThrowCompletionOr construct(VM& vm, FunctionObject& funct // 10.1.13 OrdinaryCreateFromConstructor ( constructor, intrinsicDefaultProto [ , internalSlotsList ] ), https://tc39.es/ecma262/#sec-ordinarycreatefromconstructor template -ThrowCompletionOr ordinary_create_from_constructor(VM& vm, FunctionObject const& constructor, Object* (Intrinsics::*intrinsic_default_prototype)(), Args&&... args) +ThrowCompletionOr> ordinary_create_from_constructor(VM& vm, FunctionObject const& constructor, Object* (Intrinsics::*intrinsic_default_prototype)(), Args&&... args) { auto& realm = *vm.current_realm(); auto* prototype = TRY(get_prototype_from_constructor(vm, constructor, intrinsic_default_prototype)); - return realm.heap().allocate(realm, forward(args)..., *prototype).ptr(); + return realm.heap().allocate(realm, forward(args)..., *prototype); } // 14.1 MergeLists ( a, b ), https://tc39.es/proposal-temporal/#sec-temporal-mergelists diff --git a/Userland/Libraries/LibJS/Runtime/AggregateErrorConstructor.cpp b/Userland/Libraries/LibJS/Runtime/AggregateErrorConstructor.cpp index 2ba922ba4b..431288c3e4 100644 --- a/Userland/Libraries/LibJS/Runtime/AggregateErrorConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/AggregateErrorConstructor.cpp @@ -48,7 +48,7 @@ ThrowCompletionOr AggregateErrorConstructor::construct(FunctionObject& auto options = vm.argument(2); // 2. Let O be ? OrdinaryCreateFromConstructor(newTarget, "%AggregateError.prototype%", « [[ErrorData]] »). - auto* aggregate_error = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::aggregate_error_prototype)); + auto aggregate_error = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::aggregate_error_prototype)); // 3. If message is not undefined, then if (!message.is_undefined()) { @@ -69,7 +69,7 @@ ThrowCompletionOr AggregateErrorConstructor::construct(FunctionObject& MUST(aggregate_error->define_property_or_throw(vm.names.errors, { .value = Array::create_from(realm, errors_list), .writable = true, .enumerable = false, .configurable = true })); // 7. Return O. - return aggregate_error; + return aggregate_error.ptr(); } } diff --git a/Userland/Libraries/LibJS/Runtime/ArrayBuffer.cpp b/Userland/Libraries/LibJS/Runtime/ArrayBuffer.cpp index b4f4ba09b7..809e1ea3a9 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayBuffer.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayBuffer.cpp @@ -54,7 +54,7 @@ void ArrayBuffer::visit_edges(Cell::Visitor& visitor) ThrowCompletionOr allocate_array_buffer(VM& vm, FunctionObject& constructor, size_t byte_length) { // 1. Let obj be ? OrdinaryCreateFromConstructor(constructor, "%ArrayBuffer.prototype%", « [[ArrayBufferData]], [[ArrayBufferByteLength]], [[ArrayBufferDetachKey]] »). - auto* obj = TRY(ordinary_create_from_constructor(vm, constructor, &Intrinsics::array_buffer_prototype, nullptr)); + auto obj = TRY(ordinary_create_from_constructor(vm, constructor, &Intrinsics::array_buffer_prototype, nullptr)); // 2. Let block be ? CreateByteDataBlock(byteLength). auto block = ByteBuffer::create_zeroed(byte_length); @@ -67,7 +67,7 @@ ThrowCompletionOr allocate_array_buffer(VM& vm, FunctionObject& co // 4. Set obj.[[ArrayBufferByteLength]] to byteLength. // 5. Return obj. - return obj; + return obj.ptr(); } // 25.1.2.3 DetachArrayBuffer ( arrayBuffer [ , key ] ), https://tc39.es/ecma262/#sec-detacharraybuffer diff --git a/Userland/Libraries/LibJS/Runtime/BooleanConstructor.cpp b/Userland/Libraries/LibJS/Runtime/BooleanConstructor.cpp index a0c6746051..3a6c78d406 100644 --- a/Userland/Libraries/LibJS/Runtime/BooleanConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/BooleanConstructor.cpp @@ -42,7 +42,7 @@ ThrowCompletionOr BooleanConstructor::construct(FunctionObject& new_tar auto& vm = this->vm(); auto b = vm.argument(0).to_boolean(); - return TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::boolean_prototype, b)); + return TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::boolean_prototype, b)).ptr(); } } diff --git a/Userland/Libraries/LibJS/Runtime/DataViewConstructor.cpp b/Userland/Libraries/LibJS/Runtime/DataViewConstructor.cpp index d8ab1b21a4..592628fb7c 100644 --- a/Userland/Libraries/LibJS/Runtime/DataViewConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/DataViewConstructor.cpp @@ -67,12 +67,12 @@ ThrowCompletionOr DataViewConstructor::construct(FunctionObject& new_ta return vm.throw_completion(ErrorType::InvalidLength, vm.names.DataView); } - auto* data_view = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::data_view_prototype, &array_buffer, view_byte_length, offset)); + auto data_view = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::data_view_prototype, &array_buffer, view_byte_length, offset)); if (array_buffer.is_detached()) return vm.throw_completion(ErrorType::DetachedArrayBuffer); - return data_view; + return data_view.ptr(); } } diff --git a/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp b/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp index 3b96e7b949..efe44785aa 100644 --- a/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp @@ -299,7 +299,7 @@ ThrowCompletionOr DateConstructor::construct(FunctionObject& new_target // 6. Let O be ? OrdinaryCreateFromConstructor(NewTarget, "%Date.prototype%", « [[DateValue]] »). // 7. Set O.[[DateValue]] to dv. // 8. Return O. - return TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::date_prototype, date_value)); + return TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::date_prototype, date_value)).ptr(); } // 21.4.3.1 Date.now ( ), https://tc39.es/ecma262/#sec-date.now diff --git a/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp b/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp index b77de62ad0..f30915a7fa 100644 --- a/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp @@ -203,7 +203,7 @@ ThrowCompletionOr ECMAScriptFunctionObject::internal_construct(MarkedVe // 2. Let kind be F.[[ConstructorKind]]. auto kind = m_constructor_kind; - Object* this_argument = nullptr; + GCPtr this_argument; // 3. If kind is base, then if (kind == ConstructorKind::Base) { @@ -269,7 +269,7 @@ ThrowCompletionOr ECMAScriptFunctionObject::internal_construct(MarkedVe // b. If kind is base, return thisArgument. if (kind == ConstructorKind::Base) - return this_argument; + return this_argument.ptr(); // c. If result.[[Value]] is not undefined, throw a TypeError exception. if (!result.value()->is_undefined()) diff --git a/Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp index a3a085b137..18e9440717 100644 --- a/Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp @@ -43,7 +43,7 @@ ThrowCompletionOr ErrorConstructor::construct(FunctionObject& new_targe auto options = vm.argument(1); // 2. Let O be ? OrdinaryCreateFromConstructor(newTarget, "%Error.prototype%", « [[ErrorData]] »). - auto* error = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::error_prototype)); + auto error = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::error_prototype)); // 3. If message is not undefined, then if (!message.is_undefined()) { @@ -58,7 +58,7 @@ ThrowCompletionOr ErrorConstructor::construct(FunctionObject& new_targe TRY(error->install_error_cause(options)); // 5. Return O. - return error; + return error.ptr(); } #define __JS_ENUMERATE(ClassName, snake_name, PrototypeName, ConstructorName, ArrayType) \ @@ -96,7 +96,7 @@ ThrowCompletionOr ErrorConstructor::construct(FunctionObject& new_targe auto options = vm.argument(1); \ \ /* 2. Let O be ? OrdinaryCreateFromConstructor(newTarget, "%NativeError.prototype%", « [[ErrorData]] »). */ \ - auto* error = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::snake_name##_prototype)); \ + auto error = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::snake_name##_prototype)); \ \ /* 3. If message is not undefined, then */ \ if (!message.is_undefined()) { \ @@ -111,7 +111,7 @@ ThrowCompletionOr ErrorConstructor::construct(FunctionObject& new_targe TRY(error->install_error_cause(options)); \ \ /* 5. Return O. */ \ - return error; \ + return error.ptr(); \ } JS_ENUMERATE_NATIVE_ERRORS diff --git a/Userland/Libraries/LibJS/Runtime/FinalizationRegistryConstructor.cpp b/Userland/Libraries/LibJS/Runtime/FinalizationRegistryConstructor.cpp index 83eb3f1f37..815c1aaa9b 100644 --- a/Userland/Libraries/LibJS/Runtime/FinalizationRegistryConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/FinalizationRegistryConstructor.cpp @@ -56,7 +56,7 @@ ThrowCompletionOr FinalizationRegistryConstructor::construct(FunctionOb // 7. Set finalizationRegistry.[[Cells]] to a new empty List. // NOTE: This is done inside FinalizationRegistry instead of here. // 8. Return finalizationRegistry. - return TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::finalization_registry_prototype, *realm(), vm.host_make_job_callback(cleanup_callback.as_function()))); + return TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::finalization_registry_prototype, *realm(), vm.host_make_job_callback(cleanup_callback.as_function()))).ptr(); } } diff --git a/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.cpp index 022c8bceb1..413d5aeb25 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.cpp @@ -171,10 +171,10 @@ ThrowCompletionOr CollatorConstructor::construct(FunctionObject& new_ta // a. Append [[CaseFirst]] as the last element of internalSlotsList. // 5. Let collator be ? OrdinaryCreateFromConstructor(newTarget, "%Collator.prototype%", internalSlotsList). - auto* collator = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::intl_collator_prototype)); + auto collator = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::intl_collator_prototype)); // 6. Return ? InitializeCollator(collator, locales, options). - return TRY(initialize_collator(vm, *collator, locales, options)); + return TRY(initialize_collator(vm, collator, locales, options)); } // 10.2.2 Intl.Collator.supportedLocalesOf ( locales [ , options ] ), https://tc39.es/ecma402/#sec-intl.collator.supportedlocalesof diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.cpp index 49baca561b..9b66178776 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.cpp @@ -54,17 +54,17 @@ ThrowCompletionOr DateTimeFormatConstructor::construct(FunctionObject& auto options = vm.argument(1); // 2. Let dateTimeFormat be ? OrdinaryCreateFromConstructor(newTarget, "%DateTimeFormat.prototype%", « [[InitializedDateTimeFormat]], [[Locale]], [[Calendar]], [[NumberingSystem]], [[TimeZone]], [[Weekday]], [[Era]], [[Year]], [[Month]], [[Day]], [[DayPeriod]], [[Hour]], [[Minute]], [[Second]], [[FractionalSecondDigits]], [[TimeZoneName]], [[HourCycle]], [[Pattern]], [[BoundFormat]] »). - auto* date_time_format = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::intl_date_time_format_prototype)); + auto date_time_format = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::intl_date_time_format_prototype)); // 3. Perform ? InitializeDateTimeFormat(dateTimeFormat, locales, options). - TRY(initialize_date_time_format(vm, *date_time_format, locales, options)); + TRY(initialize_date_time_format(vm, date_time_format, locales, options)); // 4. If the implementation supports the normative optional constructor mode of 4.3 Note 1, then // a. Let this be the this value. // b. Return ? ChainDateTimeFormat(dateTimeFormat, NewTarget, this). // 5. Return dateTimeFormat. - return date_time_format; + return date_time_format.ptr(); } // 11.2.2 Intl.DateTimeFormat.supportedLocalesOf ( locales [ , options ] ), https://tc39.es/ecma402/#sec-intl.datetimeformat.supportedlocalesof diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.cpp index 89c9b950b2..5d82004996 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesConstructor.cpp @@ -52,7 +52,7 @@ ThrowCompletionOr DisplayNamesConstructor::construct(FunctionObject& ne auto options_value = vm.argument(1); // 2. Let displayNames be ? OrdinaryCreateFromConstructor(NewTarget, "%DisplayNames.prototype%", « [[InitializedDisplayNames]], [[Locale]], [[Style]], [[Type]], [[Fallback]], [[LanguageDisplay]], [[Fields]] »). - auto* display_names = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::intl_display_names_prototype)); + auto display_names = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::intl_display_names_prototype)); // 3. Let requestedLocales be ? CanonicalizeLocaleList(locales). auto requested_locales = TRY(canonicalize_locale_list(vm, locale_value)); @@ -130,7 +130,7 @@ ThrowCompletionOr DisplayNamesConstructor::construct(FunctionObject& ne // 29. Set displayNames.[[Fields]] to styleFields. // 30. Return displayNames. - return display_names; + return display_names.ptr(); } // 12.2.2 Intl.DisplayNames.supportedLocalesOf ( locales [ , options ] ), https://tc39.es/ecma402/#sec-Intl.DisplayNames.supportedLocalesOf diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.cpp index d86535bf5a..ba8af2a739 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatConstructor.cpp @@ -50,7 +50,7 @@ ThrowCompletionOr DurationFormatConstructor::construct(FunctionObject& auto options_value = vm.argument(1); // 2. Let durationFormat be ? OrdinaryCreateFromConstructor(NewTarget, "%DurationFormatPrototype%", « [[InitializedDurationFormat]], [[Locale]], [[DataLocale]], [[NumberingSystem]], [[Style]], [[YearsStyle]], [[YearsDisplay]], [[MonthsStyle]], [[MonthsDisplay]] , [[WeeksStyle]], [[WeeksDisplay]] , [[DaysStyle]], [[DaysDisplay]] , [[HoursStyle]], [[HoursDisplay]] , [[MinutesStyle]], [[MinutesDisplay]] , [[SecondsStyle]], [[SecondsDisplay]] , [[MillisecondsStyle]], [[MillisecondsDisplay]] , [[MicrosecondsStyle]], [[MicrosecondsDisplay]] , [[NanosecondsStyle]], [[NanosecondsDisplay]], [[FractionalDigits]] »). - auto* duration_format = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::intl_duration_format_prototype)); + auto duration_format = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::intl_duration_format_prototype)); // 3. Let requestedLocales be ? CanonicalizeLocaleList(locales). auto requested_locales = TRY(canonicalize_locale_list(vm, locales)); @@ -138,7 +138,7 @@ ThrowCompletionOr DurationFormatConstructor::construct(FunctionObject& duration_format->set_fractional_digits(Optional(TRY(get_number_option(vm, *options, vm.names.fractionalDigits, 0, 9, 0)))); // 19. Return durationFormat. - return duration_format; + return duration_format.ptr(); } // 1.3.2 Intl.DurationFormat.supportedLocalesOf ( locales [ , options ] ), https://tc39.es/proposal-intl-duration-format/#sec-Intl.DurationFormat.supportedLocalesOf diff --git a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.cpp index 9214693169..f0f30cce9d 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/ListFormatConstructor.cpp @@ -51,7 +51,7 @@ ThrowCompletionOr ListFormatConstructor::construct(FunctionObject& new_ auto options_value = vm.argument(1); // 2. Let listFormat be ? OrdinaryCreateFromConstructor(NewTarget, "%ListFormat.prototype%", « [[InitializedListFormat]], [[Locale]], [[Type]], [[Style]], [[Templates]] »). - auto* list_format = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::intl_list_format_prototype)); + auto list_format = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::intl_list_format_prototype)); // 3. Let requestedLocales be ? CanonicalizeLocaleList(locales). auto requested_locales = TRY(canonicalize_locale_list(vm, locale_value)); @@ -91,7 +91,7 @@ ThrowCompletionOr ListFormatConstructor::construct(FunctionObject& new_ // Note: The remaining steps are skipped in favor of deferring to LibUnicode. // 19. Return listFormat. - return list_format; + return list_format.ptr(); } // 13.2.2 Intl.ListFormat.supportedLocalesOf ( locales [ , options ] ), https://tc39.es/ecma402/#sec-Intl.ListFormat.supportedLocalesOf diff --git a/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp index 724f70c67e..625d031b54 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp @@ -258,7 +258,7 @@ ThrowCompletionOr LocaleConstructor::construct(FunctionObject& new_targ // a. Append [[Numeric]] as the last element of internalSlotsList. // 6. Let locale be ? OrdinaryCreateFromConstructor(NewTarget, "%Locale.prototype%", internalSlotsList). - auto* locale = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::intl_locale_prototype)); + auto locale = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::intl_locale_prototype)); DeprecatedString tag; @@ -362,7 +362,7 @@ ThrowCompletionOr LocaleConstructor::construct(FunctionObject& new_targ locale->set_numbering_system(result.nu.release_value()); // 37. Return locale. - return locale; + return locale.ptr(); } } diff --git a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.cpp index 269c6763ba..ab0d89c8fe 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormatConstructor.cpp @@ -50,17 +50,17 @@ ThrowCompletionOr NumberFormatConstructor::construct(FunctionObject& ne auto options = vm.argument(1); // 2. Let numberFormat be ? OrdinaryCreateFromConstructor(newTarget, "%NumberFormat.prototype%", « [[InitializedNumberFormat]], [[Locale]], [[DataLocale]], [[NumberingSystem]], [[Style]], [[Unit]], [[UnitDisplay]], [[Currency]], [[CurrencyDisplay]], [[CurrencySign]], [[MinimumIntegerDigits]], [[MinimumFractionDigits]], [[MaximumFractionDigits]], [[MinimumSignificantDigits]], [[MaximumSignificantDigits]], [[RoundingType]], [[Notation]], [[CompactDisplay]], [[UseGrouping]], [[SignDisplay]], [[BoundFormat]] »). - auto* number_format = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::intl_number_format_prototype)); + auto number_format = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::intl_number_format_prototype)); // 3. Perform ? InitializeNumberFormat(numberFormat, locales, options). - TRY(initialize_number_format(vm, *number_format, locales, options)); + TRY(initialize_number_format(vm, number_format, locales, options)); // 4. If the implementation supports the normative optional constructor mode of 4.3 Note 1, then // a. Let this be the this value. // b. Return ? ChainNumberFormat(numberFormat, NewTarget, this). // 5. Return numberFormat. - return number_format; + return number_format.ptr(); } // 15.2.2 Intl.NumberFormat.supportedLocalesOf ( locales [ , options ] ), https://tc39.es/ecma402/#sec-intl.numberformat.supportedlocalesof diff --git a/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesConstructor.cpp index 8585aca319..ef424edd4b 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesConstructor.cpp @@ -51,10 +51,10 @@ ThrowCompletionOr PluralRulesConstructor::construct(FunctionObject& new auto options = vm.argument(1); // 2. Let pluralRules be ? OrdinaryCreateFromConstructor(NewTarget, "%PluralRules.prototype%", « [[InitializedPluralRules]], [[Locale]], [[Type]], [[MinimumIntegerDigits]], [[MinimumFractionDigits]], [[MaximumFractionDigits]], [[MinimumSignificantDigits]], [[MaximumSignificantDigits]], [[RoundingType]] »). - auto* plural_rules = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::intl_plural_rules_prototype)); + auto plural_rules = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::intl_plural_rules_prototype)); // 3. Return ? InitializePluralRules(pluralRules, locales, options). - return TRY(initialize_plural_rules(vm, *plural_rules, locales, options)); + return TRY(initialize_plural_rules(vm, plural_rules, locales, options)); } // 16.2.2 Intl.PluralRules.supportedLocalesOf ( locales [ , options ] ), https://tc39.es/ecma402/#sec-intl.pluralrules.supportedlocalesof diff --git a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatConstructor.cpp index c368af4b14..d1b70729ef 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatConstructor.cpp @@ -54,10 +54,10 @@ ThrowCompletionOr RelativeTimeFormatConstructor::construct(FunctionObje auto options = vm.argument(1); // 2. Let relativeTimeFormat be ? OrdinaryCreateFromConstructor(NewTarget, "%RelativeTimeFormat.prototype%", « [[InitializedRelativeTimeFormat]], [[Locale]], [[DataLocale]], [[Style]], [[Numeric]], [[NumberFormat]], [[NumberingSystem]], [[PluralRules]] »). - auto* relative_time_format = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::intl_relative_time_format_prototype)); + auto relative_time_format = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::intl_relative_time_format_prototype)); // 3. Return ? InitializeRelativeTimeFormat(relativeTimeFormat, locales, options). - return TRY(initialize_relative_time_format(vm, *relative_time_format, locales, options)); + return TRY(initialize_relative_time_format(vm, relative_time_format, locales, options)); } // 17.2.2 Intl.RelativeTimeFormat.supportedLocalesOf ( locales [ , options ] ), https://tc39.es/ecma402/#sec-Intl.RelativeTimeFormat.supportedLocalesOf diff --git a/Userland/Libraries/LibJS/Runtime/Intl/SegmenterConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/SegmenterConstructor.cpp index 8c9583987d..956d6e1307 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/SegmenterConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/SegmenterConstructor.cpp @@ -51,7 +51,7 @@ ThrowCompletionOr SegmenterConstructor::construct(FunctionObject& new_t // 2. Let internalSlotsList be « [[InitializedSegmenter]], [[Locale]], [[SegmenterGranularity]] ». // 3. Let segmenter be ? OrdinaryCreateFromConstructor(NewTarget, "%Segmenter.prototype%", internalSlotsList). - auto* segmenter = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::intl_segmenter_prototype)); + auto segmenter = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::intl_segmenter_prototype)); // 4. Let requestedLocales be ? CanonicalizeLocaleList(locales). auto requested_locales = TRY(canonicalize_locale_list(vm, locales)); @@ -83,7 +83,7 @@ ThrowCompletionOr SegmenterConstructor::construct(FunctionObject& new_t segmenter->set_segmenter_granularity(granularity.as_string().deprecated_string()); // 14. Return segmenter. - return segmenter; + return segmenter.ptr(); } // 18.2.2 Intl.Segmenter.supportedLocalesOf ( locales [ , options ] ), https://tc39.es/ecma402/#sec-intl.segmenter.supportedlocalesof diff --git a/Userland/Libraries/LibJS/Runtime/MapConstructor.cpp b/Userland/Libraries/LibJS/Runtime/MapConstructor.cpp index 830e7e0ec7..f295a4c7c3 100644 --- a/Userland/Libraries/LibJS/Runtime/MapConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/MapConstructor.cpp @@ -43,10 +43,10 @@ ThrowCompletionOr MapConstructor::construct(FunctionObject& new_target) { auto& vm = this->vm(); - auto* map = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::map_prototype)); + auto map = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::map_prototype)); if (vm.argument(0).is_nullish()) - return map; + return map.ptr(); auto adder = TRY(map->get(vm.names.set)); if (!adder.is_function()) @@ -63,7 +63,7 @@ ThrowCompletionOr MapConstructor::construct(FunctionObject& new_target) return {}; })); - return map; + return map.ptr(); } // 24.1.2.2 get Map [ @@species ], https://tc39.es/ecma262/#sec-get-map-@@species diff --git a/Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp b/Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp index 6b13086b67..71361f7eb3 100644 --- a/Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/NumberConstructor.cpp @@ -99,7 +99,7 @@ ThrowCompletionOr NumberConstructor::construct(FunctionObject& new_targ // 4. Let O be ? OrdinaryCreateFromConstructor(NewTarget, "%Number.prototype%", « [[NumberData]] »). // 5. Set O.[[NumberData]] to n. // 6. Return O. - return TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::number_prototype, number.as_double())); + return TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::number_prototype, number.as_double())).ptr(); } // 21.1.2.2 Number.isFinite ( number ), https://tc39.es/ecma262/#sec-number.isfinite diff --git a/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp index 779aa16639..eeb8371f03 100644 --- a/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/ObjectConstructor.cpp @@ -70,7 +70,7 @@ ThrowCompletionOr ObjectConstructor::construct(FunctionObject& new_targ auto& realm = *vm.current_realm(); if (&new_target != this) - return TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::object_prototype, ConstructWithPrototypeTag::Tag)); + return TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::object_prototype, ConstructWithPrototypeTag::Tag)).ptr(); auto value = vm.argument(0); if (value.is_nullish()) return Object::create(realm, realm.intrinsics().object_prototype()).ptr(); diff --git a/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp b/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp index 3215f78f96..4d58319afb 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp @@ -305,7 +305,7 @@ ThrowCompletionOr PromiseConstructor::construct(FunctionObject& new_tar } // 11. Return promise. - return promise; + return promise.ptr(); } // 27.2.4.1 Promise.all ( iterable ), https://tc39.es/ecma262/#sec-promise.all diff --git a/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp b/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp index 041de097ca..7ba8867743 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp @@ -263,7 +263,7 @@ ThrowCompletionOr> regexp_create(VM& vm, Value patter ThrowCompletionOr> regexp_alloc(VM& vm, FunctionObject& new_target) { // 1. Let obj be ? OrdinaryCreateFromConstructor(newTarget, "%RegExp.prototype%", « [[OriginalSource]], [[OriginalFlags]], [[RegExpRecord]], [[RegExpMatcher]] »). - auto* regexp_object = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::regexp_prototype)); + auto regexp_object = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::regexp_prototype)); // 2. Let thisRealm be the current Realm Record. auto& this_realm = *vm.current_realm(); @@ -287,7 +287,7 @@ ThrowCompletionOr> regexp_alloc(VM& vm, FunctionObjec MUST(regexp_object->define_property_or_throw(vm.names.lastIndex, PropertyDescriptor { .writable = true, .enumerable = false, .configurable = false })); // 7. Return obj. - return NonnullGCPtr { *regexp_object }; + return regexp_object; } } diff --git a/Userland/Libraries/LibJS/Runtime/SetConstructor.cpp b/Userland/Libraries/LibJS/Runtime/SetConstructor.cpp index 642e66866d..a9b45f10a6 100644 --- a/Userland/Libraries/LibJS/Runtime/SetConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/SetConstructor.cpp @@ -43,10 +43,10 @@ ThrowCompletionOr SetConstructor::construct(FunctionObject& new_target) { auto& vm = this->vm(); - auto* set = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::set_prototype)); + auto set = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::set_prototype)); if (vm.argument(0).is_nullish()) - return set; + return set.ptr(); auto adder = TRY(set->get(vm.names.add)); if (!adder.is_function()) @@ -57,7 +57,7 @@ ThrowCompletionOr SetConstructor::construct(FunctionObject& new_target) return {}; })); - return set; + return set.ptr(); } // 24.2.2.2 get Set [ @@species ], https://tc39.es/ecma262/#sec-get-set-@@species diff --git a/Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.cpp index b3508761a0..ef14ed8574 100644 --- a/Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.cpp @@ -59,7 +59,7 @@ ThrowCompletionOr ShadowRealmConstructor::construct(FunctionObject& new // 2. Let O be ? OrdinaryCreateFromConstructor(NewTarget, "%ShadowRealm.prototype%", « [[ShadowRealm]], [[ExecutionContext]] »). // 4. Set O.[[ShadowRealm]] to realmRec. // 9. Set O.[[ExecutionContext]] to context. - auto* object = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::shadow_realm_prototype, *realm, move(context))); + auto object = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::shadow_realm_prototype, *realm, move(context))); // 10. Perform ? SetRealmGlobalObject(realmRec, undefined, undefined). realm->set_global_object(nullptr, nullptr); @@ -71,7 +71,7 @@ ThrowCompletionOr ShadowRealmConstructor::construct(FunctionObject& new global_object.initialize(object->shadow_realm()); // 13. Return O. - return object; + return object.ptr(); } } diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp index c4ed4b55da..21437cf1ff 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp @@ -78,10 +78,10 @@ ThrowCompletionOr create_temporal_calendar(VM& vm, DeprecatedString c // 3. Let object be ? OrdinaryCreateFromConstructor(newTarget, "%Temporal.Calendar.prototype%", « [[InitializedTemporalCalendar]], [[Identifier]] »). // 4. Set object.[[Identifier]] to the ASCII-lowercase of identifier. - auto* object = TRY(ordinary_create_from_constructor(vm, *new_target, &Intrinsics::temporal_calendar_prototype, identifier.to_lowercase())); + auto object = TRY(ordinary_create_from_constructor(vm, *new_target, &Intrinsics::temporal_calendar_prototype, identifier.to_lowercase())); // 5. Return object. - return object; + return object.ptr(); } // 12.2.2 GetBuiltinCalendar ( id ), https://tc39.es/proposal-temporal/#sec-temporal-getbuiltincalendar diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Duration.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/Duration.cpp index fb211a2d6c..008baf14c6 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Duration.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Duration.cpp @@ -413,10 +413,10 @@ ThrowCompletionOr create_temporal_duration(VM& vm, double years, doub // 11. Set object.[[Milliseconds]] to ℝ(𝔽(milliseconds)). // 12. Set object.[[Microseconds]] to ℝ(𝔽(microseconds)). // 13. Set object.[[Nanoseconds]] to ℝ(𝔽(nanoseconds)). - auto* object = TRY(ordinary_create_from_constructor(vm, *new_target, &Intrinsics::temporal_duration_prototype, years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds)); + auto object = TRY(ordinary_create_from_constructor(vm, *new_target, &Intrinsics::temporal_duration_prototype, years, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds)); // 14. Return object. - return object; + return object.ptr(); } // 7.5.15 CreateNegatedTemporalDuration ( duration ), https://tc39.es/proposal-temporal/#sec-temporal-createnegatedtemporalduration diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp index dff5500db8..52b510bdd2 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp @@ -73,10 +73,10 @@ ThrowCompletionOr create_temporal_instant(VM& vm, BigInt const& epoch_ // 4. Let object be ? OrdinaryCreateFromConstructor(newTarget, "%Temporal.Instant.prototype%", « [[InitializedTemporalInstant]], [[Nanoseconds]] »). // 5. Set object.[[Nanoseconds]] to epochNanoseconds. - auto* object = TRY(ordinary_create_from_constructor(vm, *new_target, &Intrinsics::temporal_instant_prototype, epoch_nanoseconds)); + auto object = TRY(ordinary_create_from_constructor(vm, *new_target, &Intrinsics::temporal_instant_prototype, epoch_nanoseconds)); // 6. Return object. - return object; + return object.ptr(); } // 8.5.3 ToTemporalInstant ( item ), https://tc39.es/proposal-temporal/#sec-temporal-totemporalinstant diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp index 7d20d7d91d..3ab032b6cf 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp @@ -75,9 +75,9 @@ ThrowCompletionOr create_temporal_date(VM& vm, i32 iso_year, u8 iso_ // 10. Set object.[[ISOMonth]] to isoMonth. // 11. Set object.[[ISODay]] to isoDay. // 12. Set object.[[Calendar]] to calendar. - auto* object = TRY(ordinary_create_from_constructor(vm, *new_target, &Intrinsics::temporal_plain_date_prototype, iso_year, iso_month, iso_day, calendar)); + auto object = TRY(ordinary_create_from_constructor(vm, *new_target, &Intrinsics::temporal_plain_date_prototype, iso_year, iso_month, iso_day, calendar)); - return object; + return object.ptr(); } // 3.5.2 ToTemporalDate ( item [ , options ] ), https://tc39.es/proposal-temporal/#sec-temporal-totemporaldate diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.cpp index dc1249b49c..2e4f49fa5d 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.cpp @@ -240,10 +240,10 @@ ThrowCompletionOr create_temporal_date_time(VM& vm, i32 iso_year // 15. Set object.[[ISOMicrosecond]] to microsecond. // 16. Set object.[[ISONanosecond]] to nanosecond. // 17. Set object.[[Calendar]] to calendar. - auto* object = TRY(ordinary_create_from_constructor(vm, *new_target, &Intrinsics::temporal_plain_date_prototype, iso_year, iso_month, iso_day, hour, minute, second, millisecond, microsecond, nanosecond, calendar)); + auto object = TRY(ordinary_create_from_constructor(vm, *new_target, &Intrinsics::temporal_plain_date_prototype, iso_year, iso_month, iso_day, hour, minute, second, millisecond, microsecond, nanosecond, calendar)); // 18. Return object. - return object; + return object.ptr(); } // 5.5.6 TemporalDateTimeToString ( isoYear, isoMonth, isoDay, hour, minute, second, millisecond, microsecond, nanosecond, calendar, precision, showCalendar ), https://tc39.es/proposal-temporal/#sec-temporal-temporaldatetimetostring diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDay.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDay.cpp index fce9dc46e5..d38bd18cd4 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDay.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDay.cpp @@ -167,10 +167,10 @@ ThrowCompletionOr create_temporal_month_day(VM& vm, u8 iso_month // 8. Set object.[[ISODay]] to isoDay. // 9. Set object.[[Calendar]] to calendar. // 10. Set object.[[ISOYear]] to referenceISOYear. - auto* object = TRY(ordinary_create_from_constructor(vm, *new_target, &Intrinsics::temporal_plain_month_day_prototype, iso_month, iso_day, reference_iso_year, calendar)); + auto object = TRY(ordinary_create_from_constructor(vm, *new_target, &Intrinsics::temporal_plain_month_day_prototype, iso_month, iso_day, reference_iso_year, calendar)); // 11. Return object. - return object; + return object.ptr(); } // 10.5.3 TemporalMonthDayToString ( monthDay, showCalendar ), https://tc39.es/proposal-temporal/#sec-temporal-temporalmonthdaytostring diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.cpp index 9bd34f226d..62928a8e1e 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.cpp @@ -331,10 +331,10 @@ ThrowCompletionOr create_temporal_time(VM& vm, u8 hour, u8 minute, u // 9. Set object.[[ISOMicrosecond]] to microsecond. // 10. Set object.[[ISONanosecond]] to nanosecond. // 11. Set object.[[Calendar]] to ! GetISO8601Calendar(). - auto* object = TRY(ordinary_create_from_constructor(vm, *new_target, &Intrinsics::temporal_plain_time_prototype, hour, minute, second, millisecond, microsecond, nanosecond, *get_iso8601_calendar(vm))); + auto object = TRY(ordinary_create_from_constructor(vm, *new_target, &Intrinsics::temporal_plain_time_prototype, hour, minute, second, millisecond, microsecond, nanosecond, *get_iso8601_calendar(vm))); // 12. Return object. - return object; + return object.ptr(); } // 4.5.8 ToTemporalTimeRecord ( temporalTimeLike [ , completeness ] ), https://tc39.es/proposal-temporal/#sec-temporal-totemporaltimerecord diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp index c0f89530c9..ae193cf14e 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp @@ -194,10 +194,10 @@ ThrowCompletionOr create_temporal_year_month(VM& vm, i32 iso_ye // 8. Set object.[[ISOMonth]] to isoMonth. // 9. Set object.[[Calendar]] to calendar. // 10. Set object.[[ISODay]] to referenceISODay. - auto* object = TRY(ordinary_create_from_constructor(vm, *new_target, &Intrinsics::temporal_plain_year_month_prototype, iso_year, iso_month, reference_iso_day, calendar)); + auto object = TRY(ordinary_create_from_constructor(vm, *new_target, &Intrinsics::temporal_plain_year_month_prototype, iso_year, iso_month, reference_iso_day, calendar)); // 11. Return object. - return object; + return object.ptr(); } // 9.5.6 TemporalYearMonthToString ( yearMonth, showCalendar ), https://tc39.es/proposal-temporal/#sec-temporal-temporalyearmonthtostring diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZone.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZone.cpp index 7d2878a93f..b20a243a69 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZone.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZone.cpp @@ -66,7 +66,7 @@ ThrowCompletionOr create_temporal_time_zone(VM& vm, DeprecatedString new_target = realm.intrinsics().temporal_time_zone_constructor(); // 2. Let object be ? OrdinaryCreateFromConstructor(newTarget, "%Temporal.TimeZone.prototype%", « [[InitializedTemporalTimeZone]], [[Identifier]], [[OffsetNanoseconds]] »). - auto* object = TRY(ordinary_create_from_constructor(vm, *new_target, &Intrinsics::temporal_time_zone_prototype)); + auto object = TRY(ordinary_create_from_constructor(vm, *new_target, &Intrinsics::temporal_time_zone_prototype)); // 3. If IsTimeZoneOffsetString(identifier) is true, then if (is_time_zone_offset_string(identifier)) { @@ -92,7 +92,7 @@ ThrowCompletionOr create_temporal_time_zone(VM& vm, DeprecatedString } // 5. Return object. - return object; + return object.ptr(); } // 11.6.2 GetISOPartsFromEpoch ( epochNanoseconds ), https://tc39.es/proposal-temporal/#sec-temporal-getisopartsfromepoch diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp index c67470cf57..5ac39db659 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp @@ -277,10 +277,10 @@ ThrowCompletionOr create_temporal_zoned_date_time(VM& vm, BigInt // 4. Set object.[[Nanoseconds]] to epochNanoseconds. // 5. Set object.[[TimeZone]] to timeZone. // 6. Set object.[[Calendar]] to calendar. - auto* object = TRY(ordinary_create_from_constructor(vm, *new_target, &Intrinsics::temporal_time_zone_prototype, epoch_nanoseconds, time_zone, calendar)); + auto object = TRY(ordinary_create_from_constructor(vm, *new_target, &Intrinsics::temporal_time_zone_prototype, epoch_nanoseconds, time_zone, calendar)); // 7. Return object. - return object; + return object.ptr(); } // 6.5.4 TemporalZonedDateTimeToString ( zonedDateTime, precision, showCalendar, showTimeZone, showOffset [ , increment, unit, roundingMode ] ), https://tc39.es/proposal-temporal/#sec-temporal-temporalzoneddatetimetostring diff --git a/Userland/Libraries/LibJS/Runtime/WeakMapConstructor.cpp b/Userland/Libraries/LibJS/Runtime/WeakMapConstructor.cpp index 509c9711e1..4c6007244b 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakMapConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/WeakMapConstructor.cpp @@ -41,10 +41,10 @@ ThrowCompletionOr WeakMapConstructor::construct(FunctionObject& new_tar { auto& vm = this->vm(); - auto* weak_map = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::weak_map_prototype)); + auto weak_map = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::weak_map_prototype)); if (vm.argument(0).is_nullish()) - return weak_map; + return weak_map.ptr(); auto adder = TRY(weak_map->get(vm.names.set)); if (!adder.is_function()) @@ -61,7 +61,7 @@ ThrowCompletionOr WeakMapConstructor::construct(FunctionObject& new_tar return {}; })); - return weak_map; + return weak_map.ptr(); } } diff --git a/Userland/Libraries/LibJS/Runtime/WeakRefConstructor.cpp b/Userland/Libraries/LibJS/Runtime/WeakRefConstructor.cpp index 2279138d6c..dc9b887baa 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakRefConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/WeakRefConstructor.cpp @@ -45,9 +45,9 @@ ThrowCompletionOr WeakRefConstructor::construct(FunctionObject& new_tar return vm.throw_completion(ErrorType::CannotBeHeldWeakly, target.to_string_without_side_effects()); if (target.is_object()) - return TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::weak_ref_prototype, target.as_object())); + return TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::weak_ref_prototype, target.as_object())).ptr(); VERIFY(target.is_symbol()); - return TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::weak_ref_prototype, target.as_symbol())); + return TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::weak_ref_prototype, target.as_symbol())).ptr(); } } diff --git a/Userland/Libraries/LibJS/Runtime/WeakSetConstructor.cpp b/Userland/Libraries/LibJS/Runtime/WeakSetConstructor.cpp index 1da38cdbfc..b3fda331e7 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakSetConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/WeakSetConstructor.cpp @@ -41,10 +41,10 @@ ThrowCompletionOr WeakSetConstructor::construct(FunctionObject& new_tar { auto& vm = this->vm(); - auto* weak_set = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::weak_set_prototype)); + auto weak_set = TRY(ordinary_create_from_constructor(vm, new_target, &Intrinsics::weak_set_prototype)); if (vm.argument(0).is_nullish()) - return weak_set; + return weak_set.ptr(); auto adder = TRY(weak_set->get(vm.names.add)); if (!adder.is_function()) @@ -55,7 +55,7 @@ ThrowCompletionOr WeakSetConstructor::construct(FunctionObject& new_tar return {}; })); - return weak_set; + return weak_set.ptr(); } }