1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:57:43 +00:00

LibJS: Rename CallFrame => ExecutionContext

This struct represents what the ECMAScript specification calls an
"execution context" so let's use the same terminology. :^)
This commit is contained in:
Andreas Kling 2021-06-24 19:17:45 +02:00
parent 7c88caf99f
commit c2ad599783
13 changed files with 139 additions and 138 deletions

View file

@ -17,19 +17,19 @@ Exception::Exception(Value value)
: m_value(value)
{
auto& vm = this->vm();
m_traceback.ensure_capacity(vm.call_stack().size());
for (ssize_t i = vm.call_stack().size() - 1; i >= 0; i--) {
auto* call_frame = vm.call_stack()[i];
auto function_name = call_frame->function_name;
m_traceback.ensure_capacity(vm.execution_context_stack().size());
for (ssize_t i = vm.execution_context_stack().size() - 1; i >= 0; i--) {
auto* context = vm.execution_context_stack()[i];
auto function_name = context->function_name;
if (function_name.is_empty())
function_name = "<anonymous>";
m_traceback.empend(
move(function_name),
// We might not have an AST node associated with the call frame, e.g. in promise
// We might not have an AST node associated with the execution context, e.g. in promise
// reaction jobs (which aren't called anywhere from the source code).
// They're not going to generate any _unhandled_ exceptions though, so a meaningless
// source range is fine.
call_frame->current_node ? call_frame->current_node->source_range() : SourceRange {});
context->current_node ? context->current_node->source_range() : SourceRange {});
}
}