Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow null for return values of getters, matching proses #88

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,15 @@ interface SpeechRecognitionAlternative {
[Exposed=Window]
interface SpeechRecognitionResult {
readonly attribute unsigned long length;
getter SpeechRecognitionAlternative item(unsigned long index);
getter SpeechRecognitionAlternative? item(unsigned long index);
readonly attribute boolean isFinal;
};

// A collection of responses (used in continuous mode)
[Exposed=Window]
interface SpeechRecognitionResultList {
readonly attribute unsigned long length;
getter SpeechRecognitionResult item(unsigned long index);
getter SpeechRecognitionResult? item(unsigned long index);
};

// A full response, which could be interim or final, part of a continuous response or not
Expand Down Expand Up @@ -245,7 +245,7 @@ interface SpeechGrammar {
interface SpeechGrammarList {
constructor();
readonly attribute unsigned long length;
getter SpeechGrammar item(unsigned long index);
getter SpeechGrammar? item(unsigned long index);
undefined addFromURI(DOMString src,
optional float weight = 1.0);
undefined addFromString(DOMString string,
Expand Down Expand Up @@ -510,6 +510,7 @@ This structure has the following attributes:</p>

<dt><dfn method for=SpeechGrammarList>item(<var>index</var>)</dfn> getter</dt>
<dd>The item getter returns a SpeechGrammar from the index into an array of grammars.
If index is greater than or equal to length, this returns null.
The user agent must ensure that the length attribute is set to the number of elements in the array.
The user agent must ensure that the index order from smallest to largest matches the order in which grammars were added to the array.</dd>

Expand Down