From 83d3175b131b62b61078452476a1741dfec758a7 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sun, 13 Jun 2021 20:11:21 +0100 Subject: [PATCH] LibJS: Make ArrayBuffer.prototype.byteLength an accessor --- Userland/Libraries/LibJS/Runtime/ArrayBufferPrototype.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/ArrayBufferPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ArrayBufferPrototype.cpp index a44701a682..997fc9d2d2 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayBufferPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayBufferPrototype.cpp @@ -24,8 +24,7 @@ void ArrayBufferPrototype::initialize(GlobalObject& global_object) Object::initialize(global_object); u8 attr = Attribute::Writable | Attribute::Configurable; define_native_function(vm.names.slice, slice, 2, attr); - // FIXME: This should be an accessor property - define_native_property(vm.names.byteLength, byte_length_getter, {}, Attribute::Configurable); + define_native_accessor(vm.names.byteLength, byte_length_getter, {}, Attribute::Configurable); // 25.1.5.4 ArrayBuffer.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-arraybuffer.prototype-@@tostringtag define_property(vm.well_known_symbol_to_string_tag(), js_string(vm.heap(), vm.names.ArrayBuffer.as_string()), Attribute::Configurable);