mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
JS: Update OK-style comments to $-style
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// OK: people sometimes use multiple declarations in an externs file to represent multiple type signatures
|
||||
// OK - people sometimes use multiple declarations in an externs file to represent multiple type signatures
|
||||
var f = function() {};
|
||||
var f = function(x) {};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
function f() {
|
||||
// OK
|
||||
|
||||
var f;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,12 +8,12 @@ namespace N2 {
|
||||
let y;
|
||||
}
|
||||
|
||||
namespace N2 { // OK
|
||||
namespace N2 {
|
||||
var w;
|
||||
}
|
||||
|
||||
function f(x: number): number;
|
||||
function f(x: string): string; // OK
|
||||
function f(x: any): any { // OK
|
||||
function f(x: string): string;
|
||||
function f(x: any): any {
|
||||
return x;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ function f() {
|
||||
|
||||
f();
|
||||
|
||||
function f() { // NOT OK
|
||||
function f() { // $ Alert
|
||||
console.log("first declaration");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
function f() {
|
||||
var x = 1;
|
||||
var x = 2; // NOT OK
|
||||
var x = 2; // $ Alert
|
||||
}
|
||||
|
||||
function g(x) {
|
||||
var x = 1; // NOT OK
|
||||
var x = 1; // $ Alert
|
||||
}
|
||||
|
||||
function h() {
|
||||
var i = 1;
|
||||
for (var i = 0; i < 10; i++) { // NOT OK
|
||||
for (var i = 0; i < 10; i++) { // $ Alert
|
||||
}
|
||||
}
|
||||
|
||||
function k() {
|
||||
var y = 1;
|
||||
var x = 2,
|
||||
y = 2; // NOT OK
|
||||
y = 2; // $ Alert
|
||||
}
|
||||
|
||||
var g;
|
||||
|
||||
Reference in New Issue
Block a user