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

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

Issue 12543033: Revert "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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 part of dart2js; 5 part of dart2js;
6 6
7 class TreeValidatorTask extends CompilerTask { 7 class TreeValidatorTask extends CompilerTask {
8 TreeValidatorTask(Compiler compiler) : super(compiler); 8 TreeValidatorTask(Compiler compiler) : super(compiler);
9 9
10 void validate(Node tree) { 10 void validate(Node tree) {
(...skipping 24 matching lines...) Expand all
35 } 35 }
36 36
37 visitNode(Node node) {} 37 visitNode(Node node) {}
38 38
39 visitSendSet(SendSet node) { 39 visitSendSet(SendSet node) {
40 final selector = node.selector; 40 final selector = node.selector;
41 final name = node.assignmentOperator.source.stringValue; 41 final name = node.assignmentOperator.source.stringValue;
42 final arguments = node.arguments; 42 final arguments = node.arguments;
43 43
44 expect(node, arguments != null); 44 expect(node, arguments != null);
45 expect(node, 45 expect(node, selector is Identifier, 'selector is not assignable');
46 selector is Identifier || selector is FunctionExpression,
47 'selector is not assignable');
48 if (identical(name, '++') || identical(name, '--')) { 46 if (identical(name, '++') || identical(name, '--')) {
49 expect(node, node.assignmentOperator is Operator); 47 expect(node, node.assignmentOperator is Operator);
50 if (node.isIndex) { 48 if (node.isIndex) {
51 expect(node.arguments.tail.head, node.arguments.tail.isEmpty); 49 expect(node.arguments.tail.head, node.arguments.tail.isEmpty);
52 } else { 50 } else {
53 expect(node.arguments.head, node.arguments.isEmpty); 51 expect(node.arguments.head, node.arguments.isEmpty);
54 } 52 }
55 } else { 53 } else {
56 expect(node, !node.arguments.isEmpty); 54 expect(node, !node.arguments.isEmpty);
57 } 55 }
(...skipping 13 matching lines...) Expand all
71 final String message; 69 final String message;
72 InvalidNodeError(this.node, [this.message]); 70 InvalidNodeError(this.node, [this.message]);
73 71
74 toString() { 72 toString() {
75 String nodeString = node.toDebugString(); 73 String nodeString = node.toDebugString();
76 String result = 'invalid node: $nodeString'; 74 String result = 'invalid node: $nodeString';
77 if (message != null) result = '$result ($message)'; 75 if (message != null) result = '$result ($message)';
78 return result; 76 return result;
79 } 77 }
80 } 78 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/resolution/members.dart ('k') | tests/co19/co19-dart2dart.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698