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

Unified Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 12751002: Support optional function expression parameters in dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added spaces around ternary operator. 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/tree_validator.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/resolution/members.dart
diff --git a/sdk/lib/_internal/compiler/implementation/resolution/members.dart b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
index cb5811e80bbe66ab8f6b6e4a5f9e9484c7ee1dcd..ad8df6cf7c1bc29e146030062ea13c0d2f28c6ae 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
@@ -3578,11 +3578,15 @@ class SignatureResolver extends CommonResolverVisitor<Element> {
Element element;
if (node.receiver != null) {
element = visitSend(node);
- } else if (node.selector.asIdentifier() != null) {
+ } else if (node.selector.asIdentifier() != null ||
+ node.selector.asFunctionExpression() != null) {
Element variables = new VariableListElementX.node(currentDefinitions,
ElementKind.VARIABLE_LIST, enclosingElement);
- element = new VariableElementX(node.selector.asIdentifier().source,
- variables, ElementKind.PARAMETER, node);
+ SourceString source = node.selector.asIdentifier() != null ?
+ node.selector.asIdentifier().source :
+ node.selector.asFunctionExpression().name.asIdentifier().source;
+ element = new VariableElementX(source, variables,
+ ElementKind.PARAMETER, node);
}
// Visit the value. The compile time constant handler will
// make sure it's a compile time constant.
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/tree_validator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698