Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: parse a<b>>>c as a<(b>>>c) (#14819)
* fix: parse a<b>>>c as a<(b>>>c) * fix: bail out only when they could form bitshift * Revert "fix: bail out only when they could form bitshift" This reverts commit c413671.
- Loading branch information
Showing
3 changed files
with
128 additions
and
0 deletions.
There are no files selected for viewing
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
3 changes: 3 additions & 0 deletions
3
...est/fixtures/typescript/type-arguments/instantiation-expression-false-positive-4/input.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,3 @@ | ||
let f, h = 0, j = 0; | ||
|
||
f = h >>> 0 < j >>> 0; |
123 changes: 123 additions & 0 deletions
123
.../fixtures/typescript/type-arguments/instantiation-expression-false-positive-4/output.json
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,123 @@ | ||
{ | ||
"type": "File", | ||
"start":0,"end":44,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":3,"column":22,"index":44}}, | ||
"program": { | ||
"type": "Program", | ||
"start":0,"end":44,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":3,"column":22,"index":44}}, | ||
"sourceType": "module", | ||
"interpreter": null, | ||
"body": [ | ||
{ | ||
"type": "VariableDeclaration", | ||
"start":0,"end":20,"loc":{"start":{"line":1,"column":0,"index":0},"end":{"line":1,"column":20,"index":20}}, | ||
"declarations": [ | ||
{ | ||
"type": "VariableDeclarator", | ||
"start":4,"end":5,"loc":{"start":{"line":1,"column":4,"index":4},"end":{"line":1,"column":5,"index":5}}, | ||
"id": { | ||
"type": "Identifier", | ||
"start":4,"end":5,"loc":{"start":{"line":1,"column":4,"index":4},"end":{"line":1,"column":5,"index":5},"identifierName":"f"}, | ||
"name": "f" | ||
}, | ||
"init": null | ||
}, | ||
{ | ||
"type": "VariableDeclarator", | ||
"start":7,"end":12,"loc":{"start":{"line":1,"column":7,"index":7},"end":{"line":1,"column":12,"index":12}}, | ||
"id": { | ||
"type": "Identifier", | ||
"start":7,"end":8,"loc":{"start":{"line":1,"column":7,"index":7},"end":{"line":1,"column":8,"index":8},"identifierName":"h"}, | ||
"name": "h" | ||
}, | ||
"init": { | ||
"type": "NumericLiteral", | ||
"start":11,"end":12,"loc":{"start":{"line":1,"column":11,"index":11},"end":{"line":1,"column":12,"index":12}}, | ||
"extra": { | ||
"rawValue": 0, | ||
"raw": "0" | ||
}, | ||
"value": 0 | ||
} | ||
}, | ||
{ | ||
"type": "VariableDeclarator", | ||
"start":14,"end":19,"loc":{"start":{"line":1,"column":14,"index":14},"end":{"line":1,"column":19,"index":19}}, | ||
"id": { | ||
"type": "Identifier", | ||
"start":14,"end":15,"loc":{"start":{"line":1,"column":14,"index":14},"end":{"line":1,"column":15,"index":15},"identifierName":"j"}, | ||
"name": "j" | ||
}, | ||
"init": { | ||
"type": "NumericLiteral", | ||
"start":18,"end":19,"loc":{"start":{"line":1,"column":18,"index":18},"end":{"line":1,"column":19,"index":19}}, | ||
"extra": { | ||
"rawValue": 0, | ||
"raw": "0" | ||
}, | ||
"value": 0 | ||
} | ||
} | ||
], | ||
"kind": "let" | ||
}, | ||
{ | ||
"type": "ExpressionStatement", | ||
"start":22,"end":44,"loc":{"start":{"line":3,"column":0,"index":22},"end":{"line":3,"column":22,"index":44}}, | ||
"expression": { | ||
"type": "AssignmentExpression", | ||
"start":22,"end":43,"loc":{"start":{"line":3,"column":0,"index":22},"end":{"line":3,"column":21,"index":43}}, | ||
"operator": "=", | ||
"left": { | ||
"type": "Identifier", | ||
"start":22,"end":23,"loc":{"start":{"line":3,"column":0,"index":22},"end":{"line":3,"column":1,"index":23},"identifierName":"f"}, | ||
"name": "f" | ||
}, | ||
"right": { | ||
"type": "BinaryExpression", | ||
"start":26,"end":43,"loc":{"start":{"line":3,"column":4,"index":26},"end":{"line":3,"column":21,"index":43}}, | ||
"left": { | ||
"type": "BinaryExpression", | ||
"start":26,"end":33,"loc":{"start":{"line":3,"column":4,"index":26},"end":{"line":3,"column":11,"index":33}}, | ||
"left": { | ||
"type": "Identifier", | ||
"start":26,"end":27,"loc":{"start":{"line":3,"column":4,"index":26},"end":{"line":3,"column":5,"index":27},"identifierName":"h"}, | ||
"name": "h" | ||
}, | ||
"operator": ">>>", | ||
"right": { | ||
"type": "NumericLiteral", | ||
"start":32,"end":33,"loc":{"start":{"line":3,"column":10,"index":32},"end":{"line":3,"column":11,"index":33}}, | ||
"extra": { | ||
"rawValue": 0, | ||
"raw": "0" | ||
}, | ||
"value": 0 | ||
} | ||
}, | ||
"operator": "<", | ||
"right": { | ||
"type": "BinaryExpression", | ||
"start":36,"end":43,"loc":{"start":{"line":3,"column":14,"index":36},"end":{"line":3,"column":21,"index":43}}, | ||
"left": { | ||
"type": "Identifier", | ||
"start":36,"end":37,"loc":{"start":{"line":3,"column":14,"index":36},"end":{"line":3,"column":15,"index":37},"identifierName":"j"}, | ||
"name": "j" | ||
}, | ||
"operator": ">>>", | ||
"right": { | ||
"type": "NumericLiteral", | ||
"start":42,"end":43,"loc":{"start":{"line":3,"column":20,"index":42},"end":{"line":3,"column":21,"index":43}}, | ||
"extra": { | ||
"rawValue": 0, | ||
"raw": "0" | ||
}, | ||
"value": 0 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
], | ||
"directives": [] | ||
} | ||
} |