Skip to content

Instantly share code, notes, and snippets.

@catrope
Last active August 29, 2015 14:03
Show Gist options
  • Save catrope/ed1ecfefdb1d16784644 to your computer and use it in GitHub Desktop.
Save catrope/ed1ecfefdb1d16784644 to your computer and use it in GitHub Desktop.
function Bar() {
// Parent constructor
Bar.parent.call( this );
this.v2 = null;
}
OO.inheritClass( Bar, Foo );
Bar.prototype.setValue = function f( val ) {
// Call parent method
f.parent( val );
this.v2 = val;
};
Bar.prototype.getValue = function f() {
return 35 - f.parent();
};
// OO.inheritClass would have to do something like:
Bar.prototype.getValue.parent = Foo.prototype.getValue;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment