Merge pull request #1072 from asger-semmle/prop-write-static-accessor

Approved by esben-semmle
This commit is contained in:
semmle-qlci
2019-03-12 16:51:54 +00:00
committed by GitHub
2 changed files with 10 additions and 0 deletions

View File

@@ -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.",

View File

@@ -0,0 +1,7 @@
class C {
static get foo() {} // OK
static set foo(v) {} // OK
get bar() {} // OK
set bar(v) {} // OK
}