Skip to content
Browse files

Merge pull request #25 from pedronasser/master

license and module fix
  • Loading branch information...
2 parents be2bc88 + 49c920a commit f1c0860e14f927477ad45868d5e36bebf591eda7 Pedro Nasser committed
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.
View
35 source/core/base/wnModule.js
@@ -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 f1c0860

Please sign in to comment.
Something went wrong with that request. Please try again.