<p dir="auto">VS2015 is crashed when opening an empty <code class="notranslate">index.ts</code> file on TypeScript repository that has empty <code class="notranslate">index.ts</code> and <code class="notranslate">tsconfig.json</code> files.</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/3143368/15615716/d88a77bc-247a-11e6-9b79-1ea8fd084eee.png"><img src="https://cloud.githubusercontent.com/assets/3143368/15615716/d88a77bc-247a-11e6-9b79-1ea8fd084eee.png" alt="vs2015" style="max-width: 100%;"></a></p>
<p dir="auto">I got this problem since yesterday. I feel this problem is related to windows update.</p>
<p dir="auto"><strong>TypeScript Version:</strong></p>
<p dir="auto">1.8.30</p>
<p dir="auto">In the following example, running <code class="notranslate">original.js</code> directly in MS Edge 25 / EdgeHTML 13 (with experimental JavaScript enabled) outputs <code class="notranslate">"Get to the chopper!"</code> to the console.</p>
<p dir="auto"><code class="notranslate">downlevel.js</code> is produced by running <code class="notranslate">typescript@next</code> (I used v1.8.0-dev.20151210) over <code class="notranslate">original.js</code> with the <code class="notranslate">--allowJs</code> option. Running <code class="notranslate">downlevel.js</code> in MS Edge outputs an error <code class="notranslate">SCRIPT445: Object doesn't support this action</code>.</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
// file: tsconfig.json
{
    &quot;compilerOptions&quot;: {
        &quot;target&quot;: &quot;ES6&quot;,
        &quot;allowJs&quot;: true,
        &quot;outFile&quot;: &quot;downlevel.js&quot;
    },
    &quot;files&quot;: [&quot;original.js&quot;]
}


// file: original.js
var Promise = &quot;I promise not to kill anyone&quot;;
var foo = async () =&gt; &quot;Get to the chopper!&quot;;
foo().then(console.log);


// file: downlevel.js (this one is output by tsc)
var __awaiter = (this &amp;&amp; this.__awaiter) || function (thisArg, _arguments, Promise, generator) {
    return new Promise(function (resolve, reject) {
        generator = generator.call(thisArg, _arguments);
        function cast(value) { return value instanceof Promise &amp;&amp; value.constructor === Promise ? value : new Promise(function (resolve) { resolve(value); }); }
        function onfulfill(value) { try { step(&quot;next&quot;, value); } catch (e) { reject(e); } }
        function onreject(value) { try { step(&quot;throw&quot;, value); } catch (e) { reject(e); } }
        function step(verb, value) {
            var result = generator[verb](value);
            result.done ? resolve(result.value) : cast(result.value).then(onfulfill, onreject);
        }
        step(&quot;next&quot;, void 0);
    });
};
var Promise = &quot;I promise not to kill anyone&quot;;
var foo = () =&gt; __awaiter(this, void 0, Promise, function* () { return &quot;Get to the chopper!!&quot;; });
foo().then(console.log);
"><pre class="notranslate"><span class="pl-c">// file: tsconfig.json</span>
<span class="pl-kos">{</span>
    <span class="pl-s">"compilerOptions"</span>: <span class="pl-kos">{</span>
        <span class="pl-s">"target"</span>: <span class="pl-s">"ES6"</span><span class="pl-kos">,</span>
        <span class="pl-s">"allowJs"</span>: <span class="pl-c1">true</span><span class="pl-kos">,</span>
        <span class="pl-s">"outFile"</span>: <span class="pl-s">"downlevel.js"</span>
    <span class="pl-kos">}</span><span class="pl-kos">,</span>
    <span class="pl-s">"files"</span>: <span class="pl-kos">[</span><span class="pl-s">"original.js"</span><span class="pl-kos">]</span>
<span class="pl-kos">}</span>


<span class="pl-c">// file: original.js</span>
<span class="pl-k">var</span> <span class="pl-v">Promise</span> <span class="pl-c1">=</span> <span class="pl-s">"I promise not to kill anyone"</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-en">foo</span> <span class="pl-c1">=</span> <span class="pl-k">async</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-s">"Get to the chopper!"</span><span class="pl-kos">;</span>
<span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-c1">log</span><span class="pl-kos">)</span><span class="pl-kos">;</span>


<span class="pl-c">// file: downlevel.js (this one is output by tsc)</span>
<span class="pl-k">var</span> <span class="pl-s1">__awaiter</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-smi">this</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-smi">this</span><span class="pl-kos">.</span><span class="pl-c1">__awaiter</span><span class="pl-kos">)</span> <span class="pl-c1">||</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">thisArg</span><span class="pl-kos">,</span> <span class="pl-s1">_arguments</span><span class="pl-kos">,</span> <span class="pl-v">Promise</span><span class="pl-kos">,</span> <span class="pl-s1">generator</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">return</span> <span class="pl-k">new</span> <span class="pl-v">Promise</span><span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">resolve</span><span class="pl-kos">,</span> <span class="pl-s1">reject</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-s1">generator</span> <span class="pl-c1">=</span> <span class="pl-s1">generator</span><span class="pl-kos">.</span><span class="pl-en">call</span><span class="pl-kos">(</span><span class="pl-s1">thisArg</span><span class="pl-kos">,</span> <span class="pl-s1">_arguments</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-k">function</span> <span class="pl-en">cast</span><span class="pl-kos">(</span><span class="pl-s1">value</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-s1">value</span> <span class="pl-k">instanceof</span> <span class="pl-v">Promise</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-s1">value</span><span class="pl-kos">.</span><span class="pl-c1">constructor</span> <span class="pl-c1">===</span> <span class="pl-v">Promise</span> ? <span class="pl-s1">value</span> : <span class="pl-k">new</span> <span class="pl-v">Promise</span><span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">resolve</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-s1">resolve</span><span class="pl-kos">(</span><span class="pl-s1">value</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">function</span> <span class="pl-en">onfulfill</span><span class="pl-kos">(</span><span class="pl-s1">value</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">try</span> <span class="pl-kos">{</span> <span class="pl-en">step</span><span class="pl-kos">(</span><span class="pl-s">"next"</span><span class="pl-kos">,</span> <span class="pl-s1">value</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">catch</span> <span class="pl-kos">(</span><span class="pl-s1">e</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-s1">reject</span><span class="pl-kos">(</span><span class="pl-s1">e</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">function</span> <span class="pl-en">onreject</span><span class="pl-kos">(</span><span class="pl-s1">value</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">try</span> <span class="pl-kos">{</span> <span class="pl-en">step</span><span class="pl-kos">(</span><span class="pl-s">"throw"</span><span class="pl-kos">,</span> <span class="pl-s1">value</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-kos">}</span> <span class="pl-k">catch</span> <span class="pl-kos">(</span><span class="pl-s1">e</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-s1">reject</span><span class="pl-kos">(</span><span class="pl-s1">e</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">function</span> <span class="pl-en">step</span><span class="pl-kos">(</span><span class="pl-s1">verb</span><span class="pl-kos">,</span> <span class="pl-s1">value</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
            <span class="pl-k">var</span> <span class="pl-s1">result</span> <span class="pl-c1">=</span> <span class="pl-s1">generator</span><span class="pl-kos">[</span><span class="pl-s1">verb</span><span class="pl-kos">]</span><span class="pl-kos">(</span><span class="pl-s1">value</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
            <span class="pl-s1">result</span><span class="pl-kos">.</span><span class="pl-c1">done</span> ? <span class="pl-s1">resolve</span><span class="pl-kos">(</span><span class="pl-s1">result</span><span class="pl-kos">.</span><span class="pl-c1">value</span><span class="pl-kos">)</span> : <span class="pl-en">cast</span><span class="pl-kos">(</span><span class="pl-s1">result</span><span class="pl-kos">.</span><span class="pl-c1">value</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-s1">onfulfill</span><span class="pl-kos">,</span> <span class="pl-s1">onreject</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-kos">}</span>
        <span class="pl-en">step</span><span class="pl-kos">(</span><span class="pl-s">"next"</span><span class="pl-kos">,</span> <span class="pl-k">void</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-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">Promise</span> <span class="pl-c1">=</span> <span class="pl-s">"I promise not to kill anyone"</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-en">foo</span> <span class="pl-c1">=</span> <span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-c1">=&gt;</span> <span class="pl-s1">__awaiter</span><span class="pl-kos">(</span><span class="pl-smi">this</span><span class="pl-kos">,</span> <span class="pl-k">void</span> <span class="pl-c1">0</span><span class="pl-kos">,</span> <span class="pl-v">Promise</span><span class="pl-kos">,</span> <span class="pl-k">function</span><span class="pl-c1">*</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-s">"Get to the chopper!!"</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-en">foo</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">then</span><span class="pl-kos">(</span><span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-c1">log</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">It looks like the down-levelled code picks up the locally-scoped <code class="notranslate">Promise</code> instead of using the native <code class="notranslate">Promise</code>.</p>