fix: corrected var/# parsing in template

Closes #2084
This commit is contained in:
Misko Hevery
2015-05-21 12:17:46 -07:00
parent ab8eb4f652
commit a418397174
2 changed files with 21 additions and 17 deletions

View File

@ -538,19 +538,17 @@ class _ParseAST {
this.optionalCharacter($COLON);
var name = null;
var expression = null;
if (this.next !== EOF) {
if (keyIsVar) {
if (this.optionalOperator("=")) {
name = this.expectTemplateBindingKey();
} else {
name = '\$implicit';
}
} else if (!this.peekKeywordVar()) {
var start = this.inputIndex;
var ast = this.parsePipe();
var source = this.input.substring(start, this.inputIndex);
expression = new ASTWithSource(ast, source, this.location);
if (keyIsVar) {
if (this.optionalOperator("=")) {
name = this.expectTemplateBindingKey();
} else {
name = '\$implicit';
}
} else if (this.next !== EOF && !this.peekKeywordVar()) {
var start = this.inputIndex;
var ast = this.parsePipe();
var source = this.input.substring(start, this.inputIndex);
expression = new ASTWithSource(ast, source, this.location);
}
ListWrapper.push(bindings, new TemplateBinding(key, keyIsVar, name, expression));
if (!this.optionalCharacter($SEMICOLON)) {