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

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

Issue 2346573002: Fix build break. (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « pkg/dev_compiler/test/codegen_test.dart ('k') | no next file » | 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:html' show HttpRequest; 8 import 'dart:html' show HttpRequest;
9 import 'dart:convert' show BASE64; 9 import 'dart:convert' show BASE64;
10 10
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 // Create a new virtual File that contains the given Dart source. 122 // Create a new virtual File that contains the given Dart source.
123 resourceProvider.newFile("/$fileName", sourceCode); 123 resourceProvider.newFile("/$fileName", sourceCode);
124 124
125 var unit = new BuildUnit( 125 var unit = new BuildUnit(
126 libraryName, "", ["file:///$fileName"], _moduleForLibrary); 126 libraryName, "", ["file:///$fileName"], _moduleForLibrary);
127 127
128 JSModuleFile module = compiler.compile(unit, compilerOptions); 128 JSModuleFile module = compiler.compile(unit, compilerOptions);
129 129
130 var moduleCode = module.isValid 130 var moduleCode = module.isValid
131 ? module 131 ? module
132 .getCode(ModuleFormat.legacy, unit.name, unit.name + '.map') 132 .getCode(ModuleFormat.legacy, false, unit.name, unit.name + '.map' )
Jennifer Messerly 2016/09/14 20:07:03 long line, maybe run format?
133 .code 133 .code
134 : ''; 134 : '';
135 135
136 return new CompileResult( 136 return new CompileResult(
137 code: moduleCode, isValid: module.isValid, errors: module.errors); 137 code: moduleCode, isValid: module.isValid, errors: module.errors);
138 }; 138 };
139 139
140 return allowInterop(compileFn); 140 return allowInterop(compileFn);
141 } 141 }
142 } 142 }
143 143
144 // Given path, determine corresponding dart library. 144 // Given path, determine corresponding dart library.
145 String _moduleForLibrary(source) { 145 String _moduleForLibrary(source) {
146 if (source is InSummarySource) { 146 if (source is InSummarySource) {
147 return source.summaryPath.substring(1).replaceAll('.api.ds', ''); 147 return source.summaryPath.substring(1).replaceAll('.api.ds', '');
148 } 148 }
149 return source.toString().substring(1).replaceAll('.dart', ''); 149 return source.toString().substring(1).replaceAll('.dart', '');
150 } 150 }
151 151
152 /// Thrown when the input source code has errors. 152 /// Thrown when the input source code has errors.
153 class CompileErrorException implements Exception { 153 class CompileErrorException implements Exception {
154 toString() => '\nPlease fix all errors before compiling (warnings are okay).'; 154 toString() => '\nPlease fix all errors before compiling (warnings are okay).';
155 } 155 }
OLDNEW
« no previous file with comments | « pkg/dev_compiler/test/codegen_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698