diff options
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/WrappedFunction.cpp | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/WrappedFunction.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/WrappedFunction.cpp b/Userland/Libraries/LibJS/Runtime/WrappedFunction.cpp index 31d020511d..3400c5a489 100644 --- a/Userland/Libraries/LibJS/Runtime/WrappedFunction.cpp +++ b/Userland/Libraries/LibJS/Runtime/WrappedFunction.cpp @@ -11,7 +11,7 @@ namespace JS { // 3.1.1 WrappedFunctionCreate ( callerRealm: a Realm Record, Target: a function object, ), https://tc39.es/proposal-shadowrealm/#sec-wrappedfunctioncreate -ThrowCompletionOr<WrappedFunction*> WrappedFunction::create(Realm& realm, Realm& caller_realm, FunctionObject& target) +ThrowCompletionOr<NonnullGCPtr<WrappedFunction>> WrappedFunction::create(Realm& realm, Realm& caller_realm, FunctionObject& target) { auto& vm = realm.vm(); @@ -32,7 +32,7 @@ ThrowCompletionOr<WrappedFunction*> WrappedFunction::create(Realm& realm, Realm& return vm.throw_completion<TypeError>(ErrorType::WrappedFunctionCopyNameAndLengthThrowCompletion); // 9. Return wrapped. - return wrapped; + return NonnullGCPtr { *wrapped }; } // 2 Wrapped Function Exotic Objects, https://tc39.es/proposal-shadowrealm/#sec-wrapped-function-exotic-objects diff --git a/Userland/Libraries/LibJS/Runtime/WrappedFunction.h b/Userland/Libraries/LibJS/Runtime/WrappedFunction.h index 4cc6c98d86..555835327d 100644 --- a/Userland/Libraries/LibJS/Runtime/WrappedFunction.h +++ b/Userland/Libraries/LibJS/Runtime/WrappedFunction.h @@ -15,7 +15,7 @@ class WrappedFunction final : public FunctionObject { JS_OBJECT(WrappedFunction, FunctionObject); public: - static ThrowCompletionOr<WrappedFunction*> create(Realm&, Realm& caller_realm, FunctionObject& target_function); + static ThrowCompletionOr<NonnullGCPtr<WrappedFunction>> create(Realm&, Realm& caller_realm, FunctionObject& target_function); virtual ~WrappedFunction() = default; |