mirror of
https://github.com/github/codeql.git
synced 2026-05-04 13:15:21 +02:00
Merge pull request #1072 from asger-semmle/prop-write-static-accessor
Approved by esben-semmle
This commit is contained in:
@@ -154,6 +154,9 @@ where
|
||||
or
|
||||
// exclude result from js/overwritten-property
|
||||
assign2.getBase() instanceof DataFlow::ObjectLiteralNode
|
||||
or
|
||||
// exclude result from accessor declarations
|
||||
assign1.getWriteNode() instanceof AccessorMethodDeclaration
|
||||
)
|
||||
select assign1.getWriteNode(),
|
||||
"This write to property '" + name + "' is useless, since $@ always overrides it.",
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
class C {
|
||||
static get foo() {} // OK
|
||||
static set foo(v) {} // OK
|
||||
|
||||
get bar() {} // OK
|
||||
set bar(v) {} // OK
|
||||
}
|
||||
Reference in New Issue
Block a user