Minor questions on new module BNF

Sam Tobin-Hochstadt samth at ccs.neu.edu
Mon Jun 3 00:11:29 PDT 2013

On Sun, Jun 2, 2013 at 11:59 PM, Domenic Denicola
<domenic at domenicdenicola.com> wrote:
> Sam was saying that http://wiki.ecmascript.org/doku.php?id=harmony:modules is up to date. If so, I'm seeing a few things missing from the BNF. It would be great to get these clarified so people can start writing accurate transpilers.
> 1. It looks like `ExportDeclaration` can only occur inside `ModuleBody`, which itself can only occur as part of the named `ModuleDeclaration` production. I thought we would be able to export things without explicit named module declaration, so shouldn't `ExportDeclaration` be added to `ScriptElement`? Or perhaps to `Statement`? At http://wiki.ecmascript.org/doku.php?id=harmony:modules_examples the "compiler/Lexer.js" example contains such a situation, which seems invalid from the current grammar.

The idea here is that modules will typically be written in files like
"compiler/Lexer.js", where the starting grammar production *is*

> 2. Is there any way to simply "execute" a module that does not export anything? This is a common technique in both client and server-side JavaScript today, e.g.

I would just write `import {} from "someModule";`


More information about the es-discuss mailing list