<p dir="auto">First of all I am not sure if this is really a valid issue, as I am not sure if it is the responsibility of typescript but I have an issue with ES3 output.</p>
<p dir="auto">In ES3 apparently you cannot do</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Promise.resolve(...)
.then(...)
.catch(...);"><pre class="notranslate"><code class="notranslate">Promise.resolve(...)
.then(...)
.catch(...);
</code></pre></div>
<p dir="auto">you have to do</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Promise.resolve(...)
[&quot;then&quot;](...)
[&quot;catch&quot;](...);"><pre class="notranslate"><code class="notranslate">Promise.resolve(...)
["then"](...)
["catch"](...);
</code></pre></div>
<p dir="auto">However when targetting ES3 TS does not seem to notice this and lets it through, again I am not entirely sure if this is legit etc but I have spent ages tracking down an issue and it seems that ES3 does not support chaining like shown</p>
<p dir="auto">should this be added as an issue or is this not really TS' responsibility?</p>
<p dir="auto">Here is a related question on SO:<br>
<a href="http://stackoverflow.com/questions/23105089/angular-q-catch-method-fails-in-ie8" rel="nofollow">http://stackoverflow.com/questions/23105089/angular-q-catch-method-fails-in-ie8</a></p>
<p dir="auto">At work we have an embedded old IE8 engine that Works with ES3, and we have made an implementation of the ES6 Map and Set. Those clases have a <code class="notranslate">delete</code> method, which name is the same as the <code class="notranslate">delete</code> keyword.<br>
So the following typescript:</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var a = new Map&lt;string, string&gt;();
a.set(&quot;a&quot;, &quot;a&quot;);
a.delete(&quot;a&quot;);"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-smi">Map</span><span class="pl-kos">&lt;</span><span class="pl-smi">string</span><span class="pl-kos">,</span> <span class="pl-smi">string</span><span class="pl-kos">&gt;</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">a</span><span class="pl-kos">.</span><span class="pl-en">set</span><span class="pl-kos">(</span><span class="pl-s">"a"</span><span class="pl-kos">,</span> <span class="pl-s">"a"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">a</span><span class="pl-kos">.</span><span class="pl-en">delete</span><span class="pl-kos">(</span><span class="pl-s">"a"</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">produces somethind like:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var a = new Map();
a.set(&quot;a&quot;, &quot;a&quot;);
a.delete(&quot;a&quot;);"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-v">Map</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">a</span><span class="pl-kos">.</span><span class="pl-en">set</span><span class="pl-kos">(</span><span class="pl-s">"a"</span><span class="pl-kos">,</span> <span class="pl-s">"a"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">a</span><span class="pl-kos">.</span><span class="pl-en">delete</span><span class="pl-kos">(</span><span class="pl-s">"a"</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">But the <em>old IE8 engine</em> throws an error because of the <code class="notranslate">delete</code> keyword. Could ES3 target of TypeScript generate an string accessor for cases like this?</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="a[&quot;delete&quot;](&quot;a&quot;);"><pre class="notranslate"><span class="pl-s1">a</span><span class="pl-kos">[</span><span class="pl-s">"delete"</span><span class="pl-kos">]</span><span class="pl-kos">(</span><span class="pl-s">"a"</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">Of course, the same casi would occur with "new" etc.</p>
<p dir="auto">Thanks!!</p>