Update subexpression and hash AST constructs
This commit is contained in:
+1
-1
@@ -258,7 +258,7 @@ describe('ast', function() {
|
||||
block = ast.body[0];
|
||||
|
||||
equals(block.program.body[0].value, '');
|
||||
equals(block.program.body[1].sexpr.id.original, 'foo');
|
||||
equals(block.program.body[1].sexpr.path.original, 'foo');
|
||||
equals(block.program.body[2].value, '\n');
|
||||
});
|
||||
it('marks nested block mustaches as standalone', function() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*global CompilerContext, shouldCompileTo */
|
||||
/*global CompilerContext, Handlebars, shouldCompileTo, shouldThrow */
|
||||
describe('subexpressions', function() {
|
||||
it("arg-less helper", function() {
|
||||
var string = "{{foo (bar)}}!";
|
||||
@@ -135,7 +135,7 @@ describe('subexpressions', function() {
|
||||
t: function(defaultString) {
|
||||
return new Handlebars.SafeString(defaultString);
|
||||
}
|
||||
}
|
||||
};
|
||||
shouldCompileTo(string, [{}, helpers], '<input aria-label="Name" placeholder="Example User" />');
|
||||
});
|
||||
|
||||
@@ -159,7 +159,7 @@ describe('subexpressions', function() {
|
||||
t: function(defaultString) {
|
||||
return new Handlebars.SafeString(defaultString);
|
||||
}
|
||||
}
|
||||
};
|
||||
shouldCompileTo(string, [context, helpers], '<input aria-label="Name" placeholder="Example User" />');
|
||||
});
|
||||
|
||||
@@ -170,7 +170,7 @@ describe('subexpressions', function() {
|
||||
snog: function(a, b, options) {
|
||||
equals(a, 'foo');
|
||||
equals(options.types.length, 2, "string params for outer helper processed correctly");
|
||||
equals(options.types[0], 'sexpr', "string params for outer helper processed correctly");
|
||||
equals(options.types[0], 'SubExpression', "string params for outer helper processed correctly");
|
||||
equals(options.types[1], 'PathExpression', "string params for outer helper processed correctly");
|
||||
return a + b;
|
||||
},
|
||||
@@ -196,7 +196,7 @@ describe('subexpressions', function() {
|
||||
|
||||
var helpers = {
|
||||
blog: function(options) {
|
||||
equals(options.hashTypes.fun, 'sexpr');
|
||||
equals(options.hashTypes.fun, 'SubExpression');
|
||||
return "val is " + options.hash.fun;
|
||||
},
|
||||
bork: function() {
|
||||
|
||||
Reference in New Issue
Block a user