Open
Description
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)