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:
Andreas Kling 2021-06-24 21:13:09 +02:00
commit e59bf87374
Notes: sideshowbarker 2024-07-18 11:34:05 +09:00
10 changed files with 26 additions and 43 deletions

View file

@ -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;
}