Permalink
Browse files

license and module fix

  • Loading branch information...
1 parent 8cae767 commit 49c920a326a1bb84b21c4a89ea5fb6734dce1c45 @pedronasser pedronasser committed Dec 27, 2012
Showing with 37 additions and 16 deletions.
  1. +15 −3 LICENSE
  2. +22 −13 source/core/base/wnModule.js
View
18 LICENSE
@@ -1,7 +1,19 @@
Copyright (c) 2012 Pedro Nasser <pedronasser@yept.net>
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom
+the Software is furnished to do so, subject to the following conditions:
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -456,20 +456,29 @@ module.exports = {
return _modules[id];
else if (this.hasComponent('classBuilder'))
{
- var config = _modulesConfig[id] || {},
- modulePath = config.modulePath || id,
- className = config.class;
- if (fs.existsSync(modulePath) && className != undefined)
+ try {
+
+ var config = _modulesConfig[id] || {},
+ modulePath = config.modulePath || id,
+ className = config.class;
+ if (fs.existsSync(modulePath) && className != undefined)
+ {
+ config.id = id;
+ config.autoInit = !(config.autoInit == false);
+ var module = this.createModule(className,modulePath,config)
+ _modules[id] = module;
+ this.attachModuleEvents(id);
+ module.e.ready(modulePath,config);
+ return _modules[id];
+ } else
+ return false;
+ } catch (e)
{
- config.id = id;
- config.autoInit = !(config.autoInit == false);
- var module = this.createModule(className,modulePath,config)
- _modules[id] = module;
- this.attachModuleEvents(id);
- module.e.ready(modulePath,config);
- return _modules[id];
- } else
- return false;
+ this.e.log&&
+ this.e.log('wnModule.getModule: Error at loading `'+id+'`');
+ this.e.exception&&
+ this.e.exception(e);
+ }
}
},

0 comments on commit 49c920a

Please sign in to comment.