remove use of template literals in plugin regression exec test for unsupported environments
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
var code = `
|
||||
(function() {
|
||||
function foo(b){
|
||||
b === "lol";
|
||||
foo(b);
|
||||
}
|
||||
})();
|
||||
`;
|
||||
var code = multiline([
|
||||
"(function() {",
|
||||
" function foo(b){",
|
||||
' b === "lol";',
|
||||
" foo(b);",
|
||||
" }",
|
||||
"})();",
|
||||
]);
|
||||
|
||||
transform(code, {
|
||||
plugins: [
|
||||
@@ -18,10 +18,12 @@ transform(code, {
|
||||
if (path.node.seen) {
|
||||
return;
|
||||
}
|
||||
|
||||
var node = t.blockStatement(path.node.body);
|
||||
node.seen = true;
|
||||
path.replaceWith(node);
|
||||
},
|
||||
|
||||
// do type inference
|
||||
BinaryExpression: function(path) {
|
||||
var left = path.get("left");
|
||||
@@ -31,7 +33,5 @@ transform(code, {
|
||||
}
|
||||
};
|
||||
}
|
||||
],
|
||||
compact: true,
|
||||
comments: false,
|
||||
}).code;
|
||||
]
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user