fix & improve AST_TemplateString (#2410)

- resolve `semicolons:false` ambiguity with tagged literals
- allow `side_effects` to work on template literals
- traverse `AST_TemplateString` properly

fixes #2401
This commit is contained in:
Alex Lam S.L
2017-10-28 11:36:09 +08:00
committed by GitHub
parent 2848596280
commit 6ab73c7bd5
5 changed files with 87 additions and 26 deletions

View File

@@ -448,10 +448,8 @@ var AST_TemplateString = DEFNODE("TemplateString", "segments", {
},
_walk: function(visitor) {
return visitor._visit(this, function(){
this.segments.forEach(function(seg, i){
if (i % 2 !== 0) {
seg._walk(visitor);
}
this.segments.forEach(function(seg){
seg._walk(visitor);
});
});
}