Skip to content

Instantly share code, notes, and snippets.

@sebmarkbage
Created March 22, 2012 17:52
Show Gist options
  • Save sebmarkbage/2160991 to your computer and use it in GitHub Desktop.
Save sebmarkbage/2160991 to your computer and use it in GitHub Desktop.
Super calls
var currentInstance;
function parent(){
currentInstance.parent();
}
function wrapMethod(method){
return function(){
var previousInstance = currentInstance;
currentInstance = this;
var result = method.apply(this, arguments);
currentInstance = previousInstance;
return result;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment