emberjs/ember.js — pull request #1361 by owilliams (2012-09-10 19:36:39+00:00)
Title: Allow Handlebars definition passed by AMD (RequireJS)

I'm using [RequireJS](http://requirejs.org/) in my ember project, and including ember and handlebars using the [shim configuration](http://requirejs.org/docs/api.html#config-shim) (where handlebars is declared as a dependancy of ember). This works fine in development mode but unfortunately when the [optimize step](http://requirejs.org/docs/optimization.html) is run using r.js I get the following assertions error:

```Uncaught Error: assertion failed: Ember Handlebars requires Handlebars 1.0.beta.5 or greater```

This is because Ember explicitly checks the ```window``` namespace for ```Handlebars```, but because it is wrapped in an AMD module it is not avilable in the global namespace.

By not explicitly checking ```window.Handlebars``` Ember is able to use the non-global ```Handlebars``` version supplied by the AMD module.