Skip to content

Commit

Permalink
Fixes #19 - Fixed issue with multiple classes and multiple namespaces…
Browse files Browse the repository at this point in the history
… in the same file
  • Loading branch information
davglass committed Jan 17, 2012
1 parent bf0cf2e commit 967835b
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
22 changes: 22 additions & 0 deletions lib/docparser.js
Expand Up @@ -615,8 +615,21 @@ Y.log('param name/type/descript missing: ' + stringlog(block), 'warn', 'docparse

var mod = this.get(CURRENT_CLASS);
if (mod) {
var lastNS = this.get('lastnamespace');
if (lastNS && lastNS !== value) {
if (this.classes[mod]) {
var m = this.classes[mod];
delete this.classes[mod];
mod = value + '.' + mod.replace(lastNS + '.', '');
m.name = mod;
m.namespace = value;
this.classes[mod] = m;
this.set(CURRENT_CLASS, m.name);
}
}
if (this.classes[mod]) {
this.classes[mod].namespace = value;

if (mod.indexOf(value + '.') === -1) {
if (mod.indexOf('.') === -1) {
var m = this.classes[mod];
Expand Down Expand Up @@ -855,6 +868,15 @@ Y.log('param name/type/descript missing: ' + stringlog(block), 'warn', 'docparse
//console.log('SETTING CURRENT SUBMODULE: ', val, 'ON CLASS', this.get(CURRENT_CLASS));
return val;
}
},
currentnamespace: {
setter: function(val) {
this.set('lastnamespace', this.get(CURRENT_NAMESPACE));
return val;
}
},
lastnamespace: {

},
lastclass: {

Expand Down
29 changes: 29 additions & 0 deletions tests/test2/namespace.js
@@ -0,0 +1,29 @@
/**
* @module P.storage
*/

/**
* @class Store
* @constructor
* @namespace P.storage
*/
// definition of Store and Store.prototype

/**
* @class LocalStore
* @constructor
* @extends P.storage.Store
* @namespace P.storage
*/
// definition of LocalStore and LocalStore.prototype

/**
* @class storage
* @namespace P
*/

/**
* @private
* @property {Array} _storageMechanisms
* @static
*/

0 comments on commit 967835b

Please sign in to comment.