core-decorators icon indicating copy to clipboard operation
core-decorators copied to clipboard

Typescript generates enumerable methods

Open BurtHarris opened this issue 7 years ago • 2 comments

@jayphelps it seems that Typescript is generating methods (in classes) with the enumerable property set to true. I've found an issue tracking this as a bug Microsoft/TypeScript#15308, it but there seem to be older related issues and I'm guessing it isn't currently a high priority.

This is causing some tests of this projects to fail. I had misinterpreted it earlier as being related to the property descriptor limitation, but this seems to be separate. For some decorators (e.g. autobind) it would be simple for us to change the returned descriptor to make the test pass, do you think that's a good idea, or should we do something to the tests?

BurtHarris avatar Aug 06 '17 04:08 BurtHarris

 1) @autobind (from TypeScript) sets the correct prototype descriptor options:

      enumerable property mismatch
      + expected - actual

      -true
      +false

      at Context.<anonymous> (test\typescript\autobind.spec.ts:75:28)

  4) @decorate (from TypeScript) sets the correct prototype descriptor options:

      enumerable
      + expected - actual

      -true
      +false

      at Context.<anonymous> (test\typescript\decorate.spec.ts:55:28)

BurtHarris avatar Aug 06 '17 04:08 BurtHarris

Hmm did you link to the right issue? https://github.com/Microsoft/TypeScript/pull/15308 ? It's not clear how it relates 😄

jayphelps avatar Aug 13 '17 03:08 jayphelps