mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:07:35 +00:00
LibJS: Convert GeneratorObject::create() to NonnullGCPtr
This commit is contained in:
parent
d21ac9d820
commit
83de01043f
2 changed files with 3 additions and 3 deletions
|
@ -14,7 +14,7 @@
|
|||
|
||||
namespace JS {
|
||||
|
||||
ThrowCompletionOr<GeneratorObject*> GeneratorObject::create(Realm& realm, Value initial_value, ECMAScriptFunctionObject* generating_function, ExecutionContext execution_context, Bytecode::RegisterWindow frame)
|
||||
ThrowCompletionOr<NonnullGCPtr<GeneratorObject>> GeneratorObject::create(Realm& realm, Value initial_value, ECMAScriptFunctionObject* generating_function, ExecutionContext execution_context, Bytecode::RegisterWindow frame)
|
||||
{
|
||||
auto& vm = realm.vm();
|
||||
// This is "g1.prototype" in figure-2 (https://tc39.es/ecma262/img/figure-2.png)
|
||||
|
@ -32,7 +32,7 @@ ThrowCompletionOr<GeneratorObject*> GeneratorObject::create(Realm& realm, Value
|
|||
object->m_generating_function = generating_function;
|
||||
object->m_frame = move(frame);
|
||||
object->m_previous_value = initial_value;
|
||||
return object;
|
||||
return NonnullGCPtr { *object };
|
||||
}
|
||||
|
||||
GeneratorObject::GeneratorObject(Realm&, Object& prototype, ExecutionContext context)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue