ArrayBufferPrototype.h 982 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) 2020, Linus Groh <linusg@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibJS/Runtime/ArrayBuffer.h>
  8. #include <LibJS/Runtime/PrototypeObject.h>
  9. namespace JS {
  10. class ArrayBufferPrototype final : public PrototypeObject<ArrayBufferPrototype, ArrayBuffer> {
  11. JS_PROTOTYPE_OBJECT(ArrayBufferPrototype, ArrayBuffer, ArrayBuffer);
  12. GC_DECLARE_ALLOCATOR(ArrayBufferPrototype);
  13. public:
  14. virtual void initialize(Realm&) override;
  15. virtual ~ArrayBufferPrototype() override = default;
  16. private:
  17. explicit ArrayBufferPrototype(Realm&);
  18. JS_DECLARE_NATIVE_FUNCTION(byte_length_getter);
  19. JS_DECLARE_NATIVE_FUNCTION(detached_getter);
  20. JS_DECLARE_NATIVE_FUNCTION(max_byte_length);
  21. JS_DECLARE_NATIVE_FUNCTION(resizable);
  22. JS_DECLARE_NATIVE_FUNCTION(resize);
  23. JS_DECLARE_NATIVE_FUNCTION(slice);
  24. JS_DECLARE_NATIVE_FUNCTION(transfer);
  25. JS_DECLARE_NATIVE_FUNCTION(transfer_to_fixed_length);
  26. };
  27. }