File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
javascript/ql/test/query-tests/Expressions/ExprHasNoEffect Expand file tree Collapse file tree 2 files changed +15
-0
lines changed 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. |
13| try.js:22:9:22:26 | x.ordinaryProperty | This expression has no effect. |
24| tst2.js:2:4:2:4 | 0 | This expression has no effect. |
35| tst.js:3:1:3:2 | 23 | This expression has no effect. |
Original file line number Diff line number Diff line change 1+ function f ( ) {
2+ const box = document . getElementById ( 'box' ) ;
3+ box . classList . remove ( 'animate' ) ;
4+ // Force a reflow by reading layout property (side effect!)
5+ box . offsetHeight ; // $SPURIOUS:Alert
6+
7+ try {
8+ console . log ( "Hello, world!" ) ;
9+ } catch ( e ) {
10+ // Reading this property also forces layout
11+ document . documentElement . clientWidth ; // $SPURIOUS:Alert
12+ }
13+ }
You can’t perform that action at this time.
0 commit comments