mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:57:35 +00:00
LibJS: Pass GlobalObject& to native functions and property accessors
More work towards supporting multiple global objects. Native C++ code now get a GlobalObject& and don't have to ask the Interpreter for it. I've added macros for declaring and defining native callbacks since this was pretty tedious and this makes it easier next time we want to change any of these signatures.
This commit is contained in:
parent
4aa98052ca
commit
e4add19915
79 changed files with 541 additions and 519 deletions
|
@ -42,17 +42,17 @@ private:
|
|||
virtual bool has_constructor() const override { return true; }
|
||||
virtual const char* class_name() const override { return "ObjectConstructor"; }
|
||||
|
||||
static Value define_property_(Interpreter&);
|
||||
static Value is(Interpreter&);
|
||||
static Value get_own_property_descriptor(Interpreter&);
|
||||
static Value get_own_property_names(Interpreter&);
|
||||
static Value get_prototype_of(Interpreter&);
|
||||
static Value set_prototype_of(Interpreter&);
|
||||
static Value is_extensible(Interpreter&);
|
||||
static Value prevent_extensions(Interpreter&);
|
||||
static Value keys(Interpreter&);
|
||||
static Value values(Interpreter&);
|
||||
static Value entries(Interpreter&);
|
||||
JS_DECLARE_NATIVE_FUNCTION(define_property_);
|
||||
JS_DECLARE_NATIVE_FUNCTION(is);
|
||||
JS_DECLARE_NATIVE_FUNCTION(get_own_property_descriptor);
|
||||
JS_DECLARE_NATIVE_FUNCTION(get_own_property_names);
|
||||
JS_DECLARE_NATIVE_FUNCTION(get_prototype_of);
|
||||
JS_DECLARE_NATIVE_FUNCTION(set_prototype_of);
|
||||
JS_DECLARE_NATIVE_FUNCTION(is_extensible);
|
||||
JS_DECLARE_NATIVE_FUNCTION(prevent_extensions);
|
||||
JS_DECLARE_NATIVE_FUNCTION(keys);
|
||||
JS_DECLARE_NATIVE_FUNCTION(values);
|
||||
JS_DECLARE_NATIVE_FUNCTION(entries);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue