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

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: 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 f9409837c9825d94873af53612bb98c80c2b8ce4..bbde3c74555c2d25e7addb0d654e4792d057104b 100644
--- a/sdk/lib/_internal/compiler/implementation/resolution/members.dart
+++ b/sdk/lib/_internal/compiler/implementation/resolution/members.dart
@@ -3557,11 +3557,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?
ahe 2013/03/11 07:34:28 http://www.dartlang.org/articles/style-guide/#do-u
aam-me 2013/03/12 00:00:38 Thank you for pointing this out! Done.
+ 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