mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:38:12 +00:00
LibJS: Stop fetching GlobalObject from target's realm in ArrayBuffer
A function object's realm is not necessarily non-null (like when called via the Reflect API), so we can't blindly dereference it. Instead use the object's own GlobalObject.
This commit is contained in:
parent
9098257668
commit
1a8b5ef80a
1 changed files with 1 additions and 1 deletions
|
@ -65,7 +65,7 @@ static ThrowCompletionOr<Optional<size_t>> get_array_buffer_max_byte_length_opti
|
|||
// 1.2.1 ArrayBuffer ( length [, options ] ), https://tc39.es/proposal-resizablearraybuffer/#sec-arraybuffer-constructor
|
||||
ThrowCompletionOr<Object*> ArrayBufferConstructor::construct(FunctionObject& new_target)
|
||||
{
|
||||
auto& global_object = new_target.realm()->global_object();
|
||||
auto& global_object = this->global_object();
|
||||
auto& vm = this->vm();
|
||||
|
||||
// 1. If NewTarget is undefined, throw a TypeError exception.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue