summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2021-10-29 00:55:46 +0300
committerIdan Horowitz <idan.horowitz@gmail.com>2021-10-29 21:29:24 +0300
commit4c3ea0bb91d50419e3d56168637436f3b7c56435 (patch)
treeee67bce44361b26ec67819d669de1b0ae05093ab /Userland/Libraries
parent720bb21ee2e03bc5c4389e2dfbe9ce1b4478f61b (diff)
downloadserenity-4c3ea0bb91d50419e3d56168637436f3b7c56435.zip
LibJS: Convert StringIteratorPrototype functions to ThrowCompletionOr
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp6
-rw-r--r--Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp
index 47d5effc71..ad5d11ec20 100644
--- a/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp
+++ b/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.cpp
@@ -22,7 +22,7 @@ void StringIteratorPrototype::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);
// 22.1.5.1.2 %StringIteratorPrototype% [ @@toStringTag ], https://tc39.es/ecma262/#sec-%stringiteratorprototype%-@@tostringtag
define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(global_object.heap(), "String Iterator"), Attribute::Configurable);
@@ -33,9 +33,9 @@ StringIteratorPrototype::~StringIteratorPrototype()
}
// 22.1.5.1.1 %StringIteratorPrototype%.next ( ), https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next
-JS_DEFINE_OLD_NATIVE_FUNCTION(StringIteratorPrototype::next)
+JS_DEFINE_NATIVE_FUNCTION(StringIteratorPrototype::next)
{
- auto* iterator = TRY_OR_DISCARD(typed_this_value(global_object));
+ auto* iterator = TRY(typed_this_value(global_object));
if (iterator->done())
return create_iterator_result_object(global_object, js_undefined(), true);
diff --git a/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.h b/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.h
index a3e8a8b6e3..9fc892c85d 100644
--- a/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.h
+++ b/Userland/Libraries/LibJS/Runtime/StringIteratorPrototype.h
@@ -21,7 +21,7 @@ public:
virtual ~StringIteratorPrototype() override;
private:
- JS_DECLARE_OLD_NATIVE_FUNCTION(next);
+ JS_DECLARE_NATIVE_FUNCTION(next);
};
}