Closed Bug 1361475 Opened 3 years ago Closed 3 years ago

AudioContext() constructor should not throw error when invoked with argument

Categories

(Core :: Web Audio, defect, P2)

53 Branch
defect

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: tomerlahav, Assigned: padenot)

Details

(Keywords: dev-doc-complete)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36

Steps to reproduce:

Run the following code:
new AudioContext({latencyHint: 'playback'});


Actual results:

Error is thrown:
TypeError: Argument 1 of AudioContext.constructor '[object Object]' is not a valid value for enumeration AudioChannel.


Expected results:

At the very least, this should not throw an error.
AudioContext() constructor should accept an options argument:
https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/AudioContext
current implementation doesn't match to the spec.

https://dxr.mozilla.org/mozilla-central/rev/48c0fd9c9ec5d68061ea7b59358874ae8da72572/dom/webidl/AudioContext.webidl#14
> [Constructor,
>  Constructor(AudioChannel audioChannelType),
>  Pref="dom.webaudio.enabled"]
> interface AudioContext : BaseAudioContext {

https://dxr.mozilla.org/mozilla-central/rev/48c0fd9c9ec5d68061ea7b59358874ae8da72572/dom/webidl/AudioChannel.webidl#41-50
> enum AudioChannel {
>   "normal",
>   "content",
>   "notification",
>   "alarm",
>   "telephony",
>   "ringer",
>   "publicnotification",
>   "system"
> };
Status: UNCONFIRMED → NEW
Component: Untriaged → Web Audio
Ever confirmed: true
Product: Firefox → Core
Assignee: nobody → padenot
Comment on attachment 8864498 [details]
Bug 1361475 - Remove proprietary constructor on AudioContext.

https://reviewboard.mozilla.org/r/136172/#review139160
Attachment #8864498 - Flags: review?(amarchesini) → review+
Pushed by paul@paul.cx:
https://hg.mozilla.org/integration/autoland/rev/68543862570f
Remove proprietary constructor on AudioContext. r=baku
Rank: 25
Priority: -- → P2
https://hg.mozilla.org/mozilla-central/rev/68543862570f
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.