Merge branch 'v1.0'

Conflicts:
	package.json
This commit is contained in:
Patrick Steele-Idem 2014-05-08 23:22:02 -06:00
commit 54409d9e2e
2 changed files with 17 additions and 5 deletions

View File

@ -49,12 +49,15 @@ function Template(renderFunc) {
}
Template.prototype = {
render: function(data, callback, context) {
render: function(data, context) {
if (data == null) {
data = {};
}
if (typeof callback === 'function') {
var callback;
if (typeof context === 'function') {
callback = context;
context = new Context();
context
@ -67,11 +70,17 @@ Template.prototype = {
context.end();
} else {
var shouldEnd = false;
if (!context) {
context = new Context();
shouldEnd = true;
}
// A context object was provided instead of a callback
context = callback;
callback = null;
this._(data, context); //Invoke the template rendering function with the required arguments
if (shouldEnd) {
context.end();
}
}
return context;

View File

@ -281,6 +281,9 @@ module.exports = function transform(node, compiler, template) {
},
'c-input': function(attr) {
inputAttr = attr.value;
},
'c-data': function(attr) {
inputAttr = attr.value;
}
};