Guest User

Untitled

a guest
Jan 22nd, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. const _patch = function(proto, name) {
  2. const _orig = proto[name]
  3. proto[name] = function(){
  4. if(typeof(arguments[0]) == 'string')
  5. arguments[0] = this.ownerDocument.createTextNode(arguments[0])
  6. return _orig.apply(this, arguments)
  7. }
  8. }
  9. _patch(Node.prototype, 'appendChild')
Add Comment
Please, Sign In to add comment