<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Current Behavior</strong><br>
as of 7.5.0 the output of my distributed code has become more verbose.  I'm not sure if it's a bug or intended side-effect of another change.  If it's intended, I haven't worked out how to reduce the output again.</p>
<p dir="auto">Basically a single-line babel-helper has been replaced at the top of the file with multi in-line functions</p>
<p dir="auto"><strong>Input Code</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="const test = { t: 'test' };
const { t } = test;
const foo = (...args) =&gt; args;

const a = ['a', 'b', 'c'];
const b = [...a, 'foo'];
const c = foo(...a);

export const es6a = foo;
export const es6b = { ...test, t, a, b, c };"><pre class="notranslate"><span class="pl-k">const</span> <span class="pl-s1">test</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> <span class="pl-c1">t</span>: <span class="pl-s">'test'</span> <span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-kos">{</span> t <span class="pl-kos">}</span> <span class="pl-c1">=</span> <span class="pl-s1">test</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-en">foo</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span>...<span class="pl-s1">args</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-s1">args</span><span class="pl-kos">;</span>

<span class="pl-k">const</span> <span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-s">'a'</span><span class="pl-kos">,</span> <span class="pl-s">'b'</span><span class="pl-kos">,</span> <span class="pl-s">'c'</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span>...<span class="pl-s1">a</span><span class="pl-kos">,</span> <span class="pl-s">'foo'</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-k">const</span> <span class="pl-s1">c</span> <span class="pl-c1">=</span> <span class="pl-en">foo</span><span class="pl-kos">(</span>...<span class="pl-s1">a</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-k">export</span> <span class="pl-k">const</span> <span class="pl-s1">es6a</span> <span class="pl-c1">=</span> <span class="pl-en">foo</span><span class="pl-kos">;</span>
<span class="pl-k">export</span> <span class="pl-k">const</span> <span class="pl-s1">es6b</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span> ...<span class="pl-s1">test</span><span class="pl-kos">,</span> t<span class="pl-kos">,</span> a<span class="pl-kos">,</span> b<span class="pl-kos">,</span> c <span class="pl-kos">}</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>output</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import _defineProperty from &quot;@babel/runtime/helpers/defineProperty&quot;;

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i &lt; arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

var test = {
  t: 'test'
};
var t = test.t;

var foo = function foo() {
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key &lt; _len; _key++) {
    args[_key] = arguments[_key];
  }

  return args;
};

var a = ['a', 'b', 'c'];
var b = [].concat(a, ['foo']);
var c = foo.apply(void 0, a);
export var es6a = foo;
export var es6b = _objectSpread({}, test, {
  t: t,
  a: a,
  b: b,
  c: c
});


"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">_defineProperty</span> <span class="pl-k">from</span> <span class="pl-s">"@babel/runtime/helpers/defineProperty"</span><span class="pl-kos">;</span>

<span class="pl-k">function</span> <span class="pl-en">ownKeys</span><span class="pl-kos">(</span><span class="pl-s1">object</span><span class="pl-kos">,</span> <span class="pl-s1">enumerableOnly</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">var</span> <span class="pl-s1">keys</span> <span class="pl-c1">=</span> <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">keys</span><span class="pl-kos">(</span><span class="pl-s1">object</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-v">Object</span><span class="pl-kos">.</span><span class="pl-c1">getOwnPropertySymbols</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">var</span> <span class="pl-s1">symbols</span> <span class="pl-c1">=</span> <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">getOwnPropertySymbols</span><span class="pl-kos">(</span><span class="pl-s1">object</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">enumerableOnly</span><span class="pl-kos">)</span> <span class="pl-s1">symbols</span> <span class="pl-c1">=</span> <span class="pl-s1">symbols</span><span class="pl-kos">.</span><span class="pl-en">filter</span><span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">sym</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">getOwnPropertyDescriptor</span><span class="pl-kos">(</span><span class="pl-s1">object</span><span class="pl-kos">,</span> <span class="pl-s1">sym</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">enumerable</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">keys</span><span class="pl-kos">.</span><span class="pl-c1">push</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-s1">keys</span><span class="pl-kos">,</span> <span class="pl-s1">symbols</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">keys</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>

<span class="pl-k">function</span> <span class="pl-en">_objectSpread</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">for</span> <span class="pl-kos">(</span><span class="pl-k">var</span> <span class="pl-s1">i</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span> <span class="pl-s1">i</span> <span class="pl-c1">&lt;</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">i</span><span class="pl-c1">++</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">var</span> <span class="pl-s1">source</span> <span class="pl-c1">=</span> <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-s1">i</span><span class="pl-kos">]</span> <span class="pl-c1">!=</span> <span class="pl-c1">null</span> ? <span class="pl-smi">arguments</span><span class="pl-kos">[</span><span class="pl-s1">i</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">if</span> <span class="pl-kos">(</span><span class="pl-s1">i</span> <span class="pl-c1">%</span> <span class="pl-c1">2</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-en">ownKeys</span><span class="pl-kos">(</span><span class="pl-s1">source</span><span class="pl-kos">,</span> <span class="pl-c1">true</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">forEach</span><span class="pl-kos">(</span><span class="pl-k">function</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-en">_defineProperty</span><span class="pl-kos">(</span><span class="pl-s1">target</span><span class="pl-kos">,</span> <span class="pl-s1">key</span><span class="pl-kos">,</span> <span class="pl-s1">source</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-kos">}</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-k">if</span> <span class="pl-kos">(</span><span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-c1">getOwnPropertyDescriptors</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">defineProperties</span><span class="pl-kos">(</span><span class="pl-s1">target</span><span class="pl-kos">,</span> <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">getOwnPropertyDescriptors</span><span class="pl-kos">(</span><span class="pl-s1">source</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">else</span> <span class="pl-kos">{</span> <span class="pl-en">ownKeys</span><span class="pl-kos">(</span><span class="pl-s1">source</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">forEach</span><span class="pl-kos">(</span><span class="pl-k">function</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-v">Object</span><span class="pl-kos">.</span><span class="pl-en">defineProperty</span><span class="pl-kos">(</span><span class="pl-s1">target</span><span class="pl-kos">,</span> <span class="pl-s1">key</span><span class="pl-kos">,</span> <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">getOwnPropertyDescriptor</span><span class="pl-kos">(</span><span class="pl-s1">source</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-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-s1">target</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>

<span class="pl-k">var</span> <span class="pl-s1">test</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
  <span class="pl-c1">t</span>: <span class="pl-s">'test'</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">t</span> <span class="pl-c1">=</span> <span class="pl-s1">test</span><span class="pl-kos">.</span><span class="pl-c1">t</span><span class="pl-kos">;</span>

<span class="pl-k">var</span> <span class="pl-en">foo</span> <span class="pl-c1">=</span> <span class="pl-k">function</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-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">args</span> <span class="pl-c1">=</span> <span class="pl-k">new</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">args</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">args</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">a</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-s">'a'</span><span class="pl-kos">,</span> <span class="pl-s">'b'</span><span class="pl-kos">,</span> <span class="pl-s">'c'</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-en">concat</span><span class="pl-kos">(</span><span class="pl-s1">a</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-s">'foo'</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">c</span> <span class="pl-c1">=</span> <span class="pl-en">foo</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-k">void</span> <span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-s1">a</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">export</span> <span class="pl-k">var</span> <span class="pl-s1">es6a</span> <span class="pl-c1">=</span> <span class="pl-en">foo</span><span class="pl-kos">;</span>
<span class="pl-k">export</span> <span class="pl-k">var</span> <span class="pl-s1">es6b</span> <span class="pl-c1">=</span> <span class="pl-en">_objectSpread</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">test</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
  <span class="pl-c1">t</span>: <span class="pl-s1">t</span><span class="pl-kos">,</span>
  <span class="pl-c1">a</span>: <span class="pl-s1">a</span><span class="pl-kos">,</span>
  <span class="pl-c1">b</span>: <span class="pl-s1">b</span><span class="pl-kos">,</span>
  <span class="pl-c1">c</span>: <span class="pl-s1">c</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

</pre></div>
<p dir="auto"><strong>Expected behavior/code</strong><br>
previously, 7.4.4, output included a helper and much less code.</p>
<p dir="auto"><strong>output</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import _objectSpread from &quot;@babel/runtime/helpers/objectSpread&quot;;
var test = {
  t: 'test'
};
var t = test.t;

var foo = function foo() {
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key &lt; _len; _key++) {
    args[_key] = arguments[_key];
  }

  return args;
};

var a = ['a', 'b', 'c'];
var b = [].concat(a, ['foo']);
var c = foo.apply(void 0, a);
export var es6a = foo;
export var es6b = _objectSpread({}, test, {
  t: t,
  a: a,
  b: b,
  c: c
});

"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">_objectSpread</span> <span class="pl-k">from</span> <span class="pl-s">"@babel/runtime/helpers/objectSpread"</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">test</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
  <span class="pl-c1">t</span>: <span class="pl-s">'test'</span>
<span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">t</span> <span class="pl-c1">=</span> <span class="pl-s1">test</span><span class="pl-kos">.</span><span class="pl-c1">t</span><span class="pl-kos">;</span>

<span class="pl-k">var</span> <span class="pl-en">foo</span> <span class="pl-c1">=</span> <span class="pl-k">function</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-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">args</span> <span class="pl-c1">=</span> <span class="pl-k">new</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">args</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">args</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">a</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-s">'a'</span><span class="pl-kos">,</span> <span class="pl-s">'b'</span><span class="pl-kos">,</span> <span class="pl-s">'c'</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-en">concat</span><span class="pl-kos">(</span><span class="pl-s1">a</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-s">'foo'</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">c</span> <span class="pl-c1">=</span> <span class="pl-en">foo</span><span class="pl-kos">.</span><span class="pl-en">apply</span><span class="pl-kos">(</span><span class="pl-k">void</span> <span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-s1">a</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">export</span> <span class="pl-k">var</span> <span class="pl-s1">es6a</span> <span class="pl-c1">=</span> <span class="pl-en">foo</span><span class="pl-kos">;</span>
<span class="pl-k">export</span> <span class="pl-k">var</span> <span class="pl-s1">es6b</span> <span class="pl-c1">=</span> <span class="pl-en">_objectSpread</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">test</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
  <span class="pl-c1">t</span>: <span class="pl-s1">t</span><span class="pl-kos">,</span>
  <span class="pl-c1">a</span>: <span class="pl-s1">a</span><span class="pl-kos">,</span>
  <span class="pl-c1">b</span>: <span class="pl-s1">b</span><span class="pl-kos">,</span>
  <span class="pl-c1">c</span>: <span class="pl-s1">c</span>
<span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
</pre></div>
<p dir="auto"><strong>Babel Configuration (.babelrc, package.json, cli command)</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="module.exports = function babelConfig(api) {
    api.cache(true);

    return {
        presets: [
            [
                require('@babel/preset-env'),
                {
                    modules: false,
                },
            ],
        ],
        plugins: [
            require('@babel/plugin-transform-runtime'),
            require('@babel/plugin-proposal-object-rest-spread'),
        ],
    };
};
"><pre class="notranslate"><span class="pl-smi">module</span><span class="pl-kos">.</span><span class="pl-en">exports</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-en">babelConfig</span><span class="pl-kos">(</span><span class="pl-s1">api</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-s1">api</span><span class="pl-kos">.</span><span class="pl-en">cache</span><span class="pl-kos">(</span><span class="pl-c1">true</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-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">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-kos">]</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">'@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-proposal-object-rest-spread'</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"><strong>Environment</strong></p>
<ul dir="auto">
<li>Babel version(s): <code class="notranslate">7.6.0</code></li>
<li>Node/npm version: <code class="notranslate">v10.16.0</code></li>
<li>OS: <code class="notranslate">OSX 10.14.6</code></li>
<li>Monorepo: yes, but reproduce-able in 2 files (js + config)</li>
<li>How you are using Babel: cli for reproducable example (but found change via node api)</li>
</ul>
<p dir="auto"><strong>Possible Solution</strong><br>
<g-emoji class="g-emoji" alias="thinking" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f914.png">🤔</g-emoji></p>
<p dir="auto">playing with the browser targets gives a desired output.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="targets: {
        browsers: [ 'Chrome &gt;= 61', 'Firefox &gt;= 60', 'Opera &gt;= 48' ],
},"><pre class="notranslate"><code class="notranslate">targets: {
        browsers: [ 'Chrome &gt;= 61', 'Firefox &gt;= 60', 'Opera &gt;= 48' ],
},
</code></pre></div>
<p dir="auto">has there been an update to the spec which these browsers no longer support?<br>
is there another plugin or way that i can fill this gap rather than adding this code at the top of the file?</p>
<p dir="auto"><strong>Additional context/Screenshots</strong><br>
none</p>
<h2 dir="auto">Bug report</h2>
<h3 dir="auto">Input Code</h3>
<p dir="auto">I have the next code:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class ThrottleError extends Error {
  constructor() {
    super();

    this.name = 'ThrottleError';
    this.message = 'Too many function call';

    if (Error.captureStackTrace) {
      Error.captureStackTrace(this, ThrottleError);
    } else {
      this.stack = new Error().stack;
    }
  }
}

try {
  const e = new ThrottleError();
  throw e;
} catch (error) {
  console.log('error instanceof ThrottleError = ', error instanceof ThrottleError);
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">ThrottleError</span> <span class="pl-k">extends</span> <span class="pl-v">Error</span> <span class="pl-kos">{</span>
  <span class="pl-en">constructor</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-smi">super</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

    <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">name</span> <span class="pl-c1">=</span> <span class="pl-s">'ThrottleError'</span><span class="pl-kos">;</span>
    <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">message</span> <span class="pl-c1">=</span> <span class="pl-s">'Too many function call'</span><span class="pl-kos">;</span>

    <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-v">Error</span><span class="pl-kos">.</span><span class="pl-c1">captureStackTrace</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
      <span class="pl-v">Error</span><span class="pl-kos">.</span><span class="pl-en">captureStackTrace</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">,</span> <span class="pl-v">ThrottleError</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-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">stack</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Error</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">stack</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">try</span> <span class="pl-kos">{</span>
  <span class="pl-k">const</span> <span class="pl-s1">e</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">ThrottleError</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-k">throw</span> <span class="pl-s1">e</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-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">'error instanceof ThrottleError = '</span><span class="pl-kos">,</span> <span class="pl-s1">error</span> <span class="pl-k">instanceof</span> <span class="pl-v">ThrottleError</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">When I run the above code in the console of Google Chrome v58 or node.js v8.5 I get the next output, which is expected behavior:<br>
<code class="notranslate">error instanceof ThrottleError =  true</code></p>
<h3 dir="auto">Current Behavior</h3>
<p dir="auto">After transpilation the above code becomes the next:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(&quot;Cannot call a class as a function&quot;); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(&quot;this hasn't been initialised - super() hasn't been called&quot;); } return call &amp;&amp; (typeof call === &quot;object&quot; || typeof call === &quot;function&quot;) ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== &quot;function&quot; &amp;&amp; superClass !== null) { throw new TypeError(&quot;Super expression must either be null or a function, not &quot; + typeof superClass); } subClass.prototype = Object.create(superClass &amp;&amp; superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

let ThrottleError = function (_Error) {
  _inherits(ThrottleError, _Error);

  function ThrottleError() {
    _classCallCheck(this, ThrottleError);

    var _this = _possibleConstructorReturn(this, (ThrottleError.__proto__ || Object.getPrototypeOf(ThrottleError)).call(this));

    _this.name = 'ThrottleError';
    _this.message = 'Too many function call';

    if (Error.captureStackTrace) {
      Error.captureStackTrace(_this, ThrottleError);
    } else {
      _this.stack = new Error().stack;
    }
    return _this;
  }

  return ThrottleError;
}(Error);

try {
  const e = new ThrottleError();
  throw e;
} catch (error) {
  console.log('error instanceof ThrottleError = ', error instanceof ThrottleError);
}"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">_classCallCheck</span><span class="pl-kos">(</span><span class="pl-s1">instance</span><span class="pl-kos">,</span> <span class="pl-v">Constructor</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-c1">!</span><span class="pl-kos">(</span><span class="pl-s1">instance</span> <span class="pl-k">instanceof</span> <span class="pl-v">Constructor</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-v">TypeError</span><span class="pl-kos">(</span><span class="pl-s">"Cannot call a class as a function"</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-en">_possibleConstructorReturn</span><span class="pl-kos">(</span><span class="pl-s1">self</span><span class="pl-kos">,</span> <span class="pl-s1">call</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-c1">!</span><span class="pl-s1">self</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-v">ReferenceError</span><span class="pl-kos">(</span><span class="pl-s">"this hasn't been initialised - super() hasn't been called"</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">call</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-kos">(</span><span class="pl-k">typeof</span> <span class="pl-s1">call</span> <span class="pl-c1">===</span> <span class="pl-s">"object"</span> <span class="pl-c1">||</span> <span class="pl-k">typeof</span> <span class="pl-s1">call</span> <span class="pl-c1">===</span> <span class="pl-s">"function"</span><span class="pl-kos">)</span> ? <span class="pl-s1">call</span> : <span class="pl-s1">self</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>

<span class="pl-k">function</span> <span class="pl-en">_inherits</span><span class="pl-kos">(</span><span class="pl-s1">subClass</span><span class="pl-kos">,</span> <span class="pl-s1">superClass</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-k">typeof</span> <span class="pl-s1">superClass</span> <span class="pl-c1">!==</span> <span class="pl-s">"function"</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-s1">superClass</span> <span class="pl-c1">!==</span> <span class="pl-c1">null</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">throw</span> <span class="pl-k">new</span> <span class="pl-v">TypeError</span><span class="pl-kos">(</span><span class="pl-s">"Super expression must either be null or a function, not "</span> <span class="pl-c1">+</span> <span class="pl-k">typeof</span> <span class="pl-s1">superClass</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-s1">subClass</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span> <span class="pl-c1">=</span> <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">create</span><span class="pl-kos">(</span><span class="pl-s1">superClass</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-s1">superClass</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">,</span> <span class="pl-kos">{</span> <span class="pl-c1">constructor</span>: <span class="pl-kos">{</span> <span class="pl-c1">value</span>: <span class="pl-s1">subClass</span><span class="pl-kos">,</span> <span class="pl-c1">enumerable</span>: <span class="pl-c1">false</span><span class="pl-kos">,</span> <span class="pl-c1">writable</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span> <span class="pl-c1">configurable</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-k">if</span> <span class="pl-kos">(</span><span class="pl-s1">superClass</span><span class="pl-kos">)</span> <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-c1">setPrototypeOf</span> ? <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">setPrototypeOf</span><span class="pl-kos">(</span><span class="pl-s1">subClass</span><span class="pl-kos">,</span> <span class="pl-s1">superClass</span><span class="pl-kos">)</span> : <span class="pl-s1">subClass</span><span class="pl-kos">.</span><span class="pl-c1">__proto__</span> <span class="pl-c1">=</span> <span class="pl-s1">superClass</span><span class="pl-kos">;</span> <span class="pl-kos">}</span>

<span class="pl-k">let</span> <span class="pl-v">ThrottleError</span> <span class="pl-c1">=</span> <span class="pl-k">function</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-en">_inherits</span><span class="pl-kos">(</span><span class="pl-v">ThrottleError</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">function</span> <span class="pl-v">ThrottleError</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-en">_classCallCheck</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">,</span> <span class="pl-v">ThrottleError</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

    <span class="pl-k">var</span> <span class="pl-s1">_this</span> <span class="pl-c1">=</span> <span class="pl-en">_possibleConstructorReturn</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">,</span> <span class="pl-kos">(</span><span class="pl-v">ThrottleError</span><span class="pl-kos">.</span><span class="pl-c1">__proto__</span> <span class="pl-c1">||</span> <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">getPrototypeOf</span><span class="pl-kos">(</span><span class="pl-v">ThrottleError</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">call</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">)</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

    <span class="pl-s1">_this</span><span class="pl-kos">.</span><span class="pl-c1">name</span> <span class="pl-c1">=</span> <span class="pl-s">'ThrottleError'</span><span class="pl-kos">;</span>
    <span class="pl-s1">_this</span><span class="pl-kos">.</span><span class="pl-c1">message</span> <span class="pl-c1">=</span> <span class="pl-s">'Too many function call'</span><span class="pl-kos">;</span>

    <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-v">Error</span><span class="pl-kos">.</span><span class="pl-c1">captureStackTrace</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
      <span class="pl-v">Error</span><span class="pl-kos">.</span><span class="pl-en">captureStackTrace</span><span class="pl-kos">(</span><span class="pl-s1">_this</span><span class="pl-kos">,</span> <span class="pl-v">ThrottleError</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-s1">_this</span><span class="pl-kos">.</span><span class="pl-c1">stack</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Error</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">stack</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
    <span class="pl-k">return</span> <span class="pl-s1">_this</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span>

  <span class="pl-k">return</span> <span class="pl-v">ThrottleError</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span><span class="pl-kos">(</span><span class="pl-v">Error</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">const</span> <span class="pl-s1">e</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">ThrottleError</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-k">throw</span> <span class="pl-s1">e</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-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">'error instanceof ThrottleError = '</span><span class="pl-kos">,</span> <span class="pl-s1">error</span> <span class="pl-k">instanceof</span> <span class="pl-v">ThrottleError</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">When I run the transpiled code it in the console of Google Chrome v58 or node.js v8.5 I get the next output:<br>
<code class="notranslate">error instanceof ThrottleError =  false</code></p>
<p dir="auto">So it seems that <strong>transpilation of ES2015 Classes in this case works wrong</strong>!</p>
<h3 dir="auto">Possible Solution</h3>
<p dir="auto">After the transpilation, the code should be consistent with smth like the next (1):</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function ThrottleError() {
  Error.call(this);

  this.name = 'ThrottleError';
  this.message = 'Too many function call';

  if (Error.captureStackTrace) {
    Error.captureStackTrace(this, ThrottleError);
  } else {
    this.stack = new Error().stack;
  }
}

ThrottleError.prototype = Object.create(Error.prototype);
ThrottleError.prototype.constructor = ThrottleError;"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-v">ThrottleError</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-v">Error</span><span class="pl-kos">.</span><span class="pl-en">call</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

  <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">name</span> <span class="pl-c1">=</span> <span class="pl-s">'ThrottleError'</span><span class="pl-kos">;</span>
  <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">message</span> <span class="pl-c1">=</span> <span class="pl-s">'Too many function call'</span><span class="pl-kos">;</span>

  <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-v">Error</span><span class="pl-kos">.</span><span class="pl-c1">captureStackTrace</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-v">Error</span><span class="pl-kos">.</span><span class="pl-en">captureStackTrace</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">,</span> <span class="pl-v">ThrottleError</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-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">stack</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Error</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">stack</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span>

<span class="pl-v">ThrottleError</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span> <span class="pl-c1">=</span> <span class="pl-v">Object</span><span class="pl-kos">.</span><span class="pl-en">create</span><span class="pl-kos">(</span><span class="pl-v">Error</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-v">ThrottleError</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">.</span><span class="pl-c1">constructor</span> <span class="pl-c1">=</span> <span class="pl-v">ThrottleError</span><span class="pl-kos">;</span></pre></div>
<h3 dir="auto">Babel Configuration</h3>
<p dir="auto">At the moment the bug is reproduced in the browser at <a href="http://babeljs.io/repl/" rel="nofollow">http://babeljs.io/repl/</a></p>
<p dir="auto">Also, my configuration for running in node.js is:<br>
<strong>.babelrc</strong>:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
  &quot;plugins&quot;: [&quot;transform-es2015-classes&quot;]
}"><pre class="notranslate"><span class="pl-kos">{</span>
  <span class="pl-s">"plugins"</span>: <span class="pl-kos">[</span><span class="pl-s">"transform-es2015-classes"</span><span class="pl-kos">]</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>package.json</strong>:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
  &quot;name&quot;: &quot;test&quot;,
  &quot;version&quot;: &quot;0.0.1&quot;,
  &quot;devDependencies&quot;: {
    &quot;babel-cli&quot;: &quot;^6.26.0&quot;,
    &quot;babel-core&quot;: &quot;^6.26.0&quot;,
    &quot;babel-plugin-transform-es2015-classes&quot;: &quot;^6.24.1&quot;
  }
}"><pre class="notranslate"><span class="pl-kos">{</span>
  <span class="pl-s">"name"</span>: <span class="pl-s">"test"</span><span class="pl-kos">,</span>
  <span class="pl-s">"version"</span>: <span class="pl-s">"0.0.1"</span><span class="pl-kos">,</span>
  <span class="pl-s">"devDependencies"</span>: <span class="pl-kos">{</span>
    <span class="pl-s">"babel-cli"</span>: <span class="pl-s">"^6.26.0"</span><span class="pl-kos">,</span>
    <span class="pl-s">"babel-core"</span>: <span class="pl-s">"^6.26.0"</span><span class="pl-kos">,</span>
    <span class="pl-s">"babel-plugin-transform-es2015-classes"</span>: <span class="pl-s">"^6.24.1"</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<hr>
<p dir="auto">Fix it plz cuz due to the bug I have to explicitly use the old syntax (1) in my src code in this case. <g-emoji class="g-emoji" alias="blush" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f60a.png">😊</g-emoji></p>