Permalink
Browse files

- added a hook for meta preparation

  • Loading branch information...
1 parent 4ac880b commit 2487e6aa30d18ff3c31e866b71e46c4d0c87454b Nickolay Platonov committed Apr 15, 2011
Showing with 9 additions and 1 deletion.
  1. +9 −1 lib/Joose/Namespace/Manager.js
@@ -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
@@ -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
@@ -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

0 comments on commit 2487e6a

Please sign in to comment.