diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-10-29 00:53:57 +0300 |
---|---|---|
committer | Idan Horowitz <idan.horowitz@gmail.com> | 2021-10-29 21:29:24 +0300 |
commit | ffa58184d2fcc51878779f8ad55652682b21e1bc (patch) | |
tree | 668fe50a503d9e08d49d568ef7c41e23e5598217 | |
parent | 70cbd43718c5f1a1aeaa311997c14446c0c7f5c1 (diff) | |
download | serenity-ffa58184d2fcc51878779f8ad55652682b21e1bc.zip |
LibJS: Convert ArrayBufferConstructor functions to ThrowCompletionOr
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/ArrayBufferConstructor.cpp | 8 | ||||
-rw-r--r-- | 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<Object*> 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); }; } |