Move ?? to LogicalExpression
This commit is contained in:
parent
fcdfb0e31e
commit
f1b8404750
1
.gitignore
vendored
1
.gitignore
vendored
@ -4,3 +4,4 @@ coverage
|
||||
lib
|
||||
node_modules
|
||||
npm-debug.log
|
||||
.vscode
|
||||
|
||||
@ -791,7 +791,6 @@ enum BinaryOperator {
|
||||
| "|" | "^" | "&" | "in"
|
||||
| "instanceof"
|
||||
| "|>"
|
||||
| "??"
|
||||
}
|
||||
```
|
||||
|
||||
@ -839,7 +838,7 @@ A logical operator expression.
|
||||
|
||||
```js
|
||||
enum LogicalOperator {
|
||||
"||" | "&&"
|
||||
"||" | "&&" | "??"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@ -311,7 +311,9 @@ export default class ExpressionParser extends LValParser {
|
||||
|
||||
this.finishNode(
|
||||
node,
|
||||
op === tt.logicalOR || op === tt.logicalAND
|
||||
op === tt.logicalOR ||
|
||||
op === tt.logicalAND ||
|
||||
op === tt.nullishCoalescing
|
||||
? "LogicalExpression"
|
||||
: "BinaryExpression",
|
||||
);
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "BinaryExpression",
|
||||
"type": "LogicalExpression",
|
||||
"start": 0,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
@ -57,7 +57,7 @@
|
||||
}
|
||||
},
|
||||
"left": {
|
||||
"type": "BinaryExpression",
|
||||
"type": "LogicalExpression",
|
||||
"start": 0,
|
||||
"end": 6,
|
||||
"loc": {
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "BinaryExpression",
|
||||
"type": "LogicalExpression",
|
||||
"start": 0,
|
||||
"end": 8,
|
||||
"loc": {
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "BinaryExpression",
|
||||
"type": "LogicalExpression",
|
||||
"start": 0,
|
||||
"end": 16,
|
||||
"loc": {
|
||||
@ -57,7 +57,7 @@
|
||||
}
|
||||
},
|
||||
"left": {
|
||||
"type": "BinaryExpression",
|
||||
"type": "LogicalExpression",
|
||||
"start": 0,
|
||||
"end": 9,
|
||||
"loc": {
|
||||
|
||||
@ -75,7 +75,7 @@
|
||||
},
|
||||
"operator": "|>",
|
||||
"right": {
|
||||
"type": "BinaryExpression",
|
||||
"type": "LogicalExpression",
|
||||
"start": 5,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "BinaryExpression",
|
||||
"type": "LogicalExpression",
|
||||
"start": 0,
|
||||
"end": 11,
|
||||
"loc": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user