Created
July 11, 2011 07:41
-
-
Save michaelsbradleyjr/1075436 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
// NEW LOADING STYLE | |
var Joose = require('joose')() // NOTE the trailing `()` | |
/* ------- in main Joose ------- */ | |
var Joose = function Joose(jsan) { // NOTE the leading `var` | |
Joose.top = this | |
Joose.jsan = jsan | |
Joose.Namespace.Manager.my = new Joose.Namespace.Manager() | |
Joose.Namespace.Manager.my.register('Class', Joose.Meta.Class) | |
Joose.Namespace.Manager.my.register('Role', Joose.Meta.Role) | |
Joose.Namespace.Manager.my.register('Module') | |
return Joose | |
} | |
// Joose.top = this | |
... | |
// exports for NodeJS | |
if (Joose.is_NodeJS) { module.exports = Joose } | |
/* ------- in Joose.NameSpace.Manager ------- */ | |
methods : { | |
initialize : function () { | |
var globalKeeper = this.global = new Joose.Namespace.Keeper('').c | |
var globalNs = this.globalNs = globalKeeper.meta.ns | |
globalNs.container = Joose.top | |
/* --- globalNs.container = Joose.is_NodeJS && global || Joose.top --- */ | |
globalKeeper.meta.parentNs = globalKeeper | |
this.current = [ globalKeeper ] | |
}, | |
... | |
/*Joose.Namespace.Manager.my = new Joose.Namespace.Manager() | |
Joose.Namespace.Manager.my.register('Class', Joose.Meta.Class) | |
Joose.Namespace.Manager.my.register('Role', Joose.Meta.Role) | |
Joose.Namespace.Manager.my.register('Module')*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment