mirror of
https://github.com/less/less.js.git
synced 2026-05-01 03:00:22 -04:00
putting the operate function in operation.js, to facilitate access from browser code
This commit is contained in:
@@ -1,11 +1 @@
|
||||
var tree = exports;
|
||||
|
||||
tree.operate = function (op, a, b) {
|
||||
switch (op) {
|
||||
case '+': return a + b;
|
||||
case '-': return a - b;
|
||||
case '*': return a * b;
|
||||
case '/': return a / b;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -20,3 +20,11 @@ tree.Operation.prototype.eval = function (env) {
|
||||
return a.operate(this.op, b);
|
||||
};
|
||||
|
||||
tree.operate = function (op, a, b) {
|
||||
switch (op) {
|
||||
case '+': return a + b;
|
||||
case '-': return a - b;
|
||||
case '*': return a * b;
|
||||
case '/': return a / b;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user