Browse files

make the loader a bit more robust

  • Loading branch information...
1 parent 0171170 commit a139ac106258228b574cf7a8c332af102de34ad1 @janodvarko committed Feb 28, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 content/loader.js
View
6 content/loader.js
@@ -43,7 +43,7 @@ var Loader =
try
{
- var module = this.currentModule.pop();
+ var module = this.currentModule[this.currentModule.length-1];
module.exports = callback.apply(module.scope, args);
}
catch (err)
@@ -73,6 +73,10 @@ var Loader =
{
Cu.reportError(err);
}
+ finally
+ {
+ this.currentModule.pop();
+ }
// Exports (the module return value in case of AMD) is set in define function.
return module.exports;

0 comments on commit a139ac1

Please sign in to comment.