1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 07:07:34 +00:00

LibJS: Accept ArrayBuffer constructor options argument

Test262 seems to test the changes in the "Resizable ArrayBuffer and
growable SharedArrayBuffer" proposal. Begin implementing this proposal
by accepting the new options object argument to the ArrayBuffer
constructor.

https://tc39.es/proposal-resizablearraybuffer
https://github.com/tc39/test262/blob/main/test/built-ins/ArrayBuffer/options-maxbytelength-diminuitive.js
This commit is contained in:
ForLoveOfCats 2022-03-02 11:44:32 -05:00 committed by Linus Groh
parent 4eb2c70a03
commit e8416b603f
5 changed files with 54 additions and 5 deletions

View file

@ -75,7 +75,7 @@ private:
Value m_detach_key;
};
ThrowCompletionOr<ArrayBuffer*> allocate_array_buffer(GlobalObject&, FunctionObject& constructor, size_t byte_length);
ThrowCompletionOr<ArrayBuffer*> allocate_array_buffer(GlobalObject&, FunctionObject& constructor, size_t byte_length, Optional<size_t> max_byte_length = {});
ThrowCompletionOr<ArrayBuffer*> clone_array_buffer(GlobalObject&, ArrayBuffer& source_buffer, size_t source_byte_offset, size_t source_length, FunctionObject& clone_constructor);
// 25.1.2.9 RawBytesToNumeric ( type, rawBytes, isLittleEndian ), https://tc39.es/ecma262/#sec-rawbytestonumeric