Skip to content

Instantly share code, notes, and snippets.

@wkronemeijer
Created October 23, 2013 15:22
Show Gist options
  • Save wkronemeijer/7120759 to your computer and use it in GitHub Desktop.
Save wkronemeijer/7120759 to your computer and use it in GitHub Desktop.
super for any object with a prototype chain; usage: call_super(this, 'method')('hello', 'world')
window.call_super = function call_super(obj, name) {
var super_class = Object.getPrototypeOf(Object.getPrototypeOf(obj));
return (function () {
super_class[name].apply(obj, arguments);
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment