diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-10-29 00:19:34 +0300 |
---|---|---|
committer | Idan Horowitz <idan.horowitz@gmail.com> | 2021-10-29 21:29:24 +0300 |
commit | 6b954b9e76a40f2457287f1e0d7e741f32d4fcb3 (patch) | |
tree | b8c7b1d3780d653603b8276f6103d621e7d8ecef | |
parent | d46d8c9016f2cc60155f318da2412aa815f3dfd4 (diff) | |
download | serenity-6b954b9e76a40f2457287f1e0d7e741f32d4fcb3.zip |
LibJS: Convert SetIteratorPrototype functions to ThrowCompletionOr
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.cpp | 6 | ||||
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.cpp index 0b47ac4e9a..2fb811b752 100644 --- a/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.cpp @@ -23,7 +23,7 @@ void SetIteratorPrototype::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); // 24.2.5.2.2 %SetIteratorPrototype% [ @@toStringTag ], https://tc39.es/ecma262/#sec-%setiteratorprototype%-@@tostringtag define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(global_object.heap(), "Set Iterator"), Attribute::Configurable); @@ -34,9 +34,9 @@ SetIteratorPrototype::~SetIteratorPrototype() } // 24.2.5.2.1 %SetIteratorPrototype%.next ( ), https://tc39.es/ecma262/#sec-%setiteratorprototype%.next -JS_DEFINE_OLD_NATIVE_FUNCTION(SetIteratorPrototype::next) +JS_DEFINE_NATIVE_FUNCTION(SetIteratorPrototype::next) { - auto* set_iterator = TRY_OR_DISCARD(typed_this_value(global_object)); + auto* set_iterator = TRY(typed_this_value(global_object)); if (set_iterator->done()) return create_iterator_result_object(global_object, js_undefined(), true); diff --git a/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.h b/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.h index a0b028387f..43aff39f04 100644 --- a/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/SetIteratorPrototype.h @@ -20,7 +20,7 @@ public: virtual ~SetIteratorPrototype() override; private: - JS_DECLARE_OLD_NATIVE_FUNCTION(next); + JS_DECLARE_NATIVE_FUNCTION(next); }; } |