From 2e6b67713842c1b4f6650e35f018ea1e88a72aa1 Mon Sep 17 00:00:00 2001 From: Paul Adenot Date: Fri, 16 Jan 2026 15:28:38 +0100 Subject: [PATCH] Fix decodeAudioData algorithm logic Per WG resolution 2025-05-15: - Step 3 condition now correctly says "is not detached" instead of "is detached" - Step 3.2 now correctly jumps to step 4.1 (error handling) if the ArrayBuffer detach operation throws Also fixed "this operations" -> "this operation" typo. This fixes #2637 and fixes #2646. --- index.bs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.bs b/index.bs index 9da6cb2c0..372950e3f 100644 --- a/index.bs +++ b/index.bs @@ -1237,14 +1237,14 @@ Methods 2. Let promise be a new Promise. - 3. If {{BaseAudioContext/decodeAudioData(audioData, successCallback, errorCallback)/audioData!!argument}} - is [=BufferSource/detached=], execute the following steps: + 3. If {{BaseAudioContext/decodeAudioData(audioData, successCallback, errorCallback)/audioData!!argument}} + is not [=BufferSource/detached=], execute the following steps: 1. Append promise to {{BaseAudioContext/[[pending promises]]}}. 2. [=ArrayBuffer/Detach=] the {{BaseAudioContext/decodeAudioData(audioData, successCallback, errorCallback)/audioData!!argument}} {{ArrayBuffer}}. - If this operations throws, jump to the step 3. + If this operation throws, jump to step 4.1. 3. Queue a decoding operation to be performed on another thread.