1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:57:35 +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:
Nico Weber 2020-08-17 09:52:24 -04:00 committed by Andreas Kling
parent a50a9d67ee
commit 8ebef785eb
3 changed files with 109 additions and 0 deletions

View file

@ -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);
};