Skip to content

Commit bc118db

Browse files
Merge pull request estools#272 from adamjmcgrath/fix-export-specifier
Add exported identifier to ExportSpecifier for esprima
2 parents f48fa71 + 9ab203a commit bc118db

4 files changed

Lines changed: 8 additions & 3 deletions

File tree

escodegen.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2262,10 +2262,10 @@
22622262
},
22632263

22642264
ExportSpecifier: function (expr, precedence, flags) {
2265-
var exported = (expr.id || expr.imported).name;
2266-
var result = [ exported ];
2265+
var name = (expr.id || expr.imported || expr.exported).name;
2266+
var result = [ name ];
22672267
var id = expr.name || expr.local;
2268-
if (id && id.name !== exported) {
2268+
if (id && id.name !== name) {
22692269
result.push(noEmptySpace() + 'as' + noEmptySpace() + generateIdentifier(id));
22702270
}
22712271
return result;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export {
2+
foo
3+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export{foo}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { foo };

0 commit comments

Comments
 (0)