Chromium Code Reviews| OLD | NEW |
|---|---|
| 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' hide Link; | 5 import 'dart:io' hide Link; |
| 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/common.dart'; | 8 import 'package:compiler/src/common.dart'; |
| 9 import 'package:compiler/src/compiler.dart'; | 9 import 'package:compiler/src/compiler.dart'; |
| 10 import 'package:compiler/src/diagnostics/diagnostic_listener.dart'; | 10 import 'package:compiler/src/diagnostics/diagnostic_listener.dart'; |
| 11 import 'package:compiler/src/elements/elements.dart'; | 11 import 'package:compiler/src/elements/elements.dart'; |
| 12 import 'package:compiler/src/elements/entities.dart'; | 12 import 'package:compiler/src/elements/entities.dart'; |
| 13 import 'package:compiler/src/kernel/element_map.dart'; | 13 import 'package:compiler/src/kernel/element_map.dart'; |
| 14 import 'package:compiler/src/kernel/kernel_backend_strategy.dart'; | 14 import 'package:compiler/src/kernel/kernel_backend_strategy.dart'; |
| 15 import 'package:compiler/src/js_model/locals.dart'; | 15 import 'package:compiler/src/js_model/locals.dart'; |
| 16 import 'package:compiler/src/tree/nodes.dart' as ast; | 16 import 'package:compiler/src/tree/nodes.dart' as ast; |
| 17 import 'package:compiler/src/util/util.dart'; | 17 import 'package:compiler/src/util/util.dart'; |
| 18 import 'package:expect/expect.dart'; | 18 import 'package:expect/expect.dart'; |
| 19 import '../equivalence/id_equivalence.dart'; | 19 import '../equivalence/id_equivalence.dart'; |
| 20 import '../equivalence/id_equivalence_helper.dart'; | 20 import '../equivalence/id_equivalence_helper.dart'; |
| 21 import 'package:kernel/ast.dart' as ir; | 21 import 'package:kernel/ast.dart' as ir; |
| 22 | 22 |
| 23 main(List<String> args) { | 23 main(List<String> args) { |
| 24 bool verbose = args.contains('-v'); | 24 bool verbose = args.contains('-v'); |
| 25 asyncTest(() async { | 25 asyncTest(() async { |
| 26 Directory dataDir = new Directory.fromUri(Platform.script.resolve('data')); | 26 Directory dataDir = new Directory.fromUri(Platform.script.resolve('data')); |
| 27 await for (FileSystemEntity entity in dataDir.list()) { | 27 await checkTests(dataDir, computeClosureData, computeKernelClosureData, |
| 28 print('----------------------------------------------------------------'); | 28 // TODO(johnnniwinther,efortuna): Enable the these tests for .dill. |
|
Siggi Cherem (dart-lang)
2017/08/25 00:23:46
the these => these
Johnni Winther
2017/08/25 07:44:25
Done.
| |
| 29 print('Checking ${entity.uri}'); | 29 skipForKernel: ['captured_variable.dart'], |
| 30 print('----------------------------------------------------------------'); | 30 verbose: verbose); |
| 31 String annotatedCode = await new File.fromUri(entity.uri).readAsString(); | |
| 32 print('--from source---------------------------------------------------'); | |
| 33 await checkCode(annotatedCode, computeClosureData, compileFromSource, | |
| 34 verbose: verbose); | |
| 35 // TODO(johnnniwinther,efortuna): Enable the these tests for .dill. | |
| 36 if (['captured_variable.dart'].contains(entity.uri.pathSegments.last)) { | |
| 37 print('--skipped for dill--------------------------------------------'); | |
| 38 continue; | |
| 39 } | |
| 40 print('--from dill-----------------------------------------------------'); | |
| 41 await checkCode(annotatedCode, computeKernelClosureData, compileFromDill, | |
| 42 verbose: verbose); | |
| 43 } | |
| 44 }); | 31 }); |
| 45 } | 32 } |
| 46 | 33 |
| 47 /// Compute closure data mapping for [_member] as a [MemberElement]. | 34 /// Compute closure data mapping for [_member] as a [MemberElement]. |
| 48 /// | 35 /// |
| 49 /// Fills [actualMap] with the data and [sourceSpanMap] with the source spans | 36 /// Fills [actualMap] with the data and [sourceSpanMap] with the source spans |
| 50 /// for the data origin. | 37 /// for the data origin. |
| 51 void computeClosureData( | 38 void computeClosureData( |
| 52 Compiler compiler, MemberEntity _member, Map<Id, ActualData> actualMap, | 39 Compiler compiler, MemberEntity _member, Map<Id, ActualData> actualMap, |
| 53 {bool verbose: false}) { | 40 {bool verbose: false}) { |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 315 if (value != '') { | 302 if (value != '') { |
| 316 sb.write('='); | 303 sb.write('='); |
| 317 sb.write(value); | 304 sb.write(value); |
| 318 } | 305 } |
| 319 needsComma = true; | 306 needsComma = true; |
| 320 } | 307 } |
| 321 } | 308 } |
| 322 return sb.toString(); | 309 return sb.toString(); |
| 323 } | 310 } |
| 324 } | 311 } |
| OLD | NEW |