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

Side by Side Diff: pkg/front_end/lib/src/fasta/kernel/body_builder.dart

Issue 2730763002: Recover from missing arguments in new expression. (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « no previous file | tests/co19/co19-kernel.status » ('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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 library fasta.body_builder; 5 library fasta.body_builder;
6 6
7 import '../parser/parser.dart' show FormalParameterType, optional; 7 import '../parser/parser.dart' show FormalParameterType, optional;
8 8
9 import '../parser/error_kind.dart' show ErrorKind; 9 import '../parser/error_kind.dart' show ErrorKind;
10 10
(...skipping 1634 matching lines...) Expand 10 before | Expand all | Expand 10 after
1645 } 1645 }
1646 1646
1647 @override 1647 @override
1648 void handleNewExpression(Token token) { 1648 void handleNewExpression(Token token) {
1649 debugEvent("NewExpression"); 1649 debugEvent("NewExpression");
1650 Arguments arguments = pop(); 1650 Arguments arguments = pop();
1651 String name = pop(); 1651 String name = pop();
1652 List<DartType> typeArguments = pop(); 1652 List<DartType> typeArguments = pop();
1653 var type = pop(); 1653 var type = pop();
1654 1654
1655 if (arguments == null) {
1656 push(buildCompileTimeError("No arguments.", token.charOffset));
1657 return;
1658 }
1659
1655 if (typeArguments != null) { 1660 if (typeArguments != null) {
1656 assert(arguments.types.isEmpty); 1661 assert(arguments.types.isEmpty);
1657 arguments.types.addAll(typeArguments); 1662 arguments.types.addAll(typeArguments);
1658 } 1663 }
1659 1664
1660 String errorName; 1665 String errorName;
1661 if (type is ClassBuilder) { 1666 if (type is ClassBuilder) {
1662 Builder b = type.findConstructorOrFactory(name); 1667 Builder b = type.findConstructorOrFactory(name);
1663 Member target; 1668 Member target;
1664 if (b == null) { 1669 if (b == null) {
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after
2677 } else if (node is TypeDeclarationBuilder) { 2682 } else if (node is TypeDeclarationBuilder) {
2678 return node.name; 2683 return node.name;
2679 } else if (node is PrefixBuilder) { 2684 } else if (node is PrefixBuilder) {
2680 return node.name; 2685 return node.name;
2681 } else if (node is ThisPropertyAccessor) { 2686 } else if (node is ThisPropertyAccessor) {
2682 return node.name.name; 2687 return node.name.name;
2683 } else { 2688 } else {
2684 return internalError("Unhandled: ${node.runtimeType}"); 2689 return internalError("Unhandled: ${node.runtimeType}");
2685 } 2690 }
2686 } 2691 }
OLDNEW
« no previous file with comments | « no previous file | tests/co19/co19-kernel.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698