<p dir="auto">Possibly related to <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="114612516" data-permission-text="Title is private" data-url="https://github.com/babel/babel/issues/2751" data-hovercard-type="issue" data-hovercard-url="/babel/babel/issues/2751/hovercard" href="https://github.com/babel/babel/issues/2751">#2751</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="114491529" data-permission-text="Title is private" data-url="https://github.com/babel/babel/issues/2725" data-hovercard-type="issue" data-hovercard-url="/babel/babel/issues/2725/hovercard" href="https://github.com/babel/babel/issues/2725">#2725</a> and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="114304486" data-permission-text="Title is private" data-url="https://github.com/babel/babel/issues/2686" data-hovercard-type="issue" data-hovercard-url="/babel/babel/issues/2686/hovercard" href="https://github.com/babel/babel/issues/2686">#2686</a>, but I do not think it's a duplicate, since this bug only appears when default parameters are used. Also, I tried asking in slack, but didn't recieve an answer and I think the question got burried now.</p>
<p dir="auto">I'm using a fresh setup with <code class="notranslate">node v5.0.0</code>, <code class="notranslate">npm v3.3.11</code>, <code class="notranslate">babel-cli 6.0.15</code> (with <code class="notranslate">babel-core 6.0.20</code>), <code class="notranslate">babel-preset-es2015</code> (which includes <code class="notranslate">babel-plugin-transform-regenerator</code> and <code class="notranslate">babel-plugin-transform-es2015-parameters</code>).</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ babel --version
6.0.15 (babel-core 6.0.20)"><pre class="notranslate"><span class="pl-s1">$</span> <span class="pl-s1">babel</span> <span class="pl-c1">--</span><span class="pl-s1">version</span>
<span class="pl-c1">6.0</span><span class="pl-c1">.15</span> <span class="pl-kos">(</span><span class="pl-s1">babel</span><span class="pl-c1">-</span><span class="pl-s1">core</span> <span class="pl-c1">6.0</span><span class="pl-c1">.20</span><span class="pl-kos">)</span></pre></div>
<p dir="auto"><strong>.babelrc</strong> (I've tried manually specifying the above-mentioned <code class="notranslate">plugins</code> as well)</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
  &quot;presets&quot;: [&quot;es2015&quot;]
}"><pre class="notranslate"><span class="pl-kos">{</span>
  <span class="pl-s">"presets"</span>: <span class="pl-kos">[</span><span class="pl-s">"es2015"</span><span class="pl-kos">]</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto"><strong>index.js</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export class Test {
    *memberGenerator(arg = 0) {
        console.log(arg);
    }

    start() {
        this.memberGenerator(1).next();
    }
}"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-k">class</span> <span class="pl-v">Test</span> <span class="pl-kos">{</span>
    <span class="pl-c1">*</span><span class="pl-en">memberGenerator</span><span class="pl-kos">(</span><span class="pl-s1">arg</span> <span class="pl-c1">=</span> <span class="pl-c1">0</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-s1">arg</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>

    <span class="pl-en">start</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-en">memberGenerator</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-en">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></pre></div>
<p dir="auto"><strong><code class="notranslate">babel index.js --module-id Test -o out.js</code></strong></p>
<p dir="auto"><strong>out.js</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&quot;use strict&quot;;

(function (global, factory) {
    if (typeof define === &quot;function&quot; &amp;&amp; define.amd) {
        define(&quot;Test&quot;, [&quot;exports&quot;], factory);
    } else if (typeof exports !== &quot;undefined&quot;) {
        factory(exports);
    } else {
        var mod = {
            exports: {}
        };
        factory(mod.exports);
        global.Test = mod.exports;
    }
})(this, function (exports) {
    Object.defineProperty(exports, &quot;__esModule&quot;, {
        value: true
    });
    var _arguments = arguments;

    function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(&quot;Cannot call a class as a function&quot;); } }

    var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i &lt; props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (&quot;value&quot; in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();

    var Test = exports.Test = (function () {
        function Test() {
            _classCallCheck(this, Test);
        }

        _createClass(Test, [{
            key: &quot;memberGenerator&quot;,
            value: regeneratorRuntime.mark(function memberGenerator() {
                var arg = _arguments.length &lt;= 0 || _arguments[0] === undefined ? 0 : _arguments[0];
                return regeneratorRuntime.wrap(function memberGenerator$(_context) {
                    while (1) switch (_context.prev = _context.next) {
                        case 0:
                            console.log(arg);

                        case 1:
                        case &quot;end&quot;:
                            return _context.stop();
                    }
                }, memberGenerator, this);
            })
        }, {
            key: &quot;start&quot;,
            value: function start() {
                var gen = this.memberGenerator(1);
                gen.next();
            }
        }]);

        return Test;
    })();
});
"><pre class="notranslate"><span class="pl-s">"use strict"</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">global</span><span class="pl-kos">,</span> <span class="pl-s1">factory</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">define</span> <span class="pl-c1">===</span> <span class="pl-s">"function"</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-s1">define</span><span class="pl-kos">.</span><span class="pl-c1">amd</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-en">define</span><span class="pl-kos">(</span><span class="pl-s">"Test"</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-s">"exports"</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-s1">factory</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-k">typeof</span> <span class="pl-s1">exports</span> <span class="pl-c1">!==</span> <span class="pl-s">"undefined"</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-s1">factory</span><span class="pl-kos">(</span><span class="pl-s1">exports</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">var</span> <span class="pl-s1">mod</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span>
            <span class="pl-c1">exports</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">factory</span><span class="pl-kos">(</span><span class="pl-s1">mod</span><span class="pl-kos">.</span><span class="pl-c1">exports</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-s1">global</span><span class="pl-kos">.</span><span class="pl-c1">Test</span> <span class="pl-c1">=</span> <span class="pl-s1">mod</span><span class="pl-kos">.</span><span class="pl-c1">exports</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-smi">this</span><span class="pl-kos">,</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">exports</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">exports</span><span class="pl-kos">,</span> <span class="pl-s">"__esModule"</span><span class="pl-kos">,</span> <span class="pl-kos">{</span>
        <span class="pl-c1">value</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-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">_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">var</span> <span class="pl-s1">_createClass</span> <span class="pl-c1">=</span> <span class="pl-kos">(</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">function</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-s1">props</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">0</span><span class="pl-kos">;</span> <span class="pl-s1">i</span> <span class="pl-c1">&lt;</span> <span class="pl-s1">props</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">descriptor</span> <span class="pl-c1">=</span> <span class="pl-s1">props</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-s1">descriptor</span><span class="pl-kos">.</span><span class="pl-c1">enumerable</span> <span class="pl-c1">=</span> <span class="pl-s1">descriptor</span><span class="pl-kos">.</span><span class="pl-c1">enumerable</span> <span class="pl-c1">||</span> <span class="pl-c1">false</span><span class="pl-kos">;</span> <span class="pl-s1">descriptor</span><span class="pl-kos">.</span><span class="pl-c1">configurable</span> <span class="pl-c1">=</span> <span class="pl-c1">true</span><span class="pl-kos">;</span> <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-s">"value"</span> <span class="pl-k">in</span> <span class="pl-s1">descriptor</span><span class="pl-kos">)</span> <span class="pl-s1">descriptor</span><span class="pl-kos">.</span><span class="pl-c1">writable</span> <span class="pl-c1">=</span> <span class="pl-c1">true</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">descriptor</span><span class="pl-kos">.</span><span class="pl-c1">key</span><span class="pl-kos">,</span> <span class="pl-s1">descriptor</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-v">Constructor</span><span class="pl-kos">,</span> <span class="pl-s1">protoProps</span><span class="pl-kos">,</span> <span class="pl-s1">staticProps</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">protoProps</span><span class="pl-kos">)</span> <span class="pl-en">defineProperties</span><span class="pl-kos">(</span><span class="pl-v">Constructor</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">,</span> <span class="pl-s1">protoProps</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">staticProps</span><span class="pl-kos">)</span> <span class="pl-en">defineProperties</span><span class="pl-kos">(</span><span class="pl-v">Constructor</span><span class="pl-kos">,</span> <span class="pl-s1">staticProps</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-k">return</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-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-v">Test</span> <span class="pl-c1">=</span> <span class="pl-s1">exports</span><span class="pl-kos">.</span><span class="pl-c1">Test</span> <span class="pl-c1">=</span> <span class="pl-kos">(</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">function</span> <span class="pl-v">Test</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">Test</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-kos">}</span>

        <span class="pl-s1">_createClass</span><span class="pl-kos">(</span><span class="pl-v">Test</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-kos">{</span>
            <span class="pl-c1">key</span>: <span class="pl-s">"memberGenerator"</span><span class="pl-kos">,</span>
            <span class="pl-c1">value</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">memberGenerator</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">arg</span> <span class="pl-c1">=</span> <span class="pl-s1">_arguments</span><span class="pl-kos">.</span><span class="pl-c1">length</span> <span class="pl-c1">&lt;=</span> <span class="pl-c1">0</span> <span class="pl-c1">||</span> <span class="pl-s1">_arguments</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span> <span class="pl-c1">===</span> <span class="pl-c1">undefined</span> ? <span class="pl-c1">0</span> : <span class="pl-s1">_arguments</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">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">memberGenerator$</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-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-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</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">case</span> <span class="pl-c1">1</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">memberGenerator</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>
            <span class="pl-c1">key</span>: <span class="pl-s">"start"</span><span class="pl-kos">,</span>
            <span class="pl-en">value</span>: <span class="pl-k">function</span> <span class="pl-en">start</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-smi">this</span><span class="pl-kos">.</span><span class="pl-en">memberGenerator</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-s1">gen</span><span class="pl-kos">.</span><span class="pl-en">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">return</span> <span class="pl-v">Test</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>
<p dir="auto"><strong>test.js</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="require('babel-polyfill');

var Test = require('./out').Test;

var test = new Test();

test.start();"><pre class="notranslate"><span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'babel-polyfill'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-k">var</span> <span class="pl-v">Test</span> <span class="pl-c1">=</span> <span class="pl-en">require</span><span class="pl-kos">(</span><span class="pl-s">'./out'</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-c1">Test</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-k">new</span> <span class="pl-v">Test</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-en">start</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto"><strong>expected result</strong><br>
<code class="notranslate">1</code></p>
<p dir="auto"><strong>actual result</strong><br>
<code class="notranslate">{ Test: [Function: Test] }</code></p>
<p dir="auto">From what I can tell, it is the combination of exporting a class with the use of default parameters that causes this. If i <code class="notranslate">export Test { ... }</code> as an object instead of a class, or remove the default parameter, <code class="notranslate">*memberGenerator(arg)</code> it works as expected. Also, if i run this in the online babel editor, <a href="http://goo.gl/koJrnZ" rel="nofollow">http://goo.gl/koJrnZ</a>, (no export) it works as expected.</p>
<p dir="auto">Thanks for your help.</p>