Skip to content

Commit c377cb7

Browse files
committed
Resolve install() with false for an empty langs sequence.
The prose already states the promise resolves to false if options.langs is empty, but no step implemented it: an empty sequence vacuously passes the unsupported-language check and then trivially succeeds with no downloads, resolving to true. Add an explicit step, matching how the availability algorithm treats an empty sequence as unavailable.
1 parent 1274d1a commit c377cb7

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

index.bs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,8 @@ See <a href="https://lists.w3.org/Archives/Public/public-speech-api/2012Sep/0072
422422
1. Let <var>promise</var> be <a>a new promise</a>.
423423
1. If the [=current settings object=]'s [=relevant global object=]'s [=associated Document=] is NOT [=fully active=], reject <var>promise</var> with an {{InvalidStateError}}, abort these steps, returning <var>promise</var>.
424424
1. If any <var>lang</var> in {{SpeechRecognitionOptions/langs}} of <var>options</var> is not a valid [[!BCP47]] language tag, reject <var>promise</var> with a {{SyntaxError}}, abort these steps, returning <var>promise</var>.
425-
1. If the on-device speech recognition language pack for any <var>lang</var> in {{SpeechRecognitionOptions/langs}} of <var>options</var> is unsupported, resolve <var>promise</var> with false, abort these steps, returning <var>promise</var>.
425+
1. If {{SpeechRecognitionOptions/langs}} of <var>options</var> is an empty sequence, resolve <var>promise</var> with <code>false</code>, abort these steps, returning <var>promise</var>.
426+
1. If the on-device speech recognition language pack for any <var>lang</var> in {{SpeechRecognitionOptions/langs}} of <var>options</var> is unsupported, resolve <var>promise</var> with <code>false</code>, abort these steps, returning <var>promise</var>.
426427
1. [=In parallel=], run the following steps:
427428
1. For each <var>lang</var> in {{SpeechRecognitionOptions/langs}} of <var>options</var>, initiate the download of the on-device speech recognition language pack for <var>lang</var> matching the requested {{SpeechRecognitionOptions/quality}} level floor.
428429
<p class=note>

0 commit comments

Comments
 (0)