<p dir="auto">I'm not sure if this is a bug, or I'm missing something.</p>
<p dir="auto">I am compiling my TypeScript to ES6 and then using the babel preprocessor to run my tests in Karma. The class is as follows</p>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import { BaseModel, notEmpty } from '../main';

export class TestModel extends BaseModel {


    @notEmpty('Test property can not be empty')
    public testProperty: string;


}"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-kos">{</span> <span class="pl-smi">BaseModel</span><span class="pl-kos">,</span> <span class="pl-s1">notEmpty</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'../main'</span><span class="pl-kos">;</span>

<span class="pl-k">export</span> <span class="pl-k">class</span> <span class="pl-smi">TestModel</span> <span class="pl-k">extends</span> <span class="pl-smi">BaseModel</span> <span class="pl-kos">{</span>


    @<span class="pl-en">notEmpty</span><span class="pl-kos">(</span><span class="pl-s">'Test property can not be empty'</span><span class="pl-kos">)</span>
    <span class="pl-k">public</span> <span class="pl-c1">testProperty</span>: <span class="pl-smi">string</span><span class="pl-kos">;</span>


<span class="pl-kos">}</span></pre></div>
<p dir="auto">The above class compiles to</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="if (typeof __decorate !== &quot;function&quot;) __decorate = function (decorators, target, key, desc) {

    if (typeof Reflect === &quot;object&quot; &amp;&amp; typeof Reflect.decorate === &quot;function&quot;) return Reflect.decorate(decorators, target, key, desc);
    switch (arguments.length) {
        case 2: return decorators.reduceRight(function(o, d) { return (d &amp;&amp; d(o)) || o; }, target);
        case 3: return decorators.reduceRight(function(o, d) { return (d &amp;&amp; d(target, key)), void 0; }, void 0);
        case 4: return decorators.reduceRight(function(o, d) { return (d &amp;&amp; d(target, key, o)) || o; }, desc);
    }
};

import { BaseModel, notEmpty } from '../main';
export class TestModel extends BaseModel {
}
__decorate([
    notEmpty('Test property can not be empty')
], TestModel.prototype, &quot;testProperty&quot;);
"><pre class="notranslate"><span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-k">typeof</span> <span class="pl-s1">__decorate</span> <span class="pl-c1">!==</span> <span class="pl-s">"function"</span><span class="pl-kos">)</span> <span class="pl-en">__decorate</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">decorators</span><span class="pl-kos">,</span> <span class="pl-s1">target</span><span class="pl-kos">,</span> <span class="pl-s1">key</span><span class="pl-kos">,</span> <span class="pl-s1">desc</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>

    <span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-k">typeof</span> <span class="pl-v">Reflect</span> <span class="pl-c1">===</span> <span class="pl-s">"object"</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-k">typeof</span> <span class="pl-v">Reflect</span><span class="pl-kos">.</span><span class="pl-c1">decorate</span> <span class="pl-c1">===</span> <span class="pl-s">"function"</span><span class="pl-kos">)</span> <span class="pl-k">return</span> <span class="pl-v">Reflect</span><span class="pl-kos">.</span><span class="pl-en">decorate</span><span class="pl-kos">(</span><span class="pl-s1">decorators</span><span class="pl-kos">,</span> <span class="pl-s1">target</span><span class="pl-kos">,</span> <span class="pl-s1">key</span><span class="pl-kos">,</span> <span class="pl-s1">desc</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">switch</span> <span class="pl-kos">(</span><span class="pl-smi">arguments</span><span class="pl-kos">.</span><span class="pl-c1">length</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
        <span class="pl-k">case</span> <span class="pl-c1">2</span>: <span class="pl-k">return</span> <span class="pl-s1">decorators</span><span class="pl-kos">.</span><span class="pl-en">reduceRight</span><span class="pl-kos">(</span><span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">o</span><span class="pl-kos">,</span> <span class="pl-s1">d</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-kos">(</span><span class="pl-s1">d</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-s1">d</span><span class="pl-kos">(</span><span class="pl-s1">o</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-c1">||</span> <span class="pl-s1">o</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s1">target</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-k">case</span> <span class="pl-c1">3</span>: <span class="pl-k">return</span> <span class="pl-s1">decorators</span><span class="pl-kos">.</span><span class="pl-en">reduceRight</span><span class="pl-kos">(</span><span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">o</span><span class="pl-kos">,</span> <span class="pl-s1">d</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-kos">(</span><span class="pl-s1">d</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-s1">d</span><span class="pl-kos">(</span><span class="pl-s1">target</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-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-k">void</span> <span class="pl-c1">0</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
        <span class="pl-k">case</span> <span class="pl-c1">4</span>: <span class="pl-k">return</span> <span class="pl-s1">decorators</span><span class="pl-kos">.</span><span class="pl-en">reduceRight</span><span class="pl-kos">(</span><span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">o</span><span class="pl-kos">,</span> <span class="pl-s1">d</span><span class="pl-kos">)</span> <span class="pl-kos">{</span> <span class="pl-k">return</span> <span class="pl-kos">(</span><span class="pl-s1">d</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-s1">d</span><span class="pl-kos">(</span><span class="pl-s1">target</span><span class="pl-kos">,</span> <span class="pl-s1">key</span><span class="pl-kos">,</span> <span class="pl-s1">o</span><span class="pl-kos">)</span><span class="pl-kos">)</span> <span class="pl-c1">||</span> <span class="pl-s1">o</span><span class="pl-kos">;</span> <span class="pl-kos">}</span><span class="pl-kos">,</span> <span class="pl-s1">desc</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">import</span> <span class="pl-kos">{</span> <span class="pl-v">BaseModel</span><span class="pl-kos">,</span> <span class="pl-s1">notEmpty</span> <span class="pl-kos">}</span> <span class="pl-k">from</span> <span class="pl-s">'../main'</span><span class="pl-kos">;</span>
<span class="pl-k">export</span> <span class="pl-k">class</span> <span class="pl-v">TestModel</span> <span class="pl-k">extends</span> <span class="pl-v">BaseModel</span> <span class="pl-kos">{</span>
<span class="pl-kos">}</span>
<span class="pl-en">__decorate</span><span class="pl-kos">(</span><span class="pl-kos">[</span>
    <span class="pl-en">notEmpty</span><span class="pl-kos">(</span><span class="pl-s">'Test property can not be empty'</span><span class="pl-kos">)</span>
<span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-v">TestModel</span><span class="pl-kos">.</span><span class="pl-c1">prototype</span><span class="pl-kos">,</span> <span class="pl-s">"testProperty"</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">This compiled code doesn't run. Unfortunately I don't get a helpful error either so I'm not exactly sure the problem. However if I mess with the compiled JavaScript a bit</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// changing the first line from ...
if (typeof __decorate !== &quot;function&quot;) __decorate = function (decorators, target, key, desc) {
    // code here
}

// to this

if (typeof __decorate !== &quot;function&quot;) window.__decorate = function (decorators, target, key, desc) {
    // code here
}

// or to this, which would work in both browser and server environments
if (typeof __decorate !== &quot;function&quot;) var __decorate = function (decorators, target, key, desc) {
    // code here
}"><pre class="notranslate"><span class="pl-c">// changing the first line from ...</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-k">typeof</span> <span class="pl-s1">__decorate</span> <span class="pl-c1">!==</span> <span class="pl-s">"function"</span><span class="pl-kos">)</span> <span class="pl-en">__decorate</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">decorators</span><span class="pl-kos">,</span> <span class="pl-s1">target</span><span class="pl-kos">,</span> <span class="pl-s1">key</span><span class="pl-kos">,</span> <span class="pl-s1">desc</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-c">// code here</span>
<span class="pl-kos">}</span>

<span class="pl-c">// to this</span>

<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-k">typeof</span> <span class="pl-s1">__decorate</span> <span class="pl-c1">!==</span> <span class="pl-s">"function"</span><span class="pl-kos">)</span> <span class="pl-smi">window</span><span class="pl-kos">.</span><span class="pl-en">__decorate</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">decorators</span><span class="pl-kos">,</span> <span class="pl-s1">target</span><span class="pl-kos">,</span> <span class="pl-s1">key</span><span class="pl-kos">,</span> <span class="pl-s1">desc</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-c">// code here</span>
<span class="pl-kos">}</span>

<span class="pl-c">// or to this, which would work in both browser and server environments</span>
<span class="pl-k">if</span> <span class="pl-kos">(</span><span class="pl-k">typeof</span> <span class="pl-s1">__decorate</span> <span class="pl-c1">!==</span> <span class="pl-s">"function"</span><span class="pl-kos">)</span> <span class="pl-k">var</span> <span class="pl-en">__decorate</span> <span class="pl-c1">=</span> <span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">decorators</span><span class="pl-kos">,</span> <span class="pl-s1">target</span><span class="pl-kos">,</span> <span class="pl-s1">key</span><span class="pl-kos">,</span> <span class="pl-s1">desc</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-c">// code here</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">with either of those changes everything seems to work fine. Like I said though, I'm not sure if its a bug or I'm missing some small thing.</p>
<p dir="auto">I believe it's expected that <code class="notranslate">tsc -t es6</code> should be externally transpilable to ES5 (eg with Babel)</p>
<p dir="auto">See <a href="https://gist.github.com/alexeagle/24243fbb87dbd8bad6f1">https://gist.github.com/alexeagle/24243fbb87dbd8bad6f1</a></p>
<p dir="auto">Babel replaces the __decorate line <code class="notranslate">this.__decorate</code> with <code class="notranslate">undefined.__decorate</code> so that gives a runtime error. <code class="notranslate">Uncaught TypeError: Cannot read property '__decorate' of undefined   app_bin.js:7</code></p>
<p dir="auto">Note I also tried this with Closure Compiler ES6-&gt;ES5, and had a different problem because of this line in the emit:<br>
<code class="notranslate">Object.defineProperty(App, "name", { value: "App", configurable: true });</code><br>
in ES6 spec, new objects are configurable:true by default, but in mainline Chrome it is configurable:false by default so this is also a runtime error. For this case, it leads me to wonder if ES5-&gt;ES6 transpilers should be expected to translate API incompatibilities in addition to new ES6 syntax.</p>