mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
LibJS: Convert BooleanObject::create() to NonnullGCPtr
This commit is contained in:
parent
cf0a24ff0c
commit
b48fa8756f
Notes:
sideshowbarker
2024-07-17 03:18:30 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/b48fa8756f Pull-request: https://github.com/SerenityOS/serenity/pull/16479 Reviewed-by: https://github.com/davidot ✅
3 changed files with 4 additions and 4 deletions
|
@ -9,9 +9,9 @@
|
|||
|
||||
namespace JS {
|
||||
|
||||
BooleanObject* BooleanObject::create(Realm& realm, bool value)
|
||||
NonnullGCPtr<BooleanObject> BooleanObject::create(Realm& realm, bool value)
|
||||
{
|
||||
return realm.heap().allocate<BooleanObject>(realm, value, *realm.intrinsics().boolean_prototype());
|
||||
return *realm.heap().allocate<BooleanObject>(realm, value, *realm.intrinsics().boolean_prototype());
|
||||
}
|
||||
|
||||
BooleanObject::BooleanObject(bool value, Object& prototype)
|
||||
|
|
|
@ -14,7 +14,7 @@ class BooleanObject : public Object {
|
|||
JS_OBJECT(BooleanObject, Object);
|
||||
|
||||
public:
|
||||
static BooleanObject* create(Realm&, bool);
|
||||
static NonnullGCPtr<BooleanObject> create(Realm&, bool);
|
||||
|
||||
virtual ~BooleanObject() override = default;
|
||||
|
||||
|
|
|
@ -536,7 +536,7 @@ ThrowCompletionOr<Object*> Value::to_object(VM& vm) const
|
|||
// Boolean
|
||||
case BOOLEAN_TAG:
|
||||
// Return a new Boolean object whose [[BooleanData]] internal slot is set to argument. See 20.3 for a description of Boolean objects.
|
||||
return BooleanObject::create(realm, as_bool());
|
||||
return BooleanObject::create(realm, as_bool()).ptr();
|
||||
// String
|
||||
case STRING_TAG:
|
||||
// Return a new String object whose [[StringData]] internal slot is set to argument. See 22.1 for a description of String objects.
|
||||
|
|
Loading…
Reference in a new issue