<p dir="auto">The following:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="function resolve({a, b}, c) {
    return resolve();
}"><pre class="notranslate"><code class="notranslate">function resolve({a, b}, c) {
    return resolve();
}
</code></pre></div>
<p dir="auto">results in:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&quot;use strict&quot;;

function f(_x, _x2) {
    var _again = true;

    _function: while (_again) {
        var a = _ref.a;
        var b = _ref.b;
        _again = false;
        var _ref = _x,
            c = _x2;
        a = b = undefined;
        _again = true;
        continue _function;
    }
}"><pre class="notranslate"><code class="notranslate">"use strict";

function f(_x, _x2) {
    var _again = true;

    _function: while (_again) {
        var a = _ref.a;
        var b = _ref.b;
        _again = false;
        var _ref = _x,
            c = _x2;
        a = b = undefined;
        _again = true;
        continue _function;
    }
}
</code></pre></div>
<p dir="auto">This obviously breaks, as <code class="notranslate">_ref</code> is accessed before being declared.<br>
It only seems to happen, if the function is named (and recurses by calling itself by that name) and takes more than one argument.<br>
The above example is the smallest I could narrow it down to. I realise it would create an endless loop, but the problem still exists, if you make the recursing conditional.</p>
<p dir="auto">I hope this issue is not a duplicate of anything and I did not accidentally miss another issue.<br>
Tested with babel@4.7.16, straight from npm.</p>
<p dir="auto">I looked at the resulting code and was curious if the <code class="notranslate">_extends</code> that gets created also gets renamed if I create an identifier with the same name, it works when it's all on the root level, but inside a function it seems to fail.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="it('', () =&gt; {
  const _extends = {};
  const obj = {...obj};
});"><pre class="notranslate"><code class="notranslate">it('', () =&gt; {
  const _extends = {};
  const obj = {...obj};
});
</code></pre></div>
<p dir="auto">transpiles to this</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="var _extends = 'lots of code ....';

it('', function () {
  var _extends = {};
  var obj = _extends({}, obj);
});"><pre class="notranslate"><code class="notranslate">var _extends = 'lots of code ....';

it('', function () {
  var _extends = {};
  var obj = _extends({}, obj);
});
</code></pre></div>
<p dir="auto">which would use my <code class="notranslate">_extends</code>, which I think is not intended, right?</p>
<p dir="auto">see <a href="https://babeljs.io/repl/#?experimental=true&amp;evaluate=true&amp;loose=false&amp;spec=false&amp;playground=false&amp;code=it%28''%2C%20%28%29%20%3D%3E%20%7B%0A%20%20const%20_extends%20%3D%20%7B%7D%3B%0A%20%20const%20obj%20%3D%20%7B...obj%7D%3B%0A%7D%29%3B" rel="nofollow">example repl</a></p>