Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(typescript-estree): support private fields in-in syntax (#4075)
- Loading branch information
1 parent
ae0fb5a
commit 939d8ea
Showing
13 changed files
with
640 additions
and
20 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
import type { AST_NODE_TYPES } from '../../ast-node-types'; | ||
import type { BinaryExpressionBase } from '../../base/BinaryExpressionBase'; | ||
import type { BaseNode } from '../../base/BaseNode'; | ||
import type { PrivateIdentifier } from '../../special/PrivateIdentifier/spec'; | ||
import type { Expression } from '../../unions/Expression'; | ||
|
||
export interface BinaryExpression extends BinaryExpressionBase { | ||
export interface BinaryExpression extends BaseNode { | ||
type: AST_NODE_TYPES.BinaryExpression; | ||
operator: string; | ||
left: Expression | PrivateIdentifier; | ||
right: Expression; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
import type { AST_NODE_TYPES } from '../../ast-node-types'; | ||
import type { BinaryExpressionBase } from '../../base/BinaryExpressionBase'; | ||
import type { BaseNode } from '../../base/BaseNode'; | ||
import type { Expression } from '../../unions/Expression'; | ||
|
||
export interface LogicalExpression extends BinaryExpressionBase { | ||
export interface LogicalExpression extends BaseNode { | ||
type: AST_NODE_TYPES.LogicalExpression; | ||
operator: '??' | '&&' | '||'; | ||
left: Expression; | ||
right: Expression; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
packages/shared-fixtures/fixtures/typescript/basics/private-fields-in-in.src.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class Foo { | ||
#prop1; | ||
method(arg) { | ||
return #prop1 in arg; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.