1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:58:12 +00:00

LibJS: Convert RegExpObject::create() to NonnullGCPtr

This commit is contained in:
Linus Groh 2022-12-13 20:49:50 +00:00
parent bfb8d83535
commit cad40ec953
3 changed files with 7 additions and 7 deletions

View file

@ -124,14 +124,14 @@ ThrowCompletionOr<DeprecatedString> parse_regex_pattern(VM& vm, StringView patte
return result.release_value();
}
RegExpObject* RegExpObject::create(Realm& realm)
NonnullGCPtr<RegExpObject> RegExpObject::create(Realm& realm)
{
return realm.heap().allocate<RegExpObject>(realm, *realm.intrinsics().regexp_prototype());
return *realm.heap().allocate<RegExpObject>(realm, *realm.intrinsics().regexp_prototype());
}
RegExpObject* RegExpObject::create(Realm& realm, Regex<ECMA262> regex, DeprecatedString pattern, DeprecatedString flags)
NonnullGCPtr<RegExpObject> RegExpObject::create(Realm& realm, Regex<ECMA262> regex, DeprecatedString pattern, DeprecatedString flags)
{
return realm.heap().allocate<RegExpObject>(realm, move(regex), move(pattern), move(flags), *realm.intrinsics().regexp_prototype());
return *realm.heap().allocate<RegExpObject>(realm, move(regex), move(pattern), move(flags), *realm.intrinsics().regexp_prototype());
}
RegExpObject::RegExpObject(Object& prototype)