<p dir="auto">Declaring a <code class="notranslate">const</code> a second time in a switch should be possible if the second statement is unreachable.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="testytest = () =&gt; {
  switch (foo) {
    case a:
      const bar = 'foo';
      return bar;
    case b:
      const bar = 'baz';
      return bar;
  }
}"><pre class="notranslate"><span class="pl-en">testytest</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
  <span class="pl-k">switch</span> <span class="pl-kos">(</span><span class="pl-s1">foo</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">case</span> <span class="pl-s1">a</span>:
      <span class="pl-k">const</span> <span class="pl-s1">bar</span> <span class="pl-c1">=</span> <span class="pl-s">'foo'</span><span class="pl-kos">;</span>
      <span class="pl-k">return</span> <span class="pl-s1">bar</span><span class="pl-kos">;</span>
    <span class="pl-k">case</span> <span class="pl-s1">b</span>:
      <span class="pl-k">const</span> <span class="pl-s1">bar</span> <span class="pl-c1">=</span> <span class="pl-s">'baz'</span><span class="pl-kos">;</span>
      <span class="pl-k">return</span> <span class="pl-s1">bar</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Throws error <code class="notranslate">Duplicate declaration "bar"</code></p>
<blockquote>
<p dir="auto">Issue originally reported by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/ssilve1989/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/ssilve1989">@ssilve1989</a> in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="256048561" data-permission-text="Title is private" data-url="https://github.com/babel/babel-preset-env/issues/411" data-hovercard-type="issue" data-hovercard-url="/babel/babel-preset-env/issues/411/hovercard" href="https://github.com/babel/babel-preset-env/issues/411">babel/babel-preset-env#411</a></p>
</blockquote>
<p dir="auto">Specifying a target of <code class="notranslate">"safari &gt;= 10"</code> doesn't use the <code class="notranslate">transform-es2015-block-scoping</code> plugin. Yet Safari 10 does need this because of <a href="https://bugs.webkit.org/show_bug.cgi?id=159270" rel="nofollow">this</a> bug.</p>
<p dir="auto">Ex:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
  let a = 3
}

let a = 3"><pre class="notranslate"><span class="pl-kos">{</span>
  <span class="pl-k">let</span> <span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-c1">3</span>
<span class="pl-kos">}</span>

<span class="pl-k">let</span> <span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-c1">3</span></pre></div>
<p dir="auto">is an error in Safari 10.1.2 resulting in <code class="notranslate">SyntaxError: Can't create duplicate variable that shadows a global property: 'a'</code>.</p>
<p dir="auto">I've had to manually include this plugin in the <code class="notranslate">include</code> option to get Safari working.</p>