This file used to have a bunch more code. The remaining utility function inherits simulates java style inheritence and is used in gadgets.js like so: gadgets.DefaultUserPrefStore.inherits(gadgets.UserPrefStore);
On Wed, Jul 8, 2009 at 12:19 PM, Gabriel Barros <[email protected]>wrote: > I failed to see what's the utility there... anyone care to explain the > black magic involved? > > /** > * @fileoverview Utility functions for the Open Gadget Container > */ > > Function.prototype.inherits = function(parentCtor) { > function tempCtor() {}; > tempCtor.prototype = parentCtor.prototype; > this.superClass_ = parentCtor.prototype; > this.prototype = new tempCtor(); > this.prototype.constructor = this; > }; > > Thank you, > --gbarros > >

