JS: add test for DOM access where expression appears to have no side effects

This commit is contained in:
Napalys Klicius
2025-05-26 11:36:11 +02:00
parent a519eabd4d
commit 9b2ef8be10
2 changed files with 15 additions and 0 deletions

View File

@@ -1,3 +1,11 @@
| dom.js:2:5:2:30 | a.clien ... ientTop | This expression has no effect. |
| dom.js:2:5:2:50 | a.clien ... === !0 | This expression has no effect. |
| dom.js:2:33:2:50 | a.clientTop === !0 | This expression has no effect. |
| dom.js:3:5:3:20 | a && a.clientTop | This expression has no effect. |
| dom.js:4:5:4:28 | a.clien ... ientTop | This expression has no effect. |
| dom.js:5:18:5:43 | a.clien ... ientTop | This expression has no effect. |
| dom.js:6:18:6:63 | b && (b ... entTop) | This expression has no effect. |
| dom.js:6:23:6:63 | (b.clie ... entTop) | This expression has no effect. |
| try.js:22:9:22:26 | x.ordinaryProperty | This expression has no effect. |
| tst2.js:2:4:2:4 | 0 | This expression has no effect. |
| tst.js:3:1:3:2 | 23 | This expression has no effect. |

View File

@@ -0,0 +1,7 @@
function f(){
a.clientTop && a.clientTop, a.clientTop === !0; // $Alert
a && a.clientTop; // $SPURIOUS:Alert
a.clientTop, a.clientTop; // $SPURIOUS:Alert
if(a) return a.clientTop && a.clientTop, a.clientTop === !0 // $SPURIOUS:Alert
if(b) return b && (b.clientTop, b.clientTop && b.clientTop), null // $SPURIOUS:Alert
}