mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 19:59:17 +00:00
LibJS: Convert ScopeNode declaration functions to ThrowCompletionOr
This removes a number of vm.exception() checks which are now caught
directly by TRY. Make use of these checks in
{Global, Eval}DeclarationInstantiation and while we're here add spec
comments.
This commit is contained in:
@@ -36,12 +36,10 @@ void ScopeNode::generate_bytecode(Bytecode::Generator& generator) const
|
||||
HashTable<FlyString> functions_initialized;
|
||||
for_each_var_function_declaration_in_reverse_order([&](FunctionDeclaration const& function) {
|
||||
if (functions_initialized.set(function.name()) != AK::HashSetResult::InsertedNewEntry)
|
||||
return IterationDecision::Continue;
|
||||
return;
|
||||
|
||||
generator.emit<Bytecode::Op::NewFunction>(function);
|
||||
generator.emit<Bytecode::Op::SetVariable>(generator.intern_identifier(function.name()));
|
||||
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
|
||||
// FIXME: Register lexical and variable scope declarations
|
||||
|
||||
Reference in New Issue
Block a user