Open jgable opened 10 years ago
export
is only allowed in Module. Not in Script.
Make sure you are using parser.parseModule and not parser.parseScript.
An import
is allowed in a script but an export
is not? That seems odd. There is a unit test directly below mine I took as an example that uses an import statement.
import
was allowed in Script
for while. The spec draft no longer allows it but we haven't updated our code yet.
I am reopening this as a way to track:
import
in Script
.@jgable how did you get the output you show? It does not seem to come from the unit test code.
@arv The parseModule worked like a charm.
@johnjbarton I just did a console.log(actual)
(it's commented out in my unit test example above) and when I ran make test/unit
it spits it out.
Issue #753 is item 2 on my list above.
I'm experiencing some source maps being off by about 3-4 lines consistently when compiling modules of non trivial size. A full example can be seen by following directions over at ModuleLoader/es6-module-loader#91 (Note that es6-module-loader uses version 0.0.9 of traceur).
I cloned this repo locally and tried to add a unit test to figure out whether it was this project or maybe a misuse by the module loader but am hitting a roadblock because when parsing a file with an export (or default) keyword there is a syntax error generated in the code.
Example Input
Output
Full unit test I was trying to run is along these lines: