mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 21:00:40 -07:00
refactor: tests for tags
This commit is contained in:
+2
-3
@@ -1,6 +1,5 @@
|
||||
const _ = require('lodash');
|
||||
const lexical = require('./lexical.js');
|
||||
const error = require('./error.js');
|
||||
|
||||
var scope = {
|
||||
get: function(str) {
|
||||
@@ -21,7 +20,7 @@ var scope = {
|
||||
return this;
|
||||
},
|
||||
push: function(ctx) {
|
||||
if (!ctx) error(`trying to push ${ctx} into scopes`);
|
||||
if (!ctx) throw new Error(`trying to push ${ctx} into scopes`);
|
||||
return this.scopes.push(ctx);
|
||||
},
|
||||
pop: function() {
|
||||
@@ -31,6 +30,6 @@ var scope = {
|
||||
|
||||
exports.factory = function(_ctx) {
|
||||
var ctx = Object.create(scope);
|
||||
ctx.scopes = _ctx ? [_ctx] : [];
|
||||
ctx.scopes = [_ctx || {}];
|
||||
return ctx;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user