Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const _patch = function(proto, name) {
- const _orig = proto[name]
- proto[name] = function(){
- if(typeof(arguments[0]) == 'string')
- arguments[0] = this.ownerDocument.createTextNode(arguments[0])
- return _orig.apply(this, arguments)
- }
- }
- _patch(Node.prototype, 'appendChild')
Add Comment
Please, Sign In to add comment