import { DOMParser, XMLSerializer } from '@xmldom/xmldom';
const source = `<xml>&hasOwnProperty; &__proto__; &constructor;</xml>`;
const doc = new DOMParser({ errorHandler: console.error }).parseFromString(
source,
'text/xml'
);
console.log(
doc.documentElement.toString()
);
Source code using
ininstead ofObject.hasOwnProperty:xmldom/lib/sax.js
Lines 68 to 69 in 40745c6
leads to the output
<xml>function hasOwnProperty() { [native code] </xml>Try it: https://stackblitz.com/edit/js-xmldom370?devtoolsheight=33&file=index.js