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

Unified Diff: frog/minfrog

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « frog/member.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/minfrog
diff --git a/frog/minfrog b/frog/minfrog
index 6677f49bf511bce5e1398557bcbbc3e544abb3c5..a4f7d488047db53f0335d973562bacbc2543e5de 100755
--- a/frog/minfrog
+++ b/frog/minfrog
@@ -4899,9 +4899,7 @@ Parameter.prototype.resolve = function() {
}
this.type = this.method.resolveType(this.definition.type, false);
if (this.definition.value != null) {
- if (this.definition.value.span.start == this.definition.span.start) {
- return;
- }
+ if (!this.get$hasDefaultValue()) return;
if (this.method.name == ":call") {
if (this.method.get$definition().get$body() == null && !this.method.get$isNative()) {
$globals.world.error("default value not allowed on function type", this.definition.span);
@@ -4936,6 +4934,9 @@ Parameter.prototype.copyWithNewType = function(newMethod, newType) {
Parameter.prototype.get$isOptional = function() {
return this.definition != null && this.definition.value != null;
}
+Parameter.prototype.get$hasDefaultValue = function() {
+ return this.definition.value.span.start != this.definition.span.start;
+}
Parameter.prototype.copyWithNewType$2 = Parameter.prototype.copyWithNewType;
Parameter.prototype.genValue$2 = Parameter.prototype.genValue;
Parameter.prototype.resolve$0 = Parameter.prototype.resolve;
« no previous file with comments | « frog/member.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698