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

Side by Side Diff: frog/minfrog

Issue 8879006: frog: detect when getter/setter has incorrect number of arguments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years 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 #!/usr/bin/env node 1 #!/usr/bin/env node
2 // ********** Library dart:core ************** 2 // ********** Library dart:core **************
3 // ********** Natives dart:core ************** 3 // ********** Natives dart:core **************
4 /** 4 /**
5 * Generates a dynamic call stub for a function. 5 * Generates a dynamic call stub for a function.
6 * Our goal is to create a stub method like this on-the-fly: 6 * Our goal is to create a stub method like this on-the-fly:
7 * function($0, $1, capture) { return this($0, $1, true, capture); } 7 * function($0, $1, capture) { return this($0, $1, true, capture); }
8 * 8 *
9 * This stub then replaces the dynamic one on Function, with one that is 9 * This stub then replaces the dynamic one on Function, with one that is
10 * specialized for that particular function, taking into account its default 10 * specialized for that particular function, taking into account its default
(...skipping 5005 matching lines...) Expand 10 before | Expand all | Expand 10 after
5016 var c = parentMember; 5016 var c = parentMember;
5017 parent = c.baseMember; 5017 parent = c.baseMember;
5018 } 5018 }
5019 else { 5019 else {
5020 parent = parentMember; 5020 parent = parentMember;
5021 } 5021 }
5022 if (this.getter == null) this.getter = parent.getter; 5022 if (this.getter == null) this.getter = parent.getter;
5023 if (this.setter == null) this.setter = parent.setter; 5023 if (this.setter == null) this.setter = parent.setter;
5024 } 5024 }
5025 PropertyMember.prototype.resolve = function() { 5025 PropertyMember.prototype.resolve = function() {
5026 if (this.getter != null) this.getter.resolve(); 5026 if (this.getter != null) {
5027 if (this.setter != null) this.setter.resolve(); 5027 this.getter.resolve();
5028 if (this.getter.parameters.length != 0) {
5029 $globals.world.error('getter methods should take no arguments', this.gette r.definition.span);
5030 }
5031 }
5032 if (this.setter != null) {
5033 this.setter.resolve();
5034 if (this.setter.parameters.length != 1) {
5035 $globals.world.error('setter methods should take a single argument', this. setter.definition.span);
5036 }
5037 }
5028 this.get$library()._addMember(this); 5038 this.get$library()._addMember(this);
5029 } 5039 }
5030 PropertyMember.prototype._get$3 = function($0, $1, $2) { 5040 PropertyMember.prototype._get$3 = function($0, $1, $2) {
5031 return this._get($0, $1, $2, false); 5041 return this._get($0, $1, $2, false);
5032 }; 5042 };
5033 PropertyMember.prototype._get$3$isDynamic = PropertyMember.prototype._get; 5043 PropertyMember.prototype._get$3$isDynamic = PropertyMember.prototype._get;
5034 PropertyMember.prototype._get$4 = PropertyMember.prototype._get; 5044 PropertyMember.prototype._get$4 = PropertyMember.prototype._get;
5035 PropertyMember.prototype._set$4 = function($0, $1, $2, $3) { 5045 PropertyMember.prototype._set$4 = function($0, $1, $2, $3) {
5036 return this._set($0, $1, $2, $3, false); 5046 return this._set($0, $1, $2, $3, false);
5037 }; 5047 };
(...skipping 8148 matching lines...) Expand 10 before | Expand all | Expand 10 after
13186 $globals._MAGENTA_COLOR = '\u001b[35m'; 13196 $globals._MAGENTA_COLOR = '\u001b[35m';
13187 $globals._NO_COLOR = '\u001b[0m'; 13197 $globals._NO_COLOR = '\u001b[0m';
13188 $globals._RED_COLOR = '\u001b[31m'; 13198 $globals._RED_COLOR = '\u001b[31m';
13189 } 13199 }
13190 var const$0 = new NoMoreElementsException()/*const NoMoreElementsException()*/; 13200 var const$0 = new NoMoreElementsException()/*const NoMoreElementsException()*/;
13191 var const$2 = new EmptyQueueException()/*const EmptyQueueException()*/; 13201 var const$2 = new EmptyQueueException()/*const EmptyQueueException()*/;
13192 var const$3 = new _DeletedKeySentinel()/*const _DeletedKeySentinel()*/; 13202 var const$3 = new _DeletedKeySentinel()/*const _DeletedKeySentinel()*/;
13193 var $globals = {}; 13203 var $globals = {};
13194 $static_init(); 13204 $static_init();
13195 main(); 13205 main();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698