summaryrefslogtreecommitdiffstats
path: root/spec/visitor.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/visitor.js')
-rw-r--r--spec/visitor.js15
1 files changed, 7 insertions, 8 deletions
diff --git a/spec/visitor.js b/spec/visitor.js
index 0c23c0d..3217230 100644
--- a/spec/visitor.js
+++ b/spec/visitor.js
@@ -24,11 +24,10 @@ describe('Visitor', function() {
visitor.BooleanLiteral = function(bool) {
equal(bool.value, true);
- equal(this.parents.length, 4);
+ equal(this.parents.length, 3);
equal(this.parents[0].type, 'SubExpression');
- equal(this.parents[1].type, 'SubExpression');
- equal(this.parents[2].type, 'BlockStatement');
- equal(this.parents[3].type, 'Program');
+ equal(this.parents[1].type, 'BlockStatement');
+ equal(this.parents[2].type, 'Program');
};
visitor.PathExpression = function(id) {
equal(/(foo\.)?bar$/.test(id.original), true);
@@ -84,26 +83,26 @@ describe('Visitor', function() {
var visitor = new Handlebars.Visitor();
visitor.mutating = true;
- visitor.SubExpression = function() {
+ visitor.PathExpression = function() {
return false;
};
var ast = Handlebars.parse('{{foo 42}}');
visitor.accept(ast);
- }, Handlebars.Exception, 'MustacheStatement requires sexpr');
+ }, Handlebars.Exception, 'MustacheStatement requires path');
});
it('should throw when returning non-node responses', function() {
shouldThrow(function() {
var visitor = new Handlebars.Visitor();
visitor.mutating = true;
- visitor.SubExpression = function() {
+ visitor.PathExpression = function() {
return {};
};
var ast = Handlebars.parse('{{foo 42}}');
visitor.accept(ast);
- }, Handlebars.Exception, 'Unexpected node type "undefined" found when accepting sexpr on MustacheStatement');
+ }, Handlebars.Exception, 'Unexpected node type "undefined" found when accepting path on MustacheStatement');
});
});
describe('arrays', function() {