mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 02:05:07 +02:00
LibJS: Don't VERIFY that a function is Regular when executing in AST
By replacing this VERIFY with a thrown Error we no longer crash when calling a generator function in the AST interpreter. This allows us to more gracefully handle situation which have not been implemented yet. In particular this helps the libjs-test262-runner since it can now continue on to the next tests instead of having the entire process end.
This commit is contained in:
Notes:
sideshowbarker
2024-07-18 01:57:07 +09:00
Author: https://github.com/davidot Commit: https://github.com/SerenityOS/serenity/commit/9c9aaf4d4f8 Pull-request: https://github.com/SerenityOS/serenity/pull/10589
@@ -697,7 +697,8 @@ Completion ECMAScriptFunctionObject::ordinary_call_evaluate_body()
|
||||
|
||||
return normal_completion(GeneratorObject::create(global_object(), result, this, vm.running_execution_context().lexical_environment, bytecode_interpreter->snapshot_frame()));
|
||||
} else {
|
||||
VERIFY(m_kind != FunctionKind::Generator);
|
||||
if (m_kind != FunctionKind::Regular)
|
||||
return vm.throw_completion<InternalError>(global_object(), ErrorType::NotImplemented, "Non regular function execution in AST interpreter");
|
||||
OwnPtr<Interpreter> local_interpreter;
|
||||
Interpreter* ast_interpreter = vm.interpreter_if_exists();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user