Skip to content

Commit 7d87699

Browse files
committed
add test for modern compound assignment in js/implicit-operand-conversion
1 parent eb78607 commit 7d87699

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

javascript/ql/test/query-tests/Expressions/ImplicitOperandConversion/ImplicitOperandConversion.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@
1313
| tst.js:106:5:106:7 | g() | This expression will be implicitly converted from undefined to number. |
1414
| tst.js:109:13:109:15 | g() | This expression will be implicitly converted from undefined to number. |
1515
| tst.js:110:13:110:15 | g() | This expression will be implicitly converted from undefined to string. |
16+
| tst.js:117:8:117:8 | y | This expression will be implicitly converted from string to number. |
17+
| tst.js:122:10:122:10 | y | This expression will be implicitly converted from string to number. |

javascript/ql/test/query-tests/Expressions/ImplicitOperandConversion/tst.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,14 @@ function l() {
110110
var b = g() + "str";
111111
});
112112

113+
114+
function m() {
115+
var x = 19, y = "string";
116+
117+
x %= y; // NOT OK
118+
x += y; // OK
119+
x ||= y; // OK
120+
x &&= y; // OK
121+
x ??= y; // OK
122+
x >>>= y; // NOT OK
123+
}

0 commit comments

Comments
 (0)