[w3c/push-api] PushSubscriptionOptions ArrayBuffer lifetime issues (#198)

PushSubscriptionOptions is spec'd as:

```
interface PushSubscriptionOptions {
    readonly        attribute boolean      userVisibleOnly;
    [Throws]
    readonly        attribute ArrayBuffer? applicationServerKey;
};
```

1. What does `[Throws]` do? I couldn't find it in [WebIDL](https://heycam.github.io/webidl/) - is it Mozilla-specific IDL syntax?

2. Should the ArrayBuffer be marked [SameObject] since it never changes to allow `==` comparison?

3. What happens if the developer [detaches the ArrayBuffer](https://heycam.github.io/webidl/#dfn-detach) by passing it in the `transfer` argument to [postMessage](https://html.spec.whatwg.org/multipage/comms.html#dom-window-postmessage) (or using [`ArrayBuffer.transfer()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/transfer))? Do we need to freeze it or something like that? Would freezing even have any effect, since the data being detached is stored in an internal slot? See also [w3c issue 23369](https://www.w3.org/Bugs/Public/show_bug.cgi?id=23369). For example I noticed that @annevk used [`[NewObject]`](https://heycam.github.io/webidl/#NewObject) for https://encoding.spec.whatwg.org/#textencoder, but we probably can't use that here since `[NewObject]` is only for methods, not for attributes.

@martinthomson @beverloo 

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/push-api/issues/198

Received on Tuesday, 5 July 2016 18:07:23 UTC