LibJS: Implement the GetMethod() abstract operation as a Value method

This was a standalone function previously (get_method()), but instead of
passing a Value to it, we can just make it a method.

Also add spec step comments and fix the receiver value by using GetV().
This commit is contained in:
Linus Groh 2021-06-26 19:24:35 +01:00
commit 337ad6d15c
Notes: sideshowbarker 2024-07-18 11:28:24 +09:00
8 changed files with 48 additions and 41 deletions

View file

@ -101,7 +101,7 @@ void iterator_close(Object& iterator)
vm.unwind(unwind_until, unwind_until_label);
};
auto return_method = get_method(global_object, &iterator, vm.names.return_);
auto return_method = Value(&iterator).get_method(global_object, vm.names.return_);
if (!return_method)
return restore_completion(); // If return is undefined, return Completion(completion).