Disambiguate setters and getters when patching DDC SDK.

Stdio was having its setters applied twice instead of applying the
getter and setter each once.

R=vsm@google.com

Review-Url: https://codereview.chromium.org/2874713005 .
This commit is contained in:
Bob Nystrom 2017-05-10 16:56:39 -07:00
parent 17c23be470
commit a68b44924e
11 changed files with 53 additions and 38 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

View file

@ -349,13 +349,23 @@ class PatchFinder extends GeneralizingAstVisitor {
}
String _qualifiedName(Declaration node) {
var result = "";
var parent = node.parent;
var className = '';
if (parent is ClassDeclaration) {
className = parent.name.name + '.';
result = "${parent.name.name}.";
}
var name = (node as dynamic).name;
return className + (name != null ? name.name : '');
if (name != null) result += name.name;
// Make sure setters and getters don't collide.
if ((node is FunctionDeclaration || node is MethodDeclaration) &&
(node as dynamic).isSetter) {
result += "=";
}
return result;
}
bool _isPatch(AnnotatedNode node) => node.metadata.any(_isPatchAnnotation);

View file

@ -2,9 +2,6 @@
[error] A value of type 'Dimension' can't be assigned to a variable of type 'num'. (dart:html, line 40486, col 44)
[error] The getter 'value' isn't defined for the class 'num'. (dart:html, line 40506, col 20)
[error] A value of type 'Dimension' can't be assigned to a variable of type 'num'. (dart:html, line 40506, col 42)
[error] Undefined name 'lineMode'. (dart:io/stdio.dart, line 57, col 10)
[error] The name 'echoMode=' is already defined. (dart:io/stdio.dart, line 122, col 12)
[error] The name 'lineMode=' is already defined. (dart:io/stdio.dart, line 143, col 12)
[error] The getter 'packagesBase' isn't defined for the class 'IsolateNatives'. (dart:isolate, line 719, col 61)
[error] Invalid override. The type of 'JsArray.[]=' ('(Object, E) → void') isn't a subtype of 'JsObject.[]=' ('(Object, dynamic) → dynamic'). (dart:js, line 370, col 3)
[error] The argument type 'List' can't be assigned to the parameter type 'Iterable<Null>'. (dart:js_util, line 112, col 29)