[heycam/webidl] Exposing an interface "on all globals" (#468)

For WebAssembly, I'm using WebIDL to specify the interface between WebAssembly and JavaScript [in this PR](https://github.com/WebAssembly/spec/pull/591). We're trying to avoid tying this into the Web Platform. One of the few ways that the current spec does tie into the Web is, to expose the interface to global objects, it uses `[Exposed=(Window,Worker)]`.

What we really want for Wasm is for it to be exposed on all global objects. One aspect was accidentally omitting it on Worklets, but the bigger aspect is omitting it for everything that's not the web platform. For example, Node.js is likely to eventually enable Wasm support, and so the interface should be created on its global object as well.

I imagine that a version of Exposed which is everywhere might be useful for the Web Platform as well. APIs like TextEncoder which don't do any particular I/O wouldn't need a change each time another type of global object is added--they could be like new libraries added in the JavaScript standard.

What would you think about an additional extended attribute, or mode of using `[Exposed]`, to support this case?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/468

Received on Monday, 23 October 2017 18:11:36 UTC