When I use DESC with OrderBy, the 'this' in mlang.DESC is 'window'.
The OrderBy without DESC is working just fine.
The DAO in question has been in use for some time, but it's the first time I've called it with an OrderBy with Desc.
Thanks for any ideas.
Joel
dao = dao.orderBy(
//this.Workorder.START_DATE
this.DESC(this.Workorder.START_DATE)
//this.Desc.create({arg1: this.Workorder.START_DATE},this)
);
A DAO {
select_(x, sink, skip, limit, order, predicate) {
...
var arr = [];
...
var unique = this.sortUnique(arr, order, predicate);
}
function sortUnique(arr, order, predicate) {
var unique = [];
...
return unique.sort(order.compare); invokes Desc.compare (below)
}
}
mlang.order.Desc
methods: [
function compare(o1, o2) {
return -1 * this.arg1.compare(o1, o2);
},
'this' is window