zendesk/ember.js — pull request #37 by jamesarosen (2014-01-24 00:54:10+00:00)
Title: _templateContext: returns controller if available when preserving context

In Ember 1.0, a view's template context is

1. `view.controller` if that exists
1. `view.parentView.context` otherwise

We back-ported (b), but not (a). This adds the check for `controller`.

This breaks certain tests. Specifically, there are Handlebars tests that create view that has a controller property, which would change the context of the view's template. To fix these tests, I changed `controller` to `myController`.

One of the tests still fails when `VIEW_PRESERVES_CONTEXT` is `true` because the property is relative to the view, but accessed without the `view.` prefix. The test name ends in "respects keywords", which makes me believe the test *should* have `view.`, regardless of the controller changes.