Skip to content

Commit

Permalink
If result of evaluated javascript is a number return it as Dimension.
Browse files Browse the repository at this point in the history
  • Loading branch information
lesswtf committed Dec 30, 2013
1 parent 3a0f97e commit 216facd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/less/tree/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(', '));
Expand Down

0 comments on commit 216facd

Please sign in to comment.