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

Side by Side Diff: tests/compiler/dart2js/closure/closure_test.dart

Issue 2938203003: Compute KernelClosureRepresentationInfo.variableIsUsedInTryOrSync (Closed)
Patch Set: Merge KernelClosureConversionTask and KernelClosureDataLookup Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:io'; 5 import 'dart:io';
6 import 'package:async_helper/async_helper.dart'; 6 import 'package:async_helper/async_helper.dart';
7 import 'package:compiler/src/closure.dart'; 7 import 'package:compiler/src/closure.dart';
8 import 'package:compiler/src/compiler.dart'; 8 import 'package:compiler/src/compiler.dart';
9 import 'package:compiler/src/diagnostics/diagnostic_listener.dart'; 9 import 'package:compiler/src/diagnostics/diagnostic_listener.dart';
10 import 'package:compiler/src/elements/elements.dart'; 10 import 'package:compiler/src/elements/elements.dart';
11 import 'package:compiler/src/tree/nodes.dart'; 11 import 'package:compiler/src/tree/nodes.dart';
12 import '../equivalence/id_equivalence.dart'; 12 import '../equivalence/id_equivalence.dart';
13 import '../equivalence/id_equivalence_helper.dart'; 13 import '../equivalence/id_equivalence_helper.dart';
14 14
15 main() { 15 main() {
16 asyncTest(() async { 16 asyncTest(() async {
17 Directory dataDir = new Directory.fromUri(Platform.script.resolve('data')); 17 Directory dataDir = new Directory.fromUri(Platform.script.resolve('data'));
18 await for (FileSystemEntity entity in dataDir.list()) { 18 await for (FileSystemEntity entity in dataDir.list()) {
19 print('Checking ${entity.uri}'); 19 print('Checking ${entity.uri}');
20 String annotatedCode = await new File.fromUri(entity.uri).readAsString(); 20 String annotatedCode = await new File.fromUri(entity.uri).readAsString();
21 await checkCode(annotatedCode, checkClosureData); 21 await checkCode(annotatedCode, checkClosureData);
22 } 22 }
23 }); 23 });
24 } 24 }
25 25
26 void checkClosureData( 26 void checkClosureData(
27 Compiler compiler, Map<Id, String> expectedMap, MemberElement member) { 27 Compiler compiler, Map<Id, String> expectedMap, MemberElement member) {
28 new ClosureChecker(compiler.reporter, expectedMap, member.resolvedAst, 28 new ClosureChecker(compiler.reporter, expectedMap, member.resolvedAst,
29 compiler.closureDataLookup as ClosureDataLookup<Node>) 29 compiler.backendStrategy.closureDataLookup as ClosureDataLookup<Node>)
30 .check(); 30 .check();
31 } 31 }
32 32
33 class ClosureChecker extends AbstractResolvedAstChecker { 33 class ClosureChecker extends AbstractResolvedAstChecker {
34 final ClosureDataLookup<Node> closureDataLookup; 34 final ClosureDataLookup<Node> closureDataLookup;
35 final ClosureRepresentationInfo info; 35 final ClosureRepresentationInfo info;
36 36
37 ClosureChecker(DiagnosticReporter reporter, Map<Id, String> expectedMap, 37 ClosureChecker(DiagnosticReporter reporter, Map<Id, String> expectedMap,
38 ResolvedAst resolvedAst, this.closureDataLookup) 38 ResolvedAst resolvedAst, this.closureDataLookup)
39 : this.info = 39 : this.info =
(...skipping 11 matching lines...) Expand all
51 return sb.toString(); 51 return sb.toString();
52 } 52 }
53 return null; 53 return null;
54 } 54 }
55 55
56 @override 56 @override
57 String computeElementValue(AstElement element) { 57 String computeElementValue(AstElement element) {
58 return null; 58 return null;
59 } 59 }
60 } 60 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698