mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
LibJS: Convert WrappedFunction::create() to NonnullGCPtr
This commit is contained in:
parent
54ebf71da2
commit
b90f505409
Notes:
sideshowbarker
2024-07-19 01:59:31 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/b90f505409 Pull-request: https://github.com/SerenityOS/serenity/pull/16479 Reviewed-by: https://github.com/davidot ✅
2 changed files with 3 additions and 3 deletions
|
@ -11,7 +11,7 @@
|
||||||
namespace JS {
|
namespace JS {
|
||||||
|
|
||||||
// 3.1.1 WrappedFunctionCreate ( callerRealm: a Realm Record, Target: a function object, ), https://tc39.es/proposal-shadowrealm/#sec-wrappedfunctioncreate
|
// 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();
|
auto& vm = realm.vm();
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ ThrowCompletionOr<WrappedFunction*> WrappedFunction::create(Realm& realm, Realm&
|
||||||
return vm.throw_completion<TypeError>(ErrorType::WrappedFunctionCopyNameAndLengthThrowCompletion);
|
return vm.throw_completion<TypeError>(ErrorType::WrappedFunctionCopyNameAndLengthThrowCompletion);
|
||||||
|
|
||||||
// 9. Return wrapped.
|
// 9. Return wrapped.
|
||||||
return wrapped;
|
return NonnullGCPtr { *wrapped };
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2 Wrapped Function Exotic Objects, https://tc39.es/proposal-shadowrealm/#sec-wrapped-function-exotic-objects
|
// 2 Wrapped Function Exotic Objects, https://tc39.es/proposal-shadowrealm/#sec-wrapped-function-exotic-objects
|
||||||
|
|
|
@ -15,7 +15,7 @@ class WrappedFunction final : public FunctionObject {
|
||||||
JS_OBJECT(WrappedFunction, FunctionObject);
|
JS_OBJECT(WrappedFunction, FunctionObject);
|
||||||
|
|
||||||
public:
|
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;
|
virtual ~WrappedFunction() = default;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue