Open xjamundx opened 9 years ago
I have a few other nitpicky things. I'll file separate issues if you like but for now I'll just add them here, so as not to spam your repo :)
As per Espree spec https://github.com/estree/estree/blob/master/es6.md#modulespecifier the ImportSpecifier
should expect local
instead of an id
. This can be easily fixed by adding || expr.local
below:
ImportDefaultSpecifier: function (expr, precedence, flags) {
return generateIdentifier(expr.id || expr.local);
}
Here is my copy with it fixed: https://github.com/xjamundx/escodegen/blob/export-default/escodegen.js#L2236
Hey @xjamundx your implementations were great. Can you add them as PRs?
@xjamundx oh i realy love your idea,and it fixed my bugs!
Yay I think this was finally fixed!
It seems this project uses
ExportDeclaration
for bothexport
andexport default
. As far as I can tell most projects (including espree, estree, and estraverse) are now usingExportDefaultDeclaration
for these nodes, butescodegen
is complaining with the following when I try to use it:This hacky code will actually unblock the common use case... https://github.com/xjamundx/escodegen/blob/export-default/escodegen.js#L1268
See also: https://github.com/estree/estree/blob/master/es6.md#exportdefaultdeclaration