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

Unified Diff: tests/compiler/dart2js/closure/closure_test.dart

Issue 3007903002: Support annotations on assignment and postfix operations (Closed)
Patch Set: Updated cf. comments 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 | « no previous file | tests/compiler/dart2js/closure/data/captured_variable.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/closure/closure_test.dart
diff --git a/tests/compiler/dart2js/closure/closure_test.dart b/tests/compiler/dart2js/closure/closure_test.dart
index 3134d620675a6e5832c5f75c87ccefd5296cc651..335869348213f91478177bbca11811bbff2d2d9d 100644
--- a/tests/compiler/dart2js/closure/closure_test.dart
+++ b/tests/compiler/dart2js/closure/closure_test.dart
@@ -59,7 +59,7 @@ void computeKernelClosureData(
MemberDefinition definition = elementMap.getMemberDefinition(member);
assert(definition.kind == MemberKind.regular,
failedAt(member, "Unexpected member definition $definition"));
- new ClosureIrChecker(actualMap, elementMap, member,
+ new ClosureIrChecker(compiler.reporter, actualMap, elementMap, member,
localsMap.getLocalsMap(member), closureDataLookup,
verbose: verbose)
.run(definition.node);
@@ -91,7 +91,7 @@ class ClosureAstComputer extends AstDataExtractor with ComputeValueMixin {
}
@override
- String computeNodeValue(ast.Node node, [AstElement element]) {
+ String computeNodeValue(Id id, ast.Node node, [AstElement element]) {
if (element != null && element.isLocal) {
if (element.isFunction) {
LocalFunctionElement localFunction = element;
@@ -106,7 +106,7 @@ class ClosureAstComputer extends AstDataExtractor with ComputeValueMixin {
}
@override
- String computeElementValue(covariant MemberElement element) {
+ String computeElementValue(Id id, covariant MemberElement element) {
// TODO(johnniwinther,efortuna): Collect data for the member
// (has thisLocal, has box, etc.).
return computeObjectValue(element);
@@ -121,13 +121,14 @@ class ClosureIrChecker extends IrDataExtractor with ComputeValueMixin<ir.Node> {
final bool verbose;
ClosureIrChecker(
+ DiagnosticReporter reporter,
Map<Id, ActualData> actualMap,
KernelToElementMapForBuilding elementMap,
this.member,
this._localsMap,
this.closureDataLookup,
{this.verbose: false})
- : super(actualMap) {
+ : super(reporter, actualMap) {
pushMember(member);
}
@@ -150,15 +151,13 @@ class ClosureIrChecker extends IrDataExtractor with ComputeValueMixin<ir.Node> {
}
@override
- String computeNodeValue(ir.Node node) {
+ String computeNodeValue(Id id, ir.Node node) {
if (node is ir.VariableDeclaration) {
- if (node.parent is ir.FunctionDeclaration) {
- ClosureRepresentationInfo info =
- closureDataLookup.getClosureInfo(node.parent);
- return computeObjectValue(info.callMethod);
- }
Local local = _localsMap.getLocalVariable(node);
return computeLocalValue(local);
+ } else if (node is ir.FunctionDeclaration) {
+ ClosureRepresentationInfo info = closureDataLookup.getClosureInfo(node);
+ return computeObjectValue(info.callMethod);
} else if (node is ir.FunctionExpression) {
ClosureRepresentationInfo info = closureDataLookup.getClosureInfo(node);
return computeObjectValue(info.callMethod);
@@ -167,7 +166,7 @@ class ClosureIrChecker extends IrDataExtractor with ComputeValueMixin<ir.Node> {
}
@override
- String computeMemberValue(ir.Member node) {
+ String computeMemberValue(Id id, ir.Member node) {
return computeObjectValue(member);
}
}
« no previous file with comments | « no previous file | tests/compiler/dart2js/closure/data/captured_variable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698