mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 23:58:11 +00:00
LibJS: Make Heap::allocate<T>() infallible
Stop worrying about tiny OOMs. Work towards #20449. While going through these, I also changed the function signature in many places where returning ThrowCompletionOr<T> is no longer necessary.
This commit is contained in:
parent
980e7164fe
commit
72c9f56c66
337 changed files with 1229 additions and 1251 deletions
|
@ -59,7 +59,7 @@ ThrowCompletionOr<NonnullGCPtr<PromiseCapability>> new_promise_capability(VM& vm
|
|||
// 2. NOTE: C is assumed to be a constructor function that supports the parameter conventions of the Promise constructor (see 27.2.3.1).
|
||||
|
||||
// 3. Let resolvingFunctions be the Record { [[Resolve]]: undefined, [[Reject]]: undefined }.
|
||||
auto resolving_functions = TRY(vm.heap().allocate<ResolvingFunctions>(realm));
|
||||
auto resolving_functions = vm.heap().allocate<ResolvingFunctions>(realm);
|
||||
|
||||
// 4. Let executorClosure be a new Abstract Closure with parameters (resolve, reject) that captures resolvingFunctions and performs the following steps when called:
|
||||
auto executor_closure = [resolving_functions](auto& vm) -> ThrowCompletionOr<Value> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue