Skip to content

Commit

Permalink
Use for-loop for template literal conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
zertosh committed Mar 25, 2017
1 parent 539af05 commit d2ce789
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions babylon-to-espree/toAST.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ var astTransformVisitor = {

// template string range fixes
if (path.isTemplateLiteral()) {
node.quasis.forEach((q) => {
for (var j = 0; j < node.quasis.length; j++) {
var q = node.quasis[j];
q.range[0] -= 1;
if (q.tail) {
q.range[1] += 1;
Expand All @@ -228,7 +229,7 @@ var astTransformVisitor = {
} else {
q.loc.end.column += 2;
}
});
}
}
}
};

0 comments on commit d2ce789

Please sign in to comment.