mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
JS: Exclude template files in SelfAssignment
This commit is contained in:
@@ -43,5 +43,8 @@ where
|
||||
// exclude DOM properties
|
||||
not isDOMProperty(e.(PropAccess).getPropertyName()) and
|
||||
// exclude self-assignments that have been inserted to satisfy the TypeScript JS-checker
|
||||
not e.getAssignment().getParent().(ExprStmt).getDocumentation().getATag().getTitle() = "type"
|
||||
not e.getAssignment().getParent().(ExprStmt).getDocumentation().getATag().getTitle() = "type" and
|
||||
// exclude self-assignments in speculatively parsed template files
|
||||
// named arguments may be incorrectly parsed as assignments
|
||||
not e.getTopLevel() instanceof Templating::TemplateTopLevel
|
||||
select e.getParent(), "This expression assigns " + dsc + " to itself."
|
||||
|
||||
Reference in New Issue
Block a user