<h2 dir="auto"><g-emoji class="g-emoji" alias="bug" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f41b.png">🐛</g-emoji> Bug Report</h2>
<p dir="auto">When running babel with preset-env on this code</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import x from './x';

export default function(x) {}"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">x</span> <span class="pl-k">from</span> <span class="pl-s">'./x'</span><span class="pl-kos">;</span>

<span class="pl-k">export</span> <span class="pl-k">default</span> <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">x</span><span class="pl-kos">)</span> <span class="pl-kos">{</span><span class="pl-kos">}</span></pre></div>
<p dir="auto">It errors with 'Duplicate declaration "x"'</p>
<p dir="auto">I think this is valid code however, as node has no problem executing the file (with esm)</p>
<p dir="auto">Noticed a little edge-case when preparing a related issue report.</p>
<p dir="auto">Input:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var obj = {
  get foo() {
    // ...
  },

  set foo(value) {
    // ...
  }
};
"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">obj</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
  <span class="pl-k">get</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-c">// ...</span>
  <span class="pl-kos">}</span><span class="pl-kos">,</span>

  <span class="pl-k">set</span> <span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-s1">value</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-c">// ...</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="var obj = function(_obj) {
  Object.defineProperties(_obj, {
    foo: {
      get: // ...
      function() {
        // ...
      },

      set: // ...
      function(value) {
        // ...
      }
    }
  });

  return _obj;
}({});"><pre class="notranslate"><code class="notranslate">var obj = function(_obj) {
  Object.defineProperties(_obj, {
    foo: {
      get: // ...
      function() {
        // ...
      },

      set: // ...
      function(value) {
        // ...
      }
    }
  });

  return _obj;
}({});
</code></pre></div>
<p dir="auto">As you can see, the comment lines repeated.</p>