mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:07:47 +00:00
LibJS: Convert %IteratorPrototype% to ThrowCompletionOr
This commit is contained in:
parent
d1abf3d8ce
commit
e8f722fb27
2 changed files with 4 additions and 5 deletions
|
@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ public:
|
|||
virtual ~IteratorPrototype() override;
|
||||
|
||||
private:
|
||||
JS_DECLARE_OLD_NATIVE_FUNCTION(symbol_iterator);
|
||||
JS_DECLARE_NATIVE_FUNCTION(symbol_iterator);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue