JS: restrict alert location to a single line

This commit is contained in:
Esben Sparre Andreasen
2018-08-08 10:50:42 +02:00
parent e1947f04df
commit 8ee943f264
2 changed files with 4 additions and 3 deletions

View File

@@ -11,6 +11,7 @@
*/
import javascript
import semmle.javascript.RestrictedLocations
/**
* Holds if `e` is an expression of the given `kind` that must be guarded by a
@@ -59,4 +60,4 @@ where needsGuard(e, kind) and unguarded(e, ctor) and
sc.getBinder() = ctor and
sc.getEnclosingFunction() != ctor
)
select ctor, "The super constructor must be called before using '$@'.", e, kind
select (FirstLineOf)ctor, "The super constructor must be called before using '$@'.", e, kind