From dc45573cf9ead19da355872e6fbbd6270737453f Mon Sep 17 00:00:00 2001 From: Matt Brennan Date: Tue, 30 Jul 2013 16:56:14 +0100 Subject: [PATCH] Better "JavaScript evaluation error" message Less's messages for JavaScript evaluation errors do not contain the actual error thrown, making them very hard to debug. This PR adds the error message to the log. --- lib/less/tree/javascript.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/less/tree/javascript.js b/lib/less/tree/javascript.js index eaa9c0fe..b196b2b7 100644 --- a/lib/less/tree/javascript.js +++ b/lib/less/tree/javascript.js @@ -19,7 +19,7 @@ tree.JavaScript.prototype = { try { expression = new(Function)('return (' + expression + ')'); } catch (e) { - throw { message: "JavaScript evaluation error: `" + expression + "`" , + throw { message: "JavaScript evaluation error: " + e.message + " from `" + expression + "`" , index: this.index }; }