summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibJS')
-rw-r--r--Userland/Libraries/LibJS/Runtime/AggregateError.cpp4
-rw-r--r--Userland/Libraries/LibJS/Runtime/AggregateError.h4
-rw-r--r--Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp2
-rw-r--r--Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.cpp2
4 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/AggregateError.cpp b/Userland/Libraries/LibJS/Runtime/AggregateError.cpp
index db5a12cf57..8ad7773c5b 100644
--- a/Userland/Libraries/LibJS/Runtime/AggregateError.cpp
+++ b/Userland/Libraries/LibJS/Runtime/AggregateError.cpp
@@ -10,9 +10,9 @@
namespace JS {
-AggregateError* AggregateError::create(Realm& realm)
+NonnullGCPtr<AggregateError> AggregateError::create(Realm& realm)
{
- return realm.heap().allocate<AggregateError>(realm, *realm.intrinsics().aggregate_error_prototype());
+ return *realm.heap().allocate<AggregateError>(realm, *realm.intrinsics().aggregate_error_prototype());
}
AggregateError::AggregateError(Object& prototype)
diff --git a/Userland/Libraries/LibJS/Runtime/AggregateError.h b/Userland/Libraries/LibJS/Runtime/AggregateError.h
index d1ff1af061..6b295287e1 100644
--- a/Userland/Libraries/LibJS/Runtime/AggregateError.h
+++ b/Userland/Libraries/LibJS/Runtime/AggregateError.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Linus Groh <linusg@serenityos.org>
+ * Copyright (c) 2021-2022, Linus Groh <linusg@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -15,7 +15,7 @@ class AggregateError : public Error {
JS_OBJECT(AggregateError, Error);
public:
- static AggregateError* create(Realm&);
+ static NonnullGCPtr<AggregateError> create(Realm&);
virtual ~AggregateError() override = default;
private:
diff --git a/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp b/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp
index 4a3b735c82..05a340b567 100644
--- a/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp
+++ b/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp
@@ -198,7 +198,7 @@ static ThrowCompletionOr<Value> perform_promise_any(VM& vm, Iterator& iterator_r
vm, iterator_record, constructor, result_capability, promise_resolve,
[&](PromiseValueList& errors) -> ThrowCompletionOr<Value> {
// 1. Let error be a newly created AggregateError object.
- auto* error = AggregateError::create(realm);
+ 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());
diff --git a/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.cpp b/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.cpp
index ce8de8dcbb..c277ab9d19 100644
--- a/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.cpp
+++ b/Userland/Libraries/LibJS/Runtime/PromiseResolvingElementFunctions.cpp
@@ -189,7 +189,7 @@ ThrowCompletionOr<Value> PromiseAnyRejectElementFunction::resolve_element()
// 10. If remainingElementsCount.[[Value]] is 0, then
if (--m_remaining_elements.value == 0) {
// a. Let error be a newly created AggregateError object.
- auto* error = AggregateError::create(realm);
+ 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());