Skip to content

[JavaScript] LGTM.com - false positive for logical OR assignment #6362

@timvandermeij

Description

@timvandermeij

Description of the false positive

Mozilla's PDF.js project recently integrated CodeQL and it doesn't seem to understand logical OR assignment, or the ||= operator. This operator is explained on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Logical_OR_assignment. On the link below LGTM states that the externalListeners variable is never set, but it clearly is on line https://lgtm.com/projects/g/mozilla/pdf.js/snapshot/02cf4948474989afc65c0b58414fc2dc379119bc/files/web/ui_utils.js?sort=name&dir=ASC&mode=heatmap#L782.

URL to the alert on the project page on LGTM.com

https://lgtm.com/projects/g/mozilla/pdf.js/snapshot/02cf4948474989afc65c0b58414fc2dc379119bc/files/web/ui_utils.js?sort=name&dir=ASC&mode=heatmap#x9a849b47d4d84b8e:1

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions