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

Function toString

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

Source from the content-addressed store, hash-verified

7475 QUnit.test('coerced toString() markup is still sanitized', (assert) => {
7476 const dirty = {
7477 toString() {
7478 return '<b>x</b><img src=x onerror=alert(1)>';
7479 },
7480 };
7481 const out = DOMPurify.sanitize(dirty);
7482 assert.equal(out.indexOf('onerror'), -1, `onerror survived: ${out}`);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected