BroadcastChannel.postMessage should throw an InvalidStateError DOMException when channel is closed

RESOLVED FIXED in Firefox 49

Status

()

Core
DOM
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: Marijn, Assigned: baku)

Tracking

Trunk
mozilla49
Points:
---

Firefox Tracking Flags

(firefox49 fixed)

Details

(Whiteboard: btpp-active)

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.36 Safari/537.36

Steps to reproduce:

Run the following javascript code:

let c = new BroadcastChannel("foo");
c.close();
c.postMessage("bar");


Actual results:

This throws Exception { message: "", result: 2147500037, name: "NS_ERROR_FAILURE", filename: "debugger eval code", lineNumber: 1, columnNumber: 0, data: null, stack: "@debugger eval code:1:7 " }


Expected results:

According to the spec [1] this should throw an InvalidStateError DOMException

[1]: https://html.spec.whatwg.org/multipage/comms.html#dom-broadcastchannel-postmessage

Updated

2 years ago
Flags: needinfo?(amarchesini)
(Assignee)

Updated

2 years ago
Assignee: nobody → amarchesini
Flags: needinfo?(amarchesini)
(Assignee)

Comment 1

2 years ago
Created attachment 8754778 [details] [diff] [review]
bc1.patch
Attachment #8754778 - Flags: review?(bugs)
(Assignee)

Updated

2 years ago
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: btpp-active

Comment 2

2 years ago
Comment on attachment 8754778 [details] [diff] [review]
bc1.patch

curious, can PostMessageInternal throw non-DOM errors?
Attachment #8754778 - Flags: review?(bugs) → review+

Comment 4

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/b3e9f93a67f4
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox49: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
You need to log in before you can comment on or make changes to this bug.