summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp2
-rw-r--r--Userland/Libraries/LibJS/AST.cpp8
-rw-r--r--Userland/Libraries/LibJS/Bytecode/Op.cpp4
-rw-r--r--Userland/Libraries/LibJS/Runtime/Array.cpp8
-rw-r--r--Userland/Libraries/LibJS/Runtime/Array.h6
-rw-r--r--Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp10
-rw-r--r--Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp16
-rw-r--r--Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp2
-rw-r--r--Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp2
-rw-r--r--Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormat.cpp8
-rw-r--r--Userland/Libraries/LibJS/Runtime/Intl/DurationFormatPrototype.cpp2
-rw-r--r--Userland/Libraries/LibJS/Runtime/Intl/ListFormat.cpp2
-rw-r--r--Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp6
-rw-r--r--Userland/Libraries/LibJS/Runtime/Intl/PluralRulesPrototype.cpp2
-rw-r--r--Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.cpp4
-rw-r--r--Userland/Libraries/LibJS/Runtime/JSONObject.cpp2
-rw-r--r--Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp6
-rw-r--r--Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.cpp8
-rw-r--r--Userland/Libraries/LibJS/Runtime/ProxyObject.cpp4
-rw-r--r--Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp8
-rw-r--r--Userland/Libraries/LibJS/Runtime/StringPrototype.cpp2
-rw-r--r--Userland/Libraries/LibJS/Runtime/VM.cpp2
-rw-r--r--Userland/Libraries/LibWeb/Bindings/MainThreadVM.cpp2
-rw-r--r--Userland/Libraries/LibWeb/Fetch/HeadersIterator.cpp2
-rw-r--r--Userland/Services/WebContent/ConsoleGlobalEnvironmentExtensions.cpp2
25 files changed, 60 insertions, 60 deletions
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp
index 754b217a5f..b40d3b85a6 100644
--- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp
@@ -1429,7 +1429,7 @@ static void generate_wrap_statement(SourceGenerator& generator, DeprecatedString
auto& sequence_generic_type = verify_cast<IDL::ParameterizedType>(type);
scoped_generator.append(R"~~~(
- auto* new_array@recursion_depth@ = MUST(JS::Array::create(realm, 0));
+ auto new_array@recursion_depth@ = MUST(JS::Array::create(realm, 0));
)~~~");
if (!type.is_nullable()) {
diff --git a/Userland/Libraries/LibJS/AST.cpp b/Userland/Libraries/LibJS/AST.cpp
index 9ec75f5841..cf2192a3ec 100644
--- a/Userland/Libraries/LibJS/AST.cpp
+++ b/Userland/Libraries/LibJS/AST.cpp
@@ -3571,7 +3571,7 @@ Completion ArrayExpression::execute(Interpreter& interpreter) const
auto& realm = *vm.current_realm();
// 1. Let array be ! ArrayCreate(0).
- auto* array = MUST(Array::create(realm, 0));
+ auto array = MUST(Array::create(realm, 0));
// 2. Perform ? ArrayAccumulation of ElementList with arguments array and 0.
@@ -3736,10 +3736,10 @@ ThrowCompletionOr<Value> TaggedTemplateLiteral::get_template_object(Interpreter&
// 8. Let template be ! ArrayCreate(count).
// NOTE: We don't set count since we push the values using append which
// would then append after count. Same for 9.
- auto* template_ = MUST(Array::create(realm, 0));
+ auto template_ = MUST(Array::create(realm, 0));
// 9. Let rawObj be ! ArrayCreate(count).
- auto* raw_obj = MUST(Array::create(realm, 0));
+ auto raw_obj = MUST(Array::create(realm, 0));
// 10. Let index be 0.
// 11. Repeat, while index < count,
@@ -3775,7 +3775,7 @@ ThrowCompletionOr<Value> TaggedTemplateLiteral::get_template_object(Interpreter&
MUST(template_->set_integrity_level(Object::IntegrityLevel::Frozen));
// 15. Append the Record { [[Site]]: templateLiteral, [[Array]]: template } to templateRegistry.
- m_cached_values.set(&realm, make_handle(template_));
+ m_cached_values.set(&realm, make_handle(template_.ptr()));
// 16. Return template.
return template_;
diff --git a/Userland/Libraries/LibJS/Bytecode/Op.cpp b/Userland/Libraries/LibJS/Bytecode/Op.cpp
index 597053b145..e7bb2d1c7d 100644
--- a/Userland/Libraries/LibJS/Bytecode/Op.cpp
+++ b/Userland/Libraries/LibJS/Bytecode/Op.cpp
@@ -176,7 +176,7 @@ ThrowCompletionOr<void> NewBigInt::execute_impl(Bytecode::Interpreter& interpret
ThrowCompletionOr<void> NewArray::execute_impl(Bytecode::Interpreter& interpreter) const
{
- auto* array = MUST(Array::create(interpreter.realm(), 0));
+ auto array = MUST(Array::create(interpreter.realm(), 0));
for (size_t i = 0; i < m_element_count; i++) {
auto& value = interpreter.reg(Register(m_elements[0].index() + i));
array->indexed_properties().put(i, value, default_attributes);
@@ -273,7 +273,7 @@ ThrowCompletionOr<void> IteratorToArray::execute_impl(Bytecode::Interpreter& int
auto iterator_object = TRY(interpreter.accumulator().to_object(vm));
auto iterator = object_to_iterator(vm, *iterator_object);
- auto* array = MUST(Array::create(interpreter.realm(), 0));
+ auto array = MUST(Array::create(interpreter.realm(), 0));
size_t index = 0;
while (true) {
diff --git a/Userland/Libraries/LibJS/Runtime/Array.cpp b/Userland/Libraries/LibJS/Runtime/Array.cpp
index 5b7b7011b2..1d89d4f8d7 100644
--- a/Userland/Libraries/LibJS/Runtime/Array.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Array.cpp
@@ -17,7 +17,7 @@
namespace JS {
// 10.4.2.2 ArrayCreate ( length [ , proto ] ), https://tc39.es/ecma262/#sec-arraycreate
-ThrowCompletionOr<Array*> Array::create(Realm& realm, u64 length, Object* prototype)
+ThrowCompletionOr<NonnullGCPtr<Array>> Array::create(Realm& realm, u64 length, Object* prototype)
{
auto& vm = realm.vm();
@@ -38,14 +38,14 @@ ThrowCompletionOr<Array*> Array::create(Realm& realm, u64 length, Object* protot
MUST(array->internal_define_own_property(vm.names.length, { .value = Value(length), .writable = true, .enumerable = false, .configurable = false }));
// 7. Return A.
- return array;
+ return NonnullGCPtr { *array };
}
// 7.3.18 CreateArrayFromList ( elements ), https://tc39.es/ecma262/#sec-createarrayfromlist
-Array* Array::create_from(Realm& realm, Vector<Value> const& elements)
+NonnullGCPtr<Array> Array::create_from(Realm& realm, Vector<Value> const& elements)
{
// 1. Let array be ! ArrayCreate(0).
- auto* array = MUST(Array::create(realm, 0));
+ auto array = MUST(Array::create(realm, 0));
// 2. Let n be 0.
// 3. For each element e of elements, do
diff --git a/Userland/Libraries/LibJS/Runtime/Array.h b/Userland/Libraries/LibJS/Runtime/Array.h
index dd988309b7..77224c4f1b 100644
--- a/Userland/Libraries/LibJS/Runtime/Array.h
+++ b/Userland/Libraries/LibJS/Runtime/Array.h
@@ -21,11 +21,11 @@ class Array : public Object {
JS_OBJECT(Array, Object);
public:
- static ThrowCompletionOr<Array*> create(Realm&, u64 length, Object* prototype = nullptr);
- static Array* create_from(Realm&, Vector<Value> const&);
+ static ThrowCompletionOr<NonnullGCPtr<Array>> create(Realm&, u64 length, Object* prototype = nullptr);
+ static NonnullGCPtr<Array> create_from(Realm&, Vector<Value> const&);
// Non-standard but equivalent to CreateArrayFromList.
template<typename T>
- static Array* create_from(Realm& realm, Span<T const> elements, Function<Value(T const&)> map_fn)
+ static NonnullGCPtr<Array> create_from(Realm& realm, Span<T const> elements, Function<Value(T const&)> map_fn)
{
auto values = MarkedVector<Value> { realm.heap() };
values.ensure_capacity(elements.size());
diff --git a/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp
index 7dc7110f6b..74fcdc0012 100644
--- a/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp
+++ b/Userland/Libraries/LibJS/Runtime/ArrayConstructor.cpp
@@ -55,11 +55,11 @@ ThrowCompletionOr<Object*> ArrayConstructor::construct(FunctionObject& new_targe
auto* proto = TRY(get_prototype_from_constructor(vm, new_target, &Intrinsics::array_prototype));
if (vm.argument_count() == 0)
- return MUST(Array::create(realm, 0, proto));
+ return MUST(Array::create(realm, 0, proto)).ptr();
if (vm.argument_count() == 1) {
auto length = vm.argument(0);
- auto* array = MUST(Array::create(realm, 0, proto));
+ auto array = MUST(Array::create(realm, 0, proto));
size_t int_length;
if (!length.is_number()) {
MUST(array->create_data_property_or_throw(0, length));
@@ -70,15 +70,15 @@ ThrowCompletionOr<Object*> ArrayConstructor::construct(FunctionObject& new_targe
return vm.throw_completion<RangeError>(ErrorType::InvalidLength, "array");
}
TRY(array->set(vm.names.length, Value(int_length), Object::ShouldThrowExceptions::Yes));
- return array;
+ return array.ptr();
}
- auto* array = TRY(Array::create(realm, vm.argument_count(), proto));
+ auto array = TRY(Array::create(realm, vm.argument_count(), proto));
for (size_t k = 0; k < vm.argument_count(); ++k)
MUST(array->create_data_property_or_throw(k, vm.argument(k)));
- return array;
+ return array.ptr();
}
// 23.1.2.1 Array.from ( items [ , mapfn [ , thisArg ] ] ), https://tc39.es/ecma262/#sec-array.from
diff --git a/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp
index 7f8325ec21..aeab875a0d 100644
--- a/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp
+++ b/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp
@@ -120,7 +120,7 @@ static ThrowCompletionOr<Object*> array_species_create(VM& vm, Object& original_
auto is_array = TRY(Value(&original_array).is_array(vm));
if (!is_array)
- return TRY(Array::create(realm, length));
+ return TRY(Array::create(realm, length)).ptr();
auto constructor = TRY(original_array.get(vm.names.constructor));
if (constructor.is_constructor()) {
@@ -140,7 +140,7 @@ static ThrowCompletionOr<Object*> array_species_create(VM& vm, Object& original_
}
if (constructor.is_undefined())
- return TRY(Array::create(realm, length));
+ return TRY(Array::create(realm, length)).ptr();
if (!constructor.is_constructor())
return vm.throw_completion<TypeError>(ErrorType::NotAConstructor, constructor.to_string_without_side_effects());
@@ -796,7 +796,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayPrototype::group)
// 8. For each Record { [[Key]], [[Elements]] } g of groups, do
for (auto& group : groups) {
// a. Let elements be CreateArrayFromList(g.[[Elements]]).
- auto* elements = Array::create_from(realm, group.value);
+ auto elements = Array::create_from(realm, group.value);
// b. Perform ! CreateDataPropertyOrThrow(obj, g.[[Key]], elements).
MUST(object->create_data_property_or_throw(group.key, elements));
@@ -868,7 +868,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayPrototype::group_to_map)
// 8. For each Record { [[Key]], [[Elements]] } g of groups, do
for (auto& group : groups) {
// a. Let elements be CreateArrayFromList(g.[[Elements]]).
- auto* elements = Array::create_from(realm, group.value);
+ auto elements = Array::create_from(realm, group.value);
// b. Let entry be the Record { [[Key]]: g.[[Key]], [[Value]]: elements }.
// c. Append entry as the last element of map.[[MapData]].
@@ -1758,7 +1758,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayPrototype::to_reversed)
auto length = TRY(length_of_array_like(vm, *object));
// 3. Let A be ? ArrayCreate(𝔽(len)).
- auto* array = TRY(Array::create(realm, length));
+ auto array = TRY(Array::create(realm, length));
// 4. Let k be 0.
// 5. Repeat, while k < len,
@@ -1800,7 +1800,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayPrototype::to_sorted)
auto length = TRY(length_of_array_like(vm, *object));
// 4. Let A be ? ArrayCreate(𝔽(len)).
- auto* array = TRY(Array::create(realm, length));
+ auto array = TRY(Array::create(realm, length));
// 5. Let SortCompare be a new Abstract Closure with parameters (x, y) that captures comparefn and performs the following steps when called:
Function<ThrowCompletionOr<double>(Value, Value)> sort_compare = [&](auto x, auto y) -> ThrowCompletionOr<double> {
@@ -1893,7 +1893,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayPrototype::to_spliced)
auto new_length = static_cast<u64>(new_length_double);
// 13. Let A be ? ArrayCreate(𝔽(newLen)).
- auto* array = TRY(Array::create(realm, new_length));
+ auto array = TRY(Array::create(realm, new_length));
// 14. Let i be 0.
size_t i = 0;
@@ -2047,7 +2047,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayPrototype::with)
return vm.throw_completion<RangeError>(ErrorType::IndexOutOfRange, actual_index, length);
// 7. Let A be ? ArrayCreate(𝔽(len)).
- auto* array = TRY(Array::create(realm, length));
+ auto array = TRY(Array::create(realm, length));
// 8. Let k be 0.
// 9. Repeat, while k < len,
diff --git a/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp b/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp
index 9d65077b9c..451cafc04e 100644
--- a/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp
+++ b/Userland/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp
@@ -441,7 +441,7 @@ ThrowCompletionOr<void> ECMAScriptFunctionObject::function_declaration_instantia
[&](auto const& param) -> ThrowCompletionOr<void> {
Value argument_value;
if (parameter.is_rest) {
- auto* array = MUST(Array::create(realm, 0));
+ auto array = MUST(Array::create(realm, 0));
for (size_t rest_index = i; rest_index < execution_context_arguments.size(); ++rest_index)
array->indexed_properties().append(execution_context_arguments[rest_index]);
argument_value = array;
diff --git a/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp
index 0d635f20c6..55b275cc2e 100644
--- a/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp
@@ -589,7 +589,7 @@ ThrowCompletionOr<Array*> supported_locales(VM& vm, Vector<DeprecatedString> con
}
// 5. Return CreateArrayFromList(supportedLocales).
- return Array::create_from<DeprecatedString>(realm, supported_locales, [&vm](auto& locale) { return PrimitiveString::create(vm, locale); });
+ return Array::create_from<DeprecatedString>(realm, supported_locales, [&vm](auto& locale) { return PrimitiveString::create(vm, locale); }).ptr();
}
// 9.2.12 CoerceOptionsToObject ( options ), https://tc39.es/ecma402/#sec-coerceoptionstoobject
diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormat.cpp
index 82bdc14222..672f04d7ef 100644
--- a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormat.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormat.cpp
@@ -857,7 +857,7 @@ ThrowCompletionOr<Array*> format_date_time_to_parts(VM& vm, DateTimeFormat& date
auto parts = TRY(partition_date_time_pattern(vm, date_time_format, time));
// 2. Let result be ! ArrayCreate(0).
- auto* result = MUST(Array::create(realm, 0));
+ auto result = MUST(Array::create(realm, 0));
// 3. Let n be 0.
size_t n = 0;
@@ -881,7 +881,7 @@ ThrowCompletionOr<Array*> format_date_time_to_parts(VM& vm, DateTimeFormat& date
}
// 5. Return result.
- return result;
+ return result.ptr();
}
template<typename Callback>
@@ -1173,7 +1173,7 @@ ThrowCompletionOr<Array*> format_date_time_range_to_parts(VM& vm, DateTimeFormat
auto parts = TRY(partition_date_time_range_pattern(vm, date_time_format, start, end));
// 2. Let result be ! ArrayCreate(0).
- auto* result = MUST(Array::create(realm, 0));
+ auto result = MUST(Array::create(realm, 0));
// 3. Let n be 0.
size_t n = 0;
@@ -1200,7 +1200,7 @@ ThrowCompletionOr<Array*> format_date_time_range_to_parts(VM& vm, DateTimeFormat
}
// 5. Return result.
- return result;
+ return result.ptr();
}
// 11.5.13 ToLocalTime ( epochNs, calendar, timeZone ), https://tc39.es/ecma402/#sec-tolocaltime
diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatPrototype.cpp
index 166f97d3a5..8712ffdc85 100644
--- a/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatPrototype.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Intl/DurationFormatPrototype.cpp
@@ -82,7 +82,7 @@ JS_DEFINE_NATIVE_FUNCTION(DurationFormatPrototype::format_to_parts)
auto parts = partition_duration_format_pattern(vm, *duration_format, record);
// 6. Let result be ! ArrayCreate(0).
- auto* result = MUST(Array::create(realm, 0));
+ auto result = MUST(Array::create(realm, 0));
// 7. Let n be 0.
// 8. For each { [[Type]], [[Value]] } part in parts, do
diff --git a/Userland/Libraries/LibJS/Runtime/Intl/ListFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/ListFormat.cpp
index 7f1bd1a594..4f030e1955 100644
--- a/Userland/Libraries/LibJS/Runtime/Intl/ListFormat.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Intl/ListFormat.cpp
@@ -209,7 +209,7 @@ Array* format_list_to_parts(VM& vm, ListFormat const& list_format, Vector<Deprec
auto parts = create_parts_from_list(list_format, list);
// 2. Let result be ! ArrayCreate(0).
- auto* result = MUST(Array::create(realm, 0));
+ auto result = MUST(Array::create(realm, 0));
// 3. Let n be 0.
size_t n = 0;
diff --git a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp
index 3f9b643d33..cad3bb1d1e 100644
--- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp
@@ -914,7 +914,7 @@ Array* format_numeric_to_parts(VM& vm, NumberFormat& number_format, Mathematical
auto parts = partition_number_pattern(vm, number_format, move(number));
// 2. Let result be ! ArrayCreate(0).
- auto* result = MUST(Array::create(realm, 0));
+ auto result = MUST(Array::create(realm, 0));
// 3. Let n be 0.
size_t n = 0;
@@ -1824,7 +1824,7 @@ ThrowCompletionOr<Array*> format_numeric_range_to_parts(VM& vm, NumberFormat& nu
auto parts = TRY(partition_number_range_pattern(vm, number_format, move(start), move(end)));
// 2. Let result be ! ArrayCreate(0).
- auto* result = MUST(Array::create(realm, 0));
+ auto result = MUST(Array::create(realm, 0));
// 3. Let n be 0.
size_t n = 0;
@@ -1851,7 +1851,7 @@ ThrowCompletionOr<Array*> format_numeric_range_to_parts(VM& vm, NumberFormat& nu
}
// 5. Return result.
- return result;
+ return result.ptr();
}
}
diff --git a/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesPrototype.cpp
index 7fe8279c04..0c2c1401ad 100644
--- a/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesPrototype.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Intl/PluralRulesPrototype.cpp
@@ -108,7 +108,7 @@ JS_DEFINE_NATIVE_FUNCTION(PluralRulesPrototype::resolved_options)
// 5. Let pluralCategories be a List of Strings containing all possible results of PluralRuleSelect for the selected locale pr.[[Locale]].
auto available_categories = ::Locale::available_plural_categories(plural_rules->locale(), plural_rules->type());
- auto* plural_categories = Array::create_from<::Locale::PluralCategory>(realm, available_categories, [&](auto category) {
+ auto plural_categories = Array::create_from<::Locale::PluralCategory>(realm, available_categories, [&](auto category) {
return PrimitiveString::create(vm, ::Locale::plural_category_to_string(category));
});
diff --git a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.cpp
index 3b34526877..74c45c4e45 100644
--- a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.cpp
@@ -249,7 +249,7 @@ ThrowCompletionOr<Array*> format_relative_time_to_parts(VM& vm, RelativeTimeForm
auto parts = TRY(partition_relative_time_pattern(vm, relative_time_format, value, unit));
// 2. Let result be ! ArrayCreate(0).
- auto* result = MUST(Array::create(realm, 0));
+ auto result = MUST(Array::create(realm, 0));
// 3. Let n be 0.
size_t n = 0;
@@ -279,7 +279,7 @@ ThrowCompletionOr<Array*> format_relative_time_to_parts(VM& vm, RelativeTimeForm
}
// 5. Return result.
- return result;
+ return result.ptr();
}
}
diff --git a/Userland/Libraries/LibJS/Runtime/JSONObject.cpp b/Userland/Libraries/LibJS/Runtime/JSONObject.cpp
index 489d6f04e3..1d6437eb7f 100644
--- a/Userland/Libraries/LibJS/Runtime/JSONObject.cpp
+++ b/Userland/Libraries/LibJS/Runtime/JSONObject.cpp
@@ -441,7 +441,7 @@ Object* JSONObject::parse_json_object(VM& vm, JsonObject const& json_object)
Array* JSONObject::parse_json_array(VM& vm, JsonArray const& json_array)
{
auto& realm = *vm.current_realm();
- auto* array = MUST(Array::create(realm, 0));
+ auto array = MUST(Array::create(realm, 0));
size_t index = 0;
json_array.for_each([&](auto& value) {
array->define_direct_property(index++, parse_json_value(vm, value), default_attributes);
diff --git a/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp b/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp
index 05a340b567..7aab263eb6 100644
--- a/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp
+++ b/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp
@@ -121,7 +121,7 @@ static ThrowCompletionOr<Value> perform_promise_all(VM& vm, Iterator& iterator_r
vm, iterator_record, constructor, result_capability, promise_resolve,
[&](PromiseValueList& values) -> ThrowCompletionOr<Value> {
// 1. Let valuesArray be CreateArrayFromList(values).
- auto* values_array = Array::create_from(realm, values.values());
+ auto values_array = Array::create_from(realm, values.values());
// 2. Perform ? Call(resultCapability.[[Resolve]], undefined, « valuesArray »).
TRY(call(vm, *result_capability.resolve(), js_undefined(), values_array));
@@ -154,7 +154,7 @@ static ThrowCompletionOr<Value> perform_promise_all_settled(VM& vm, Iterator& it
return perform_promise_common(
vm, iterator_record, constructor, result_capability, promise_resolve,
[&](PromiseValueList& values) -> ThrowCompletionOr<Value> {
- auto* values_array = Array::create_from(realm, values.values());
+ auto values_array = Array::create_from(realm, values.values());
TRY(call(vm, *result_capability.resolve(), js_undefined(), values_array));
@@ -201,7 +201,7 @@ static ThrowCompletionOr<Value> perform_promise_any(VM& vm, Iterator& iterator_r
auto error = AggregateError::create(realm);
// 2. Perform ! DefinePropertyOrThrow(error, "errors", PropertyDescriptor { [[Configurable]]: true, [[Enumerable]]: false, [[Writable]]: true, [[Value]]: CreateArrayFromList(errors) }).
- auto* errors_array = Array::create_from(realm, errors.values());
+ auto errors_array = Array::create_from(realm, errors.values());
MUST(error->define_property_or_throw(vm.names.errors, { .value = errors_array, .writable = true, .enumerable = false, .configurable = true }));
// 3. Return ThrowCompletion(error).
diff --git a/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.cpp b/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.cpp
index c277ab9d19..a03622d70b 100644
--- a/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.cpp
+++ b/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.cpp
@@ -75,7 +75,7 @@ ThrowCompletionOr<Value> PromiseAllResolveElementFunction::resolve_element()
// 10. If remainingElementsCount.[[Value]] is 0, then
if (--m_remaining_elements.value == 0) {
// a. Let valuesArray be CreateArrayFromList(values).
- auto* values_array = Array::create_from(realm, m_values.values());
+ auto values_array = Array::create_from(realm, m_values.values());
// b. Return ? Call(promiseCapability.[[Resolve]], undefined, « valuesArray »).
return JS::call(vm, *m_capability->resolve(), js_undefined(), values_array);
@@ -116,7 +116,7 @@ ThrowCompletionOr<Value> PromiseAllSettledResolveElementFunction::resolve_elemen
// 14. If remainingElementsCount.[[Value]] is 0, then
if (--m_remaining_elements.value == 0) {
// a. Let valuesArray be CreateArrayFromList(values).
- auto* values_array = Array::create_from(realm, m_values.values());
+ auto values_array = Array::create_from(realm, m_values.values());
// b. Return ? Call(promiseCapability.[[Resolve]], undefined, « valuesArray »).
return JS::call(vm, *m_capability->resolve(), js_undefined(), values_array);
@@ -157,7 +157,7 @@ ThrowCompletionOr<Value> PromiseAllSettledRejectElementFunction::resolve_element
// 14. If remainingElementsCount.[[Value]] is 0, then
if (--m_remaining_elements.value == 0) {
// a. Let valuesArray be CreateArrayFromList(values).
- auto* values_array = Array::create_from(realm, m_values.values());
+ auto values_array = Array::create_from(realm, m_values.values());
// b. Return ? Call(promiseCapability.[[Resolve]], undefined, « valuesArray »).
return JS::call(vm, *m_capability->resolve(), js_undefined(), values_array);
@@ -192,7 +192,7 @@ ThrowCompletionOr<Value> PromiseAnyRejectElementFunction::resolve_element()
auto error = AggregateError::create(realm);
// b. Perform ! DefinePropertyOrThrow(error, "errors", PropertyDescriptor { [[Configurable]]: true, [[Enumerable]]: false, [[Writable]]: true, [[Value]]: CreateArrayFromList(errors) }).
- auto* errors_array = Array::create_from(realm, m_values.values());
+ auto errors_array = Array::create_from(realm, m_values.values());
MUST(error->define_property_or_throw(vm.names.errors, { .value = errors_array, .writable = true, .enumerable = false, .configurable = true }));
// c. Return ? Call(promiseCapability.[[Reject]], undefined, « error »).
diff --git a/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp b/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp
index e09167a824..a1efa6326e 100644
--- a/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp
+++ b/Userland/Libraries/LibJS/Runtime/ProxyObject.cpp
@@ -767,7 +767,7 @@ ThrowCompletionOr<Value> ProxyObject::internal_call(Value this_argument, MarkedV
}
// 7. Let argArray be CreateArrayFromList(argumentsList).
- auto* arguments_array = Array::create_from(realm, arguments_list);
+ auto arguments_array = Array::create_from(realm, arguments_list);
// 8. Return ? Call(trap, handler, « target, thisArgument, argArray »).
return call(vm, trap, &m_handler, &m_target, this_argument, arguments_array);
@@ -812,7 +812,7 @@ ThrowCompletionOr<Object*> ProxyObject::internal_construct(MarkedVector<Value> a
}
// 8. Let argArray be CreateArrayFromList(argumentsList).
- auto* arguments_array = Array::create_from(realm, arguments_list);
+ auto arguments_array = Array::create_from(realm, arguments_list);
// 9. Let newObj be ? Call(trap, handler, « target, argArray, newTarget »).
auto new_object = TRY(call(vm, trap, &m_handler, &m_target, arguments_array, &new_target));
diff --git a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp
index dcbd064cc3..06cbbba499 100644
--- a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp
+++ b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp
@@ -121,7 +121,7 @@ static Value make_match_indices_index_pair_array(VM& vm, Utf16View const& string
// 4. NOTE: The groupNames List contains elements aligned with the indices List starting at indices[1].
// 5. Set A to ! ArrayCreate(n).
- auto* array = MUST(Array::create(realm, indices.size()));
+ auto array = MUST(Array::create(realm, indices.size()));
// 6. If hasGroups is true, then
// a. Let groups be ! ObjectCreate(null).
@@ -253,7 +253,7 @@ static ThrowCompletionOr<Value> regexp_builtin_exec(VM& vm, RegExpObject& regexp
VERIFY(result.n_named_capture_groups < NumericLimits<u32>::max());
// 19. Let A be ! ArrayCreate(n + 1).
- auto* array = MUST(Array::create(realm, result.n_named_capture_groups + 1));
+ auto array = MUST(Array::create(realm, result.n_named_capture_groups + 1));
// 20. Assert: The mathematical value of A's "length" property is n + 1.
@@ -546,7 +546,7 @@ JS_DEFINE_NATIVE_FUNCTION(RegExpPrototype::symbol_match)
TRY(regexp_object->set(vm.names.lastIndex, Value(0), Object::ShouldThrowExceptions::Yes));
// c. Let A be ! ArrayCreate(0).
- auto* array = MUST(Array::create(realm, 0));
+ auto array = MUST(Array::create(realm, 0));
// d. Let n be 0.
size_t n = 0;
@@ -926,7 +926,7 @@ JS_DEFINE_NATIVE_FUNCTION(RegExpPrototype::symbol_split)
auto* splitter = TRY(construct(vm, *constructor, regexp_object, PrimitiveString::create(vm, move(new_flags))));
// 11. Let A be ! ArrayCreate(0).
- auto* array = MUST(Array::create(realm, 0));
+ auto array = MUST(Array::create(realm, 0));
// 12. Let lengthA be 0.
size_t array_length = 0;
diff --git a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp
index 45adc0ec27..5d28808b2b 100644
--- a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp
+++ b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp
@@ -757,7 +757,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::split)
auto string = TRY(object.to_utf16_string(vm));
- auto* array = MUST(Array::create(realm, 0));
+ auto array = MUST(Array::create(realm, 0));
size_t array_length = 0;
auto limit = NumericLimits<u32>::max();
diff --git a/Userland/Libraries/LibJS/Runtime/VM.cpp b/Userland/Libraries/LibJS/Runtime/VM.cpp
index 626e6f5219..9b91ad1442 100644
--- a/Userland/Libraries/LibJS/Runtime/VM.cpp
+++ b/Userland/Libraries/LibJS/Runtime/VM.cpp
@@ -431,7 +431,7 @@ ThrowCompletionOr<void> VM::iterator_binding_initialization(BindingPattern const
VERIFY(i == binding.entries.size() - 1);
// 2. Let A be ! ArrayCreate(0).
- auto* array = MUST(Array::create(realm, 0));
+ auto array = MUST(Array::create(realm, 0));
// 3. Let n be 0.
// 4. Repeat,
diff --git a/Userland/Libraries/LibWeb/Bindings/MainThreadVM.cpp b/Userland/Libraries/LibWeb/Bindings/MainThreadVM.cpp
index c57622217e..b3335506dd 100644
--- a/Userland/Libraries/LibWeb/Bindings/MainThreadVM.cpp
+++ b/Userland/Libraries/LibWeb/Bindings/MainThreadVM.cpp
@@ -443,7 +443,7 @@ void queue_mutation_observer_microtask(DOM::Document& document)
auto& callback = mutation_observer->callback();
auto& realm = callback.callback_context.realm();
- auto* wrapped_records = MUST(JS::Array::create(realm, 0));
+ auto wrapped_records = MUST(JS::Array::create(realm, 0));
for (size_t i = 0; i < records.size(); ++i) {
auto& record = records.at(i);
auto property_index = JS::PropertyKey { i };
diff --git a/Userland/Libraries/LibWeb/Fetch/HeadersIterator.cpp b/Userland/Libraries/LibWeb/Fetch/HeadersIterator.cpp
index 00afcce5bf..0afc37b487 100644
--- a/Userland/Libraries/LibWeb/Fetch/HeadersIterator.cpp
+++ b/Userland/Libraries/LibWeb/Fetch/HeadersIterator.cpp
@@ -57,7 +57,7 @@ JS::ThrowCompletionOr<JS::Object*> HeadersIterator::next()
case JS::Object::PropertyKind::Value:
return create_iterator_result_object(vm(), JS::PrimitiveString::create(vm(), StringView { pair.value }), false);
case JS::Object::PropertyKind::KeyAndValue: {
- auto* array = JS::Array::create_from(realm(), { JS::PrimitiveString::create(vm(), StringView { pair.name }), JS::PrimitiveString::create(vm(), StringView { pair.value }) });
+ auto array = JS::Array::create_from(realm(), { JS::PrimitiveString::create(vm(), StringView { pair.name }), JS::PrimitiveString::create(vm(), StringView { pair.value }) });
return create_iterator_result_object(vm(), array, false);
}
default:
diff --git a/Userland/Services/WebContent/ConsoleGlobalEnvironmentExtensions.cpp b/Userland/Services/WebContent/ConsoleGlobalEnvironmentExtensions.cpp
index 3377b1a4fe..fa9f792f4c 100644
--- a/Userland/Services/WebContent/ConsoleGlobalEnvironmentExtensions.cpp
+++ b/Userland/Services/WebContent/ConsoleGlobalEnvironmentExtensions.cpp
@@ -109,7 +109,7 @@ JS_DEFINE_NATIVE_FUNCTION(ConsoleGlobalEnvironmentExtensions::$$_function)
return element->query_selector_all(selector);
}));
- auto* array = TRY(JS::Array::create(*vm.current_realm(), node_list->length()));
+ auto array = TRY(JS::Array::create(*vm.current_realm(), node_list->length()));
for (auto i = 0u; i < node_list->length(); ++i) {
TRY(array->create_data_property_or_throw(i, node_list->item_value(i)));
}