Skip to content

Commit 9e5f89d

Browse files
committed
Add exported identifier to ExportSpecifier for esprima
See estools#271
1 parent f48fa71 commit 9e5f89d

4 files changed

Lines changed: 8 additions & 4 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
@@ -1,2 +1,5 @@
11
export default function a() {
22
}
3+
export {
4+
foo
5+
};
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export default function a(){}
1+
export default function a(){}export{foo}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export default function a () { }
2+
export { foo };
23
// export default var i = 20;
34
// export default const K = 20;

0 commit comments

Comments
 (0)