Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(295)

Side by Side Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/html/angular/AngularHtmlUnitResolver.java

Issue 713303002: Issue 21549. Fix for infinite loop in the Angular expression parser. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013, the Dart project authors. 2 * Copyright (c) 2013, the Dart project authors.
3 * 3 *
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except
5 * in compliance with the License. You may obtain a copy of the License at 5 * in compliance with the License. You may obtain a copy of the License at
6 * 6 *
7 * http://www.eclipse.org/legal/epl-v10.html 7 * http://www.eclipse.org/legal/epl-v10.html
8 * 8 *
9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License 9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 formatterToken = name.getEndToken().getNext(); 506 formatterToken = name.getEndToken().getNext();
507 // parse arguments 507 // parse arguments
508 List<AngularFormatterArgument> arguments = Lists.newArrayList(); 508 List<AngularFormatterArgument> arguments = Lists.newArrayList();
509 while (formatterToken.getType() != TokenType.EOF) { 509 while (formatterToken.getType() != TokenType.EOF) {
510 // skip ":" 510 // skip ":"
511 Token colonToken = formatterToken; 511 Token colonToken = formatterToken;
512 if (colonToken.getType() == TokenType.COLON) { 512 if (colonToken.getType() == TokenType.COLON) {
513 formatterToken = formatterToken.getNext(); 513 formatterToken = formatterToken.getNext();
514 } else { 514 } else {
515 reportErrorForToken(AngularCode.MISSING_FORMATTER_COLON, colonToken); 515 reportErrorForToken(AngularCode.MISSING_FORMATTER_COLON, colonToken);
516 break;
516 } 517 }
517 // parse argument 518 // parse argument
518 Expression argument = parseDartExpressionInToken(formatterToken); 519 Expression argument = parseDartExpressionInToken(formatterToken);
519 arguments.add(new AngularFormatterArgument(colonToken, argument)); 520 arguments.add(new AngularFormatterArgument(colonToken, argument));
520 // next token 521 // next token
521 formatterToken = argument.getEndToken().getNext(); 522 formatterToken = argument.getEndToken().getNext();
522 } 523 }
523 formatters.add(new AngularFormatterNode(barToken, name, arguments)); 524 formatters.add(new AngularFormatterNode(barToken, name, arguments));
524 } 525 }
525 // done 526 // done
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 public Void visitXmlTagNode(XmlTagNode node) { 857 public Void visitXmlTagNode(XmlTagNode node) {
857 NgModelProcessor directive = NgModelProcessor.INSTANCE; 858 NgModelProcessor directive = NgModelProcessor.INSTANCE;
858 if (directive.canApply(node)) { 859 if (directive.canApply(node)) {
859 directive.applyTopDeclarations(AngularHtmlUnitResolver.this, node); 860 directive.applyTopDeclarations(AngularHtmlUnitResolver.this, node);
860 } 861 }
861 return super.visitXmlTagNode(node); 862 return super.visitXmlTagNode(node);
862 } 863 }
863 }); 864 });
864 } 865 }
865 } 866 }
OLDNEW
« no previous file with comments | « no previous file | editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/html/angular/AngularHtmlUnitResolverTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698