mirror of
https://github.com/harttle/liquidjs.git
synced 2026-10-03 09:05:14 -07:00
fix #29
This commit is contained in:
+1
-1
@@ -129,7 +129,7 @@ var Scope = {
|
|||||||
name = str.slice(i + 2, j);
|
name = str.slice(i + 2, j);
|
||||||
seq.push(name);
|
seq.push(name);
|
||||||
name = '';
|
name = '';
|
||||||
i = j + 1;
|
i = j + 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// foo.bar
|
// foo.bar
|
||||||
|
|||||||
+7
-1
@@ -30,12 +30,18 @@ describe('scope', function() {
|
|||||||
expect(scope.propertyAccessSeq('foo[foo]'))
|
expect(scope.propertyAccessSeq('foo[foo]'))
|
||||||
.to.deep.equal(['foo', 'zoo']);
|
.to.deep.equal(['foo', 'zoo']);
|
||||||
});
|
});
|
||||||
it('should handle nested access', function() {
|
it('should handle nested access 1', function() {
|
||||||
expect(scope.propertyAccessSeq('foo[bar.zoo]'))
|
expect(scope.propertyAccessSeq('foo[bar.zoo]'))
|
||||||
.to.deep.equal(['foo', 'coo']);
|
.to.deep.equal(['foo', 'coo']);
|
||||||
|
});
|
||||||
|
it('should handle nested access 2', function() {
|
||||||
expect(scope.propertyAccessSeq('foo[bar["zoo"]]'))
|
expect(scope.propertyAccessSeq('foo[bar["zoo"]]'))
|
||||||
.to.deep.equal(['foo', 'coo']);
|
.to.deep.equal(['foo', 'coo']);
|
||||||
});
|
});
|
||||||
|
it('should handle nested access 3', function() {
|
||||||
|
expect(scope.propertyAccessSeq('bar["foo"].zoo'))
|
||||||
|
.to.deep.equal(['bar', 'foo', 'zoo']);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('#get()', function() {
|
describe('#get()', function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user