tc39 / proposal-class-public-fields

Stage 2 proposal for public class fields in ECMAScript
https://tc39.github.io/proposal-class-public-fields/
488 stars 25 forks source link

Property descriptor looks wrong in step 2 of "Instance Property Initialization Process" #3

Closed ajklein closed 9 years ago

ajklein commented 9 years ago

The descriptor is:

{
  configurable: true,
  enumerable: true,
  writable: true,
  get: undefined,
  set: undefined,
}

But should presumably be:

{
  configurable: true,
  enumerable: true,
  writable: true,
  value: resultOfInitializerFunction
}
ajklein commented 9 years ago

The same problem appears in step 6 of the process for initializing static properties.

jeffmo commented 9 years ago

Sorry, I left this out thinking it was implicit -- but I can see how this could be ambiguous. Thanks for pointing this out

Fixed in https://github.com/jeffmo/es-class-properties/commit/7643fbf990733170bcfb30bc4b4651fe369cf87c