emberjs/ember.js — pull request #4774 by marcioj (2014-04-26 21:43:38+00:00)
Title: [BUGFIX beta] Use controller keywords to get the current context control...

...ler

When using the `with` helper with the `controller` option, the controller instance is created via [this.container](https://github.com/emberjs/ember.js/blob/c25a546997edcc24522394bcb3526d915003075b/packages_es6/ember-handlebars/lib/helpers/binding.js#L90), where `this` is expected to be a controller instance.

But the `this` context can be changed, for instance with the `each` helper:

{{#each}}
{{#with this controller="foo"}}
...
{{/with}}
{{/each}}

Causing an `Uncaught TypeError: Cannot read property 'lookupFactory' of undefined `.
This is a [jsbin](http://emberjs.jsbin.com/jupoyabo/2/edit) showing the problem

//cc @bcardarella