mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:57:43 +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
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