-
Notifications
You must be signed in to change notification settings - Fork 30
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
+1
−2
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
saschanaz
approved these changes
Sep 30, 2018
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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)
willbe 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