Skip to content

Commit c0b7538

Browse files
committed
made the blacklist for methods named "function" work again
1 parent e5290f3 commit c0b7538

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

javascript/ql/src/Declarations/SuspiciousMethodNameDeclaration.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ where
5252
// The developer was not confused about "function" when there are other methods in the interface.
5353
name = "function" and
5454
exists(MethodDeclaration other | other = container.getAMethod() |
55-
name != "function" and
55+
other.getName() != "function" and
5656
not other.(ConstructorDeclaration).isSynthetic()
5757
)
5858
)

javascript/ql/test/query-tests/Declarations/SuspiciousMethodNameDeclaration/SuspiciousMethodNameDeclaration.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
| tst.ts:4:3:4:22 | function (): number; | The member name 'function' does not declare a function, it declares a method named 'function'. |
21
| tst.ts:7:3:7:24 | constru ... string; | The member name 'constructor' does not declare a constructor in interface declarations, but it does in class declarations. |
32
| tst.ts:16:3:16:21 | function(): number; | The member name 'function' does not declare a function, it declares a method named 'function'. |
43
| tst.ts:37:3:37:21 | function(): number; | The member name 'function' does not declare a function, it declares a method named 'function'. |

0 commit comments

Comments
 (0)