Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

- further cleanup

  • Loading branch information...
commit 4ac880b092c6bae4b828a3a941751c40f3941876 1 parent 134f3d4
Nickolay Platonov authored
Showing with 8 additions and 22 deletions.
  1. +3 −14 lib/Joose/Namespace/Keeper.js
  2. +5 −8 lib/Joose/Namespace/Manager.js
17 lib/Joose/Namespace/Keeper.js
View
@@ -1,8 +1,8 @@
Joose.Namespace.Keeper = new Joose.Meta.Class('Joose.Namespace.Keeper', {
- isa : Joose.Meta.Class,
+ isa : Joose.Meta.Class,
- have : {
+ have : {
externalConstructor : null
},
@@ -10,6 +10,7 @@ Joose.Namespace.Keeper = new Joose.Meta.Class('Joose.Namespace.Keeper', {
methods: {
defaultConstructor: function () {
+
return function () {
//constructors should assume that meta is attached to 'arguments.callee' (not to 'this')
var thisMeta = arguments.callee.meta
@@ -33,25 +34,13 @@ Joose.Namespace.Keeper = new Joose.Meta.Class('Joose.Namespace.Keeper', {
//withClass should be not constructed yet on this stage (see Joose.Proto.Class.construct)
//it should be on the 'constructorOnly' life stage (should already have constructor)
plant: function (withClass) {
- this.copyNamespaceState(withClass)
-
var keeper = this.c
keeper.meta = withClass.meta
keeper.meta.c = keeper
keeper.meta.externalConstructor = withClass
- },
-
-
- copyNamespaceState : function (targetClass) {
- var targetMeta = targetClass.meta
-
- targetMeta.parentNs = this.parentNs
-
- targetMeta.ns = this.ns
}
-
}
}).c
13 lib/Joose/Namespace/Manager.js
View
@@ -1,8 +1,6 @@
Joose.Namespace.Manager = new Joose.Managed.Class('Joose.Namespace.Manager', {
have : {
- global : null,
-
current : null
},
@@ -10,9 +8,6 @@ Joose.Namespace.Manager = new Joose.Managed.Class('Joose.Namespace.Manager', {
methods : {
initialize : function () {
- // backward compat, is used in JXND, pending for removal
- this.global = Joose.top
-
this.current = [ Joose.top ]
},
@@ -158,8 +153,10 @@ Joose.Namespace.Manager = new Joose.Managed.Class('Joose.Namespace.Manager', {
return me[ helperName ].apply(me, arguments)
}
- if (!Joose.top[ helperName ]) Joose.top[ helperName ] = helper
- if (!Joose[ helperName ]) Joose[ helperName ] = helper
+ if (!Joose.top[ helperName ]) Joose.top[ helperName ] = helper
+ if (!Joose[ helperName ]) Joose[ helperName ] = helper
+
+ if (Joose.is_NodeJS && typeof exports != 'undefined') exports[ helperName ] = helper
} else {
var methods = {}
@@ -190,4 +187,4 @@ 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')
+Joose.Namespace.Manager.my.register('Module')
Please sign in to comment.
Something went wrong with that request. Please try again.