Skip to content

Commit

Permalink
- added a hook for meta preparation
Browse files Browse the repository at this point in the history
  • Loading branch information
Nickolay Platonov committed Apr 15, 2011
1 parent 4ac880b commit 2487e6a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/Joose/Namespace/Manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Joose.Namespace.Manager = new Joose.Managed.Class('Joose.Namespace.Manager', {

//this function establishing the full "namespace chain" (including the last element)
create : function (nsName, metaClass, extend) {

//if no name provided, then we creating an anonymous class, so just skip all the namespace manipulations
if (!nsName) return new metaClass(nsName, extend).c

Expand Down Expand Up @@ -100,7 +101,10 @@ Joose.Namespace.Manager = new Joose.Managed.Class('Joose.Namespace.Manager', {

} else
if (isLast && !(cur && cur.meta && cur.meta.meta)) throw "Trying to setup module " + soFarName + " failed. There is already something: " + cur


// hook to allow embedd resource into meta
if (isLast) this.prepareMeta(cur.meta)

if (needFinalize) cur.meta.construct(props)

object = cur
Expand All @@ -110,6 +114,10 @@ Joose.Namespace.Manager = new Joose.Managed.Class('Joose.Namespace.Manager', {
},


prepareMeta : function () {
},


prepareProperties : function (name, props, defaultMeta, callback) {
if (name && typeof name != 'string') {
props = name
Expand Down

0 comments on commit 2487e6a

Please sign in to comment.