ftsrg / codemodel-rifle

Graph-based incremental static analysis of ECMAScript 6 source code repositories
http://docs.inf.mit.bme.hu/codemodel-rifle/
Eclipse Public License 1.0
19 stars 3 forks source link

export { name1 as default } gets exported as variable with the name "default" #2

Closed luczsoma closed 7 years ago

luczsoma commented 7 years ago

When exporting from exporter.js with the syntax export { name1 as default } then name1 should be the default export of the module. Instead, it gets exported as an ordinary variable with the name "default". This is most possibly a Shift Parser bug.

steindani commented 7 years ago

Great question, I did not find any clarification in the specification http://www.ecma-international.org/ecma-262/6.0/#sec-exports. In my opinion Shift is only giving you the syntax tree and it is a semantic information that this is the same as an export default statement. This may be a default (hah!) transformation of our framework.

luczsoma commented 7 years ago

Thanks for the elaboration. I close this issue, as the "bug" (which is not a bug as is turns out) can be easily resolved by simply adding disposable semantic information to the transformation. I have already done that in commit c68e331.