<blockquote>
<p dir="auto">Issue originally made by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/Riim/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/Riim">@Riim</a></p>
</blockquote>
<h3 dir="auto">Bug information</h3>
<ul dir="auto">
<li><strong>Babel version:</strong> 6.x.x</li>
</ul>
<h3 dir="auto">Options</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="loaders: [
    {
        test: /\.js$/,
        exclude: /node_modules/,
        loader: 'babel',
        query: { presets: ['es2015'] }
    }
]"><pre class="notranslate"><code class="notranslate">loaders: [
    {
        test: /\.js$/,
        exclude: /node_modules/,
        loader: 'babel',
        query: { presets: ['es2015'] }
    }
]
</code></pre></div>
<h3 dir="auto">Input code</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="let Component = createClass({
    setTimeout(cb, delay) {
        let id = nextUID();

        let timeoutId = setTimeout(() =&gt; {
            delete this._disposables[id];
            cb.call(this);
        }, delay);

        let _clearTimeout = () =&gt; {
            if (this._disposables[id]) {
                clearTimeout(timeoutId);
                delete this._disposables[id];
            }
        };

        let timeout = this._disposables[id] = {
            clear: _clearTimeout,
            dispose: _clearTimeout
        };

        return timeout;
    }
});"><pre class="notranslate"><code class="notranslate">let Component = createClass({
    setTimeout(cb, delay) {
        let id = nextUID();

        let timeoutId = setTimeout(() =&gt; {
            delete this._disposables[id];
            cb.call(this);
        }, delay);

        let _clearTimeout = () =&gt; {
            if (this._disposables[id]) {
                clearTimeout(timeoutId);
                delete this._disposables[id];
            }
        };

        let timeout = this._disposables[id] = {
            clear: _clearTimeout,
            dispose: _clearTimeout
        };

        return timeout;
    }
});
</code></pre></div>
<h3 dir="auto">Description</h3>
<p dir="auto">Output code in babel5:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="var Component = createClass({
    setTimeout: (function (_setTimeout) {
        function setTimeout(_x2, _x3) {
            return _setTimeout.apply(this, arguments);
        }

        setTimeout.toString = function () {
            return _setTimeout.toString();
        };

        return setTimeout;
    })(function (cb, delay) {
        var _this4 = this;

        var id = nextUID();

        var timeoutId = setTimeout(function () {
            delete _this4._disposables[id];
            cb.call(_this4);
        }, delay);

        var _clearTimeout = function _clearTimeout() {
            if (_this4._disposables[id]) {
                clearTimeout(timeoutId);
                delete _this4._disposables[id];
            }
        };

        var timeout = this._disposables[id] = {
            clear: _clearTimeout,
            dispose: _clearTimeout
        };

        return timeout;
    })
});"><pre class="notranslate"><code class="notranslate">var Component = createClass({
    setTimeout: (function (_setTimeout) {
        function setTimeout(_x2, _x3) {
            return _setTimeout.apply(this, arguments);
        }

        setTimeout.toString = function () {
            return _setTimeout.toString();
        };

        return setTimeout;
    })(function (cb, delay) {
        var _this4 = this;

        var id = nextUID();

        var timeoutId = setTimeout(function () {
            delete _this4._disposables[id];
            cb.call(_this4);
        }, delay);

        var _clearTimeout = function _clearTimeout() {
            if (_this4._disposables[id]) {
                clearTimeout(timeoutId);
                delete _this4._disposables[id];
            }
        };

        var timeout = this._disposables[id] = {
            clear: _clearTimeout,
            dispose: _clearTimeout
        };

        return timeout;
    })
});
</code></pre></div>
<p dir="auto">Output code in babel6:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="var _this4 = this;

var Component = createClass({
    setTimeout: (function (_setTimeout) {
        function setTimeout(_x2, _x3) {
            return _setTimeout.apply(this, arguments);
        }

        setTimeout.toString = function () {
            return _setTimeout.toString();
        };

        return setTimeout;
    })(function (cb, delay) {
        var id = nextUID();

        var timeoutId = setTimeout(function () {
            delete _this4._disposables[id];
            cb.call(_this4);
        }, delay);

        var _clearTimeout = function _clearTimeout() {
            if (_this4._disposables[id]) {
                clearTimeout(timeoutId);
                delete _this4._disposables[id];
            }
        };

        var timeout = this._disposables[id] = {
            clear: _clearTimeout,
            dispose: _clearTimeout
        };

        return timeout;
    })
});"><pre class="notranslate"><code class="notranslate">var _this4 = this;

var Component = createClass({
    setTimeout: (function (_setTimeout) {
        function setTimeout(_x2, _x3) {
            return _setTimeout.apply(this, arguments);
        }

        setTimeout.toString = function () {
            return _setTimeout.toString();
        };

        return setTimeout;
    })(function (cb, delay) {
        var id = nextUID();

        var timeoutId = setTimeout(function () {
            delete _this4._disposables[id];
            cb.call(_this4);
        }, delay);

        var _clearTimeout = function _clearTimeout() {
            if (_this4._disposables[id]) {
                clearTimeout(timeoutId);
                delete _this4._disposables[id];
            }
        };

        var timeout = this._disposables[id] = {
            clear: _clearTimeout,
            dispose: _clearTimeout
        };

        return timeout;
    })
});
</code></pre></div>
<p dir="auto">It fails with <code class="notranslate">"&lt;name&gt;" is read-only</code>.</p>
<p dir="auto">Sample code:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="class A {
  b() {
    const b = 1;
  }
}"><pre class="notranslate"><span class="pl-k">class</span> <span class="pl-v">A</span> <span class="pl-kos">{</span>
  <span class="pl-en">b</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">b</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span>
<span class="pl-kos">}</span></pre></div>