Add RecordProperty AST type
View Rendered Text
This PR proposes a new node type RecordProperty which shares the same interface with ObjectProperty. This type is only valid in RecordExpression.
The new node type also paves the way for proper AST support on the stage-1 Deep Path Properties in Record Literals.
cc @rickbutton
My only concern is that the deep path properties proposal is also investigating usage with objects, although the proposal explainer hasn't been updated to reflect that. There was significant support for usage with objects in TC39, so splitting out a RecordProperty might not prove useful if ObjectProperty needs to support the additional syntax as well.
Deep Path Properties is also very early, and the syntax has a decent chance of changing. I would be hesitant to recommend additional work on your side with the expectation that deep path properties lands as designed.
Given that it has not been decided whether DPP (Deep Path Properties) should be supported for object, I am good with holding off this proposal and delaying parser support on DPP.
I will leave this proposal open for community feedbacks. However, if decision is not made in the next 6 months, this proposal should be closed with respect to the RFC process.
Related: https://github.com/tc39/proposal-deep-path-properties-for-record/issues/11