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

Unified Diff: dart/tests/compiler/dart2js/memory_compiler.dart

Issue 21110003: Implement MirrorUsed.targets for libraries (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r25609 and added test. Created 7 years, 5 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
Index: dart/tests/compiler/dart2js/memory_compiler.dart
diff --git a/dart/tests/compiler/dart2js/memory_compiler.dart b/dart/tests/compiler/dart2js/memory_compiler.dart
index 3bf07d2d93b1e0217d2c16252e4023760849f919..a45e1ca27695eae95ab54c4f5fb5c0a8d648b8c3 100644
--- a/dart/tests/compiler/dart2js/memory_compiler.dart
+++ b/dart/tests/compiler/dart2js/memory_compiler.dart
@@ -1,68 +1,68 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library dart2js.test.memory_compiler;
-
-import 'package:expect/expect.dart';
-import 'memory_source_file_helper.dart';
-
-import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart'
- show NullSink;
-
-import '../../../sdk/lib/_internal/compiler/compiler.dart'
- show DiagnosticHandler;
-
-import 'dart:async';
-
-import '../../../sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart';
-import '../../../sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart';
-
-Compiler compilerFor(Map<String,String> memorySourceFiles,
- {DiagnosticHandler diagnosticHandler,
- List<String> options: const []}) {
- Uri script = currentDirectory.resolve(nativeToUriPath(Platform.script));
- Uri libraryRoot = script.resolve('../../../sdk/');
- Uri packageRoot = script.resolve('./packages/');
-
- MemorySourceFileProvider.MEMORY_SOURCE_FILES = memorySourceFiles;
- var provider = new MemorySourceFileProvider();
- if (diagnosticHandler == null) {
- diagnosticHandler = new FormattingDiagnosticHandler(provider);
- }
-
- EventSink<String> outputProvider(String name, String extension) {
- if (name != '') throw 'Attempt to output file "$name.$extension"';
- return new NullSink('$name.$extension');
- }
-
- Compiler compiler = new Compiler(provider.readStringFromUri,
- outputProvider,
- diagnosticHandler,
- libraryRoot,
- packageRoot,
- options);
- return compiler;
-}
-
-Future<MirrorSystem> mirrorSystemFor(Map<String,String> memorySourceFiles,
- {DiagnosticHandler diagnosticHandler,
- List<String> options: const []}) {
- Uri script = currentDirectory.resolve(nativeToUriPath(Platform.script));
- Uri libraryRoot = script.resolve('../../../sdk/');
- Uri packageRoot = script.resolve('./packages/');
-
- MemorySourceFileProvider.MEMORY_SOURCE_FILES = memorySourceFiles;
- var provider = new MemorySourceFileProvider();
- if (diagnosticHandler == null) {
- diagnosticHandler = new FormattingDiagnosticHandler(provider);
- }
-
- List<Uri> libraries = <Uri>[];
- memorySourceFiles.forEach((String path, _) {
- libraries.add(new Uri(scheme: 'memory', path: path));
- });
-
- return analyze(libraries, libraryRoot, packageRoot,
- provider, diagnosticHandler, options);
-}
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library dart2js.test.memory_compiler;
+
+import 'package:expect/expect.dart';
+import 'memory_source_file_helper.dart';
+
+import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart'
+ show NullSink;
+
+import '../../../sdk/lib/_internal/compiler/compiler.dart'
+ show DiagnosticHandler;
+
+import 'dart:async';
+
+import '../../../sdk/lib/_internal/compiler/implementation/mirrors/mirrors.dart';
+import '../../../sdk/lib/_internal/compiler/implementation/mirrors/dart2js_mirror.dart';
+
+Compiler compilerFor(Map<String,String> memorySourceFiles,
+ {DiagnosticHandler diagnosticHandler,
+ List<String> options: const []}) {
+ Uri script = currentDirectory.resolve(nativeToUriPath(Platform.script));
+ Uri libraryRoot = script.resolve('../../../sdk/');
+ Uri packageRoot = script.resolve('./packages/');
+
+ MemorySourceFileProvider.MEMORY_SOURCE_FILES = memorySourceFiles;
+ var provider = new MemorySourceFileProvider();
+ if (diagnosticHandler == null) {
+ diagnosticHandler = new FormattingDiagnosticHandler(provider);
+ }
+
+ EventSink<String> outputProvider(String name, String extension) {
+ if (name != '') throw 'Attempt to output file "$name.$extension"';
+ return new NullSink('$name.$extension');
+ }
+
+ Compiler compiler = new Compiler(provider.readStringFromUri,
+ outputProvider,
+ diagnosticHandler,
+ libraryRoot,
+ packageRoot,
+ options);
+ return compiler;
+}
+
+Future<MirrorSystem> mirrorSystemFor(Map<String,String> memorySourceFiles,
+ {DiagnosticHandler diagnosticHandler,
+ List<String> options: const []}) {
+ Uri script = currentDirectory.resolve(nativeToUriPath(Platform.script));
+ Uri libraryRoot = script.resolve('../../../sdk/');
+ Uri packageRoot = script.resolve('./packages/');
+
+ MemorySourceFileProvider.MEMORY_SOURCE_FILES = memorySourceFiles;
+ var provider = new MemorySourceFileProvider();
+ if (diagnosticHandler == null) {
+ diagnosticHandler = new FormattingDiagnosticHandler(provider);
+ }
+
+ List<Uri> libraries = <Uri>[];
+ memorySourceFiles.forEach((String path, _) {
+ libraries.add(new Uri(scheme: 'memory', path: path));
+ });
+
+ return analyze(libraries, libraryRoot, packageRoot,
+ provider, diagnosticHandler, options);
+}

Powered by Google App Engine
This is Rietveld 408576698