labeledmodules/labeled-modules-spec — Issue #1: Allow variable passthrough
Author: calyptus
Created: 2012-02-15 13:35:59+00:00
State: open

We could allow a passthrough of variables by having string literals follow the exports label.

exports: "A", "B", "C";

This would be equivalent to ES.next:

export * from "A";
export * from "B";
export * from "C";

It's also compatible with script tag loading.

The problem is that the exports object require getters/setters to let multiple exports objects merge into one object while retaining variable binding. This would not let the spec run in ES3 and still be compatible with CommonJS. Perhaps there's a clever way to handle it and still be backwards compatible?

We could also define this statement to COPY the exports from one to another. Although this is inconsistent with the current semantics. It can also break cyclic dependencies.