About halfway through converting all tags to async

This commit is contained in:
Tim Hardy
2016-09-18 01:23:29 -05:00
parent ba390df7b6
commit dc85c80afe
8 changed files with 61 additions and 13 deletions
+2 -2
View File
@@ -38,12 +38,12 @@ var render = {
renderTag: function(template, scope, register) {
if (template.name === 'continue') {
scope.set('forloop.skip', true);
return;
return Promise.resolve('');
}
if (template.name === 'break') {
scope.set('forloop.stop', true);
scope.set('forloop.skip', true);
return;
return Promise.resolve('');
}
return template.render(scope, register);
},
+2 -1
View File
@@ -1,4 +1,5 @@
const lexical = require('./lexical.js');
const Promise = require('any-promise');
const Exp = require('./expression.js');
const TokenizationError = require('./error.js').TokenizationError;
@@ -21,7 +22,7 @@ module.exports = function() {
var reg = register[this.name];
if(!reg) reg = register[this.name] = {};
var obj = hash(this.token.args, scope);
return this.tagImpl.render && this.tagImpl.render(scope, obj, reg) || '';
return this.tagImpl.render && this.tagImpl.render(scope, obj, reg) || Promise.resolve('');
},
parse: function(token, tokens){
this.type = 'tag';