(n)
| 152 | } |
| 153 | |
| 154 | function dirtyMixed(n) { |
| 155 | // Realistic dirty input: things to strip, hoist and rewrite. |
| 156 | let html = ''; |
| 157 | for (let i = 0; i < n; i++) { |
| 158 | html += |
| 159 | `<div onclick="alert(${i})"><script>steal(${i})</script>` + |
| 160 | `<img src="x" onerror="alert(${i})">` + |
| 161 | `<a href="javascript:alert(${i})">bad link ${i}</a>` + |
| 162 | `<unknown-tag-${i % 3}><b>kept ${i}</b></unknown-tag-${i % 3}>` + |
| 163 | `<p style="position:fixed">text ${i}</p></div>`; |
| 164 | } |
| 165 | |
| 166 | return html; |
| 167 | } |
| 168 | |
| 169 | /* ------------------------------------------------------------------ */ |
| 170 | /* Scenarios */ |
no outgoing calls
no test coverage detected
searching dependent graphs…