mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:27:45 +00:00
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 :^)
This commit is contained in:
parent
1ff9d33131
commit
340a115dfe
64 changed files with 1160 additions and 1114 deletions
|
@ -27,22 +27,22 @@
|
|||
#pragma once
|
||||
|
||||
#define JS_DECLARE_NATIVE_FUNCTION(name) \
|
||||
static JS::Value name(JS::Interpreter&, JS::GlobalObject&)
|
||||
static JS::Value name(JS::VM&, JS::GlobalObject&)
|
||||
|
||||
#define JS_DECLARE_NATIVE_GETTER(name) \
|
||||
static JS::Value name(JS::Interpreter&, JS::GlobalObject&)
|
||||
static JS::Value name(JS::VM&, JS::GlobalObject&)
|
||||
|
||||
#define JS_DECLARE_NATIVE_SETTER(name) \
|
||||
static void name(JS::Interpreter&, JS::GlobalObject&, JS::Value)
|
||||
static void name(JS::VM&, JS::GlobalObject&, JS::Value)
|
||||
|
||||
#define JS_DEFINE_NATIVE_FUNCTION(name) \
|
||||
JS::Value name([[maybe_unused]] JS::Interpreter& interpreter, [[maybe_unused]] JS::GlobalObject& global_object)
|
||||
JS::Value name([[maybe_unused]] JS::VM& vm, [[maybe_unused]] JS::GlobalObject& global_object)
|
||||
|
||||
#define JS_DEFINE_NATIVE_GETTER(name) \
|
||||
JS::Value name([[maybe_unused]] JS::Interpreter& interpreter, [[maybe_unused]] JS::GlobalObject& global_object)
|
||||
JS::Value name([[maybe_unused]] JS::VM& vm, [[maybe_unused]] JS::GlobalObject& global_object)
|
||||
|
||||
#define JS_DEFINE_NATIVE_SETTER(name) \
|
||||
void name([[maybe_unused]] JS::Interpreter& interpreter, [[maybe_unused]] JS::GlobalObject& global_object, JS::Value value)
|
||||
void name([[maybe_unused]] JS::VM& vm, [[maybe_unused]] JS::GlobalObject& global_object, JS::Value value)
|
||||
|
||||
#define JS_ENUMERATE_NATIVE_OBJECTS \
|
||||
__JS_ENUMERATE(Array, array, ArrayPrototype, ArrayConstructor) \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue