File tree Expand file tree Collapse file tree 3 files changed +6
-4
lines changed
test/query-tests/Expressions/ExprHasNoEffect Expand file tree Collapse file tree 3 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -10,4 +10,8 @@ predicate isDomProperty(string p) {
1010 exists ( ExternalMemberDecl emd | emd .getName ( ) = p |
1111 isDomRootType ( emd .getDeclaringType ( ) .getASupertype * ( ) )
1212 )
13+ or
14+ exists ( DataFlow:: SourceNode domNode | isDomNode ( domNode ) |
15+ p = domNode .getAPropertyRead ( ) .getPropertyName ( )
16+ )
1317}
Original file line number Diff line number Diff line change 1- | dom.js:5:3:5:18 | box.offsetHeight | This expression has no effect. |
2- | dom.js:11:5:11:40 | documen ... ntWidth | This expression has no effect. |
31| try.js:22:9:22:26 | x.ordinaryProperty | This expression has no effect. |
42| tst2.js:2:4:2:4 | 0 | This expression has no effect. |
53| tst.js:3:1:3:2 | 23 | This expression has no effect. |
Original file line number Diff line number Diff line change @@ -2,12 +2,12 @@ function f() {
22 const box = document . getElementById ( 'box' ) ;
33 box . classList . remove ( 'animate' ) ;
44 // Force a reflow by reading layout property (side effect!)
5- box . offsetHeight ; // $SPURIOUS:Alert
5+ box . offsetHeight ;
66
77 try {
88 console . log ( "Hello, world!" ) ;
99 } catch ( e ) {
1010 // Reading this property also forces layout
11- document . documentElement . clientWidth ; // $SPURIOUS:Alert
11+ document . documentElement . clientWidth ;
1212 }
1313}
You can’t perform that action at this time.
0 commit comments