mirror of
https://github.com/RGBCube/serenity
synced 2025-07-02 23:42:13 +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:
parent
cd9bb985d4
commit
50bf303edd
11 changed files with 33 additions and 32 deletions
|
@ -5,6 +5,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibJS/AST.h>
|
||||
#include <LibJS/Interpreter.h>
|
||||
#include <LibJS/Runtime/FunctionEnvironment.h>
|
||||
#include <LibJS/Runtime/GlobalObject.h>
|
||||
|
@ -141,8 +142,8 @@ ThrowCompletionOr<Value> NativeFunction::internal_call(Value this_argument, Mark
|
|||
// NOTE: This is a LibJS specific hack for NativeFunction to inherit the strictness of its caller.
|
||||
callee_context.is_strict_mode = vm.in_strict_mode();
|
||||
|
||||
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();
|
||||
|
||||
// </8.> --------------------------------------------------------------------------
|
||||
|
||||
|
@ -204,8 +205,8 @@ ThrowCompletionOr<NonnullGCPtr<Object>> NativeFunction::internal_construct(Marke
|
|||
// NOTE: This is a LibJS specific hack for NativeFunction to inherit the strictness of its caller.
|
||||
callee_context.is_strict_mode = vm.in_strict_mode();
|
||||
|
||||
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();
|
||||
|
||||
// </8.> --------------------------------------------------------------------------
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue