JS: sharpen js/duplicate-parameter-name

This commit is contained in:
Esben Sparre Andreasen
2020-01-06 08:40:13 +01:00
parent 5718fbd98a
commit 96748ca32e
3 changed files with 4 additions and 1 deletions

View File

@@ -36,6 +36,9 @@ where
i < j and
j = max(int k | parmBinds(f, k, _, name) | k) and
not isDummy(p) and
// ignore functions without bodies or empty bodies
f.hasBody() and
exists(f.getABodyStmt()) and
// duplicate parameters in strict mode functions are flagged by the 'Syntax error' rule
not f.isStrict()
select p, "This parameter has the same name as $@ of the same function.", q, "another parameter"