|
@@ -4,17 +4,17 @@
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
*/
|
|
|
|
|
|
-#include <LibJS/Runtime/GeneratorObjectPrototype.h>
|
|
|
+#include <LibJS/Runtime/GeneratorPrototype.h>
|
|
|
#include <LibJS/Runtime/GlobalObject.h>
|
|
|
|
|
|
namespace JS {
|
|
|
|
|
|
-GeneratorObjectPrototype::GeneratorObjectPrototype(GlobalObject& global_object)
|
|
|
+GeneratorPrototype::GeneratorPrototype(GlobalObject& global_object)
|
|
|
: PrototypeObject(*global_object.iterator_prototype())
|
|
|
{
|
|
|
}
|
|
|
|
|
|
-void GeneratorObjectPrototype::initialize(GlobalObject& global_object)
|
|
|
+void GeneratorPrototype::initialize(GlobalObject& global_object)
|
|
|
{
|
|
|
auto& vm = this->vm();
|
|
|
Object::initialize(global_object);
|
|
@@ -27,19 +27,19 @@ void GeneratorObjectPrototype::initialize(GlobalObject& global_object)
|
|
|
define_direct_property(*vm.well_known_symbol_to_string_tag(), js_string(vm, "Generator"), Attribute::Configurable);
|
|
|
}
|
|
|
|
|
|
-GeneratorObjectPrototype::~GeneratorObjectPrototype()
|
|
|
+GeneratorPrototype::~GeneratorPrototype()
|
|
|
{
|
|
|
}
|
|
|
|
|
|
// 27.5.1.2 Generator.prototype.next ( value ), https://tc39.es/ecma262/#sec-generator.prototype.next
|
|
|
-JS_DEFINE_NATIVE_FUNCTION(GeneratorObjectPrototype::next)
|
|
|
+JS_DEFINE_NATIVE_FUNCTION(GeneratorPrototype::next)
|
|
|
{
|
|
|
auto* generator_object = TRY(typed_this_object(global_object));
|
|
|
return generator_object->next_impl(vm, global_object, vm.argument(0), {});
|
|
|
}
|
|
|
|
|
|
// 27.5.1.3 Generator.prototype.next ( value ), https://tc39.es/ecma262/#sec-generator.prototype.return
|
|
|
-JS_DEFINE_NATIVE_FUNCTION(GeneratorObjectPrototype::return_)
|
|
|
+JS_DEFINE_NATIVE_FUNCTION(GeneratorPrototype::return_)
|
|
|
{
|
|
|
auto* generator_object = TRY(typed_this_object(global_object));
|
|
|
generator_object->set_done();
|
|
@@ -47,7 +47,7 @@ JS_DEFINE_NATIVE_FUNCTION(GeneratorObjectPrototype::return_)
|
|
|
}
|
|
|
|
|
|
// 27.5.1.4 Generator.prototype.next ( value ), https://tc39.es/ecma262/#sec-generator.prototype.throw
|
|
|
-JS_DEFINE_NATIVE_FUNCTION(GeneratorObjectPrototype::throw_)
|
|
|
+JS_DEFINE_NATIVE_FUNCTION(GeneratorPrototype::throw_)
|
|
|
{
|
|
|
auto* generator_object = TRY(typed_this_object(global_object));
|
|
|
return generator_object->next_impl(vm, global_object, {}, vm.argument(0));
|