Last active
August 29, 2015 14:05
-
-
Save jonobr1/aeffaba1fa3387c2c8b3 to your computer and use it in GitHub Desktop.
Export private class to external object.
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
/* | |
* Base class | |
*/ | |
(function() { | |
var root = this; | |
var previousBase = root.Base || {}; | |
var foo = 1; | |
var Base = root.Base = { | |
version: foo, | |
noConflict: function() { | |
root.Base = previousBase; | |
return Base; | |
} | |
}; | |
})(); | |
/** | |
* Subsidiary class | |
*/ | |
(function() { | |
var foo = 5; | |
var Child = Base.Child = function() { }; | |
Child.prototype.age = foo; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment