summaryrefslogtreecommitdiff
path: root/bin/lib/less/tree/condition.js
diff options
context:
space:
mode:
Diffstat (limited to 'bin/lib/less/tree/condition.js')
-rw-r--r--bin/lib/less/tree/condition.js42
1 files changed, 0 insertions, 42 deletions
diff --git a/bin/lib/less/tree/condition.js b/bin/lib/less/tree/condition.js
deleted file mode 100644
index 6b79dc96..00000000
--- a/bin/lib/less/tree/condition.js
+++ /dev/null
@@ -1,42 +0,0 @@
-(function (tree) {
-
-tree.Condition = function (op, l, r, i, negate) {
- this.op = op.trim();
- this.lvalue = l;
- this.rvalue = r;
- this.index = i;
- this.negate = negate;
-};
-tree.Condition.prototype.eval = function (env) {
- var a = this.lvalue.eval(env),
- b = this.rvalue.eval(env);
-
- var i = this.index, result;
-
- var result = (function (op) {
- switch (op) {
- case 'and':
- return a && b;
- case 'or':
- return a || b;
- default:
- if (a.compare) {
- result = a.compare(b);
- } else if (b.compare) {
- result = b.compare(a);
- } else {
- throw { type: "Type",
- message: "Unable to perform comparison",
- index: i };
- }
- switch (result) {
- case -1: return op === '<' || op === '=<';
- case 0: return op === '=' || op === '>=' || op === '=<';
- case 1: return op === '>' || op === '>=';
- }
- }
- })(this.op);
- return this.negate ? !result : result;
-};
-
-})(require('../tree'));