Merge pull request #6698 from asgerf/js/template-self-assignment

Approved by esbena
This commit is contained in:
CodeQL CI
2021-09-15 01:08:39 -07:00
committed by GitHub
2 changed files with 7 additions and 1 deletions

View File

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