Files
codeql/javascript/ql/test/query-tests/Declarations/UniqueParameterNames/tst.js
Asger F 86932c51bc JS: Move some alerts to their correct location
One of the diffs look confusing but:
Previously parameter {2,3} where flagged, now parameter {1,2} are flagged.

Note that for command injection, the SystemCommandExecution is flagged
despite the test file claiming otherwise.
2025-02-28 13:27:40 +01:00

22 lines
417 B
JavaScript

function f(
x, // $ Alert
x, // $ Alert
\u0078
) { return; }
this.addPropertyListener(prop.name, function(_, _, _, a) {
proxy.delegate = a.dao;
});
// OK - for strict mode functions, duplicate parameter names are a syntax error
function f(x, y, x) {
'use strict';
}
function f(
x,
x // OK - empty function
) { }
(a, a) => a + a; // OK - for strict mode functions, duplicate parameter names are a syntax error