Skip to content

Instantly share code, notes, and snippets.

@sekimura
Created June 25, 2012 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sekimura/2989933 to your computer and use it in GitHub Desktop.
Save sekimura/2989933 to your computer and use it in GitHub Desktop.
var App = {};
(function wrapper() {
var Foo = (function FooClosure() {
/**
* A Foo
* @param {string} first name
* @param {string} last name
* @constructor
*/
function Foo(firstName, lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
Foo.prototype.fullName = function Foo_fullName() {
return this.firstName + ' ' + this.lastName;
};
return Foo;
})();
var Base = (function BaseClosure() {
/**
* Base
* @constructor
*/
function Base() {}
Base.prototype.perform = function Base_perform() {};
return Base;
})();
var Dog = (function DogClosure() {
/**
* Dog
* @constructor
*/
function Dog() {}
Dog.prototype = Object.create(Base.prototype);
Dog.prototype.perform = function Dog_perform() {};
return Dog;
})();
var Cat = (function CatClosure() {
/**
* Cat
* @constructor
*/
function Cat() {}
Cat.prototype = Object.create(Base.prototype);
Cat.prototype.perform = function Cat_perform() {};
return Cat;
})();
}).call((typeof window === 'undefined') ? this : window);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment