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

Unified Diff: sdk/lib/_internal/compiler/implementation/dart_backend/placeholder_collector.dart

Issue 12440035: Support optional function expression parameters in dart2js... and dart2dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/resolution/members.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/dart_backend/placeholder_collector.dart
diff --git a/sdk/lib/_internal/compiler/implementation/dart_backend/placeholder_collector.dart b/sdk/lib/_internal/compiler/implementation/dart_backend/placeholder_collector.dart
index 693afa03db84e87e7e46fd138148c5c1659050d9..601d1367c2aca5adf12c37df8fe9c497d908382c 100644
--- a/sdk/lib/_internal/compiler/implementation/dart_backend/placeholder_collector.dart
+++ b/sdk/lib/_internal/compiler/implementation/dart_backend/placeholder_collector.dart
@@ -423,11 +423,15 @@ class PlaceholderCollector extends Visitor {
element is TypeVariableElement);
makeElementPlaceholder(send.selector, element);
} else {
- assert(send.selector is Identifier);
+ Identifier identifier = send.selector.asIdentifier();
+ if (identifier == null) {
+ // Handle optional function expression parameters with default values.
+ identifier = send.selector.asFunctionExpression().name;
+ }
if (Elements.isInstanceField(element)) {
- tryMakeMemberPlaceholder(send.selector);
+ tryMakeMemberPlaceholder(identifier);
} else {
- tryMakeLocalPlaceholder(element, send.selector);
+ tryMakeLocalPlaceholder(element, identifier);
}
}
}
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/resolution/members.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698