You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by Gabriel Barros <gb...@yahoo-inc.com> on 2009/07/08 21:19:30 UTC

util.js

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


Re: util.js

Posted by Kevin Brown <et...@google.com>.
That code should probably be deleted. Anything in the top level "javascript"
directory should be treated as nothing more than examples (maybe we should
just rename it to 'examples'?).

I think the only file in there that is actually important is the copy of
rpc_relay.html.

On Wed, Jul 8, 2009 at 12:19 PM, Gabriel Barros <gb...@yahoo-inc.com>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
>
>

Re: util.js

Posted by Paul Lindner <li...@inuus.com>.
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 <gb...@yahoo-inc.com>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
>
>