mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 20:28:11 +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
|
@ -193,8 +193,7 @@ EnvironmentRecord& get_this_environment(VM& vm)
|
|||
Object* get_super_constructor(VM& vm)
|
||||
{
|
||||
auto& env = get_this_environment(vm);
|
||||
VERIFY(is<FunctionEnvironmentRecord>(env));
|
||||
auto& active_function = static_cast<FunctionEnvironmentRecord&>(env).function_object();
|
||||
auto& active_function = verify_cast<FunctionEnvironmentRecord>(env).function_object();
|
||||
auto* super_constructor = active_function.prototype();
|
||||
return super_constructor;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue