<p dir="auto">I'm using 6to5 on a big app. I like that you guys use regenerator to implement generators, so I'm confused why you care that things get renamed. I have a lot of generator functions, and if I minimize, I see the error "GeneratorFunction renamed?"</p>
<p dir="auto"><a href="http://jlongster.com/s/genfunc-err.png" rel="nofollow">http://jlongster.com/s/genfunc-err.png</a></p>
<p dir="auto">If there isn't a solution to this, this may be a showstopper for me using 6to5. Surely you guys support minification?</p>
<p dir="auto">See <a href="https://github.com/6to5/6to5/blob/55e2010311906a05e56b8c9ecd4e11d497b5e9f8/lib/6to5/transformation/transformers/es6-generators/runtime.js#L39">here</a>.</p>
<p dir="auto">The author of this code tries to be clever and set <code class="notranslate">GF.name</code> in the line above, but this actually isn't possible to do (try it in Chrome or Firefox, it will just ignore the assignment).</p>
<p dir="auto">Having <code class="notranslate">"GeneratorFunction"</code> as the constructor name is mandated by the specification. However, I would argue it's not a very important part of the specification, and that convenient minification is much more important. At the very least, the <code class="notranslate">throw</code> line should be removed, so people who don't care what the constructor name is aren't affected. It's worth noting that Regenerator itself does not care what the constructor name is.</p>
<p dir="auto">However, there is a case for removing the <code class="notranslate">"GeneratorFunction"</code> trick altogether: it would allow for removing the <code class="notranslate">mark()</code> call in the following, improving the readability of the generated code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="root@smogon-dev:~$ echo 'function* foo() { }' | 6to5
&quot;use strict&quot;;

var foo = regeneratorRuntime.mark(function foo() {
  return regeneratorRuntime.wrap(function foo$(_context) {
    while (true) switch (_context.prev = _context.next) {
      case 0:
      case &quot;end&quot;: return _context.stop();
    }
  }, foo, this);
});"><pre class="notranslate"><code class="notranslate">root@smogon-dev:~$ echo 'function* foo() { }' | 6to5
"use strict";

var foo = regeneratorRuntime.mark(function foo() {
  return regeneratorRuntime.wrap(function foo$(_context) {
    while (true) switch (_context.prev = _context.next) {
      case 0:
      case "end": return _context.stop();
    }
  }, foo, this);
});
</code></pre></div>
<p dir="auto">Here's the issue which lead to <code class="notranslate">mark</code> being added: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="21928288" data-permission-text="Title is private" data-url="https://github.com/facebook/regenerator/issues/48" data-hovercard-type="issue" data-hovercard-url="/facebook/regenerator/issues/48/hovercard" href="https://github.com/facebook/regenerator/issues/48">facebook/regenerator#48</a>. The primary reason seems to be allowing the <code class="notranslate">co</code>  library to perform some magic to distinguish between regular functions and generator functions. I guess I'm not swayed by this because <code class="notranslate">co</code> isn't very useful when you have async functions (like we do).</p>