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

Unified Diff: tests/compiler/dart2js/inference/inference_test_helper.dart

Issue 3009043002: Handle variable declarations in inferrer (Closed)
Patch Set: Created 3 years, 3 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 | « tests/compiler/dart2js/inference/data/locals.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/inference/inference_test_helper.dart
diff --git a/tests/compiler/dart2js/inference/inference_test_helper.dart b/tests/compiler/dart2js/inference/inference_test_helper.dart
index 50581ed32c45fabdfac219966a31a5df7ce8afa6..af90be5671f8aa266e1d41ca5a2bfd9b0f27de54 100644
--- a/tests/compiler/dart2js/inference/inference_test_helper.dart
+++ b/tests/compiler/dart2js/inference/inference_test_helper.dart
@@ -69,7 +69,7 @@ class TypeMaskComputer extends AstDataExtractor
if (element.isParameter) {
ParameterElement parameter = element;
return getParameterValue(parameter);
- } else if (element.isLocal) {
+ } else if (element.isLocal && element.isFunction) {
LocalFunctionElement localFunction = element;
return getMemberValue(localFunction.callMethod);
} else {
@@ -80,10 +80,18 @@ class TypeMaskComputer extends AstDataExtractor
@override
String computeNodeValue(Id id, ast.Node node, [AstElement element]) {
- if (node is ast.Send) {
- return getTypeMaskValue(result.typeOfSend(node));
- } else if (element != null && element.isLocal) {
+ if (element != null && element.isLocal && element.isFunction) {
return computeElementValue(id, element);
+ } else if (node is ast.SendSet) {
+ if (id.kind == IdKind.invoke) {
+ return getTypeMaskValue(result.typeOfOperator(node));
+ } else if (id.kind == IdKind.update) {
+ return getTypeMaskValue(result.typeOfSend(node));
+ } else if (id.kind == IdKind.node) {
+ return getTypeMaskValue(result.typeOfGetter(node));
+ }
+ } else if (node is ast.Send) {
+ return getTypeMaskValue(result.typeOfSend(node));
}
return null;
}
« no previous file with comments | « tests/compiler/dart2js/inference/data/locals.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698