JS: Ignore strict-mode-call-stack-introspection for expr stmts

This commit is contained in:
Asger Feldthaus
2020-01-13 15:50:30 +00:00
parent ad0ad3a3e4
commit 73e60a7400
4 changed files with 16 additions and 9 deletions

View File

@@ -32,5 +32,6 @@ where
acc.accesses(baseNode.asExpr(), prop) and
acc.getContainer().isStrict() and
illegalPropAccess(baseNode.getAValue(), base, prop) and
forex(AbstractValue av | av = baseNode.getAValue() | illegalPropAccess(av, _, prop))
forex(AbstractValue av | av = baseNode.getAValue() | illegalPropAccess(av, _, prop)) and
not acc = any(ExprStmt stmt).getExpr() // reported by js/useless-expression
select acc, "Strict mode code cannot use " + base + "." + prop + "."