mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
LibJS: Implement basic functionality of Array.from()
The optional 2nd and 3rd arguments are not yet implemented. This assumes that `this` is the Array constructor and doesn't yet implement the more general behavior in the ES6 spec that allows transferring this method to other constructors.
This commit is contained in:
parent
a50a9d67ee
commit
8ebef785eb
Notes:
sideshowbarker
2024-07-19 03:28:59 +09:00
Author: https://github.com/nico
Commit: 8ebef785eb
Pull-request: https://github.com/SerenityOS/serenity/pull/3194
Reviewed-by: https://github.com/linusg ✅
3 changed files with 109 additions and 0 deletions
|
@ -44,6 +44,7 @@ public:
|
|||
private:
|
||||
virtual bool has_constructor() const override { return true; }
|
||||
|
||||
JS_DECLARE_NATIVE_FUNCTION(from);
|
||||
JS_DECLARE_NATIVE_FUNCTION(is_array);
|
||||
JS_DECLARE_NATIVE_FUNCTION(of);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue