OLD | NEW |
---|---|
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 /// Command line tool to run the checker on a Dart program. | 5 /// Command line tool to run the checker on a Dart program. |
6 library dev_compiler.src.compiler; | 6 library dev_compiler.src.compiler; |
7 | 7 |
8 import 'dart:async'; | 8 import 'dart:async'; |
9 import 'dart:collection'; | 9 import 'dart:collection'; |
10 import 'dart:convert' show JSON; | 10 import 'dart:convert' show JSON; |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
298 scriptSource = context.sourceFactory.resolveUri(source, srcAttr); | 298 scriptSource = context.sourceFactory.resolveUri(source, srcAttr); |
299 } | 299 } |
300 | 300 |
301 if (scriptSource != null) { | 301 if (scriptSource != null) { |
302 var lib = context.computeLibraryElement(scriptSource); | 302 var lib = context.computeLibraryElement(scriptSource); |
303 _compileLibrary(lib, notifier); | 303 _compileLibrary(lib, notifier); |
304 script.replaceWith(_linkLibraries(lib, loadedLibs, from: htmlOutDir)); | 304 script.replaceWith(_linkLibraries(lib, loadedLibs, from: htmlOutDir)); |
305 } | 305 } |
306 } | 306 } |
307 | 307 |
308 new File(getOutputPath(source.uri)).openSync(mode: FileMode.WRITE) | 308 var outputFile = getOutputPath(source.uri); |
309 var file = new File(outputFile)..createSync(recursive: true); | |
310 file.openSync(mode: FileMode.WRITE) | |
Jennifer Messerly
2016/01/29 16:49:49
silly style nit: curious about the mix between cas
vsm
2016/01/29 18:13:51
Done.
| |
309 ..writeStringSync(document.outerHtml) | 311 ..writeStringSync(document.outerHtml) |
310 ..writeStringSync('\n') | 312 ..writeStringSync('\n') |
311 ..closeSync(); | 313 ..closeSync(); |
312 } | 314 } |
313 | 315 |
314 html.DocumentFragment _linkLibraries( | 316 html.DocumentFragment _linkLibraries( |
315 LibraryElement mainLib, LinkedHashSet<Uri> loaded, | 317 LibraryElement mainLib, LinkedHashSet<Uri> loaded, |
316 {String from}) { | 318 {String from}) { |
317 assert(from != null); | 319 assert(from != null); |
318 var alreadyLoaded = loaded.length; | 320 var alreadyLoaded = loaded.length; |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
535 var files = [ | 537 var files = [ |
536 'harmony_feature_check.js', | 538 'harmony_feature_check.js', |
537 'dart_library.js', | 539 'dart_library.js', |
538 'dart/_runtime.js', | 540 'dart/_runtime.js', |
539 ]; | 541 ]; |
540 files.addAll(corelibOrder.map(coreToFile)); | 542 files.addAll(corelibOrder.map(coreToFile)); |
541 return files; | 543 return files; |
542 }(); | 544 }(); |
543 | 545 |
544 final _log = new Logger('dev_compiler.src.compiler'); | 546 final _log = new Logger('dev_compiler.src.compiler'); |
OLD | NEW |