mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 15:49:11 +00:00
LibJS: Make Function::call() not require an Interpreter&
This makes a difference inside ScriptFunction::call(), which will now instantiate a temporary Interpreter if one is not attached to the VM.
This commit is contained in:
parent
be31805e8b
commit
1ff9d33131
Notes:
sideshowbarker
2024-07-19 02:10:38 +09:00
Author: https://github.com/awesomekling
Commit: 1ff9d33131
42 changed files with 167 additions and 142 deletions
|
@ -58,6 +58,8 @@ public:
|
|||
return interpreter;
|
||||
}
|
||||
|
||||
static NonnullOwnPtr<Interpreter> create_with_existing_global_object(GlobalObject&);
|
||||
|
||||
template<typename... Args>
|
||||
[[nodiscard]] ALWAYS_INLINE Value call(Function& function, Value this_value, Args... args)
|
||||
{
|
||||
|
@ -110,7 +112,10 @@ public:
|
|||
private:
|
||||
explicit Interpreter(VM&);
|
||||
|
||||
[[nodiscard]] Value call_internal(Function&, Value this_value, Optional<MarkedValueList>);
|
||||
[[nodiscard]] Value call_internal(Function& function, Value this_value, Optional<MarkedValueList> arguments)
|
||||
{
|
||||
return vm().call(function, this_value, move(arguments));
|
||||
}
|
||||
|
||||
NonnullRefPtr<VM> m_vm;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue