<p dir="auto">The following bug happens with "es6.spec.blockScoping" turned on.</p>
<p dir="auto"><strong>Possible code generated</strong></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var _temporalUndefined = {};
// ...
UserSettings.prototype.initArray = function (key) {
    var key = _temporalUndefined;
    key = arguments.length &lt;= 0 || arguments[0] === undefined ? undefined : arguments[0];
// ...
}

settings.initArray('foo');"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">_temporalUndefined</span> <span class="pl-c1">=</span> <span class="pl-kos">{</span><span class="pl-kos">}</span><span class="pl-kos">;</span>
<span class="pl-c">// ...</span>
<span class="pl-v">UserSettings</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">.</span><span class="pl-en">initArray</span> <span class="pl-c1">=</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-k">var</span> <span class="pl-s1">key</span> <span class="pl-c1">=</span> <span class="pl-s1">_temporalUndefined</span><span class="pl-kos">;</span>
    <span class="pl-s1">key</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-c1">&lt;=</span> <span class="pl-c1">0</span> <span class="pl-c1">||</span> <span class="pl-smi">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">undefined</span> : <span class="pl-smi">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-c">// ...</span>
<span class="pl-kos">}</span>

<span class="pl-s1">settings</span><span class="pl-kos">.</span><span class="pl-en">initArray</span><span class="pl-kos">(</span><span class="pl-s">'foo'</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">In IE 9, causing the code to fail with a TDZ error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="arguments[0] === _temporalUndefined;"><pre class="notranslate"><code class="notranslate">arguments[0] === _temporalUndefined;
</code></pre></div>
<p dir="auto">otherwise:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="arguments[0] === 'foo';"><pre class="notranslate"><code class="notranslate">arguments[0] === 'foo';
</code></pre></div>
<p dir="auto"><strong>Cause</strong>: IE 9 mutates the <code class="notranslate">arguments</code> property when changing <code class="notranslate">key</code>, other browsers including newer IE versions and Edge don't.</p>
<p dir="auto"><strong>Possible Fix</strong>: To fix this the parameter list has to be emptied, then a "new" variable gets created instead of mutating the function parameter.</p>
<p dir="auto">Accidentally discovered because we weren't running some of our code in strict mode when we thought we were. I'll just be fixing the "use strict" usage so not a huge priority for us. Just wanted to let you know.</p>
<p dir="auto">Example input: Compiled without <code class="notranslate">strict</code> but with blockScopingTDZ</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(function fn(arg, arg2='arg2'){
    console.log(arg, arg2);
})('arg')"><pre class="notranslate"><code class="notranslate">(function fn(arg, arg2='arg2'){
    console.log(arg, arg2);
})('arg')
</code></pre></div>
<p dir="auto">results in</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="var _temporalAssertDefined = function (val, name, undef) { if (val === undef) { throw new ReferenceError(name + &quot; is not defined - temporal dead zone&quot;); } return true; };

var _temporalUndefined = {};
(function fn(arg) {
  var arg = _temporalUndefined;
  var arg2 = _temporalUndefined;
  arg = arguments[0] === undefined ? undefined : arguments[0];
  arg2 = arguments[1] === undefined ? &quot;arg2&quot; : arguments[1];
  console.log(_temporalAssertDefined(arg, &quot;arg&quot;, _temporalUndefined) &amp;&amp; arg, _temporalAssertDefined(arg2, &quot;arg2&quot;, _temporalUndefined) &amp;&amp; arg2);
})(&quot;arg&quot;);"><pre class="notranslate"><code class="notranslate">var _temporalAssertDefined = function (val, name, undef) { if (val === undef) { throw new ReferenceError(name + " is not defined - temporal dead zone"); } return true; };

var _temporalUndefined = {};
(function fn(arg) {
  var arg = _temporalUndefined;
  var arg2 = _temporalUndefined;
  arg = arguments[0] === undefined ? undefined : arguments[0];
  arg2 = arguments[1] === undefined ? "arg2" : arguments[1];
  console.log(_temporalAssertDefined(arg, "arg", _temporalUndefined) &amp;&amp; arg, _temporalAssertDefined(arg2, "arg2", _temporalUndefined) &amp;&amp; arg2);
})("arg");
</code></pre></div>
<p dir="auto">In non-strict mode, that <code class="notranslate">var arg = _temporalUndefined</code> also changes <code class="notranslate">arguments[0]</code> because <code class="notranslate">arg</code> is a live binding to <code class="notranslate">arguments[0]</code>. So <code class="notranslate">arg = arguments[0] === undefined ? undefined : arguments[0];</code> ends up actually being <code class="notranslate">arg = _temporalUndefined === undefined ? undefined : _temporalUndefined;</code> and therefore is a no-op.</p>
<p dir="auto">It doesn't seem like <code class="notranslate">arg</code> needed to be processed by TDZ anyway, so perhaps only processing TDZ on <code class="notranslate">arg2</code> is the real fix here?</p>