File tree Expand file tree Collapse file tree
javascript/ql/src/semmle/javascript Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55import javascript
66import semmle.javascript.frameworks.Templating
7+ private import semmle.javascript.dataflow.InferredTypes
78
89module DOM {
910 /**
@@ -292,10 +293,18 @@ module DOM {
292293
293294 private class DefaultRange extends Range {
294295 DefaultRange ( ) {
295- this .asExpr ( ) .( VarAccess ) .getVariable ( ) instanceof DOMGlobalVariable or
296- this = domValueRef ( ) .getAPropertyRead ( ) or
297- this = domElementCreationOrQuery ( ) or
296+ this .asExpr ( ) .( VarAccess ) .getVariable ( ) instanceof DOMGlobalVariable
297+ or
298+ this = domValueRef ( ) .getAPropertyRead ( )
299+ or
300+ this = domElementCreationOrQuery ( )
301+ or
298302 this = domElementCollection ( )
303+ or
304+ exists ( JQuery:: MethodCall call | this = call and call .getMethodName ( ) = "get" |
305+ call .getNumArgument ( ) = 1 and
306+ forex ( InferredType t | t = call .getArgument ( 0 ) .analyze ( ) .getAType ( ) | t = TTNumber ( ) )
307+ )
299308 }
300309 }
301310 }
You can’t perform that action at this time.
0 commit comments