mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
LibJS: Replace GlobalObject with VM in common AOs [Part 18/19]
This commit is contained in:
parent
7856886ed5
commit
25849f8a6d
95 changed files with 536 additions and 677 deletions
|
@ -53,11 +53,8 @@ void ArrayBuffer::visit_edges(Cell::Visitor& visitor)
|
|||
// 25.1.2.1 AllocateArrayBuffer ( constructor, byteLength ), https://tc39.es/ecma262/#sec-allocatearraybuffer
|
||||
ThrowCompletionOr<ArrayBuffer*> allocate_array_buffer(VM& vm, FunctionObject& constructor, size_t byte_length)
|
||||
{
|
||||
auto& realm = *vm.current_realm();
|
||||
auto& global_object = realm.global_object();
|
||||
|
||||
// 1. Let obj be ? OrdinaryCreateFromConstructor(constructor, "%ArrayBuffer.prototype%", « [[ArrayBufferData]], [[ArrayBufferByteLength]], [[ArrayBufferDetachKey]] »).
|
||||
auto* obj = TRY(ordinary_create_from_constructor<ArrayBuffer>(global_object, constructor, &GlobalObject::array_buffer_prototype, nullptr));
|
||||
auto* obj = TRY(ordinary_create_from_constructor<ArrayBuffer>(vm, constructor, &GlobalObject::array_buffer_prototype, nullptr));
|
||||
|
||||
// 2. Let block be ? CreateByteDataBlock(byteLength).
|
||||
auto block = ByteBuffer::create_zeroed(byte_length);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue