UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/56.0.2924.76 Chrome/56.0.2924.76 Safari/537.36
Steps to reproduce the problem:
1. Execute the following code in the context of a service worker:
new ExtendableMessageEvent('name').ports;
What is the expected behavior?
The expression should evaluate to an Array of length 0
What went wrong?
The expression evaluates to `null`
Did this work before? N/A
Does this work in other browsers? Yes
Chrome version: 58.0.3029.19 Channel: dev
OS Version:
Flash Version:
According to the WebIDL definition [1], the default value of this property
should be an empty array. The same behavior is observable when an
`eventInitDict` without a `ports` property is specified and when the dictionary
specifies the value `undefined` for `ports`:
new ExtendableMessageEvent('name', {}).ports;
new ExtendableMessageEvent('name', { ports: undefined }).ports;
[1] https://w3c.github.io/ServiceWorker/#extendablemessageevent-interface
> # 4.8. ExtendableMessageEvent
>
> dictionary ExtendableMessageEventInit : ExtendableEventInit {
> any data = null;
> USVString origin = "";
> DOMString lastEventId = "";
> (Client or ServiceWorker or MessagePort)? source = null;
> sequence<MessagePort> ports = [];
> };
Comment 1 by m...@mikepennisi.com
, Mar 16 2017