mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:28:10 +00:00
Userland: Replace VERIFY(is<T>) with verify_cast<T>
Instead of doing a VERIFY(is<T>(x)) and *then* casting it to T, we can just do the cast right away with verify_cast<T>. :^)
This commit is contained in:
parent
7fef8c5648
commit
e59bf87374
10 changed files with 26 additions and 43 deletions
|
@ -390,9 +390,8 @@ void AssignmentExpression::generate_bytecode(Bytecode::Generator& generator) con
|
|||
m_rhs->generate_bytecode(generator);
|
||||
generator.emit<Bytecode::Op::PutByValue>(object_reg, property_reg);
|
||||
} else {
|
||||
VERIFY(is<Identifier>(expression.property()));
|
||||
m_rhs->generate_bytecode(generator);
|
||||
auto identifier_table_ref = generator.intern_string(static_cast<Identifier const&>(expression.property()).string());
|
||||
auto identifier_table_ref = generator.intern_string(verify_cast<Identifier>(expression.property()).string());
|
||||
generator.emit<Bytecode::Op::PutById>(object_reg, identifier_table_ref);
|
||||
}
|
||||
return;
|
||||
|
@ -628,8 +627,7 @@ void MemberExpression::generate_bytecode(Bytecode::Generator& generator) const
|
|||
property().generate_bytecode(generator);
|
||||
generator.emit<Bytecode::Op::GetByValue>(object_reg);
|
||||
} else {
|
||||
VERIFY(is<Identifier>(property()));
|
||||
auto identifier_table_ref = generator.intern_string(static_cast<Identifier const&>(property()).string());
|
||||
auto identifier_table_ref = generator.intern_string(verify_cast<Identifier>(property()).string());
|
||||
generator.emit<Bytecode::Op::GetById>(identifier_table_ref);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue