<h3 dir="auto"><g-emoji class="g-emoji" alias="computer" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f4bb.png">💻</g-emoji></h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Would you like to work on a fix?</li>
</ul>
<h3 dir="auto">How are you using Babel?</h3>
<p dir="auto">@babel/cli</p>
<h3 dir="auto">Input code</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function toLowerCase(){}
low = {toLowerCase}
const v1 = fullStr =&gt; {
    const v2 = new Map();
    const v3 = [1,2,3];
    for (let v4 of v3) {
        let {
            v20: v0,
            v4 : v4
        } = {
            [6]: 5,
            get: -12
        };
    }
    return v2;
};
v1(low)"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">toLowerCase</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">{</span><span class="pl-kos">}</span>
<span class="pl-s1">low</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>toLowerCase<span class="pl-kos">}</span>
<span class="pl-k">const</span> <span class="pl-en">v1</span> <span class="pl-c1">=</span> <span class="pl-s1">fullStr</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
    <span class="pl-k">const</span> <span class="pl-s1">v2</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Map</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">const</span> <span class="pl-s1">v3</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">,</span><span class="pl-c1">2</span><span class="pl-kos">,</span><span class="pl-c1">3</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
    <span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-k">let</span> <span class="pl-s1">v4</span> <span class="pl-k">of</span> <span class="pl-s1">v3</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-k">let</span> <span class="pl-kos">{</span>
            <span class="pl-c1">v20</span>: <span class="pl-s1">v0</span><span class="pl-kos">,</span>
            <span class="pl-c1">v4</span> : <span class="pl-s1">v4</span>
        <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
            <span class="pl-kos">[</span><span class="pl-c1">6</span><span class="pl-kos">]</span>: <span class="pl-c1">5</span><span class="pl-kos">,</span>
            <span class="pl-c1">get</span>: <span class="pl-c1">-</span><span class="pl-c1">12</span>
        <span class="pl-kos">}</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
    <span class="pl-k">return</span> <span class="pl-s1">v2</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-en">v1</span><span class="pl-kos">(</span><span class="pl-s1">low</span><span class="pl-kos">)</span></pre></div>
<p dir="auto">Here is the <a href="https://babel.dev/repl#?browsers=defaults%2C%20not%20ie%2011%2C%20not%20ie_mob%2011&amp;build=&amp;builtIns=false&amp;corejs=false&amp;spec=false&amp;loose=true&amp;code_lz=GYVwdgxgLglg9mABFOAZOB3ApgJwMICGAzlgBQCUA3gL4BQANpogLyKUrrb7FZ0QJEoiAG4BGFolD16AZSg4WAPja1EaxPzCCRAJglgsGRAFkCABwoBuVes3bhAZgkBtUQBodbhwF1r6yXAKpPRYQsIALIhwwCIO5Cr-_iFClDaJicI6AAwAXCJZbmnp6hGIeRFF_tQSqcWJzgBs3nkArIV1_gDmoXkAtKI6lerUfsNFOKEgOEiZ1iO0YsGY5EA&amp;debug=false&amp;forceAllTransforms=true&amp;shippedProposals=false&amp;circleciRepo=&amp;evaluate=false&amp;fileSize=false&amp;timeTravel=false&amp;sourceType=unambiguous&amp;lineWrap=true&amp;presets=env&amp;prettier=false&amp;targets=&amp;version=7.17.8&amp;externalPlugins=&amp;assumptions=%7B%7D" rel="nofollow">REPL</a></p>
<h3 dir="auto">Configuration file name</h3>
<p dir="auto">babel.config.json</p>
<h3 dir="auto">Configuration</h3>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
  &quot;sourceType&quot;: &quot;unambiguous&quot;,
  &quot;presets&quot;: [&quot;@babel/preset-env&quot;],
  &quot;plugins&quot;: [
    &quot;@babel/plugin-transform-runtime&quot;
  ]
}"><pre class="notranslate">{
  <span class="pl-ent">"sourceType"</span>: <span class="pl-s"><span class="pl-pds">"</span>unambiguous<span class="pl-pds">"</span></span>,
  <span class="pl-ent">"presets"</span>: [<span class="pl-s"><span class="pl-pds">"</span>@babel/preset-env<span class="pl-pds">"</span></span>],
  <span class="pl-ent">"plugins"</span>: [
    <span class="pl-s"><span class="pl-pds">"</span>@babel/plugin-transform-runtime<span class="pl-pds">"</span></span>
  ]
}</pre></div>
<h3 dir="auto">Current and expected behavior</h3>
<p dir="auto">The input code can be run by node, but when it is converted by babel, there is an error report</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Duplicate declaration &quot;v4&quot;"><pre class="notranslate">Duplicate declaration <span class="pl-s"><span class="pl-pds">"</span>v4<span class="pl-pds">"</span></span></pre></div>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>babel</li>
<li>
<ul dir="auto">
<li>├── @babel/cli@7.17.0=6</li>
</ul>
</li>
<li>
<ul dir="auto">
<li>├── @babel/generator@7.17.3</li>
</ul>
</li>
<li>
<ul dir="auto">
<li>├── @babel/plugin-transform-runtime@7.17.0</li>
</ul>
</li>
<li>
<ul dir="auto">
<li>├── @babel/preset-env@7.16.11</li>
</ul>
</li>
<li>Node: [v17.3.0]</li>
<li>npm version [8.5.2]</li>
<li>os [ubuntu 20.04]</li>
</ul>
<h3 dir="auto">Possible solution</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Additional context</h3>
<p dir="auto"><em>No response</em></p>
<p dir="auto">This input:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export async function foo () {
  await bar();
}

export async function bar () {
 await foo();
}"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-k">async</span> <span class="pl-k">function</span> <span class="pl-en">foo</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-k">await</span> <span class="pl-en">bar</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-k">export</span> <span class="pl-k">async</span> <span class="pl-k">function</span> <span class="pl-en">bar</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
 <span class="pl-k">await</span> <span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">produces:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&quot;use strict&quot;;

var _interopRequire = function (obj) {
  return obj &amp;&amp; (obj[&quot;default&quot;] || obj);
};

var Bluebird = _interopRequire(require(&quot;bluebird&quot;));

var Bluebird = _interopRequire(require(&quot;bluebird&quot;));

var foo = exports.foo = Bluebird.coroutine(function* foo() {
  yield bar();
});
var bar = exports.bar = Bluebird.coroutine(function* bar() {
  yield foo();
});
//# sourceMappingURL=bug.js.map"><pre class="notranslate"><span class="pl-s">"use strict"</span><span class="pl-kos">;</span>

<span class="pl-k">var</span> <span class="pl-en">_interopRequire</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">obj</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-k">return</span> <span class="pl-s1">obj</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-kos">(</span><span class="pl-s1">obj</span><span class="pl-kos">[</span><span class="pl-s">"default"</span><span class="pl-kos">]</span> <span class="pl-c1">||</span> <span class="pl-s1">obj</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>

<span class="pl-k">var</span> <span class="pl-v">Bluebird</span> <span class="pl-c1">=</span> <span class="pl-en">_interopRequire</span><span class="pl-kos">(</span><span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"bluebird"</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-k">var</span> <span class="pl-v">Bluebird</span> <span class="pl-c1">=</span> <span class="pl-en">_interopRequire</span><span class="pl-kos">(</span><span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">"bluebird"</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-k">var</span> <span class="pl-s1">foo</span> <span class="pl-c1">=</span> <span class="pl-s1">exports</span><span class="pl-kos">.</span><span class="pl-c1">foo</span> <span class="pl-c1">=</span> <span class="pl-v">Bluebird</span><span class="pl-kos">.</span><span class="pl-en">coroutine</span><span class="pl-kos">(</span><span class="pl-k">function</span><span class="pl-c1">*</span> <span class="pl-s1">foo</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-k">yield</span> <span class="pl-en">bar</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">bar</span> <span class="pl-c1">=</span> <span class="pl-s1">exports</span><span class="pl-kos">.</span><span class="pl-c1">bar</span> <span class="pl-c1">=</span> <span class="pl-v">Bluebird</span><span class="pl-kos">.</span><span class="pl-en">coroutine</span><span class="pl-kos">(</span><span class="pl-k">function</span><span class="pl-c1">*</span> <span class="pl-s1">bar</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-k">yield</span> <span class="pl-s1">foo</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-c">//# sourceMappingURL=bug.js.map</span></pre></div>
<p dir="auto">Note the duplicate <code class="notranslate">require('bluebird')</code>s</p>