File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -291,11 +291,25 @@ module DOM {
291291 */
292292 abstract class Range extends DataFlow:: Node { }
293293
294+ private string getADomPropertyName ( ) {
295+ exists ( ExternalInstanceMemberDecl decl |
296+ result = decl .getName ( ) and
297+ isDomRootType ( decl .getDeclaringType ( ) .getASupertype * ( ) )
298+ )
299+ }
300+
294301 private class DefaultRange extends Range {
295302 DefaultRange ( ) {
296303 this .asExpr ( ) .( VarAccess ) .getVariable ( ) instanceof DOMGlobalVariable
297304 or
298- this = domValueRef ( ) .getAPropertyRead ( )
305+ exists ( DataFlow:: PropRead read |
306+ this = read and
307+ read = domValueRef ( ) .getAPropertyRead ( )
308+ |
309+ not read .mayHavePropertyName ( _)
310+ or
311+ read .mayHavePropertyName ( getADomPropertyName ( ) )
312+ )
299313 or
300314 this = domElementCreationOrQuery ( )
301315 or
Original file line number Diff line number Diff line change @@ -4,9 +4,5 @@ test_locationRef
44| customization.js:3:3:3:14 | doc.location |
55test_domValueRef
66| customization.js:4:3:4:28 | doc.get ... 'test') |
7- | tst.js:45:8:45:7 | this |
8- | tst.js:46:7:46:12 | this.x |
97| tst.js:49:3:49:8 | window |
108| tst.js:50:3:50:8 | window |
11- | tst.js:50:3:50:14 | window.myApp |
12- | tst.js:50:3:50:18 | window.myApp.foo |
You can’t perform that action at this time.
0 commit comments