Skip to content

Exposing an interface "on all globals" #468

@littledan

Description

@littledan

For WebAssembly, I'm using WebIDL to specify the interface between WebAssembly and JavaScript in this PR. 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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions