From ffa58184d2fcc51878779f8ad55652682b21e1bc Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Fri, 29 Oct 2021 00:53:57 +0300 Subject: LibJS: Convert ArrayBufferConstructor functions to ThrowCompletionOr --- Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.cpp | 8 ++++---- Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.cpp index 38c7d46238..c82a467c32 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.cpp @@ -27,10 +27,10 @@ void ArrayBufferConstructor::initialize(GlobalObject& global_object) define_direct_property(vm.names.prototype, global_object.array_buffer_prototype(), 0); u8 attr = Attribute::Writable | Attribute::Configurable; - define_old_native_function(vm.names.isView, is_view, 1, attr); + define_native_function(vm.names.isView, is_view, 1, attr); // 25.1.5.4 ArrayBuffer.prototype [ @@toStringTag ], https://tc39.es/ecma262/#sec-arraybuffer.prototype-@@tostringtag - define_old_native_accessor(*vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable); + define_native_accessor(*vm.well_known_symbol_species(), symbol_species_getter, {}, Attribute::Configurable); define_direct_property(vm.names.length, Value(1), Attribute::Configurable); } @@ -64,7 +64,7 @@ ThrowCompletionOr ArrayBufferConstructor::construct(FunctionObject& new } // 25.1.4.1 ArrayBuffer.isView ( arg ), https://tc39.es/ecma262/#sec-arraybuffer.isview -JS_DEFINE_OLD_NATIVE_FUNCTION(ArrayBufferConstructor::is_view) +JS_DEFINE_NATIVE_FUNCTION(ArrayBufferConstructor::is_view) { auto arg = vm.argument(0); if (!arg.is_object()) @@ -77,7 +77,7 @@ JS_DEFINE_OLD_NATIVE_FUNCTION(ArrayBufferConstructor::is_view) } // 25.1.4.3 get ArrayBuffer [ @@species ], https://tc39.es/ecma262/#sec-get-arraybuffer-@@species -JS_DEFINE_OLD_NATIVE_FUNCTION(ArrayBufferConstructor::symbol_species_getter) +JS_DEFINE_NATIVE_FUNCTION(ArrayBufferConstructor::symbol_species_getter) { return vm.this_value(global_object); } diff --git a/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.h b/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.h index 34f7c1b66c..43ddbb8ab5 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.h +++ b/Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.h @@ -24,9 +24,9 @@ public: private: virtual bool has_constructor() const override { return true; } - JS_DECLARE_OLD_NATIVE_FUNCTION(is_view); + JS_DECLARE_NATIVE_FUNCTION(is_view); - JS_DECLARE_OLD_NATIVE_FUNCTION(symbol_species_getter); + JS_DECLARE_NATIVE_FUNCTION(symbol_species_getter); }; } -- cgit v1.2.3