mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:48:12 +00:00

SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
35 lines
869 B
C++
35 lines
869 B
C++
/*
|
|
* Copyright (c) 2021, Linus Groh <mail@linusgroh.de>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibJS/Runtime/NativeFunction.h>
|
|
|
|
namespace JS {
|
|
|
|
class PromiseConstructor final : public NativeFunction {
|
|
JS_OBJECT(PromiseConstructor, NativeFunction);
|
|
|
|
public:
|
|
explicit PromiseConstructor(GlobalObject&);
|
|
virtual void initialize(GlobalObject&) override;
|
|
virtual ~PromiseConstructor() override = default;
|
|
|
|
virtual Value call() override;
|
|
virtual Value construct(Function& new_target) override;
|
|
|
|
private:
|
|
virtual bool has_constructor() const override { return true; }
|
|
|
|
JS_DECLARE_NATIVE_FUNCTION(all);
|
|
JS_DECLARE_NATIVE_FUNCTION(all_settled);
|
|
JS_DECLARE_NATIVE_FUNCTION(any);
|
|
JS_DECLARE_NATIVE_FUNCTION(race);
|
|
JS_DECLARE_NATIVE_FUNCTION(reject);
|
|
JS_DECLARE_NATIVE_FUNCTION(resolve);
|
|
};
|
|
|
|
}
|