<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Current Behavior</strong><br>
The transpilation result of generator functions is incomplete when a specific preset is enabled.</p>
<p dir="auto"><strong>Input Code</strong><br>
The following code doesn't transpile correclty with the "firefox &gt;= 45" preset enabled.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class Plug {
  
  *[Symbol.iterator]() {
    yield 1;
    yield 2;
  }
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">Plug</span> <span class="pl-kos">{</span>
  
  <span class="pl-c1">*</span><span class="pl-kos">[</span><span class="pl-v">Symbol</span><span class="pl-kos">.</span><span class="pl-c1">iterator</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">yield</span> <span class="pl-c1">1</span><span class="pl-kos">;</span>
    <span class="pl-k">yield</span> <span class="pl-c1">2</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">The <a href="https://babeljs.io/repl/#?babili=false&amp;browsers=Firefox%20%3E%3D%2045&amp;build=&amp;builtIns=false&amp;spec=false&amp;loose=false&amp;code_lz=MYGwhgzhAEAKIFcDm0DeAoa1PQFQG0BlATwFsAjAexADoBLAFwFMAnMBylgXQAoBKNDizE6TEABNoARgDcQ6CLGSATHKwBfdJqA&amp;debug=false&amp;forceAllTransforms=false&amp;shippedProposals=false&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.4.3&amp;externalPlugins=" rel="nofollow">generated output on the babel REPL</a> is referencing a <code class="notranslate">_callee</code> variable which is never defined.</p>
<p dir="auto"><strong>Expected behavior/code</strong><br>
Some valid transpiled code.</p>
<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() {
  const presets = [
    [
      &quot;@babel/preset-env&quot;,
      {
        &quot;targets&quot;: {
          &quot;firefox&quot;: &quot;53&quot;
        }
      }
    ]
  ];

  var config = {
    presets
  };

  return config;
};"><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-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-k">const</span> <span class="pl-s1">presets</span> <span class="pl-c1">=</span> <span class="pl-kos">[</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-s">"targets"</span>: <span class="pl-kos">{</span>
          <span class="pl-s">"firefox"</span>: <span class="pl-s">"53"</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-s1">config</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
    presets
  <span class="pl-kos">}</span><span class="pl-kos">;</span>

  <span class="pl-k">return</span> <span class="pl-s1">config</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): 7.3.4</li>
<li>Node/npm version: Node v10.15.3/npm 56.4.1</li>
<li>OS: Ubunut 16.04</li>
<li>Monorepo: ?</li>
<li>How you are using Babel: cli</li>
</ul>
<h2 dir="auto">Bug Report</h2>
<p dir="auto"><strong>Current Behavior</strong></p>
<p dir="auto">Class with a generator method like this:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class Foo {  
  method(){
    thia.val = 10;
  }

  *bar(){
    yield this.val;
    return 'bar';
  }
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">Foo</span> <span class="pl-kos">{</span>  
  <span class="pl-en">method</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
    <span class="pl-s1">thia</span><span class="pl-kos">.</span><span class="pl-c1">val</span> <span class="pl-c1">=</span> <span class="pl-c1">10</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span>

  <span class="pl-c1">*</span><span class="pl-en">bar</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
    <span class="pl-k">yield</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">val</span><span class="pl-kos">;</span>
    <span class="pl-k">return</span> <span class="pl-s">'bar'</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">I disabled class transform option because many browsers are natively support this feature.  But I got a bad transformed output:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class Foo {
  method() {
    thia.val = 10;
  }

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

            case 2:
              return _context.abrupt(&quot;return&quot;, &quot;bar&quot;);

            case 3:
            case &quot;end&quot;:
              return _context.stop();
          }
      },
      _callee,
      this
    );
  }
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">Foo</span> <span class="pl-kos">{</span>
  <span class="pl-en">method</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-s1">thia</span><span class="pl-kos">.</span><span class="pl-c1">val</span> <span class="pl-c1">=</span> <span class="pl-c1">10</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span>

  <span class="pl-en">bar</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-k">switch</span> <span class="pl-kos">(</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-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">next</span> <span class="pl-c1">=</span> <span class="pl-c1">2</span><span class="pl-kos">;</span>
              <span class="pl-k">return</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">val</span><span class="pl-kos">;</span>

            <span class="pl-k">case</span> <span class="pl-c1">2</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-s">"bar"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

            <span class="pl-k">case</span> <span class="pl-c1">3</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-s1">_callee</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-kos">}</span></pre></div>
<p dir="auto">When run in browser, got <code class="notranslate">_callee</code> is not defined.</p>
<p dir="auto"><strong>Expected behavior/code</strong></p>
<p dir="auto">The correct transform result maybe looks like:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class Foo {
  method() {
    thia.val = 10;
  }

  bar() {
    return regeneratorRuntime.mark(function bar() {
      return regeneratorRuntime.wrap(
        function bar$(_context) {
          while (1) {
            switch ((_context.prev = _context.next)) {
              case 0:
                _context.next = 2;
                return this.val;

              case 2:
                return _context.abrupt(&quot;return&quot;, &quot;bar&quot;);

              case 3:
              case &quot;end&quot;:
                return _context.stop();
            }
          }
        },
        bar,
        this
      );
    });
  }
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">Foo</span> <span class="pl-kos">{</span>
  <span class="pl-en">method</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-s1">thia</span><span class="pl-kos">.</span><span class="pl-c1">val</span> <span class="pl-c1">=</span> <span class="pl-c1">10</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span>

  <span class="pl-en">bar</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">mark</span><span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-en">bar</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">bar$</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-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-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">next</span> <span class="pl-c1">=</span> <span class="pl-c1">2</span><span class="pl-kos">;</span>
                <span class="pl-k">return</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">val</span><span class="pl-kos">;</span>

              <span class="pl-k">case</span> <span class="pl-c1">2</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-s">"bar"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

              <span class="pl-k">case</span> <span class="pl-c1">3</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">bar</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-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>Additional context/Screenshots</strong></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/6045824/50137862-7d9a5000-02d7-11e9-9e52-406026374877.png"><img src="https://user-images.githubusercontent.com/6045824/50137862-7d9a5000-02d7-11e9-9e52-406026374877.png" alt="image" style="max-width: 100%;"></a></p>