Skip to content

Instantly share code, notes, and snippets.

@pvdz
Created June 26, 2013 19:09
Show Gist options
  • Save pvdz/5870502 to your computer and use it in GitHub Desktop.
Save pvdz/5870502 to your computer and use it in GitHub Desktop.
var call = Function.prototype.call;
var apply = Function.prototype.apply;
call.call = call;
call.apply = apply;
apply.call = call;
apply.apply = apply;
var hop = Object.prototype.hasOwnProperty;
var hasOwnProperty = function(obj, prop){
return call.call(hop, obj, prop);
};
console.log(hasOwnProperty({foo:15}, 'foo'));
console.log(hasOwnProperty({foo:15}, 'toString'));
Function.prototype.call = null;
Function.prototype.apply = null;
console.log(hop.call);
console.log(hop.apply);
console.log(hasOwnProperty({foo:15}, 'foo'));
console.log(hasOwnProperty({foo:15}, 'toString'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment