diff options
author | Linus Groh <mail@linusgroh.de> | 2022-12-14 19:18:10 +0000 |
---|---|---|
committer | Tim Flynn <trflynn89@pm.me> | 2022-12-15 06:56:37 -0500 |
commit | 6ae79a84df4ded7d3580a60fce5d1fa6e1ffd44d (patch) | |
tree | 1892be6fec1f014c02524918922abe70691f69ed /Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp | |
parent | 03acbf0beba6e7c07124742ab61918f712af7088 (diff) | |
download | serenity-6ae79a84df4ded7d3580a60fce5d1fa6e1ffd44d.zip |
LibJS: Convert Object::construct() to NonnullGCPtr
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp index 18e9440717..b2b10d1665 100644 --- a/Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp @@ -35,7 +35,7 @@ ThrowCompletionOr<Value> ErrorConstructor::call() } // 20.5.1.1 Error ( message [ , options ] ), https://tc39.es/ecma262/#sec-error-message -ThrowCompletionOr<Object*> ErrorConstructor::construct(FunctionObject& new_target) +ThrowCompletionOr<NonnullGCPtr<Object>> ErrorConstructor::construct(FunctionObject& new_target) { auto& vm = this->vm(); @@ -58,7 +58,7 @@ ThrowCompletionOr<Object*> ErrorConstructor::construct(FunctionObject& new_targe TRY(error->install_error_cause(options)); // 5. Return O. - return error.ptr(); + return error; } #define __JS_ENUMERATE(ClassName, snake_name, PrototypeName, ConstructorName, ArrayType) \ @@ -88,7 +88,7 @@ ThrowCompletionOr<Object*> ErrorConstructor::construct(FunctionObject& new_targe } \ \ /* 20.5.6.1.1 NativeError ( message [ , options ] ), https://tc39.es/ecma262/#sec-nativeerror */ \ - ThrowCompletionOr<Object*> ConstructorName::construct(FunctionObject& new_target) \ + ThrowCompletionOr<NonnullGCPtr<Object>> ConstructorName::construct(FunctionObject& new_target) \ { \ auto& vm = this->vm(); \ \ @@ -111,7 +111,7 @@ ThrowCompletionOr<Object*> ErrorConstructor::construct(FunctionObject& new_targe TRY(error->install_error_cause(options)); \ \ /* 5. Return O. */ \ - return error.ptr(); \ + return error; \ } JS_ENUMERATE_NATIVE_ERRORS |