jrburke/requirejs — pull request #1031 by gartz (2014-02-17 21:18:19+00:00)
Title: Added optional extended context feature

Extended Context is a feature, that when using the `Define`or `Require` with AMD (not compatibility mode) it apply in the callback function the context that contains re-maped objects with dependence exports and it prototype the `root` element (root on the nodejs or window in browsers).

Need to add a config `extContext: true` to enable this feature, so it doesn't change for the current projects.

When enabled, it still retro-compatible.

Usage example:

```
define(['moduleA', 'submodule/moduleB', '../parentModuleC'], function () {
console.log(this);
this.moduleA; // return moduleA export
this.submodule.moduleB; // return submodule/moduleB export
this.parentDir.parentModuleC // return ../parentModuleC export
});
```

When we are using requirejs in huge projects, it's commun to import a big list of dependences for a module, to maintain the argument list in order is a challange. This way the order doesn't matter. And is very easy to debbug the modules export available in the context.