[Pkg-javascript-commits] [less.js] 78/285: Pass options object to parser.parse in less.render.

Jonas Smedegaard dr at jones.dk
Mon Oct 26 23:23:40 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag v2.0.0
in repository less.js.

commit f16cc895705e4dd159594c4d49d1615fce3b6b2e
Author: Rasmus Back <rasmus.back at reaktor.fi>
Date:   Mon Mar 10 17:04:05 2014 +0200

    Pass options object to parser.parse in less.render.
---
 lib/less/index.js   |  4 ++--
 test/modify-vars.js | 17 +++++++++++++++++
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/lib/less/index.js b/lib/less/index.js
index 1324c6c..5ddfa4c 100644
--- a/lib/less/index.js
+++ b/lib/less/index.js
@@ -27,7 +27,7 @@ var less = {
                 }
                 catch (err) { callback(err); return; }
                 callback(null, css);
-            });
+            }, options);
         } else {
             ee = new (require('events').EventEmitter)();
 
@@ -36,7 +36,7 @@ var less = {
                     if (e) { return ee.emit('error', e); }
                     try { ee.emit('success', root.toCSS(options)); }
                     catch (err) { ee.emit('error', err); }
-                });
+                }, options);
             });
             return ee;
         }
diff --git a/test/modify-vars.js b/test/modify-vars.js
new file mode 100644
index 0000000..c4c6c5b
--- /dev/null
+++ b/test/modify-vars.js
@@ -0,0 +1,17 @@
+var less = require('../lib/less'),
+  fs = require('fs')
+
+var input = fs.readFileSync("./test/less/modifyVars/extended.less", 'utf8')
+var expectedCss = fs.readFileSync('./test/css/modifyVars/extended.css', 'utf8')
+var options = {
+  modifyVars: JSON.parse(fs.readFileSync("./test/less/modifyVars/extended.json", 'utf8'))
+}
+
+less.render(input, options, function (err, css) {
+  if (err) console.log(err);
+  if (css === expectedCss) {
+    console.log("PASS")
+  } else {
+    console.log("FAIL")
+  }
+})
\ No newline at end of file

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/less.js.git



More information about the Pkg-javascript-commits mailing list