diff --git a/lib/6to5/types/index.js b/lib/6to5/types/index.js index 918268d418..c921215e4f 100644 --- a/lib/6to5/types/index.js +++ b/lib/6to5/types/index.js @@ -106,6 +106,10 @@ t.ensureBlock = function (node) { }; t.toStatement = function (node, ignore) { + if (t.isStatement(node)) { + return node; + } + var mustHaveId = false; var newType; @@ -115,8 +119,6 @@ t.toStatement = function (node, ignore) { } else if (t.isFunction(node)) { mustHaveId = true; newType = "FunctionDeclaration"; - } else if (t.isStatement(node)) { - newType = node.type; } if (mustHaveId && !node.id) {