Permalink
Browse files

Allow multiple namespace() calls with the same name to not override e…

…ach other. #144

The original behavior is that calling namespace() multiple times with
the same name will cause the old namespace to be overridden.

This commit makes it so that instead of the old namespace being
overridden, it is extended. This is the same as when calling
task() multiple times.
  • Loading branch information...
1 parent 060e84d commit d315cfa86d30c3ec5eaab3026e8e2db375198eb2 Chakrit Wichian committed Aug 17, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/api.js
View
@@ -147,7 +147,7 @@ var api = new (function () {
*/
this.namespace = function (name, scope) {
var curr = jake.currentNamespace
- , ns = new jake.Namespace(name, curr);
+ , ns = curr.childNamespaces[name] || new jake.Namespace(name, curr);
curr.childNamespaces[name] = ns;
jake.currentNamespace = ns;
scope();

0 comments on commit d315cfa

Please sign in to comment.