yui/yui3 — pull request #1360 by caridy (2013-10-30 19:14:09+00:00)
Title: Preserving [global] as [this] when executing a yui module in nodejs.

* when executing a module that has some code other than of the `YUI.add()` statement, that code
is suppose to run in a closure where `this` is equal to nodejs' `global` variable,
which is the equivalent to `window` on the browser. That way we maintain feature
parity for polyfills and other vendor scripts.

Here is an example:

```
(function (global) {
// this is a very common pattern for polyfills
global.bar = 1;
})(this);

YUI.add('foo', function (Y) {
// Y.config.global.bar === 1;
}, '', {});
```

In nodejs, `Y.config.global` is `global`, while on the browser, it is `window`. The problem here is that `this` is not `global` when executing the polyfill code, but on the browser is it `window`. This PR is meant to solve this inconsistency.

_Note: this change is very low risk because YUI developers are normally not dealing with this use-case, but in the near future they will see more and more of this when we start using more polyfills across the board._

## TODO

* [ ] tests