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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/js/builder.dart

Issue 255843005: Avoid generating VariableUse nodes with non-identifier names (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 months 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
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js/nodes.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 // Utilities for building JS ASTs at runtime. Contains a builder class 5 // Utilities for building JS ASTs at runtime. Contains a builder class
6 // and a parser that parses part of the language. 6 // and a parser that parses part of the language.
7 7
8 part of js; 8 part of js;
9 9
10 10
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 return parseObjectInitializer(); 672 return parseObjectInitializer();
673 } else if (acceptCategory(LSQUARE)) { 673 } else if (acceptCategory(LSQUARE)) {
674 var values = <ArrayElement>[]; 674 var values = <ArrayElement>[];
675 if (!acceptCategory(RSQUARE)) { 675 if (!acceptCategory(RSQUARE)) {
676 do { 676 do {
677 values.add(new ArrayElement(values.length, parseAssignment())); 677 values.add(new ArrayElement(values.length, parseAssignment()));
678 } while (acceptCategory(COMMA)); 678 } while (acceptCategory(COMMA));
679 expectCategory(RSQUARE); 679 expectCategory(RSQUARE);
680 } 680 }
681 return new ArrayInitializer(values.length, values); 681 return new ArrayInitializer(values.length, values);
682 } else if (last.startsWith("/")) { 682 } else if (last != null && last.startsWith("/")) {
683 String regexp = getDelimited(lastPosition); 683 String regexp = getDelimited(lastPosition);
684 getToken(); 684 getToken();
685 String flags = lastToken; 685 String flags = lastToken;
686 if (!acceptCategory(ALPHA)) flags = ""; 686 if (!acceptCategory(ALPHA)) flags = "";
687 Expression expression = new RegExpLiteral(regexp + flags); 687 Expression expression = new RegExpLiteral(regexp + flags);
688 return expression; 688 return expression;
689 } else if (acceptCategory(HASH)) { 689 } else if (acceptCategory(HASH)) {
690 InterpolatedExpression expression = 690 InterpolatedExpression expression =
691 new InterpolatedExpression(interpolatedValues.length); 691 new InterpolatedExpression(interpolatedValues.length);
692 interpolatedValues.add(expression); 692 interpolatedValues.add(expression);
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
1172 Catch parseCatch() { 1172 Catch parseCatch() {
1173 expectCategory(LPAREN); 1173 expectCategory(LPAREN);
1174 String identifier = lastToken; 1174 String identifier = lastToken;
1175 expectCategory(ALPHA); 1175 expectCategory(ALPHA);
1176 expectCategory(RPAREN); 1176 expectCategory(RPAREN);
1177 expectCategory(LBRACE); 1177 expectCategory(LBRACE);
1178 Block body = parseBlock(); 1178 Block body = parseBlock();
1179 return new Catch(new VariableDeclaration(identifier), body); 1179 return new Catch(new VariableDeclaration(identifier), body);
1180 } 1180 }
1181 } 1181 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/js/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698