mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibJS: Convert to_object() to ThrowCompletionOr
This commit is contained in:
parent
9eb065a1f6
commit
52976bfac6
Notes:
sideshowbarker
2024-07-18 02:47:31 +09:00
Author: https://github.com/linusg
Commit: 52976bfac6
Pull-request: https://github.com/SerenityOS/serenity/pull/10452
Reviewed-by: https://github.com/IdanHo ✅
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