Files
codeql/javascript/ql/examples/snippets/constantbrackets.ql
2019-08-02 15:33:40 +02:00

18 lines
425 B
Plaintext

/**
* @id js/examples/constantbrackets
* @name Constant property name in `[]` property access
* @description Finds property accesses using the square bracket notation
* where the property name is a constant string
* @tags property access
* computed
* brackets
* index
* constant
*/
import javascript
from IndexExpr idx
where idx.getIndex() instanceof StringLiteral
select idx