fix include scope.blocks bleeding

This commit is contained in:
harttle
2016-11-06 14:57:48 +08:00
parent c100a2e25e
commit 258f4a2073
9 changed files with 95 additions and 52 deletions
+7 -3
View File
@@ -147,13 +147,17 @@ function matchRightBracket(str, begin) {
return -1;
}
exports.factory = function(_ctx, opts) {
exports.factory = function(ctx, opts) {
opts = _.assign({
strict: false
strict: false,
blocks: {}
}, opts);
ctx = _.assign(ctx, {
liquid: opts
});
var scope = Object.create(Scope);
scope.opts = opts;
scope.scopes = [_ctx || {}];
scope.scopes = [ctx];
return scope;
};