[heycam/webidl] Declaring modules in WebIDL (#592)

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)

-- 
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/592

Received on Tuesday, 4 December 2018 08:38:34 UTC