mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:17:35 +00:00
LibJS: Convert to_object() to ThrowCompletionOr
This commit is contained in:
parent
9eb065a1f6
commit
52976bfac6
45 changed files with 239 additions and 490 deletions
|
@ -17,10 +17,7 @@ GeneratorObject* GeneratorObject::create(GlobalObject& global_object, Value init
|
|||
{
|
||||
// This is "g1.prototype" in figure-2 (https://tc39.es/ecma262/img/figure-2.png)
|
||||
auto generating_function_prototype = TRY_OR_DISCARD(generating_function->get(global_object.vm().names.prototype));
|
||||
auto* generating_function_prototype_object = generating_function_prototype.to_object(global_object);
|
||||
if (!generating_function_prototype_object)
|
||||
return {};
|
||||
|
||||
auto* generating_function_prototype_object = TRY_OR_DISCARD(generating_function_prototype.to_object(global_object));
|
||||
auto object = global_object.heap().allocate<GeneratorObject>(global_object, global_object, *generating_function_prototype_object);
|
||||
object->m_generating_function = generating_function;
|
||||
object->m_environment = generating_scope;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue