2020-04-10 14:14:02 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-04-10 14:14:02 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <LibJS/Runtime/NativeFunction.h>
|
|
|
|
|
|
|
|
namespace JS {
|
|
|
|
|
|
|
|
class StringConstructor final : public NativeFunction {
|
2020-06-21 15:14:02 +02:00
|
|
|
JS_OBJECT(StringConstructor, NativeFunction);
|
|
|
|
|
2020-04-10 14:14:02 +02:00
|
|
|
public:
|
2020-06-20 15:40:48 +02:00
|
|
|
explicit StringConstructor(GlobalObject&);
|
2020-07-22 17:50:18 +02:00
|
|
|
virtual void initialize(GlobalObject&) override;
|
2020-04-10 14:14:02 +02:00
|
|
|
virtual ~StringConstructor() override;
|
|
|
|
|
2020-09-27 17:24:14 +02:00
|
|
|
virtual Value call() override;
|
2020-09-27 18:45:21 +02:00
|
|
|
virtual Value construct(Function& new_target) override;
|
2020-04-10 14:14:02 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
virtual bool has_constructor() const override { return true; }
|
2020-05-06 17:49:48 -07:00
|
|
|
|
2020-06-20 13:55:34 +02:00
|
|
|
JS_DECLARE_NATIVE_FUNCTION(raw);
|
|
|
|
JS_DECLARE_NATIVE_FUNCTION(from_char_code);
|
2020-04-10 14:14:02 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|