facebook/flow

Parser: Missing decorators on `PropertyDefinition`

fisker opened this issue · 0 comments

Flow version: 0.198.2

Expected behavior

Should have decorators on PropertyDefinition or throw an error if not supported.

Actual behavior

> require('flow-parser').parse('class A {@decorator property;}', {esproposal_decorators: true}).body[0].body.body[0]
{
  type: 'PropertyDefinition',
  loc: {
    source: null,
    start: { line: 1, column: 9 },
    end: { line: 1, column: 29 }
  },
  range: [ 9, 29 ],
  key: {
    type: 'Identifier',
    loc: { source: null, start: [Object], end: [Object] },
    range: [ 20, 28 ],
    name: 'property',
    typeAnnotation: null,
    optional: false
  },
  value: null,
  typeAnnotation: null,
  computed: false,
  static: false,
  variance: null
}
  • Link to Try-Flow or Github repo:

https://flow.org/try/#0MYGwhgzhAECC0G8ACATApsA9gJzAFx2gAdtMi1s8BPAbgF8g