title: Typescript: decorators behave differently on angular project and typescript playground
body: <p>I need to serialize an object to json in angular 2.0.0-rc1 when I found out that Typescript's private isn't private at all, and get set property are not outputted through JSON.stringify.</p>
  <p>So I set out to decorate the class:</p>
  <pre><code>//method decorator
  function enumerable(value: boolean) {
      return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) {
          descriptor.enumerable = value;
      };
  }
  //property decorator
  function exclude(target: any, propertyKey: string): any {
      return { enumerable: false };
  }
  class MyClass {
      test: string = &quot;test&quot;;
      @exclude
      testExclude: string = &quot;should be excluded&quot;;
      @enumerable(true)
      get enumerated(): string {
          return &quot;yes&quot;;
      }
      @enumerable(false)
      get nonEnumerated(): string {
          return &quot;non enumerable&quot;
      }
  }
  
  let x = new MyClass();
  //1st
  console.log(JSON.stringify(x));
  //2nd
  console.log(JSON.stringify(x, Object.keys(MyClass.prototype)));
  //3rd
  console.log(JSON.stringify(x, Object.keys(x).concat(Object.keys(MyClass.prototype))));//test 3
  </code></pre>
  <p>on <a href="http://www.typescriptlang.org/play/index.html" rel="nofollow noreferrer" title="Typescript playground">Typescript playground</a>, this gives</p>
  <pre><code>{&quot;test&quot;:&quot;test&quot;}
  {&quot;enumerated&quot;:&quot;yes&quot;}
  {&quot;test&quot;:&quot;test&quot;,&quot;enumerated&quot;:&quot;yes&quot;}
  </code></pre>
  <p>but on my project (angular 2.0.0-rc1), this gives</p>
  <pre><code>{&quot;test&quot;:&quot;test&quot;,&quot;testExclude&quot;:&quot;should be excluded&quot;}
  {&quot;enumerated&quot;:&quot;yes&quot;}
  {&quot;test&quot;:&quot;test&quot;,&quot;testExclude&quot;:&quot;should be excluded&quot;,&quot;enumerated&quot;:&quot;yes&quot;}
  </code></pre>
  <p>What I'm really after is output #3 from the playground.</p>
  <p>After taking a look at the transpiled code,
  the only difference is reflect-metadata's code:</p>
  <pre><code>//snip ...
  
      __decorate([
          exclude, 
          __metadata('design:type', String)
      ], MyClass.prototype, &quot;testExclude&quot;, void 0);
      __decorate([
          enumerable(true), 
          __metadata('design:type', String)
      ], MyClass.prototype, &quot;enumerated&quot;, null);
      __decorate([
          enumerable(false), 
          __metadata('design:type', String)
      ], MyClass.prototype, &quot;nonEnumerated&quot;, null);
      return MyClass;
  }());
  </code></pre>
  <p>none of that <code>__metadata</code> lines in playground.</p>
  <p>What's happening in here? And how can I achieve playground's #3 result on my project?</p>