less/less.js — pull request #2015 by seven-phases-max (2014-05-17 16:30:40+00:00)
Title: Reworked guard comparison.

**Changes:**

*[1]*. Fixes #1180 case (4).
*[2]*. Adds support for list/array values comparison (#2003 test (4)).

*[3]*. Fixes #2009, #1725. I've simply "disabled" greater/less operators for anything except "number vs. number" and "quoted string vs. quoted string" comparisons. The main show-stopper for other cases ("unquoted string vs. unquoted string vs. anything else" in particular) is that after all it comes to the toCSS-based comparison and thus brings all those "nice" side effects of the alphabetical `>`/`<` ops with weird results like:
```
abc > "abc" // true
6em > "7" // true
1px < ~"1" // true
1 < ~"1 " // true
```
It's not really a big deal to put more consistency for such comparisons but the code quickly becomes too bloated (handling all those Keyword, Anonymous, escaped Quoted and their combinations) to be worth probably never existing use-cases (assuming [this rationale](https://github.com/less/less.js/pull/1798#issuecomment-32154454)). In fact I was even thinking of disabling the greater/less stuff for quoted strings too (as it feels quite weird to support quoted strings more than the unquoted) but I decided to keep it for a sort of "demo" purposes (i.e. just to keep corresponding functions and code structure set up for possible changes (if any)).