[Pkg-javascript-commits] [less.js] 01/25: Pass options object to parser.parse in less.render.
Jonas Smedegaard
dr at jones.dk
Mon Oct 26 23:23:09 UTC 2015
This is an automated email from the git hooks/post-receive script.
js pushed a commit to annotated tag v1.7.5
in repository less.js.
commit ef1566c8980e7d09c2657f2ce1bf394f58e5f0e1
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 348a5d8..3be8672 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