Skip to content

Commit

Permalink
Allow specifying the original name of nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
iBelieve committed May 3, 2020
1 parent a3b6718 commit eafbc38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions escodegen.js
Original file line number Diff line number Diff line change
Expand Up @@ -526,9 +526,9 @@
}
}
if (node.loc == null) {
return new SourceNode(null, null, sourceMap, generated, node.name || null);
return new SourceNode(null, null, sourceMap, generated, node.originalName || node.name || null);
}
return new SourceNode(node.loc.start.line, node.loc.start.column, (sourceMap === true ? node.loc.source || null : sourceMap), generated, node.name || null);
return new SourceNode(node.loc.start.line, node.loc.start.column, (sourceMap === true ? node.loc.source || null : sourceMap), generated, node.originalName || node.name || null);
}

function noEmptySpace() {
Expand Down

0 comments on commit eafbc38

Please sign in to comment.