* ♻️ added condition to check for left and right of nullish coalescing operator and if any is a logical expression without a paren then throw an error * 🐛 bugs fixed and test cases updated for babel parser * ♻️ code comments added * 🐛 spell error rectified * ♻️ failing test updated * 🐛 push tests after make build * Skip nullish-coalescing flow precedence tests They're now incorrect * ♻️ error message updated, binop priority of other logical operators +1 from ?? and * ♻️ increaed the binOp for in and instanceOf, added logic to print the brackets in an ?? && || expression, test cases added * 🐛 failing test fixed and comments updated * ♻️ new lines added between tests * ♻️ basic tests for checking the binOp of instanceOf, in and relational operators to be equal added * ♻️ new lines added in between tests
137 lines
2.8 KiB
JSON
137 lines
2.8 KiB
JSON
{
|
|
"type": "File",
|
|
"start": 0,
|
|
"end": 14,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 14
|
|
}
|
|
},
|
|
"program": {
|
|
"type": "Program",
|
|
"start": 0,
|
|
"end": 14,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 14
|
|
}
|
|
},
|
|
"sourceType": "script",
|
|
"interpreter": null,
|
|
"body": [
|
|
{
|
|
"type": "ExpressionStatement",
|
|
"start": 0,
|
|
"end": 14,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 14
|
|
}
|
|
},
|
|
"expression": {
|
|
"type": "LogicalExpression",
|
|
"start": 0,
|
|
"end": 13,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 13
|
|
}
|
|
},
|
|
"left": {
|
|
"type": "Identifier",
|
|
"start": 0,
|
|
"end": 1,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 0
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 1
|
|
},
|
|
"identifierName": "a"
|
|
},
|
|
"name": "a"
|
|
},
|
|
"operator": "??",
|
|
"right": {
|
|
"type": "LogicalExpression",
|
|
"start": 6,
|
|
"end": 12,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 6
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 12
|
|
}
|
|
},
|
|
"left": {
|
|
"type": "Identifier",
|
|
"start": 6,
|
|
"end": 7,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 6
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 7
|
|
},
|
|
"identifierName": "b"
|
|
},
|
|
"name": "b"
|
|
},
|
|
"operator": "&&",
|
|
"right": {
|
|
"type": "Identifier",
|
|
"start": 11,
|
|
"end": 12,
|
|
"loc": {
|
|
"start": {
|
|
"line": 1,
|
|
"column": 11
|
|
},
|
|
"end": {
|
|
"line": 1,
|
|
"column": 12
|
|
},
|
|
"identifierName": "c"
|
|
},
|
|
"name": "c"
|
|
},
|
|
"extra": {
|
|
"parenthesized": true,
|
|
"parenStart": 5
|
|
}
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"directives": []
|
|
}
|
|
} |