mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:17:34 +00:00
LibJS: Convert BooleanObject::create() to NonnullGCPtr
This commit is contained in:
parent
cf0a24ff0c
commit
b48fa8756f
3 changed files with 4 additions and 4 deletions
|
@ -9,9 +9,9 @@
|
||||||
|
|
||||||
namespace JS {
|
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)
|
BooleanObject::BooleanObject(bool value, Object& prototype)
|
||||||
|
|
|
@ -14,7 +14,7 @@ class BooleanObject : public Object {
|
||||||
JS_OBJECT(BooleanObject, Object);
|
JS_OBJECT(BooleanObject, Object);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static BooleanObject* create(Realm&, bool);
|
static NonnullGCPtr<BooleanObject> create(Realm&, bool);
|
||||||
|
|
||||||
virtual ~BooleanObject() override = default;
|
virtual ~BooleanObject() override = default;
|
||||||
|
|
||||||
|
|
|
@ -536,7 +536,7 @@ ThrowCompletionOr<Object*> Value::to_object(VM& vm) const
|
||||||
// Boolean
|
// Boolean
|
||||||
case BOOLEAN_TAG:
|
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 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
|
// String
|
||||||
case STRING_TAG:
|
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.
|
// Return a new String object whose [[StringData]] internal slot is set to argument. See 22.1 for a description of String objects.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue