Skip to content

decodeAudioData step 3 has the test inverted #2646

@bakkot

Description

@bakkot

decodeAudioData step 3/4 says:

  1. If audioData is detached, execute the following steps:
    1. Append promise to [[pending promises]].
    2. Detach the audioData ArrayBuffer. If this operations throws, jump to the step 3.
    3. Queue a decoding operation to be performed on another thread.
  2. Else, execute the following error steps:
    1. Let error be a DataCloneError.
    2. Reject promise with error, and remove it from [[pending promises]].
    3. Queue a media element task to invoke errorCallback with error.

That's backwards. The first case is for buffers which are not detached. This appears to have gotten broken in #2603; previously it said "If IsDetachedBuffer on audioData is false".


Also, the "jump to the step 3" part is incoherent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions