<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">Other (Next.js, Gatsby, vue-cli, ...)</p>
<h3 dir="auto">Input code</h3>
<p dir="auto">Code that reproduces the crash (only happens when targeting older engines like <code class="notranslate">IE 11</code>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="main();

async function main() {
  let is_done = false;
  const async_iterable = {
    [Symbol.asyncIterator]: () =&gt; ({
      next: () =&gt; {
        const promise = Promise.resolve({ value: &quot;luv u&quot;, done: is_done });
        is_done = true;
        return promise;
      },
    }),
  };


  (async () =&gt; { // IIFE: required for babel to crash
    for await (const string of async_iterable) { // for await: required for babel to crash
      console.log(string);
    }
  })();

  const [one] = [1]; // array destructuring: required for babel to crash
}"><pre class="notranslate"><code class="notranslate">main();

async function main() {
  let is_done = false;
  const async_iterable = {
    [Symbol.asyncIterator]: () =&gt; ({
      next: () =&gt; {
        const promise = Promise.resolve({ value: "luv u", done: is_done });
        is_done = true;
        return promise;
      },
    }),
  };


  (async () =&gt; { // IIFE: required for babel to crash
    for await (const string of async_iterable) { // for await: required for babel to crash
      console.log(string);
    }
  })();

  const [one] = [1]; // array destructuring: required for babel to crash
}
</code></pre></div>
<p dir="auto"><a href="https://babeljs.io/repl/#?browsers=IE%2011&amp;build=&amp;builtIns=false&amp;corejs=3.6&amp;spec=false&amp;loose=false&amp;code_lz=LYQwlgdgFAlA3AKASAzgTwgYwAQDMCuWALmAPYTaiSzYDeC22ANgKZHZgoD6AJuS9gC8eEExQtEjTORTtUGTFzBEWAJxAAjVkLoNG2ANoBlNMA2kmAOnlYAkivVFSqgLoAubDUEA-T_X36ECwAHkQeXr7-AfrSELLYAA6qpMCcAsIACsmp4paqLCgWAG4sULTYRaL4LB4AREz4Rdj4tQA02HxBHpy8_NgAvvB60RzcnenYRKrVkiPY-UT4qhRJKWmzAf2twwMw24z9iEiMUDY4EXTYAPRX2La2AGIAoh75AI74YPk8eM7YGpoWExJqRsJh1CgABY7XB_EAAd3A7CgsXislUkAA5thSLhsGclA5NKwYJcbr9VPjEcpXiwPl8WD9YZSARogSCwRDoSNURYWJYmKRMVB0Vihps9INYEcpDJ2AZ-C4dAYAIwuODXW4gVTqNAdApTfCYRYYiCY2n074U_6A4FOTmoaH9BBAA&amp;debug=false&amp;forceAllTransforms=false&amp;shippedProposals=true&amp;circleciRepo=&amp;evaluate=false&amp;fileSize=false&amp;timeTravel=false&amp;sourceType=module&amp;lineWrap=true&amp;presets=env&amp;prettier=false&amp;targets=&amp;version=7.15.7&amp;externalPlugins=&amp;assumptions=%7B%7D" rel="nofollow">REPL link that also crashes</a></p>
<h3 dir="auto">Configuration file name</h3>
<p dir="auto">babel.config.js</p>
<h3 dir="auto">Configuration</h3>
<p dir="auto">Not relevant IMO since it also crashes in REPL. Target has to be set to <code class="notranslate">IE 11</code>.</p>
<h3 dir="auto">Current and expected behavior</h3>
<p dir="auto">Current behavior: <code class="notranslate">Property name expected type of string but got null</code></p>
<p dir="auto">Expected behavior: Code that prints <code class="notranslate">luv u</code> to the console when ran.</p>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Babel: 7.15.7 (@babel/core 7.15.5)</li>
<li>Node v16.9.1</li>
<li>Yarn 3.0.2</li>
<li>OS: macOS 10.15.7 (19H1323)</li>
</ul>
<h3 dir="auto">Possible solution</h3>
<p dir="auto">Transpile the code correctly instead of crashing</p>
<h3 dir="auto">Additional context</h3>
<p dir="auto">I wrote code which was the reproduction code but with many more steps. Wanted to push it to a customer as a quick fix before my next calendar event. Babel crashed. Suck. Deployed only for modern browsers. Bored, offline on a flight I removed code bit for bit for bit for bit until I came up with the reproduction snippet. This is a very weird bug.</p>
<p dir="auto">Following code produces the error:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const hello = async () =&gt; {
  const he = { ll: '2' }
  const { ll } = he
}"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-en">hello</span> <span class="pl-c1">=</span> <span class="pl-k">async</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">const</span> <span class="pl-s1">he</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">ll</span>: <span class="pl-s">'2'</span> <span class="pl-kos">}</span>
  <span class="pl-k">const</span> <span class="pl-kos">{</span> ll <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-s1">he</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><code class="notranslate">babel config</code></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="module.exports = {
  presets: [
    [
      require('@babel/preset-env'),
      {
        targets: 'defaults, not ie &lt;= 11, not edge &gt; 0, not IE_Mob 11',
        modules: false
      }
    ],
    require('@babel/preset-react')
  ],
  plugins: [
    require('react-hot-loader/babel'),
    require('@babel/plugin-transform-regenerator'),
    require('@babel/plugin-syntax-dynamic-import'),
    require('@babel/plugin-syntax-throw-expressions'),
    require('@babel/plugin-transform-runtime'),
    require('babel-plugin-styled-components')
  ],
  env: {
    production: {
      plugins: [require('babel-plugin-transform-react-remove-prop-types')]
    }
  }
}"><pre class="notranslate"><span class="pl-smi">module</span><span class="pl-kos">.</span><span class="pl-c1">exports</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
  <span class="pl-c1">presets</span>: <span class="pl-kos">[</span>
    <span class="pl-kos">[</span>
      <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'@babel/preset-env'</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
      <span class="pl-kos">{</span>
        <span class="pl-c1">targets</span>: <span class="pl-s">'defaults, not ie &lt;= 11, not edge &gt; 0, not IE_Mob 11'</span><span class="pl-kos">,</span>
        <span class="pl-c1">modules</span>: <span class="pl-c1">false</span>
      <span class="pl-kos">}</span>
    <span class="pl-kos">]</span><span class="pl-kos">,</span>
    <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'@babel/preset-react'</span><span class="pl-kos">)</span>
  <span class="pl-kos">]</span><span class="pl-kos">,</span>
  <span class="pl-c1">plugins</span>: <span class="pl-kos">[</span>
    <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'react-hot-loader/babel'</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
    <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'@babel/plugin-transform-regenerator'</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
    <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'@babel/plugin-syntax-dynamic-import'</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
    <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'@babel/plugin-syntax-throw-expressions'</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
    <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'@babel/plugin-transform-runtime'</span><span class="pl-kos">)</span><span class="pl-kos">,</span>
    <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'babel-plugin-styled-components'</span><span class="pl-kos">)</span>
  <span class="pl-kos">]</span><span class="pl-kos">,</span>
  <span class="pl-c1">env</span>: <span class="pl-kos">{</span>
    <span class="pl-c1">production</span>: <span class="pl-kos">{</span>
      <span class="pl-c1">plugins</span>: <span class="pl-kos">[</span><span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'babel-plugin-transform-react-remove-prop-types'</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></pre></div>
<p dir="auto"><code class="notranslate">package.json</code></p>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="  &quot;dependencies&quot;: {
    &quot;@babel/core&quot;: &quot;^7.9.0&quot;,
    &quot;@babel/plugin-syntax-dynamic-import&quot;: &quot;^7.8.3&quot;,
    &quot;@babel/plugin-syntax-throw-expressions&quot;: &quot;^7.8.3&quot;,
    &quot;@babel/plugin-transform-regenerator&quot;: &quot;^7.8.7&quot;,
    &quot;@babel/plugin-transform-runtime&quot;: &quot;^7.9.0&quot;,
    &quot;@babel/preset-env&quot;: &quot;^7.9.0&quot;,
    &quot;@babel/preset-react&quot;: &quot;^7.9.4&quot;,
    &quot;babel-eslint&quot;: &quot;^10.1.0&quot;,
    &quot;babel-jest&quot;: &quot;^25.1.0&quot;,
    &quot;babel-loader&quot;: &quot;^8.1.0&quot;,
    &quot;babel-plugin-styled-components&quot;: &quot;^1.10.7&quot;,
    &quot;babel-plugin-transform-react-remove-prop-types&quot;: &quot;^0.4.24&quot;,
    &quot;react-hot-loader&quot;: &quot;^4.12.20&quot;
  },"><pre class="notranslate">  <span class="pl-ent">"dependencies"</span>: {
    <span class="pl-ent">"@babel/core"</span>: <span class="pl-s"><span class="pl-pds">"</span>^7.9.0<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"@babel/plugin-syntax-dynamic-import"</span>: <span class="pl-s"><span class="pl-pds">"</span>^7.8.3<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"@babel/plugin-syntax-throw-expressions"</span>: <span class="pl-s"><span class="pl-pds">"</span>^7.8.3<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"@babel/plugin-transform-regenerator"</span>: <span class="pl-s"><span class="pl-pds">"</span>^7.8.7<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"@babel/plugin-transform-runtime"</span>: <span class="pl-s"><span class="pl-pds">"</span>^7.9.0<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"@babel/preset-env"</span>: <span class="pl-s"><span class="pl-pds">"</span>^7.9.0<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"@babel/preset-react"</span>: <span class="pl-s"><span class="pl-pds">"</span>^7.9.4<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"babel-eslint"</span>: <span class="pl-s"><span class="pl-pds">"</span>^10.1.0<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"babel-jest"</span>: <span class="pl-s"><span class="pl-pds">"</span>^25.1.0<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"babel-loader"</span>: <span class="pl-s"><span class="pl-pds">"</span>^8.1.0<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"babel-plugin-styled-components"</span>: <span class="pl-s"><span class="pl-pds">"</span>^1.10.7<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"babel-plugin-transform-react-remove-prop-types"</span>: <span class="pl-s"><span class="pl-pds">"</span>^0.4.24<span class="pl-pds">"</span></span>,
    <span class="pl-ent">"react-hot-loader"</span>: <span class="pl-s"><span class="pl-pds">"</span>^4.12.20<span class="pl-pds">"</span></span>
  },</pre></div>
<p dir="auto"><code class="notranslate">node</code> version <code class="notranslate">v12.13.1</code></p>
<p dir="auto">Thanks</p>
<p dir="auto">More context <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="596818928" data-permission-text="Title is private" data-url="https://github.com/facebook/regenerator/issues/390" data-hovercard-type="pull_request" data-hovercard-url="/facebook/regenerator/pull/390/hovercard" href="https://github.com/facebook/regenerator/pull/390">#390</a></p>