MCPcopy Create free account
hub / github.com/cure53/DOMPurify / toString

Function toString

test/test-suite.js:6215–6217  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6213 QUnit.test('coerced toString() markup is still sanitized', (assert) => {
6214 const dirty = {
6215 toString() {
6216 return '<b>x</b><img src=x onerror=alert(1)>';
6217 },
6218 };
6219 const out = DOMPurify.sanitize(dirty);
6220 assert.equal(out.indexOf('onerror'), -1, `onerror survived: ${out}`);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected