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

Merge SpeechSynthesisUtterance constructor overloads #48

Merged
merged 1 commit into from
Oct 1, 2018

Conversation

foolip
Copy link
Member

@foolip foolip commented Sep 29, 2018

This old and new IDL is not equivalent because
https://heycam.github.io/webidl/#dfn-overload-resolution-algorithm first
considers the number of arguments, so given one argument the
Constructor(DOMString text) overload is used. With optional arguments,
however, trailing undefined arguments are ignored so that foo(undefined) will
be indistinguishable from foo().

In other words, the behavior of new SpeechSynthesisUtterance(undefined)
changes here, from resulting in a text of "undefined" to "".

This in itself doesn't really matter, but if we want to add an init dict for
SpeechSynthesisUtterance it would be optional, and then that would result in
the behavior changing to what this change does.

Tests: web-platform-tests/wpt#13018


Preview | Diff

This old and new IDL is not equivalent because
https://heycam.github.io/webidl/#dfn-overload-resolution-algorithm first
considers the number of arguments, so given one argument the
`Constructor(DOMString text)` overload is used. With optional arguments,
however, trailing undefined arguments are ignored so that `foo(undefined)` will
be indistinguishable from `foo()`.

In other words, the behavior of `new SpeechSynthesisUtterance(undefined)`
changes here, from resulting in a `text` of "undefined" to "".

This in itself doesn't really matter, but if we want to add an init dict for
SpeechSynthesisUtterance it would be optional, and then that would result in
the behavior changing to what this change does.

Tests: web-platform-tests/wpt#13018
foolip added a commit to web-platform-tests/wpt that referenced this pull request Sep 29, 2018
@foolip foolip merged commit e3b96a8 into master Oct 1, 2018
@foolip foolip deleted the SpeechSynthesisUtterance-constructor-overloads branch October 1, 2018 14:23
foolip added a commit to web-platform-tests/wpt that referenced this pull request Oct 1, 2018
This is targeting a mundane difference in `new
SpeechSynthesisUtterance(undefined)` depending on whether the IDL definition of
the construtor uses a single constructor with an optional argument, or two
constructor overloads with zero and one argument respectively.

Follows WICG/speech-api#48.
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Oct 8, 2018
…ndefined), a=testonly

Automatic update from web-platform-testsTest new SpeechSynthesisUtterance(null/undefined) (#13018)

This is targeting a mundane difference in `new
SpeechSynthesisUtterance(undefined)` depending on whether the IDL definition of
the construtor uses a single constructor with an optional argument, or two
constructor overloads with zero and one argument respectively.

Follows WICG/speech-api#48.
--

wpt-commits: e5dcf1ae9902517fbbfda03fa2dd372f4aa18a34
wpt-pr: 13018
xeonchen pushed a commit to xeonchen/gecko-cinnabar that referenced this pull request Oct 9, 2018
…ndefined), a=testonly

Automatic update from web-platform-testsTest new SpeechSynthesisUtterance(null/undefined) (#13018)

This is targeting a mundane difference in `new
SpeechSynthesisUtterance(undefined)` depending on whether the IDL definition of
the construtor uses a single constructor with an optional argument, or two
constructor overloads with zero and one argument respectively.

Follows WICG/speech-api#48.
--

wpt-commits: e5dcf1ae9902517fbbfda03fa2dd372f4aa18a34
wpt-pr: 13018
boazsender pushed a commit to bocoup/wpt that referenced this pull request Sep 10, 2019
…#13018)

This is targeting a mundane difference in `new
SpeechSynthesisUtterance(undefined)` depending on whether the IDL definition of
the construtor uses a single constructor with an optional argument, or two
constructor overloads with zero and one argument respectively.

Follows WICG/speech-api#48.
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 3, 2019
…ndefined), a=testonly

Automatic update from web-platform-testsTest new SpeechSynthesisUtterance(null/undefined) (#13018)

This is targeting a mundane difference in `new
SpeechSynthesisUtterance(undefined)` depending on whether the IDL definition of
the construtor uses a single constructor with an optional argument, or two
constructor overloads with zero and one argument respectively.

Follows WICG/speech-api#48.
--

wpt-commits: e5dcf1ae9902517fbbfda03fa2dd372f4aa18a34
wpt-pr: 13018

UltraBlame original commit: 89a485a70c00e524e96a52b0ce502077ca7e662b
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 3, 2019
…ndefined), a=testonly

Automatic update from web-platform-testsTest new SpeechSynthesisUtterance(null/undefined) (#13018)

This is targeting a mundane difference in `new
SpeechSynthesisUtterance(undefined)` depending on whether the IDL definition of
the construtor uses a single constructor with an optional argument, or two
constructor overloads with zero and one argument respectively.

Follows WICG/speech-api#48.
--

wpt-commits: e5dcf1ae9902517fbbfda03fa2dd372f4aa18a34
wpt-pr: 13018

UltraBlame original commit: 89a485a70c00e524e96a52b0ce502077ca7e662b
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 3, 2019
…ndefined), a=testonly

Automatic update from web-platform-testsTest new SpeechSynthesisUtterance(null/undefined) (#13018)

This is targeting a mundane difference in `new
SpeechSynthesisUtterance(undefined)` depending on whether the IDL definition of
the construtor uses a single constructor with an optional argument, or two
constructor overloads with zero and one argument respectively.

Follows WICG/speech-api#48.
--

wpt-commits: e5dcf1ae9902517fbbfda03fa2dd372f4aa18a34
wpt-pr: 13018

UltraBlame original commit: 89a485a70c00e524e96a52b0ce502077ca7e662b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants