lib/less/js/lib/less/tree/dimension.js in less-2.0.8 vs lib/less/js/lib/less/tree/dimension.js in less-2.0.9

- old
+ new

@@ -26,9 +26,24 @@ // `101cm`. operate: function (op, other) { return new(tree.Dimension) (tree.operate(op, this.value, other.value), this.unit || other.unit); + }, + + // TODO: Perform unit conversion before comparing + compare: function (other) { + if (other instanceof tree.Dimension) { + if (other.value > this.value) { + return -1; + } else if (other.value < this.value) { + return 1; + } else { + return 0; + } + } else { + return -1; + } } }; })(require('../tree'));