andyearnshaw/Intl.js — pull request #22 by caridy (2013-10-30 22:01:35+00:00)
Title: using standard polyfill wrapping pattern to access global scope in multiple runtimes

Accessing `window` object directly is not recommended because it bound this polyfill to a browser. Other polyfills are using a more elegant solution to access the global scope.

With this PR, we can guarantee:

* using `this` (which is `window` in the browser, and `global` in nodejs) as the global scope to augment it with `Intl` member.
* preserving `OldIntl` on the global scope (even though it is not used in this script at the moment).
* a new `Intl` will be created everytime that this script gets evaluated.