Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Property and AssignmentProperty have the same type #1295

Open
yigalirani opened this issue Apr 18, 2024 · 1 comment
Open

Property and AssignmentProperty have the same type #1295

yigalirani opened this issue Apr 18, 2024 · 1 comment

Comments

@yigalirani
Copy link

relevant code from acorn.d.ts

export interface AssignmentProperty extends Node {
  type: "Property"
  //deleted for bravity
}

export interface Property extends Node {
  type: "Property"
 //deleted for bravity
}

that makes it diffecullt, maybe impossble, to write a type guard for that

@marijnh
Copy link
Member

marijnh commented Apr 18, 2024

This kind of falls out of the ESTree design, which we aren't responsible for. In one context, nodes with a Property type have a pattern in their value field, but in another context, when a child of an object pattern, it holds an expression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants