[Pkg-javascript-commits] [node-jade] 34/72: Fix normalization and test
Jelmer Vernooij
jelmer at moszumanska.debian.org
Sun Jul 3 18:03:27 UTC 2016
This is an automated email from the git hooks/post-receive script.
jelmer pushed a commit to annotated tag upstream/1.0.0
in repository node-jade.
commit 6721fe322449b1cfb2055178101ec1afdd00aec4
Author: Timothy Gu <timothygu99 at gmail.com>
Date: Thu Jul 2 22:31:43 2015 -0700
Fix normalization and test
---
index.js | 9 ++++++---
test/compile.js | 2 +-
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/index.js b/index.js
index 70f1d22..fc00783 100644
--- a/index.js
+++ b/index.js
@@ -132,9 +132,12 @@ Transformer.prototype.compile = function (str, options) {
if (!this.can('compile')) {
if (this.can('render')) {
var _this = this;
- return tr.normalizeFn(function (locals) {
- return tr.normalize(_this._tr.render(str, options, locals));
- });
+ return {
+ fn: function (locals) {
+ return tr.normalize(_this._tr.render(str, options, locals)).body;
+ },
+ dependencies: []
+ };
}
if (this.can('compileAsync')) {
throw new Error('The Transform "' + this.name + '" does not support synchronous compilation');
diff --git a/test/compile.js b/test/compile.js
index 3b7d726..8f86ff0 100644
--- a/test/compile.js
+++ b/test/compile.js
@@ -62,5 +62,5 @@ test('compile - without tr.compile, but with tr.render => fn', function () {
return locals.name;
}
});
- assert.equal(tr.compile('example input').fn({name: 'hola'}).body, 'hola');
+ assert.equal(tr.compile('example input').fn({name: 'hola'}), 'hola');
});
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-jade.git
More information about the Pkg-javascript-commits
mailing list