| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 // Test that the compiler emits a warning on import of 'dart:mirrors' unless | 5 // Test that the compiler emits a warning on import of 'dart:mirrors' unless |
| 6 // the flag --enable-experimental-mirrors is used. | 6 // the flag --enable-experimental-mirrors is used. |
| 7 | 7 |
| 8 library dart2js.test.import_mirrors; | 8 library dart2js.test.import_mirrors; |
| 9 | 9 |
| 10 import 'dart:async'; | 10 import 'dart:async'; |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 expectedPaths = [expectedPaths]; | 309 expectedPaths = [expectedPaths]; |
| 310 } | 310 } |
| 311 var collector = new DiagnosticCollector(); | 311 var collector = new DiagnosticCollector(); |
| 312 var options = []; | 312 var options = []; |
| 313 if (verbose) { | 313 if (verbose) { |
| 314 options.add('--verbose'); | 314 options.add('--verbose'); |
| 315 } | 315 } |
| 316 if (enableExperimentalMirrors) { | 316 if (enableExperimentalMirrors) { |
| 317 options.add('--enable-experimental-mirrors'); | 317 options.add('--enable-experimental-mirrors'); |
| 318 } | 318 } |
| 319 CompilationResult result = await runCompiler( | 319 await runCompiler( |
| 320 entryPoint: Uri.parse('memory:/main.dart'), | 320 entryPoint: Uri.parse('memory:/main.dart'), |
| 321 memorySourceFiles: sourceFiles, | 321 memorySourceFiles: sourceFiles, |
| 322 diagnosticHandler: collector, | 322 diagnosticHandler: collector, |
| 323 packageRoot: Uri.parse('memory:/pkg/'), | 323 packageRoot: Uri.parse('memory:/pkg/'), |
| 324 options: options); | 324 options: options); |
| 325 Expect.equals(0, collector.errors.length, 'Errors: ${collector.errors}'); | 325 Expect.equals(0, collector.errors.length, 'Errors: ${collector.errors}'); |
| 326 if (enableExperimentalMirrors) { | 326 if (enableExperimentalMirrors) { |
| 327 Expect.equals( | 327 Expect.equals( |
| 328 0, collector.warnings.length, 'Warnings: ${collector.errors}'); | 328 0, collector.warnings.length, 'Warnings: ${collector.errors}'); |
| 329 } else { | 329 } else { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 DUAL_INDIRECT_IMPORT2, | 366 DUAL_INDIRECT_IMPORT2, |
| 367 DUAL_INDIRECT_IMPORT3, | 367 DUAL_INDIRECT_IMPORT3, |
| 368 DUAL_INDIRECT_PACKAGE_IMPORT1, | 368 DUAL_INDIRECT_PACKAGE_IMPORT1, |
| 369 DIRECT_EXPORT, | 369 DIRECT_EXPORT, |
| 370 INDIRECT_EXPORT1, | 370 INDIRECT_EXPORT1, |
| 371 INDIRECT_EXPORT2, | 371 INDIRECT_EXPORT2, |
| 372 INDIRECT_PACKAGE_EXPORT1, | 372 INDIRECT_PACKAGE_EXPORT1, |
| 373 INDIRECT_PACKAGE_EXPORT2 | 373 INDIRECT_PACKAGE_EXPORT2 |
| 374 ], (map) => checkPaths(map))); | 374 ], (map) => checkPaths(map))); |
| 375 } | 375 } |
| OLD | NEW |