summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2021-10-29 17:09:47 -0400
committerIdan Horowitz <idan.horowitz@gmail.com>2021-10-31 07:50:30 +0200
commite8f722fb27e1868ebfb50856a3d9f3d26d5a31a3 (patch)
tree45f1c4aae15ec6d489875a27a743ca6d2f912dd9 /Userland/Libraries
parentd1abf3d8ce91d1a060b1c06ac50d1c36367ca6e3 (diff)
downloadserenity-e8f722fb27e1868ebfb50856a3d9f3d26d5a31a3.zip
LibJS: Convert %IteratorPrototype% to ThrowCompletionOr
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibJS/Runtime/IteratorPrototype.cpp7
-rw-r--r--Userland/Libraries/LibJS/Runtime/IteratorPrototype.h2
2 files changed, 4 insertions, 5 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/IteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/IteratorPrototype.cpp
index 31d00a9b7d..ca1a10771f 100644
--- a/Userland/Libraries/LibJS/Runtime/IteratorPrototype.cpp
+++ b/Userland/Libraries/LibJS/Runtime/IteratorPrototype.cpp
@@ -20,7 +20,7 @@ void IteratorPrototype::initialize(GlobalObject& global_object)
auto& vm = this->vm();
Object::initialize(global_object);
u8 attr = Attribute::Writable | Attribute::Enumerable;
- define_old_native_function(*vm.well_known_symbol_iterator(), symbol_iterator, 0, attr);
+ define_native_function(*vm.well_known_symbol_iterator(), symbol_iterator, 0, attr);
}
IteratorPrototype::~IteratorPrototype()
@@ -28,10 +28,9 @@ IteratorPrototype::~IteratorPrototype()
}
// 27.1.2.1 %IteratorPrototype% [ @@iterator ] ( ), https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
-JS_DEFINE_OLD_NATIVE_FUNCTION(IteratorPrototype::symbol_iterator)
+JS_DEFINE_NATIVE_FUNCTION(IteratorPrototype::symbol_iterator)
{
- auto* this_object = TRY_OR_DISCARD(vm.this_value(global_object).to_object(global_object));
- return this_object;
+ return TRY(vm.this_value(global_object).to_object(global_object));
}
}
diff --git a/Userland/Libraries/LibJS/Runtime/IteratorPrototype.h b/Userland/Libraries/LibJS/Runtime/IteratorPrototype.h
index 7aee58e1db..1b62f4d45b 100644
--- a/Userland/Libraries/LibJS/Runtime/IteratorPrototype.h
+++ b/Userland/Libraries/LibJS/Runtime/IteratorPrototype.h
@@ -19,7 +19,7 @@ public:
virtual ~IteratorPrototype() override;
private:
- JS_DECLARE_OLD_NATIVE_FUNCTION(symbol_iterator);
+ JS_DECLARE_NATIVE_FUNCTION(symbol_iterator);
};
}