1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:17:35 +00:00

LibJS: Implement and test ArrayBuffer.prototype.resize

This commit is contained in:
ForLoveOfCats 2022-03-02 11:24:46 -05:00 committed by Linus Groh
parent b29e19c52a
commit f350c153e8
7 changed files with 118 additions and 0 deletions

View file

@ -39,6 +39,11 @@ public:
static NonnullRefPtr<VM> create(OwnPtr<CustomData> = {});
~VM();
enum class HostResizeArrayBufferResult {
Unhandled,
Handled,
};
Heap& heap() { return m_heap; }
const Heap& heap() const { return m_heap; }
@ -223,6 +228,7 @@ public:
Function<void(FinalizationRegistry&)> host_enqueue_finalization_registry_cleanup_job;
Function<void(Function<ThrowCompletionOr<Value>()>, Realm*)> host_enqueue_promise_job;
Function<JobCallback(FunctionObject&)> host_make_job_callback;
Function<ThrowCompletionOr<HostResizeArrayBufferResult>(GlobalObject&, size_t)> host_resize_array_buffer;
private:
explicit VM(OwnPtr<CustomData>);