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

Side by Side Diff: frog/member.dart

Issue 9153009: Minor code review change. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 11 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
« no previous file with comments | « no previous file | frog/minfrog » ('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) 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 /** A formal parameter to a [Method]. */ 5 /** A formal parameter to a [Method]. */
6 class Parameter { 6 class Parameter {
7 FormalNode definition; 7 FormalNode definition;
8 Member method; 8 Member method;
9 9
10 String name; 10 String name;
(...skipping 10 matching lines...) Expand all
21 name = name.substring(5); 21 name = name.substring(5);
22 isInitializer = true; 22 isInitializer = true;
23 } 23 }
24 24
25 type = method.resolveType(definition.type, false); 25 type = method.resolveType(definition.type, false);
26 26
27 if (definition.value != null) { 27 if (definition.value != null) {
28 // To match VM, detect cases where value was not actually specified in 28 // To match VM, detect cases where value was not actually specified in
29 // code and don't signal errors. 29 // code and don't signal errors.
30 // TODO(jimhug): Clean up after issue #352 is resolved. 30 // TODO(jimhug): Clean up after issue #352 is resolved.
31 if (definition.value.span.start == definition.span.start) { 31 if (!hasDefaultValue) return;
32 return;
33 }
34 32
35 if (method.name == ':call') { 33 if (method.name == ':call') {
36 // TODO(jimhug): Need simpler way to detect "true" function types vs. 34 // TODO(jimhug): Need simpler way to detect "true" function types vs.
37 // regular methods being used as function types for closures. 35 // regular methods being used as function types for closures.
38 // TODO(sigmund): Disallow non-null default values for native calls? 36 // TODO(sigmund): Disallow non-null default values for native calls?
39 if (method.definition.body == null && !method.isNative) { 37 if (method.definition.body == null && !method.isNative) {
40 world.error('default value not allowed on function type', 38 world.error('default value not allowed on function type',
41 definition.span); 39 definition.span);
42 } 40 }
43 } else if (method.isAbstract) { 41 } else if (method.isAbstract) {
(...skipping 1544 matching lines...) Expand 10 before | Expand all | Expand 10 after
1588 } 1586 }
1589 1587
1590 void forEach(void f(Member member)) { 1588 void forEach(void f(Member member)) {
1591 factories.forEach((_, Map constructors) { 1589 factories.forEach((_, Map constructors) {
1592 constructors.forEach((_, Member member) { 1590 constructors.forEach((_, Member member) {
1593 f(member); 1591 f(member);
1594 }); 1592 });
1595 }); 1593 });
1596 } 1594 }
1597 } 1595 }
OLDNEW
« no previous file with comments | « no previous file | frog/minfrog » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698