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

LibJS: Capture UnrealizedSourceRanges in ExecutionContext, not ASTNodes

This loosens the connection to the AST interpreter and will allow us to
generate SourceRanges for the Bytecode interpreter in the future as well

Moves UnrealizedSourceRanges from TracebackFrame to the JS namespace for
this
This commit is contained in:
Hediadyoin1 2023-07-27 14:40:01 +02:00 committed by Andreas Kling
parent cd9bb985d4
commit 50bf303edd
11 changed files with 33 additions and 32 deletions

View file

@ -154,8 +154,8 @@ ThrowCompletionOr<Value> ECMAScriptFunctionObject::internal_call(Value this_argu
// Non-standard
callee_context.arguments.extend(move(arguments_list));
if (auto* interpreter = vm.interpreter_if_exists())
callee_context.current_node = interpreter->current_node();
if (auto* interpreter = vm.interpreter_if_exists(); interpreter && interpreter->current_node())
callee_context.source_range = interpreter->current_node()->unrealized_source_range();
// 2. Let calleeContext be PrepareForOrdinaryCall(F, undefined).
// NOTE: We throw if the end of the native stack is reached, so unlike in the spec this _does_ need an exception check.
@ -225,8 +225,8 @@ ThrowCompletionOr<NonnullGCPtr<Object>> ECMAScriptFunctionObject::internal_const
// Non-standard
callee_context.arguments.extend(move(arguments_list));
if (auto* interpreter = vm.interpreter_if_exists())
callee_context.current_node = interpreter->current_node();
if (auto* interpreter = vm.interpreter_if_exists(); interpreter && interpreter->current_node())
callee_context.source_range = interpreter->current_node()->unrealized_source_range();
// 4. Let calleeContext be PrepareForOrdinaryCall(F, newTarget).
// NOTE: We throw if the end of the native stack is reached, so unlike in the spec this _does_ need an exception check.