mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
JS: Update OK-style comments to $-style
This commit is contained in:
@@ -1,24 +1,20 @@
|
||||
// NOT OK
|
||||
(0).foo = 42;
|
||||
(0).foo = 42; // $ Alert
|
||||
|
||||
// NOT OK, but already flagged by SuspiciousPropAccess.ql
|
||||
null.bar = 23; undefined.baz = 42;
|
||||
null.bar = 23; undefined.baz = 42; // OK - already flagged by SuspiciousPropAccess.ql
|
||||
|
||||
function f() {
|
||||
var s = "";
|
||||
for (var i=0;i<10;++i)
|
||||
// NOT OK
|
||||
s[i] = " ";
|
||||
s[i] = " "; // $ Alert
|
||||
}
|
||||
|
||||
function g(b) {
|
||||
var x = b ? "" : 42, z;
|
||||
// NOT OK
|
||||
x.y = true;
|
||||
// OK: we don't know the type of `b`
|
||||
x.y = true; // $ Alert
|
||||
// OK - we don't know the type of `b`
|
||||
b.y = true;
|
||||
return;
|
||||
// OK: no types inferred for `z`, since this is dead code
|
||||
// OK - no types inferred for `z`, since this is dead code
|
||||
z.y = true;
|
||||
}
|
||||
|
||||
@@ -26,4 +22,4 @@ function h() {
|
||||
let tmp;
|
||||
let obj = (tmp ||= {});
|
||||
obj.p = 42;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user