mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:27:45 +00:00
LibJS: Add Object::put_native_function() for convenience
This makes it a little bit nicer to add native function properties to JavaScript objects. Thanks to Sergey for suggesting it! :^)
This commit is contained in:
parent
6089d6566b
commit
9f38f4dbfb
5 changed files with 16 additions and 7 deletions
|
@ -41,6 +41,8 @@ public:
|
|||
Value get(String property_name) const;
|
||||
void put(String property_name, Value);
|
||||
|
||||
void put_native_function(String property_name, AK::Function<Value(Interpreter&, Vector<Value>)>);
|
||||
|
||||
virtual bool is_function() const { return false; }
|
||||
virtual bool is_native_function() const { return false; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue