You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(orderBy): maintain order in array of objects when predicate is not provided
In ES262, there are two properties which are used to get a primitive value from an Object:
- valueOf() -- a method which returns a primitive value represented by the Object
- toString() -- a method which returns a string value representing the Object.
When comparing objects using relational operators, the abstract operation ToPrimitive(O, TypeHint) is used,
which will use these methods to retrieve a value.
This CL emulates the behaviour of ToPrimitive(), and ensures that no ordering occurs if the retrieved value
is identical.
This behaviour was previously used for Date objects, however it can be safely made generic as it applies to
all objects.
Closesangular#9566Closesangular#9747Closesangular#10311
0 commit comments