diff options
author | Andreas Kling <kling@serenityos.org> | 2020-09-27 18:36:49 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-09-27 20:26:58 +0200 |
commit | 340a115dfe9518eae3d76154fba9092c36526430 (patch) | |
tree | ced6db98e45ce6ac110db8e6a2a8ba7d95565cea /Libraries/LibJS/Runtime/NativeFunction.cpp | |
parent | 1ff9d33131921d97b5de99496f933bcebeb4faaa (diff) | |
download | serenity-340a115dfe9518eae3d76154fba9092c36526430.zip |
LibJS: Make native function/property callbacks take VM, not Interpreter
More work on decoupling the general runtime from Interpreter. The goal
is becoming clearer. Interpreter should be one possible way to execute
code inside a VM. In the future we might have other ways :^)
Diffstat (limited to 'Libraries/LibJS/Runtime/NativeFunction.cpp')
-rw-r--r-- | Libraries/LibJS/Runtime/NativeFunction.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Libraries/LibJS/Runtime/NativeFunction.cpp b/Libraries/LibJS/Runtime/NativeFunction.cpp index 6703f90e02..3785b4865b 100644 --- a/Libraries/LibJS/Runtime/NativeFunction.cpp +++ b/Libraries/LibJS/Runtime/NativeFunction.cpp @@ -31,7 +31,7 @@ namespace JS { -NativeFunction* NativeFunction::create(GlobalObject& global_object, const FlyString& name, AK::Function<Value(Interpreter&, GlobalObject&)> function) +NativeFunction* NativeFunction::create(GlobalObject& global_object, const FlyString& name, AK::Function<Value(VM&, GlobalObject&)> function) { return global_object.heap().allocate<NativeFunction>(global_object, name, move(function), *global_object.function_prototype()); } @@ -41,7 +41,7 @@ NativeFunction::NativeFunction(Object& prototype) { } -NativeFunction::NativeFunction(const FlyString& name, AK::Function<Value(Interpreter&, GlobalObject&)> native_function, Object& prototype) +NativeFunction::NativeFunction(const FlyString& name, AK::Function<Value(VM&, GlobalObject&)> native_function, Object& prototype) : Function(prototype) , m_name(name) , m_native_function(move(native_function)) @@ -60,7 +60,7 @@ NativeFunction::~NativeFunction() Value NativeFunction::call() { - return m_native_function(interpreter(), global_object()); + return m_native_function(vm(), global_object()); } Value NativeFunction::construct(Interpreter&, Function&) |