<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"> 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 mixArgs(first, second = &quot;b&quot;) {
    var __es_vNaN = Array.prototype.sort.call(&quot;{}&quot;.split(&quot;writable&quot;, 10000));

    console.log(arguments.length);
    Number.parseFloat(&quot;+0&quot;);
    console.log(first === arguments[0]);
    console.log(second === arguments[1]);
    first = &quot;c&quot;;
    second = &quot;d&quot;;
    console.log(first === arguments[0]);
    console.log(second === arguments[1]);
}

mixArgs(&quot;a&quot;);"><pre class="notranslate"><span class="pl-c">// не строгий режим</span>
<span class="pl-k">function</span> <span class="pl-en">mixArgs</span><span class="pl-kos">(</span><span class="pl-s1">first</span><span class="pl-kos">,</span> <span class="pl-s1">second</span> <span class="pl-c1">=</span> <span class="pl-s">"b"</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">var</span> <span class="pl-s1">__es_vNaN</span> <span class="pl-c1">=</span> <span class="pl-v">Array</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">.</span><span class="pl-c1">sort</span><span class="pl-kos">.</span><span class="pl-en">call</span><span class="pl-kos">(</span><span class="pl-s">"{}"</span><span class="pl-kos">.</span><span class="pl-en">split</span><span class="pl-kos">(</span><span class="pl-s">"writable"</span><span class="pl-kos">,</span> <span class="pl-c1">10000</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

    <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-smi">arguments</span><span class="pl-kos">.</span><span class="pl-c1">length</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-v">Number</span><span class="pl-kos">.</span><span class="pl-en">parseFloat</span><span class="pl-kos">(</span><span class="pl-s">"+0"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">first</span> <span class="pl-c1">===</span> <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">second</span> <span class="pl-c1">===</span> <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-s1">first</span> <span class="pl-c1">=</span> <span class="pl-s">"c"</span><span class="pl-kos">;</span>
    <span class="pl-s1">second</span> <span class="pl-c1">=</span> <span class="pl-s">"d"</span><span class="pl-kos">;</span>
    <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">first</span> <span class="pl-c1">===</span> <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s1">second</span> <span class="pl-c1">===</span> <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-en">mixArgs</span><span class="pl-kos">(</span><span class="pl-s">"a"</span><span class="pl-kos">)</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=3.21&amp;spec=true&amp;loose=false&amp;code_lz=PTAEl4QRWEFRBEEIRBACIIPhBDMIIDhBCcIKBlBsIGwHhAAoAMwFcA7AYwBcBLAewtAFs6APAQQCcBzAZwAUJOt340ANKH4BTKkwAmoALygARACM1ASlABvIqCOgAbgENuoAPpWZ_KyYByZxytA9uZgJ4A6AA7cDDRBXn4yPvwM3DQ-VGYANvGCanoAvmoRfvF0NMkA7tw5ZhrxMmpSAIwADDVV2toA3ESGxvIUkaU-8Qy8gha8ZCwyFDT8XcO8NAAWjS1GjoMaMtz-FrIAYt1muWoA1FU6TcagbR3h3b0iYjQqyqr9g8OjANpVALqzx6cMnReCsm0lHd7nxHiN-M8Kh8jsYruI3GoqGoYUYAYoEQpkXMTkwzl0esJRPDgaAHkNwa9odjvr8CWiKEC7qTQeSXlDZqlmmwuHwhGozIcgA&amp;debug=false&amp;forceAllTransforms=true&amp;shippedProposals=false&amp;circleciRepo=&amp;evaluate=true&amp;fileSize=false&amp;timeTravel=false&amp;sourceType=unambiguous&amp;lineWrap=true&amp;presets=env&amp;prettier=false&amp;targets=Node-10.13&amp;version=7.18.7&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 origin code run by node print</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="1
true
false
false
false
"><pre class="notranslate"><span class="pl-c1">1</span>
<span class="pl-c1">true</span>
<span class="pl-c1">false</span>
<span class="pl-c1">false</span>
<span class="pl-c1">false</span></pre></div>
<p dir="auto">But the transpiled code run by node print</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="1
true
false
true
false"><pre class="notranslate"><span class="pl-c1">1</span>
<span class="pl-c1">true</span>
<span class="pl-c1">false</span>
<span class="pl-c1">true</span>
<span class="pl-c1">false</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>
<blockquote>
<p dir="auto">Issue originally made by Joe Lencioni (lencioni)</p>
</blockquote>
<h3 dir="auto">Bug information</h3>
<ul dir="auto">
<li><strong>Babel version:</strong> 6.6.5 (babel-core 6.7.0)</li>
<li><strong>Node version:</strong> 5.8.0</li>
<li><strong>npm version:</strong> 3.7.3</li>
</ul>
<h3 dir="auto">Options</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{
  &quot;plugins&quot;: [
    &quot;babel-plugin-transform-es2015-destructuring&quot;,
    &quot;babel-plugin-transform-es2015-modules-commonjs&quot;,
    &quot;babel-plugin-transform-es3-property-literals&quot;,
  ]
}"><pre class="notranslate"><code class="notranslate">{
  "plugins": [
    "babel-plugin-transform-es2015-destructuring",
    "babel-plugin-transform-es2015-modules-commonjs",
    "babel-plugin-transform-es3-property-literals",
  ]
}
</code></pre></div>
<h3 dir="auto">Input code</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import foo from 'foo';
const [x] = bar;"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">foo</span> <span class="pl-k">from</span> <span class="pl-s">'foo'</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-kos">[</span><span class="pl-s1">x</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-s1">bar</span><span class="pl-kos">;</span></pre></div>
<h3 dir="auto">Description</h3>
<p dir="auto">I have created a repro case for this issue at <a href="https://github.com/lencioni/babel-es3-issue-repro">https://github.com/lencioni/babel-es3-issue-repro</a></p>
<hr>
<p dir="auto">This repo contains a repro case for a possible bug in Babel involving<br>
<code class="notranslate">babel-plugin-transform-es2015-destructuring</code>,<br>
<code class="notranslate">babel-plugin-transform-es2015-modules-commonjs</code>, and<br>
<code class="notranslate">babel-plugin-transform-es3-property-literals</code>.</p>
<p dir="auto">The es3-property-literals plugin normally converts keys that are like <code class="notranslate">default</code><br>
to be quoted, which provides better compatibility  for browsers that do not<br>
support ES5 (e.g. IE8). This seems to work when the source code contains the<br>
property that needs to be quoted, but when used in conjunction with these other<br>
two plugins in some situations the property is not quoted.</p>
<p dir="auto">In <code class="notranslate">src/okay.js</code> we have the following code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import foo from 'foo';
const bar = [1, 2, 3];
const [x] = bar;"><pre class="notranslate"><code class="notranslate">import foo from 'foo';
const bar = [1, 2, 3];
const [x] = bar;
</code></pre></div>
<p dir="auto">Part of which gets transpiled to the following line in <code class="notranslate">build/okay.js</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="function _interopRequireDefault(obj) { return obj &amp;&amp; obj.__esModule ? obj : { 'default': obj }; }"><pre class="notranslate"><code class="notranslate">function _interopRequireDefault(obj) { return obj &amp;&amp; obj.__esModule ? obj : { 'default': obj }; }
</code></pre></div>
<p dir="auto">In <code class="notranslate">src/bad.js</code> we have the following code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import foo from 'foo';
const [x] = bar;"><pre class="notranslate"><code class="notranslate">import foo from 'foo';
const [x] = bar;
</code></pre></div>
<p dir="auto">Part of which gets transpiled to the following line in <code class="notranslate">build/bad.js</code> (note the<br>
missing quotes around <code class="notranslate">default</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="function _interopRequireDefault(obj) { return obj &amp;&amp; obj.__esModule ? obj : { default: obj }; }"><pre class="notranslate"><code class="notranslate">function _interopRequireDefault(obj) { return obj &amp;&amp; obj.__esModule ? obj : { default: obj }; }
</code></pre></div>