mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 04:10:40 -07:00
feature: unshift and shift for scope, working on #15
This commit is contained in:
+7
-1
@@ -41,7 +41,13 @@ var Scope = {
|
||||
pop: function() {
|
||||
return this.scopes.pop();
|
||||
},
|
||||
|
||||
unshift: function(ctx) {
|
||||
if (!ctx) throw new Error('trying to push $(ctx) into scopes');
|
||||
return this.scopes.unshift(ctx);
|
||||
},
|
||||
shift: function() {
|
||||
return this.scopes.shift();
|
||||
},
|
||||
setPropertyByPath: function(obj, path, val) {
|
||||
if (_.isString(path)) {
|
||||
var paths = path.replace(/\[/g, '.').replace(/\]/g, '').split('.');
|
||||
|
||||
Reference in New Issue
Block a user