diff --git a/packages/babel-plugin-transform-es2015-parameters/src/rest.js b/packages/babel-plugin-transform-es2015-parameters/src/rest.js index 85324b22d2..d88d115fcd 100644 --- a/packages/babel-plugin-transform-es2015-parameters/src/rest.js +++ b/packages/babel-plugin-transform-es2015-parameters/src/rest.js @@ -245,9 +245,9 @@ export let visitor = { target.findParent(function (path) { if (path.isLoop()) { target = path; - } else if (path.isFunction()) { - // stop crawling up for functions - return true; + } else { + // Stop crawling up if this is a function. + return path.isFunction(); } });