From 216facd033751160a5ca72cb99ecc949adb2ba61 Mon Sep 17 00:00:00 2001 From: lesswtf Date: Mon, 30 Dec 2013 05:11:24 +0300 Subject: [PATCH] If result of evaluated javascript is a number return it as Dimension. --- lib/less/tree/javascript.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/less/tree/javascript.js b/lib/less/tree/javascript.js index dc7910c48..0b0a12944 100644 --- a/lib/less/tree/javascript.js +++ b/lib/less/tree/javascript.js @@ -39,7 +39,9 @@ tree.JavaScript.prototype = { throw { message: "JavaScript evaluation error: '" + e.name + ': ' + e.message + "'" , index: this.index }; } - if (typeof(result) === 'string') { + if (typeof(result) === 'number') { + return new(tree.Dimension)(result); + } else if (typeof(result) === 'string') { return new(tree.Quoted)('"' + result + '"', result, this.escaped, this.index); } else if (Array.isArray(result)) { return new(tree.Anonymous)(result.join(', '));