How can GetModuleNamespace throw a SyntaxError?

Isiah Meadows isiahmeadows at
Thu Dec 10 06:11:24 UTC 2015

It has to do with circular exported bindings. And IMHO a SyntaxError
is the wrong error to throw (it should really throw a ReferenceError,
as it's a circular reference).

// foo.js
export {name} from "./bar.js"

// bar.js
export {name} from "./foo.js"

// main.js
import * as foo from "./foo.js" // Error!

See the note in
That should help you.

On Wed, Dec 9, 2015 at 2:44 PM, Jon Coppeard <jcoppeard at> wrote:
> In the definition of GetModuleNamespace (section, a
> SyntaxError is thrown if we fail to resolve an exported name:
>> 3.d.iii If resolution is null, throw a SyntaxError exception.
> What situation leads to this error?
> I wasn't able to come up with an example that would make this happen,
> and my attempts all generated a SyntaxError at an earlier point.  It
> seems that GetExportedNames should only return names that will
> successfully resolve, but I may be missing something.
> Thanks,
> Jon
> _______________________________________________
> es-discuss mailing list
> es-discuss at

Isiah Meadows

More information about the es-discuss mailing list