mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:27:35 +00:00
AK: Rename adopt() to adopt_ref()
This makes it more symmetrical with adopt_own() (which is used to create a NonnullOwnPtr from the result of a naked new.)
This commit is contained in:
parent
b3db01e20e
commit
b91c49364d
228 changed files with 461 additions and 461 deletions
|
@ -27,7 +27,7 @@ template<class T, class... Args>
|
|||
static inline NonnullRefPtr<T>
|
||||
create_ast_node(SourceRange range, Args&&... args)
|
||||
{
|
||||
return adopt(*new T(range, forward<Args>(args)...));
|
||||
return adopt_ref(*new T(range, forward<Args>(args)...));
|
||||
}
|
||||
|
||||
class ASTNode : public RefCounted<ASTNode> {
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
|
||||
static Handle create(T* cell)
|
||||
{
|
||||
return Handle(adopt(*new HandleImpl(cell)));
|
||||
return Handle(adopt_ref(*new HandleImpl(cell)));
|
||||
}
|
||||
|
||||
T* cell() { return static_cast<T*>(m_impl->cell()); }
|
||||
|
|
|
@ -228,7 +228,7 @@ NonnullRefPtr<Program> Parser::parse_program()
|
|||
{
|
||||
auto rule_start = push_start();
|
||||
ScopePusher scope(*this, ScopePusher::Var | ScopePusher::Let | ScopePusher::Function);
|
||||
auto program = adopt(*new Program({ m_filename, rule_start.position(), position() }));
|
||||
auto program = adopt_ref(*new Program({ m_filename, rule_start.position(), position() }));
|
||||
|
||||
bool first = true;
|
||||
while (!done()) {
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace JS {
|
|||
|
||||
NonnullRefPtr<VM> VM::create()
|
||||
{
|
||||
return adopt(*new VM);
|
||||
return adopt_ref(*new VM);
|
||||
}
|
||||
|
||||
VM::VM()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue