From bb483c83087acfe78da2a18905cc9a9d8b93014c Mon Sep 17 00:00:00 2001 From: davidot Date: Tue, 24 Jan 2023 16:27:40 +0100 Subject: [PATCH] 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. --- Userland/Libraries/LibJS/Runtime/DisposableStackPrototype.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/Runtime/DisposableStackPrototype.cpp b/Userland/Libraries/LibJS/Runtime/DisposableStackPrototype.cpp index 9ba270ce15..74c136f638 100644 --- a/Userland/Libraries/LibJS/Runtime/DisposableStackPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/DisposableStackPrototype.cpp @@ -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.