TyrealHu / acorn-typescript

Alternative, TypeScript parser
https://www.npmjs.com/package/acorn-typescript?activeTab=readme
MIT License
145 stars 18 forks source link

Ranges: node.start > node.end, but loc still valid #54

Open turdwaster opened 6 months ago

turdwaster commented 6 months ago

Test input:

export default class ParamList extends Vue { // Newline here to trigger
@Watch('deepStuff') private onDeepChange() {} } 

Expected result: all nodes have .start < .end Actual result: some nodes have a very low number as end, < start

Is this the culprit? Was expecting something along the lines of node.end = endLoc.index? https://github.com/TyrealHu/acorn-typescript/blob/8956dc50370c7ee2ea97a3c903611079192b28d5/src/index.ts#L402