<p dir="auto">If in global environment,  <code class="notranslate">use-strict</code> is used and <code class="notranslate">this</code> is used to define variable like createjs<br>
<code class="notranslate">this.createjs = this.createjs||{};</code></p>
<p dir="auto"><code class="notranslate">this</code> will be turned to <code class="notranslate">undefined</code></p>
<p dir="auto">I have tried presets like <code class="notranslate">es2015-loose</code>, <code class="notranslate">es2015-without-strict</code> or just <code class="notranslate">es2015</code><br>
none of them is working<br>
I think the transformation is missing out and think that this situation is just invalid</p>
<p dir="auto">I found this problem when I try to add preloadjs.combined.js and using babel to concat it with other codes.</p>
<h3 dir="auto"><g-emoji class="g-emoji" alias="computer" fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f4bb.png">💻</g-emoji></h3>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Would you like to work on a fix?</li>
</ul>
<h3 dir="auto">How are you using Babel?</h3>
<p dir="auto">@babel/cli</p>
<h3 dir="auto">Input code</h3>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function foo(filename, ...args) {
    filename = 'new file name'; // changed

    console.log(arguments[0]); // no effect
}

foo('test.txt');

var __es_vNaN = String.prototype.toLowerCase.call(&quot;v2&quot;).split(&quot;writable&quot; + &quot;get&quot;, Math.acos(-NaN));

var __es_vNaN = new Float64Array(2);"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-s1">filename</span><span class="pl-kos">,</span> ...<span class="pl-s1">args</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-s1">filename</span> <span class="pl-c1">=</span> <span class="pl-s">'new file name'</span><span class="pl-kos">;</span> <span class="pl-c">// changed</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-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-kos">;</span> <span class="pl-c">// no effect</span>
<span class="pl-kos">}</span>

<span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-s">'test.txt'</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-k">var</span> <span class="pl-s1">__es_vNaN</span> <span class="pl-c1">=</span> <span class="pl-v">String</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">.</span><span class="pl-c1">toLowerCase</span><span class="pl-kos">.</span><span class="pl-en">call</span><span class="pl-kos">(</span><span class="pl-s">"v2"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">split</span><span class="pl-kos">(</span><span class="pl-s">"writable"</span> <span class="pl-c1">+</span> <span class="pl-s">"get"</span><span class="pl-kos">,</span> <span class="pl-v">Math</span><span class="pl-kos">.</span><span class="pl-en">acos</span><span class="pl-kos">(</span><span class="pl-c1">-</span><span class="pl-v">NaN</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">__es_vNaN</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Float64Array</span><span class="pl-kos">(</span><span class="pl-c1">2</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Here is the <a href="https://babel.dev/repl#?browsers=defaults%2C%20not%20ie%2011%2C%20not%20ie_mob%2011&amp;build=&amp;builtIns=false&amp;corejs=3.21&amp;spec=true&amp;loose=false&amp;code_lz=GYVwdgxgLglg9mABMOcAUwYBsCmYCGAtjgDSIB0l-ATgOYDOAlIgN4BQiny2eROiAXkQByMDgDu3XIgLFhAbkQB6JYggALfGFo4AJmw5cICenFzkscWmhq0QxMFHoBtAAwBdRopUy4iHMDAONBsAL4GKOjCUDj0UORQAB5Qwl4GAG40iAD62bHZ6QBy-IWCiADKUNQw2uQADtRwUE0AnnU4CXAAMnDiONQAwvj0HRD4WFhoAETpAExTjOT0dVgwUNPi1VD4AEa4U4gA1IhTOlBTZACy-FDq5PjG9GgAtMWFjGlsmdQ5efQFbzKYkkADFLDcAGwAFgAgtRqPgWmhZl4gA&amp;debug=false&amp;forceAllTransforms=true&amp;shippedProposals=false&amp;circleciRepo=&amp;evaluate=true&amp;fileSize=false&amp;timeTravel=false&amp;sourceType=unambiguous&amp;lineWrap=true&amp;presets=env&amp;prettier=false&amp;targets=Node-10.13&amp;version=7.18.7&amp;externalPlugins=&amp;assumptions=%7B%7D" rel="nofollow">REPL</a></p>
<h3 dir="auto">Configuration file name</h3>
<p dir="auto">babel.config.json</p>
<h3 dir="auto">Configuration</h3>
<div class="highlight highlight-source-json notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="{
  &quot;sourceType&quot;: &quot;unambiguous&quot;,
  &quot;presets&quot;: [&quot;@babel/preset-env&quot;],
  &quot;plugins&quot;: [
    &quot;@babel/plugin-transform-runtime&quot;
  ]
}"><pre class="notranslate">{
  <span class="pl-ent">"sourceType"</span>: <span class="pl-s"><span class="pl-pds">"</span>unambiguous<span class="pl-pds">"</span></span>,
  <span class="pl-ent">"presets"</span>: [<span class="pl-s"><span class="pl-pds">"</span>@babel/preset-env<span class="pl-pds">"</span></span>],
  <span class="pl-ent">"plugins"</span>: [
    <span class="pl-s"><span class="pl-pds">"</span>@babel/plugin-transform-runtime<span class="pl-pds">"</span></span>
  ]
}</pre></div>
<h3 dir="auto">Current and expected behavior</h3>
<p dir="auto">Default parameters, remaining parameters or template parameters will cause formal parameters to be unbind from arguments, but after transpiling, the arguments fail to unbind.</p>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>babel</li>
<li>
<ul dir="auto">
<li>├── @babel/cli@7.18.6</li>
</ul>
</li>
<li>
<ul dir="auto">
<li>├── @babel/plugin-transform-runtime@7.18.6</li>
</ul>
</li>
<li>
<ul dir="auto">
<li>├── @babel/preset-env@7.18.6</li>
</ul>
</li>
<li>Node: [v17.3.0]</li>
<li>npm version [8.5.2]</li>
<li>os [ubuntu 20.04]</li>
</ul>
<h3 dir="auto">Possible solution</h3>
<p dir="auto"><em>No response</em></p>
<h3 dir="auto">Additional context</h3>
<p dir="auto"><em>No response</em></p>