Skip to content

Declaring modules in WebIDL #592

Open
@littledan

Description

@littledan

There's talk in various places about adding built-in modules to JavaScript and the Web Platform. For this, it could be useful to add support to WebIDL for defining a module.

namespace/[LegacyNamespace=...] could be a good model here, but lots of details are a bit different, as modules don't have all the flexibility of objects. For example, attributes in modules (which will always be readonly) shouldn't trigger any kind of evaluation/execution when they are accessed.

We could start with modules exporting only functions and interfaces (classes). It could look something like this:

module "std::foo" {
  double sum(double x, double y);
}
[Module="std::foo"]
interface Bar { }

Thoughts?

(this issue should be tagged jsidl)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions