WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
94310
[JSC] window.postMessage() throws wrong exception types
https://bugs.webkit.org/show_bug.cgi?id=94310
Summary
[JSC] window.postMessage() throws wrong exception types
Chris Dumez
Reported
2012-08-17 01:09:19 PDT
According the HTML5 communication spec (
http://www.w3.org/TR/html5/comms.html#dom-window-postmessage-2
), window.postMessage() "Throws an INVALID_STATE_ERR if the ports array is not null and it contains either null entries or duplicate ports." but we currently throw a TypeError in this case. According to the structured clone spec (
http://www.w3.org/TR/html5/common-dom-interfaces.html#structured-clone
), we are supposed to throw a DATA_CLONE_ERR exception and abort the overall structured clone algorithm if the input is an unsupported native object type (e.g. Error, Function) or a host object (e.g. a DOM node). We currently throw a TypeError in this case as well. The V8 implementation behaves according to specification. This is already tested by: fast/dom/Window/window-postmessage-clone-really-deep-array.html fast/events/message-port-multi.html
Attachments
Add attachment
proposed patch, testcase, etc.
Chris Dumez
Comment 1
2012-09-03 01:09:59 PDT
Dependencies have landed. Closing this bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug