Skip to content

Commit

Permalink
Merge pull request #17841 from rwjblue/fix-sort
Browse files Browse the repository at this point in the history
[BUGFIX] Ensure @sort works on non-Ember.Objects.
  • Loading branch information
pzuraq committed Apr 3, 2019
2 parents d059ad6 + 00a0c0b commit 4b099ee
Show file tree
Hide file tree
Showing 2 changed files with 477 additions and 464 deletions.
10 changes: 8 additions & 2 deletions packages/@ember/object/lib/computed/reduce_computed_macros.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
*/
import { DEBUG } from '@glimmer/env';
import { assert } from '@ember/debug';
import { get, computed, addObserver, removeObserver } from '@ember/-internals/metal';
import {
get,
computed,
addObserver,
removeObserver,
notifyPropertyChange,
} from '@ember/-internals/metal';
import { compare, isArray, A as emberA, uniqBy as uniqByArray } from '@ember/-internals/runtime';

function reduceMacro(dependentKey, callback, initialValue, name) {
Expand Down Expand Up @@ -1427,7 +1433,7 @@ function propertySort(itemsKey, sortPropertiesKey) {

if (!sortPropertyDidChangeMap.has(this)) {
sortPropertyDidChangeMap.set(this, function() {
this.notifyPropertyChange(key);
notifyPropertyChange(this, key);
});
}

Expand Down
Loading

0 comments on commit 4b099ee

Please sign in to comment.