mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 04:10:40 -07:00
fix include scope.blocks bleeding
This commit is contained in:
@@ -3,6 +3,7 @@ const Promise = require('any-promise');
|
||||
const mapSeries = require('./util/promise.js').mapSeries;
|
||||
const RenderBreak = require('./util/error.js').RenderBreak;
|
||||
const assert = require('./util/assert.js');
|
||||
const _ = require('./util/underscore.js');
|
||||
|
||||
var render = {
|
||||
|
||||
|
||||
+7
-3
@@ -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;
|
||||
};
|
||||
|
||||
@@ -37,7 +37,15 @@ function isArray(value) {
|
||||
return value instanceof Array;
|
||||
}
|
||||
|
||||
function echo(prefix){
|
||||
return v => {
|
||||
console.log('[' + prefix + ']', v);
|
||||
return v;
|
||||
};
|
||||
}
|
||||
|
||||
exports.isString = isString;
|
||||
exports.isArray = isArray;
|
||||
exports.forOwn = forOwn;
|
||||
exports.assign = assign;
|
||||
exports.echo = echo;
|
||||
|
||||
Reference in New Issue
Block a user