| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library dart2js.test.memory_compiler; | 5 library dart2js.test.memory_compiler; |
| 6 | 6 |
| 7 import 'package:expect/expect.dart'; | 7 import 'package:expect/expect.dart'; |
| 8 import 'memory_source_file_helper.dart'; | 8 import 'memory_source_file_helper.dart'; |
| 9 | 9 |
| 10 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' | 10 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 EventSink<String> outputProvider(String name, String extension) { | 90 EventSink<String> outputProvider(String name, String extension) { |
| 91 if (name != '') throw 'Attempt to output file "$name.$extension"'; | 91 if (name != '') throw 'Attempt to output file "$name.$extension"'; |
| 92 return new NullSink('$name.$extension'); | 92 return new NullSink('$name.$extension'); |
| 93 } | 93 } |
| 94 | 94 |
| 95 Compiler compiler = new Compiler(provider.readStringFromUri, | 95 Compiler compiler = new Compiler(provider.readStringFromUri, |
| 96 outputProvider, | 96 outputProvider, |
| 97 handler, | 97 handler, |
| 98 libraryRoot, | 98 libraryRoot, |
| 99 packageRoot, | 99 packageRoot, |
| 100 options); | 100 options, |
| 101 {}); |
| 101 if (cachedCompiler != null) { | 102 if (cachedCompiler != null) { |
| 102 compiler.coreLibrary = cachedCompiler.libraries['dart:core']; | 103 compiler.coreLibrary = cachedCompiler.libraries['dart:core']; |
| 103 compiler.types = cachedCompiler.types; | 104 compiler.types = cachedCompiler.types; |
| 104 cachedCompiler.libraries.forEach((String uri, library) { | 105 cachedCompiler.libraries.forEach((String uri, library) { |
| 105 if (library.isPlatformLibrary) { | 106 if (library.isPlatformLibrary) { |
| 106 compiler.libraries[uri] = library; | 107 compiler.libraries[uri] = library; |
| 107 compiler.onLibraryLoaded(library, library.canonicalUri); | 108 compiler.onLibraryLoaded(library, library.canonicalUri); |
| 108 } | 109 } |
| 109 }); | 110 }); |
| 110 | 111 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 createDiagnosticHandler(diagnosticHandler, provider, showDiagnostics); | 146 createDiagnosticHandler(diagnosticHandler, provider, showDiagnostics); |
| 146 | 147 |
| 147 List<Uri> libraries = <Uri>[]; | 148 List<Uri> libraries = <Uri>[]; |
| 148 memorySourceFiles.forEach((String path, _) { | 149 memorySourceFiles.forEach((String path, _) { |
| 149 libraries.add(new Uri(scheme: 'memory', path: path)); | 150 libraries.add(new Uri(scheme: 'memory', path: path)); |
| 150 }); | 151 }); |
| 151 | 152 |
| 152 return analyze(libraries, libraryRoot, packageRoot, | 153 return analyze(libraries, libraryRoot, packageRoot, |
| 153 provider, handler, options); | 154 provider, handler, options); |
| 154 } | 155 } |
| OLD | NEW |