This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ExtendedInventory = Inventory.extend({ | |
defaults: { | |
rabit:25 | |
} | |
}); | |
_.extend(ExtendedInventory.prototype.defaults, Inventory.prototype.defaults); | |
// or |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// tests if we can get super in .toString() | |
fnTest = /xyz/.test(function() { | |
xyz; | |
}) ? /\b_super\b/ : /.*/, | |
// overwrites an object with methods, sets up _super | |
// newProps - new properties | |
// oldProps - where the old properties might be | |
// addTo - what we are adding to | |
inheritProps = function( newProps, oldProps, addTo ) { |
NewerOlder