| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 @JS() | 4 @JS() |
| 5 library dev_compiler.web.web_command; | 5 library dev_compiler.web.web_command; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:convert'; | 8 import 'dart:convert'; |
| 9 import 'dart:html' show HttpRequest; | 9 import 'dart:html' show HttpRequest; |
| 10 | 10 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 var url = summaryUrls[i]; | 109 var url = summaryUrls[i]; |
| 110 var summaryBundle = new PackageBundle.fromBuffer(bytes); | 110 var summaryBundle = new PackageBundle.fromBuffer(bytes); |
| 111 summaryDataStore.addBundle(url, summaryBundle); | 111 summaryDataStore.addBundle(url, summaryBundle); |
| 112 } | 112 } |
| 113 var summaryResolver = | 113 var summaryResolver = |
| 114 new InSummaryUriResolver(resourceProvider, summaryDataStore); | 114 new InSummaryUriResolver(resourceProvider, summaryDataStore); |
| 115 | 115 |
| 116 var fileResolvers = [summaryResolver, resourceUriResolver]; | 116 var fileResolvers = [summaryResolver, resourceUriResolver]; |
| 117 | 117 |
| 118 var compiler = new ModuleCompiler( | 118 var compiler = new ModuleCompiler( |
| 119 new AnalyzerOptions(dartSdkPath: '/dart-sdk'), | 119 new AnalyzerOptions.basic(dartSdkPath: '/dart-sdk'), |
| 120 sdkResolver: sdkResolver, | 120 sdkResolver: sdkResolver, |
| 121 fileResolvers: fileResolvers, | 121 fileResolvers: fileResolvers, |
| 122 resourceProvider: resourceProvider); | 122 resourceProvider: resourceProvider); |
| 123 | 123 |
| 124 var context = compiler.context as AnalysisContextImpl; | 124 var context = compiler.context as AnalysisContextImpl; |
| 125 context.resultProvider = | 125 context.resultProvider = |
| 126 new InputPackagesResultProvider(compiler.context, summaryDataStore); | 126 new InputPackagesResultProvider(compiler.context, summaryDataStore); |
| 127 | 127 |
| 128 var compilerOptions = new CompilerOptions.fromArguments(argResults); | 128 var compilerOptions = new CompilerOptions.fromArguments(argResults); |
| 129 | 129 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 if (source is InSummarySource) { | 218 if (source is InSummarySource) { |
| 219 return source.summaryPath.substring(1).replaceAll('.api.ds', ''); | 219 return source.summaryPath.substring(1).replaceAll('.api.ds', ''); |
| 220 } | 220 } |
| 221 return source.toString().substring(1).replaceAll('.dart', ''); | 221 return source.toString().substring(1).replaceAll('.dart', ''); |
| 222 } | 222 } |
| 223 | 223 |
| 224 /// Thrown when the input source code has errors. | 224 /// Thrown when the input source code has errors. |
| 225 class CompileErrorException implements Exception { | 225 class CompileErrorException implements Exception { |
| 226 toString() => '\nPlease fix all errors before compiling (warnings are okay).'; | 226 toString() => '\nPlease fix all errors before compiling (warnings are okay).'; |
| 227 } | 227 } |
| OLD | NEW |