1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:57:35 +00:00

LibJS: Add missing MUST in DisposableStack.prototype.use

Although the spec has a TRY here I believe this is a spec issue
together with the missing TRY just above this change.
This commit is contained in:
davidot 2023-01-24 16:27:40 +01:00 committed by Linus Groh
parent 42606c87e3
commit bb483c8308

View file

@ -100,7 +100,8 @@ JS_DEFINE_NATIVE_FUNCTION(DisposableStackPrototype::use)
}
// d. Else,
// i. Perform ? AddDisposableResource(disposableStack, value, sync-dispose, method).
add_disposable_resource(vm, disposable_stack->disposable_resource_stack(), value, Environment::InitializeBindingHint::SyncDispose, method);
// FIXME: Fairly sure this can't fail, see https://github.com/tc39/proposal-explicit-resource-management/pull/142
MUST(add_disposable_resource(vm, disposable_stack->disposable_resource_stack(), value, Environment::InitializeBindingHint::SyncDispose, method));
}
// 5. Return value.