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

Side by Side Diff: pkg/dev_compiler/web/web_command.dart

Issue 2474523003: fix #27607, add dev_compiler summary to the SDK and move JS files (Closed)
Patch Set: fix typo Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « pkg/dev_compiler/tool/build_test_pkgs.sh ('k') | tools/create_sdk.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 } 190 }
191 sb.write(body); 191 sb.write(body);
192 sourceCode = sb.toString(); 192 sourceCode = sb.toString();
193 } 193 }
194 resourceProvider.newFile(fileName, sourceCode); 194 resourceProvider.newFile(fileName, sourceCode);
195 195
196 var unit = new BuildUnit(libraryName, "", [fileName], _moduleForLibrary); 196 var unit = new BuildUnit(libraryName, "", [fileName], _moduleForLibrary);
197 197
198 JSModuleFile module = compiler.compile(unit, compilerOptions); 198 JSModuleFile module = compiler.compile(unit, compilerOptions);
199 199
200 var moduleCode = module.isValid 200 var moduleCode = '';
201 ? module 201 if (module.isValid) {
202 .getCode(ModuleFormat.legacy, true, unit.name, unit.name + '.map') 202 moduleCode = module
203 .code 203 .getCode(ModuleFormat.legacy, unit.name, unit.name + '.map',
204 : ''; 204 singleOutFile: true)
205 .code;
206 }
205 207
206 return new CompileResult( 208 return new CompileResult(
207 code: moduleCode, isValid: module.isValid, errors: module.errors); 209 code: moduleCode, isValid: module.isValid, errors: module.errors);
208 }; 210 };
209 211
210 return allowInterop(compileFn); 212 return allowInterop(compileFn);
211 } 213 }
212 } 214 }
213 215
214 // Given path, determine corresponding dart library. 216 // Given path, determine corresponding dart library.
215 String _moduleForLibrary(source) { 217 String _moduleForLibrary(source) {
216 if (source is InSummarySource) { 218 if (source is InSummarySource) {
217 return source.summaryPath.substring(1).replaceAll('.api.ds', ''); 219 return source.summaryPath.substring(1).replaceAll('.api.ds', '');
218 } 220 }
219 return source.toString().substring(1).replaceAll('.dart', ''); 221 return source.toString().substring(1).replaceAll('.dart', '');
220 } 222 }
221 223
222 /// Thrown when the input source code has errors. 224 /// Thrown when the input source code has errors.
223 class CompileErrorException implements Exception { 225 class CompileErrorException implements Exception {
224 toString() => '\nPlease fix all errors before compiling (warnings are okay).'; 226 toString() => '\nPlease fix all errors before compiling (warnings are okay).';
225 } 227 }
OLDNEW
« no previous file with comments | « pkg/dev_compiler/tool/build_test_pkgs.sh ('k') | tools/create_sdk.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698