better support for the `&&=`, `||=`, and `??=` operators · ByteDecoder/codeql@d95d427 · GitHub
Skip to content

Commit d95d427

Browse files
committed
better support for the &&=, ||=, and ??= operators
1 parent fd9eb1d commit d95d427

6 files changed

Lines changed: 728 additions & 2 deletions

File tree

javascript/extractor/src/com/semmle/js/extractor/CFGExtractor.java

Lines changed: 21 additions & 2 deletions

javascript/extractor/src/com/semmle/js/parser/TypeScriptASTConverter.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,9 @@ private Node convertBinaryExpression(JsonObject node, SourceLocation loc) throws
852852
case ">>=":
853853
case "<<=":
854854
case ">>>=":
855+
case "??=":
856+
case "&&=":
857+
case "||=":
855858
return new AssignmentExpression(loc, operator, convertLValue(left), right);
856859

857860
default:
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
let a = 2;
2+
let b = 3;
3+
4+
a = 23;
5+
a += 19;
6+
7+
a &&= 4;
8+
a ||= 5;
9+
a ??= 6;

javascript/ql/test/library-tests/Expr/tests.expected

Lines changed: 120 additions & 0 deletions

0 commit comments

Comments
 (0)