diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-10-29 01:01:49 +0300 |
---|---|---|
committer | Idan Horowitz <idan.horowitz@gmail.com> | 2021-10-29 21:29:24 +0300 |
commit | f1e215ea3ec89f6b429acc8bde1acb825e8ae401 (patch) | |
tree | 5bb41b9a3c342cbd091dd5df1b4a3e05a457af53 /Userland | |
parent | dab0a92c19f54801f501452ba2d20da0c16fe2ba (diff) | |
download | serenity-f1e215ea3ec89f6b429acc8bde1acb825e8ae401.zip |
LibJS: Convert MapIteratorPrototype functions to ThrowCompletionOr
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.cpp | 6 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.cpp index 8be40ce855..a7613c6dfe 100644 --- a/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.cpp @@ -23,7 +23,7 @@ void MapIteratorPrototype::initialize(GlobalObject& global_object) auto& vm = this->vm(); Object::initialize(global_object); - define_old_native_function(vm.names.next, next, 0, Attribute::Configurable | Attribute::Writable); + define_native_function(vm.names.next, next, 0, Attribute::Configurable | Attribute::Writable); define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(global_object.heap(), "Map Iterator"), Attribute::Configurable); } @@ -32,9 +32,9 @@ MapIteratorPrototype::~MapIteratorPrototype() } // 24.1.5.2.1 %MapIteratorPrototype%.next ( ), https://tc39.es/ecma262/#sec-%mapiteratorprototype%.next -JS_DEFINE_OLD_NATIVE_FUNCTION(MapIteratorPrototype::next) +JS_DEFINE_NATIVE_FUNCTION(MapIteratorPrototype::next) { - auto* map_iterator = TRY_OR_DISCARD(typed_this_value(global_object)); + auto* map_iterator = TRY(typed_this_value(global_object)); if (map_iterator->done()) return create_iterator_result_object(global_object, js_undefined(), true); diff --git a/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.h b/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.h index 98f2fd3dc4..730e3334aa 100644 --- a/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/MapIteratorPrototype.h @@ -20,7 +20,7 @@ public: virtual ~MapIteratorPrototype() override; private: - JS_DECLARE_OLD_NATIVE_FUNCTION(next); + JS_DECLARE_NATIVE_FUNCTION(next); }; } |