|
@@ -19,7 +19,7 @@ void WeakRefPrototype::initialize(GlobalObject& global_object)
|
|
auto& vm = this->vm();
|
|
auto& vm = this->vm();
|
|
Object::initialize(global_object);
|
|
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);
|
|
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
|
|
// 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();
|
|
weak_ref->update_execution_generation();
|
|
return weak_ref->value() ?: js_undefined();
|
|
return weak_ref->value() ?: js_undefined();
|