JS: Update OK-style comments to $-style

This commit is contained in:
Asger F
2025-02-06 13:34:01 +01:00
parent 7e5c24a8ec
commit 9be041e27d
536 changed files with 4408 additions and 4762 deletions

View File

@@ -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;
}
}