Created
June 25, 2012 17:09
-
-
Save sekimura/2989933 to your computer and use it in GitHub Desktop.
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 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