diff --git a/Userland/Libraries/LibJS/Runtime/WeakRefPrototype.cpp b/Userland/Libraries/LibJS/Runtime/WeakRefPrototype.cpp index 7ca695632f..9dd86d5221 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakRefPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/WeakRefPrototype.cpp @@ -19,7 +19,7 @@ void WeakRefPrototype::initialize(GlobalObject& global_object) auto& vm = this->vm(); Object::initialize(global_object); - define_old_native_function(vm.names.deref, deref, 0, Attribute::Writable | Attribute::Configurable); + define_native_function(vm.names.deref, deref, 0, Attribute::Writable | Attribute::Configurable); define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, vm.names.WeakRef.as_string()), Attribute::Configurable); } @@ -29,9 +29,9 @@ WeakRefPrototype::~WeakRefPrototype() } // 26.1.3.2 WeakRef.prototype.deref ( ), https://tc39.es/ecma262/#sec-weak-ref.prototype.deref -JS_DEFINE_OLD_NATIVE_FUNCTION(WeakRefPrototype::deref) +JS_DEFINE_NATIVE_FUNCTION(WeakRefPrototype::deref) { - auto* weak_ref = TRY_OR_DISCARD(typed_this_object(global_object)); + auto* weak_ref = TRY(typed_this_object(global_object)); weak_ref->update_execution_generation(); return weak_ref->value() ?: js_undefined(); diff --git a/Userland/Libraries/LibJS/Runtime/WeakRefPrototype.h b/Userland/Libraries/LibJS/Runtime/WeakRefPrototype.h index 11abd18ab7..15254e946c 100644 --- a/Userland/Libraries/LibJS/Runtime/WeakRefPrototype.h +++ b/Userland/Libraries/LibJS/Runtime/WeakRefPrototype.h @@ -20,7 +20,7 @@ public: virtual ~WeakRefPrototype() override; private: - JS_DECLARE_OLD_NATIVE_FUNCTION(deref); + JS_DECLARE_NATIVE_FUNCTION(deref); }; }