lib/less/js/lib/less/tree/quoted.js in less-2.3.0 vs lib/less/js/lib/less/tree/quoted.js in less-2.3.1
- old
+ new
@@ -18,12 +18,26 @@
var that = this;
var value = this.value.replace(/`([^`]+)`/g, function (_, exp) {
return new(tree.JavaScript)(exp, that.index, true).eval(env).value;
}).replace(/@\{([\w-]+)\}/g, function (_, name) {
var v = new(tree.Variable)('@' + name, that.index).eval(env);
- return ('value' in v) ? v.value : v.toCSS();
+ return (v instanceof tree.Quoted) ? v.value : v.toCSS();
});
return new(tree.Quoted)(this.quote + value + this.quote, value, this.escaped, this.index);
+ },
+ compare: function (x) {
+ if (!x.toCSS) {
+ return -1;
+ }
+
+ var left = this.toCSS(),
+ right = x.toCSS();
+
+ if (left === right) {
+ return 0;
+ }
+
+ return left < right ? -1 : 1;
}
};
})(require('../tree'));