clean up loose template literals

This commit is contained in:
Sebastian McKenzie 2015-01-14 08:55:24 +11:00
parent 6b836de306
commit e258b85420
2 changed files with 5 additions and 5 deletions

View File

@ -42,7 +42,8 @@ File.helpers = [
File.excludeHelpersFromRuntime = [
"async-to-generator",
"typeof"
"typeof",
"tagged-template-literal-loose"
];
File.normaliseOptions = function (opts) {

View File

@ -20,11 +20,10 @@ exports.TaggedTemplateExpression = function (node, parent, file) {
strings = t.arrayExpression(strings);
raw = t.arrayExpression(raw);
var template = file.isLoose("templateLiterals") ?
"tagged-template-literal-loose" :
"tagged-template-literal";
var templateName = "tagged-template-literal";
if (file.isLoose("templateLiterals")) templateName += "-loose";
args.push(t.callExpression(file.addHelper(templateName), [strings, raw]));
args.push(t.callExpression(file.addHelper(template), [strings, raw]));
args = args.concat(quasi.expressions);
return t.callExpression(node.tag, args);