emberjs/ember.js — pull request #4063 by mmpestorich (2014-01-04 20:17:16+00:00)
Title: Allow Ember.computed.sort to use property paths in sortDefinitions.

`Ember.computed.sort` only works if sortDefinitions contain simple properties. It will fail if a `sortDefinition` contains a property path (i.e. somehting like `person.name`).

A `SearchProxy` is used to shadow the new value of an underlying property with the old value to ensure proper comparisons take place while searching for an item in the sorted array. When using a property path rather than a simple property to sort on, `SearchProxy` will use the actual property path in its attempt to shadow underlying properties - something like: `{ person.name: 'John Doe' }`. This causes things to blow up because every comparison between an existing item `get(itemA, sortProperty)` and a search proxy `get(itemB, sortProperty)` will return a bogus result. In this case, `get(itemB, 'person.name')` will not return the shadowed value (stored as `{ person.name: 'John Doe' } `) but rather the current value of that path on the search proxy's underlying `content`.

This commit allows a proper comparison to take place when a `sortDefinition` contains a property path.