Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

ExpressionVisitor should throw with better messages #830

Closed
vicb opened this issue Apr 1, 2014 · 3 comments
Closed

ExpressionVisitor should throw with better messages #830

vicb opened this issue Apr 1, 2014 · 3 comments

Comments

@vicb
Copy link
Contributor

vicb commented Apr 1, 2014

<p ng-repeat="i in [1,2] trak by $id">{{ i }}</p>

would throw

Bad state: Can not watch expression containing ';'.

STACKTRACE:
#0      ExpressionVisitor._notSupported (package:angular/core/scope.dart:1094:5)
#1      ExpressionVisitor.visitChain (package:angular/core/scope.dart:1090:18)
#2      Chain.accept (package:angular/core/parser/syntax.dart:73:48)
#3      DynamicExpression.accept (package:angular/core/parser/dynamic_parser.dart:46:48)
#4      ExpressionVisitor.visit (package:angular/core/scope.dart:984:15)
#5      ExpressionVisitor.visitCollection (package:angular/core/scope.dart:993:65)
#6      _AstParser.call (package:angular/core/scope.dart:968:51)
#7      _AstParser.call (package:angular/core/scope.dart:969:7)
#8      _AstParser.call (package:angular/core/scope.dart:969:7)
#9      Scope.watch (package:angular/core/scope.dart:228:35)

I've noticed this message in several different situation. We should give a better explanation of the issue.

@mhevery mhevery added this to the Community PRs Welcomed milestone Apr 10, 2014
@vsavkin
Copy link
Contributor

vsavkin commented Apr 14, 2014

May I try this?

@vicb
Copy link
Contributor Author

vicb commented Apr 14, 2014

That would be great, Victor!

vsavkin added a commit to vsavkin/angular.dart that referenced this issue Apr 15, 2014
…nexpected token

Change the handling of unexpected tokens. Make the parser throw the "is an unexpected token" exception, so ExpressionVisitor won't throw confusing "Can not watch expression containing ';'".

Closes dart-archive#830
@vsavkin
Copy link
Contributor

vsavkin commented Apr 15, 2014

PR: #905

I looked at AngularJS to see how it addresses this issue, and it does by throwing an error in the parser. So I did it in the same way.

vsavkin added a commit to vsavkin/angular.dart that referenced this issue Apr 15, 2014
…nexpected token

Change the handling of unexpected tokens. Make the parser throw the "is an unexpected token" exception, so ExpressionVisitor won't throw confusing "Can not watch expression containing ';'".

Closes dart-archive#830
mhevery pushed a commit that referenced this issue Apr 15, 2014
…nexpected token

Change the handling of unexpected tokens. Make the parser throw the "is an unexpected token" exception, so ExpressionVisitor won't throw confusing "Can not watch expression containing ';'".

Closes #830

Closes #905
mhevery pushed a commit that referenced this issue Apr 16, 2014
…nexpected token

Change the handling of unexpected tokens. Make the parser throw the "is an unexpected token" exception, so ExpressionVisitor won't throw confusing "Can not watch expression containing ';'".

Closes #830

Closes #905
mhevery pushed a commit that referenced this issue Apr 17, 2014
…nexpected token

Change the handling of unexpected tokens. Make the parser throw the "is an unexpected token" exception, so ExpressionVisitor won't throw confusing "Can not watch expression containing ';'".

Closes #830

Closes #905
mhevery pushed a commit that referenced this issue Apr 24, 2014
…nexpected token

Change the handling of unexpected tokens. Make the parser throw the "is an unexpected token" exception, so ExpressionVisitor won't throw confusing "Can not watch expression containing ';'".

Closes #830

Closes #905
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
3 participants