From 0711fa67b434baa73984f19943cb15500641786e Mon Sep 17 00:00:00 2001 From: Amjad Masad Date: Tue, 10 Nov 2015 17:34:46 -0800 Subject: [PATCH] ensure block --- .../babel-plugin-transform-es2015-block-scoping/src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/babel-plugin-transform-es2015-block-scoping/src/index.js b/packages/babel-plugin-transform-es2015-block-scoping/src/index.js index 759eb9c62f..f0347595d6 100644 --- a/packages/babel-plugin-transform-es2015-block-scoping/src/index.js +++ b/packages/babel-plugin-transform-es2015-block-scoping/src/index.js @@ -42,7 +42,8 @@ export default function () { }, Loop(path, file) { - let { parent, scope } = path; + let { node, parent, scope } = path; + t.ensureBlock(node); let blockScoping = new BlockScoping(path, path.get("body"), parent, scope, file); let replace = blockScoping.run(); if (replace) path.replaceWith(replace); @@ -79,7 +80,6 @@ function convertBlockScopedToVar(node, parent, scope) { } node[t.BLOCK_SCOPED_SYMBOL] = true; - node._let = true; node.kind = "var"; }