This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 13675 - MessageEvent::ports should be a nullable platform array object for interop
Summary: MessageEvent::ports should be a nullable platform array object for interop
Status: RESOLVED WONTFIX
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: Web Messaging (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-04 18:27 UTC by Travis Leithead [MSFT]
Modified: 2011-08-05 15:24 UTC (History)
3 users (show)

See Also:


Attachments

Description Travis Leithead [MSFT] 2011-08-04 18:27:33 UTC
The ports property of MessageEvent is currently defined as:

readonly attribute MessagePort[] ports;

however, IE10, Chrome, and Safari all return null when no ports were provided. (Opera returns an empty array as per the spec.) Not sure what Firefox is returning...

For better interop, consider changing the type of the ports property to a nullable platform array object:

readonly attribute MessagePort[]? ports; 
(with accompaning changes in the algorithms)
Comment 1 Ian 'Hixie' Hickson 2011-08-05 15:24:16 UTC
It would be much better to return an empty array. Returning null or an array is a great way to have programming errors.