scottjehl/picturefill — pull request #364 by meinaart (2014-10-31 16:07:53+00:00)
Title: Always expose picturefill on window object when in browser.

This pull request makes sure that picturefill will always be registered on the window object. Even when an AMD loader is available.

**Why do this even when AMD is available?**
If you want to asynchronously load picturefill in the `

` and are loading an AMD loader further down the page it's possible that picturefill will register itself as an AMD module even though that might not have been the intention.

To make picturefill behave more predictable we always register it on the `window` object also. This way you can use it both as an AMD module as well as using it outside of an AMD loader.

See discussion in https://github.com/scottjehl/picturefill/pull/345. This would also solve the issue described in that pull request.

This is probably a cleaner solution. Although it would go against a pure AMD pattern. I think the benefits outweight the downsides here. So I would actually prefer this PR over #345.