Comparing version 0.8.1 to 0.8.2
@@ -83,2 +83,6 @@ 'use strict'; | ||
if (_.isUndefined(content)) { | ||
return; | ||
} | ||
// Prevent useless copies (might happen if exports is used) | ||
@@ -85,0 +89,0 @@ if (this.content === content) { |
@@ -110,3 +110,3 @@ 'use strict'; | ||
if (_.isFunction(module)) { | ||
return module.apply(global, this.computeArgs(parent, replace, module)); | ||
return module.apply(parent.content, this.computeArgs(parent, replace, module)); | ||
} | ||
@@ -168,3 +168,3 @@ | ||
dep = path.shift(); | ||
if (dep in replace) { | ||
@@ -171,0 +171,0 @@ dep = replace[dep]; |
{ | ||
"name": "r42", | ||
"version": "0.8.1", | ||
"version": "0.8.2", | ||
"description": "Dependency injection done right.", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -237,6 +237,18 @@ ## r42 | ||
return exports; | ||
return exports; // optional | ||
}); | ||
``` | ||
exports is also accessible without injection using `this`: | ||
```js | ||
define(function(exports) { | ||
this.fnA = function() { | ||
// ... | ||
}; | ||
// ... | ||
}); | ||
``` | ||
##### Other load mechanism | ||
@@ -477,2 +489,7 @@ | ||
#### 0.8.2 | ||
* make `return` optional in modules (prepare for deprecation) | ||
* add `this` in module definitions as an alias to `exports` | ||
#### 0.8.1 | ||
@@ -479,0 +496,0 @@ |
Sorry, the diff of this file is not supported yet
38045
597
561