Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(function(){
(function() {
for (let x in y) y[x];
f(() => { g() });
})();
function g() {}
})();
`);
const ast = babel.transform(source, {
presets: ["env"],
sourceType: "script",
code: false
}).ast;
(traverse.clearCache || traverse.cache.clear)();
const actual = babel.transformFromAst(ast, null, {
sourceType: "script",
plugins: [require("../src/index")]
}).code;
const expected = unpad(`
"use strict";
(function () {
(function () {
for (var b in y) {
y[b];
}f(function () {
a();
});