RegExpConstructor.h 726 B

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibJS/Runtime/NativeFunction.h>
  8. namespace JS {
  9. class RegExpConstructor final : public NativeFunction {
  10. JS_OBJECT(RegExpConstructor, NativeFunction);
  11. public:
  12. explicit RegExpConstructor(GlobalObject&);
  13. virtual void initialize(GlobalObject&) override;
  14. virtual ~RegExpConstructor() override;
  15. virtual ThrowCompletionOr<Value> call() override;
  16. virtual ThrowCompletionOr<Object*> construct(FunctionObject& new_target) override;
  17. private:
  18. virtual bool has_constructor() const override { return true; }
  19. JS_DECLARE_NATIVE_FUNCTION(symbol_species_getter);
  20. };
  21. }