<h3 dir="auto">Input Code</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" const tryCatchWrapper = (target) =&gt; async (...targetArgs) =&gt; {
    try {
      return target(...targetArgs);
    } catch (e) {
      throw errorObj({_error: e.message});
   }
 };"><pre class="notranslate"> <span class="pl-k">const</span> <span class="pl-en">tryCatchWrapper</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-s1">target</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-k">async</span> <span class="pl-kos">(</span>...<span class="pl-s1">targetArgs</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
    <span class="pl-k">try</span> <span class="pl-kos">{</span>
      <span class="pl-k">return</span> <span class="pl-s1">target</span><span class="pl-kos">(</span>...<span class="pl-s1">targetArgs</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span> <span class="pl-k">catch</span> <span class="pl-kos">(</span><span class="pl-s1">e</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
      <span class="pl-k">throw</span> <span class="pl-en">errorObj</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">_error</span>: <span class="pl-s1">e</span><span class="pl-kos">.</span><span class="pl-c1">message</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></pre></div>
<h3 dir="auto">Babel Configuration (.babelrc, package.json, cli command)</h3>
<p dir="auto">babeljs.io standard config</p>
<h3 dir="auto">Expected Behavior</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&quot;use strict&quot;;

function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step(&quot;next&quot;, value); }, function (err) { step(&quot;throw&quot;, err); }); } } return step(&quot;next&quot;); }); }; }

var tryCatchWrapper = function tryCatchWrapper(target) {
  return function () {
    var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee() {
      for (var _len = arguments.length, targetArgs = Array(_len), _key = 0; _key &lt; _len; _key++) {
        targetArgs[_key] = arguments[_key];
      }

      return regeneratorRuntime.wrap(function _callee$(_context) {
        while (1) {
          switch (_context.prev = _context.next) {
            case 0:
              _context.prev = 0;

              targetArgs;
              return _context.abrupt(&quot;return&quot;, target.apply(undefined, targetArgs));

            case 5:
              _context.prev = 5;
              _context.t0 = _context[&quot;catch&quot;](0);
              throw errorObj({ _error: _context.t0.message });

            case 8:
            case &quot;end&quot;:
              return _context.stop();
          }
        }
      }, _callee, undefined, [[0, 5]]);
    }));

    return function () {
      return _ref.apply(this, arguments);
    };
  }();
};"><pre class="notranslate"><span class="pl-s">"use strict"</span><span class="pl-kos">;</span>

<span class="pl-k">function</span> <span class="pl-en">_asyncToGenerator</span><span class="pl-kos">(</span><span class="pl-s1">fn</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-k">function</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">gen</span> <span class="pl-c1">=</span> <span class="pl-s1">fn</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">,</span> <span class="pl-smi">arguments</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-v">Promise</span><span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">resolve</span><span class="pl-kos">,</span> <span class="pl-s1">reject</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">function</span> <span class="pl-en">step</span><span class="pl-kos">(</span><span class="pl-s1">key</span><span class="pl-kos">,</span> <span class="pl-s1">arg</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">try</span> <span class="pl-kos">{</span> <span class="pl-k">var</span> <span class="pl-s1">info</span> <span class="pl-c1">=</span> <span class="pl-s1">gen</span><span class="pl-kos">[</span><span class="pl-s1">key</span><span class="pl-kos">]</span><span class="pl-kos">(</span><span class="pl-s1">arg</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">var</span> <span class="pl-s1">value</span> <span class="pl-c1">=</span> <span class="pl-s1">info</span><span class="pl-kos">.</span><span class="pl-c1">value</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">catch</span> <span class="pl-kos">(</span><span class="pl-s1">error</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-s1">reject</span><span class="pl-kos">(</span><span class="pl-s1">error</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">return</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">info</span><span class="pl-kos">.</span><span class="pl-c1">done</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-s1">resolve</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-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-v">Promise</span><span class="pl-kos">.</span><span class="pl-en">resolve</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-en">then</span><span class="pl-kos">(</span><span class="pl-k">function</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-en">step</span><span class="pl-kos">(</span><span class="pl-s">"next"</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-kos">}</span><span class="pl-kos">,</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">err</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-en">step</span><span class="pl-kos">(</span><span class="pl-s">"throw"</span><span class="pl-kos">,</span> <span class="pl-s1">err</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-kos">}</span> <span class="pl-k">return</span> <span class="pl-en">step</span><span class="pl-kos">(</span><span class="pl-s">"next"</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-kos">;</span> <span class="pl-kos">}</span>

<span class="pl-k">var</span> <span class="pl-en">tryCatchWrapper</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-en">tryCatchWrapper</span><span class="pl-kos">(</span><span class="pl-s1">target</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-k">return</span> <span class="pl-k">function</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">_ref</span> <span class="pl-c1">=</span> <span class="pl-en">_asyncToGenerator</span><span class="pl-kos">(</span><span class="pl-s1">regeneratorRuntime</span><span class="pl-kos">.</span><span class="pl-en">mark</span><span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-en">_callee</span><span class="pl-kos">(</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">var</span> <span class="pl-s1">_len</span> <span class="pl-c1">=</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-s1">targetArgs</span> <span class="pl-c1">=</span> <span class="pl-v">Array</span><span class="pl-kos">(</span><span class="pl-s1">_len</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-s1">_key</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span> <span class="pl-s1">_key</span> <span class="pl-c1">&lt;</span> <span class="pl-s1">_len</span><span class="pl-kos">;</span> <span class="pl-s1">_key</span><span class="pl-c1">++</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-s1">targetArgs</span><span class="pl-kos">[</span><span class="pl-s1">_key</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-s1">_key</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">regeneratorRuntime</span><span class="pl-kos">.</span><span class="pl-en">wrap</span><span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-en">_callee$</span><span class="pl-kos">(</span><span class="pl-s1">_context</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-k">while</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-k">switch</span> <span class="pl-kos">(</span><span class="pl-s1">_context</span><span class="pl-kos">.</span><span class="pl-c1">prev</span> <span class="pl-c1">=</span> <span class="pl-s1">_context</span><span class="pl-kos">.</span><span class="pl-c1">next</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
            <span class="pl-k">case</span> <span class="pl-c1">0</span>:
              <span class="pl-s1">_context</span><span class="pl-kos">.</span><span class="pl-c1">prev</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span>

              <span class="pl-s1">targetArgs</span><span class="pl-kos">;</span>
              <span class="pl-k">return</span> <span class="pl-s1">_context</span><span class="pl-kos">.</span><span class="pl-en">abrupt</span><span class="pl-kos">(</span><span class="pl-s">"return"</span><span class="pl-kos">,</span> <span class="pl-s1">target</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">targetArgs</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

            <span class="pl-k">case</span> <span class="pl-c1">5</span>:
              <span class="pl-s1">_context</span><span class="pl-kos">.</span><span class="pl-c1">prev</span> <span class="pl-c1">=</span> <span class="pl-c1">5</span><span class="pl-kos">;</span>
              <span class="pl-s1">_context</span><span class="pl-kos">.</span><span class="pl-c1">t0</span> <span class="pl-c1">=</span> <span class="pl-s1">_context</span><span class="pl-kos">[</span><span class="pl-s">"catch"</span><span class="pl-kos">]</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-k">throw</span> <span class="pl-en">errorObj</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">_error</span>: <span class="pl-s1">_context</span><span class="pl-kos">.</span><span class="pl-c1">t0</span><span class="pl-kos">.</span><span class="pl-c1">message</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

            <span class="pl-k">case</span> <span class="pl-c1">8</span>:
            <span class="pl-k">case</span> <span class="pl-s">"end"</span>:
              <span class="pl-k">return</span> <span class="pl-s1">_context</span><span class="pl-kos">.</span><span class="pl-en">stop</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-kos">,</span> <span class="pl-s1">_callee</span><span class="pl-kos">,</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-c1">5</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-kos">)</span><span class="pl-kos">;</span>

    <span class="pl-k">return</span> <span class="pl-k">function</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">_ref</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">,</span> <span class="pl-smi">arguments</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-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<h3 dir="auto">Current Behavior</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&quot;use strict&quot;;

var _arguments = arguments;

function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step(&quot;next&quot;, value); }, function (err) { step(&quot;throw&quot;, err); }); } } return step(&quot;next&quot;); }); }; }

var tryCatchWrapper = function tryCatchWrapper(target) {
  return function () {
    var _ref = _asyncToGenerator(regeneratorRuntime.mark(function _callee() {
      var _args = _arguments;
      return regeneratorRuntime.wrap(function _callee$(_context) {
        while (1) {
          switch (_context.prev = _context.next) {
            case 0:
              _context.prev = 0;
              return _context.abrupt(&quot;return&quot;, target.apply(undefined, _args));

            case 4:
              _context.prev = 4;
              _context.t0 = _context[&quot;catch&quot;](0);
              throw errorObj({ _error: _context.t0.message });

            case 7:
            case &quot;end&quot;:
              return _context.stop();
          }
        }
      }, _callee, undefined, [[0, 4]]);
    }));

    return function () {
      return _ref.apply(this, arguments);
    };
  }();
};"><pre class="notranslate"><span class="pl-s">"use strict"</span><span class="pl-kos">;</span>

<span class="pl-k">var</span> <span class="pl-s1">_arguments</span> <span class="pl-c1">=</span> <span class="pl-smi">arguments</span><span class="pl-kos">;</span>

<span class="pl-k">function</span> <span class="pl-en">_asyncToGenerator</span><span class="pl-kos">(</span><span class="pl-s1">fn</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-k">function</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">gen</span> <span class="pl-c1">=</span> <span class="pl-s1">fn</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">,</span> <span class="pl-smi">arguments</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-v">Promise</span><span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">resolve</span><span class="pl-kos">,</span> <span class="pl-s1">reject</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">function</span> <span class="pl-en">step</span><span class="pl-kos">(</span><span class="pl-s1">key</span><span class="pl-kos">,</span> <span class="pl-s1">arg</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">try</span> <span class="pl-kos">{</span> <span class="pl-k">var</span> <span class="pl-s1">info</span> <span class="pl-c1">=</span> <span class="pl-s1">gen</span><span class="pl-kos">[</span><span class="pl-s1">key</span><span class="pl-kos">]</span><span class="pl-kos">(</span><span class="pl-s1">arg</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">var</span> <span class="pl-s1">value</span> <span class="pl-c1">=</span> <span class="pl-s1">info</span><span class="pl-kos">.</span><span class="pl-c1">value</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">catch</span> <span class="pl-kos">(</span><span class="pl-s1">error</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-s1">reject</span><span class="pl-kos">(</span><span class="pl-s1">error</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">return</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">info</span><span class="pl-kos">.</span><span class="pl-c1">done</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-s1">resolve</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-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-v">Promise</span><span class="pl-kos">.</span><span class="pl-en">resolve</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-en">then</span><span class="pl-kos">(</span><span class="pl-k">function</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-en">step</span><span class="pl-kos">(</span><span class="pl-s">"next"</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-kos">}</span><span class="pl-kos">,</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">err</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-en">step</span><span class="pl-kos">(</span><span class="pl-s">"throw"</span><span class="pl-kos">,</span> <span class="pl-s1">err</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-kos">}</span> <span class="pl-k">return</span> <span class="pl-en">step</span><span class="pl-kos">(</span><span class="pl-s">"next"</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-kos">;</span> <span class="pl-kos">}</span>

<span class="pl-k">var</span> <span class="pl-en">tryCatchWrapper</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-en">tryCatchWrapper</span><span class="pl-kos">(</span><span class="pl-s1">target</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-k">return</span> <span class="pl-k">function</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">_ref</span> <span class="pl-c1">=</span> <span class="pl-en">_asyncToGenerator</span><span class="pl-kos">(</span><span class="pl-s1">regeneratorRuntime</span><span class="pl-kos">.</span><span class="pl-en">mark</span><span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-en">_callee</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">_args</span> <span class="pl-c1">=</span> <span class="pl-s1">_arguments</span><span class="pl-kos">;</span>
      <span class="pl-k">return</span> <span class="pl-s1">regeneratorRuntime</span><span class="pl-kos">.</span><span class="pl-en">wrap</span><span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-en">_callee$</span><span class="pl-kos">(</span><span class="pl-s1">_context</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-k">while</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-k">switch</span> <span class="pl-kos">(</span><span class="pl-s1">_context</span><span class="pl-kos">.</span><span class="pl-c1">prev</span> <span class="pl-c1">=</span> <span class="pl-s1">_context</span><span class="pl-kos">.</span><span class="pl-c1">next</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
            <span class="pl-k">case</span> <span class="pl-c1">0</span>:
              <span class="pl-s1">_context</span><span class="pl-kos">.</span><span class="pl-c1">prev</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span>
              <span class="pl-k">return</span> <span class="pl-s1">_context</span><span class="pl-kos">.</span><span class="pl-en">abrupt</span><span class="pl-kos">(</span><span class="pl-s">"return"</span><span class="pl-kos">,</span> <span class="pl-s1">target</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-s1">_args</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

            <span class="pl-k">case</span> <span class="pl-c1">4</span>:
              <span class="pl-s1">_context</span><span class="pl-kos">.</span><span class="pl-c1">prev</span> <span class="pl-c1">=</span> <span class="pl-c1">4</span><span class="pl-kos">;</span>
              <span class="pl-s1">_context</span><span class="pl-kos">.</span><span class="pl-c1">t0</span> <span class="pl-c1">=</span> <span class="pl-s1">_context</span><span class="pl-kos">[</span><span class="pl-s">"catch"</span><span class="pl-kos">]</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-k">throw</span> <span class="pl-en">errorObj</span><span class="pl-kos">(</span><span class="pl-kos">{</span> <span class="pl-c1">_error</span>: <span class="pl-s1">_context</span><span class="pl-kos">.</span><span class="pl-c1">t0</span><span class="pl-kos">.</span><span class="pl-c1">message</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

            <span class="pl-k">case</span> <span class="pl-c1">7</span>:
            <span class="pl-k">case</span> <span class="pl-s">"end"</span>:
              <span class="pl-k">return</span> <span class="pl-s1">_context</span><span class="pl-kos">.</span><span class="pl-en">stop</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-kos">,</span> <span class="pl-s1">_callee</span><span class="pl-kos">,</span> <span class="pl-c1">undefined</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-c1">4</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-kos">)</span><span class="pl-kos">;</span>

    <span class="pl-k">return</span> <span class="pl-k">function</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">_ref</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">,</span> <span class="pl-smi">arguments</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-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<h3 dir="auto">Possible Solution</h3>
<p dir="auto">Reference the destructured args:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" const tryCatchWrapper = (target) =&gt; async (...targetArgs) =&gt; {
    try {
      targetArgs; // do this!
      return target(...targetArgs);
    } catch (e) {
      throw errorObj({_error: e.message});
   }
 };"><pre class="notranslate"> <span class="pl-k">const</span> <span class="pl-en">tryCatchWrapper</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-s1">target</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-k">async</span> <span class="pl-kos">(</span>...<span class="pl-s1">targetArgs</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-kos">{</span>
    <span class="pl-k">try</span> <span class="pl-kos">{</span>
      <span class="pl-s1">targetArgs</span><span class="pl-kos">;</span> <span class="pl-c">// do this!</span>
      <span class="pl-k">return</span> <span class="pl-s1">target</span><span class="pl-kos">(</span>...<span class="pl-s1">targetArgs</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span> <span class="pl-k">catch</span> <span class="pl-kos">(</span><span class="pl-s1">e</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
      <span class="pl-k">throw</span> <span class="pl-en">errorObj</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">_error</span>: <span class="pl-s1">e</span><span class="pl-kos">.</span><span class="pl-c1">message</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></pre></div>
<h3 dir="auto">Context</h3>
<p dir="auto">Made a try/catch wrapper for calling stripe. it bugs out! But then when i put a <code class="notranslate">console.log</code> in there, it works fine, which makes it extra confusing.<br>
A call might look like this:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="stripe.invoices.retrieveUpcoming = tryCatchWrapper(stripe.invoices.retrieveUpcoming.bind(stripe.invoices));"><pre class="notranslate"><span class="pl-s1">stripe</span><span class="pl-kos">.</span><span class="pl-c1">invoices</span><span class="pl-kos">.</span><span class="pl-c1">retrieveUpcoming</span> <span class="pl-c1">=</span> <span class="pl-en">tryCatchWrapper</span><span class="pl-kos">(</span><span class="pl-s1">stripe</span><span class="pl-kos">.</span><span class="pl-c1">invoices</span><span class="pl-kos">.</span><span class="pl-c1">retrieveUpcoming</span><span class="pl-kos">.</span><span class="pl-en">bind</span><span class="pl-kos">(</span><span class="pl-s1">stripe</span><span class="pl-kos">.</span><span class="pl-c1">invoices</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<h3 dir="auto">Your Environment</h3>
<p dir="auto">babeljs.io</p>
<h2 dir="auto">Bug Report</h2>
<p dir="auto">The preset seems to think that Android does not support anything and enables every plugin because of <code class="notranslate">"android": "67"</code> support. Chrome for Android should support most features in that version.</p>
<p dir="auto">I set up an <a href="https://github.com/luzat/babel-preset-env-demo">example repository</a> with basic configuration and debug enabled. Output after <code class="notranslate">npm install</code>/<code class="notranslate">yarn install</code> and <code class="notranslate">npm run demo</code>/<code class="notranslate">yarn run demo</code> is:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt; babel-preset-env-demo@1.0.0 demo /home/tom/p/babel-preset-env-demo
&gt; babel index.js

@babel/preset-env: `DEBUG` option

Using targets:
{
  &quot;android&quot;: &quot;67&quot;,
  &quot;chrome&quot;: &quot;66&quot;,
  &quot;edge&quot;: &quot;17&quot;,
  &quot;firefox&quot;: &quot;60&quot;,
  &quot;ios&quot;: &quot;11&quot;,
  &quot;safari&quot;: &quot;11.1&quot;
}

Using modules transform: commonjs

Using plugins:
  transform-template-literals { &quot;android&quot;:&quot;67&quot; }
  transform-literals { &quot;android&quot;:&quot;67&quot; }
  transform-function-name { &quot;android&quot;:&quot;67&quot;, &quot;edge&quot;:&quot;17&quot; }
  transform-arrow-functions { &quot;android&quot;:&quot;67&quot; }
  transform-block-scoped-functions { &quot;android&quot;:&quot;67&quot; }
  transform-classes { &quot;android&quot;:&quot;67&quot; }
  transform-object-super { &quot;android&quot;:&quot;67&quot; }
  transform-shorthand-properties { &quot;android&quot;:&quot;67&quot; }
  transform-duplicate-keys { &quot;android&quot;:&quot;67&quot; }
  transform-computed-properties { &quot;android&quot;:&quot;67&quot; }
  transform-for-of { &quot;android&quot;:&quot;67&quot; }
  transform-sticky-regex { &quot;android&quot;:&quot;67&quot; }
  transform-dotall-regex { &quot;android&quot;:&quot;67&quot;, &quot;edge&quot;:&quot;17&quot;, &quot;firefox&quot;:&quot;60&quot;, &quot;ios&quot;:&quot;11&quot; }
  transform-unicode-regex { &quot;android&quot;:&quot;67&quot; }
  transform-spread { &quot;android&quot;:&quot;67&quot; }
  transform-parameters { &quot;android&quot;:&quot;67&quot; }
  transform-destructuring { &quot;android&quot;:&quot;67&quot;, &quot;edge&quot;:&quot;17&quot; }
  transform-block-scoping { &quot;android&quot;:&quot;67&quot; }
  transform-typeof-symbol { &quot;android&quot;:&quot;67&quot; }
  transform-new-target { &quot;android&quot;:&quot;67&quot; }
  transform-regenerator { &quot;android&quot;:&quot;67&quot; }
  transform-exponentiation-operator { &quot;android&quot;:&quot;67&quot; }
  transform-async-to-generator { &quot;android&quot;:&quot;67&quot; }
  proposal-async-generator-functions { &quot;android&quot;:&quot;67&quot;, &quot;edge&quot;:&quot;17&quot;, &quot;ios&quot;:&quot;11&quot;, &quot;safari&quot;:&quot;11.1&quot; }
  proposal-object-rest-spread { &quot;android&quot;:&quot;67&quot;, &quot;edge&quot;:&quot;17&quot;, &quot;ios&quot;:&quot;11&quot; }
  proposal-unicode-property-regex { &quot;android&quot;:&quot;67&quot;, &quot;edge&quot;:&quot;17&quot;, &quot;firefox&quot;:&quot;60&quot;, &quot;ios&quot;:&quot;11&quot; }

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
&quot;use strict&quot;;"><pre class="notranslate"><code class="notranslate">&gt; babel-preset-env-demo@1.0.0 demo /home/tom/p/babel-preset-env-demo
&gt; babel index.js

@babel/preset-env: `DEBUG` option

Using targets:
{
  "android": "67",
  "chrome": "66",
  "edge": "17",
  "firefox": "60",
  "ios": "11",
  "safari": "11.1"
}

Using modules transform: commonjs

Using plugins:
  transform-template-literals { "android":"67" }
  transform-literals { "android":"67" }
  transform-function-name { "android":"67", "edge":"17" }
  transform-arrow-functions { "android":"67" }
  transform-block-scoped-functions { "android":"67" }
  transform-classes { "android":"67" }
  transform-object-super { "android":"67" }
  transform-shorthand-properties { "android":"67" }
  transform-duplicate-keys { "android":"67" }
  transform-computed-properties { "android":"67" }
  transform-for-of { "android":"67" }
  transform-sticky-regex { "android":"67" }
  transform-dotall-regex { "android":"67", "edge":"17", "firefox":"60", "ios":"11" }
  transform-unicode-regex { "android":"67" }
  transform-spread { "android":"67" }
  transform-parameters { "android":"67" }
  transform-destructuring { "android":"67", "edge":"17" }
  transform-block-scoping { "android":"67" }
  transform-typeof-symbol { "android":"67" }
  transform-new-target { "android":"67" }
  transform-regenerator { "android":"67" }
  transform-exponentiation-operator { "android":"67" }
  transform-async-to-generator { "android":"67" }
  proposal-async-generator-functions { "android":"67", "edge":"17", "ios":"11", "safari":"11.1" }
  proposal-object-rest-spread { "android":"67", "edge":"17", "ios":"11" }
  proposal-unicode-property-regex { "android":"67", "edge":"17", "firefox":"60", "ios":"11" }

Using polyfills: No polyfills were added, since the `useBuiltIns` option was not set.
"use strict";
</code></pre></div>
<p dir="auto">I would expect the Android browser to support most if not all of these. I guess there is a mapping from Android to the equivalent Chrome versions missing at some point (compat-table, caniuse, browserslist?) and I recall having used Babel 7 previously without this behavior. I imagine some third-party library update to be responsible.</p>
<p dir="auto"><strong>babel.config.js</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="module.exports = {
  presets: [
    [
      '@babel/env',
      {
        debug: true,
      },
    ],
  ],
}"><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-s">'@babel/env'</span><span class="pl-kos">,</span>
      <span class="pl-kos">{</span>
        <span class="pl-c1">debug</span>: <span class="pl-c1">true</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-kos">,</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">I am not sure if the feature sets of Android x and Chrome x are equivalent starting with some version of if there are numbering and feature differences to account for, but probably either compat-table or preset-env should have some mapping., most likely for all versions of Android &gt;4.4.</p>
<p dir="auto"><strong>Environment</strong></p>
<ul dir="auto">
<li>Babel version(s): 7.0.0-beta.54; downgrading to beta.31 did not help.</li>
<li>Node/npm version: Node v10.7.0</li>
<li>OS: Debian GNU/Linux</li>
<li>How you are using Babel: cli and loader</li>
</ul>