| Index: lib/src/emitters.dart
|
| diff --git a/lib/src/emitters.dart b/lib/src/emitters.dart
|
| index 0093f88e543aa1d7fd445b13befe3aabfb1d120f..19d252bbc86ac4a620c9e68bdea48203fd1fa5d2 100644
|
| --- a/lib/src/emitters.dart
|
| +++ b/lib/src/emitters.dart
|
| @@ -351,7 +351,7 @@ class WebComponentEmitter extends RecursiveEmitter {
|
| : info.tagName.replaceAll(new RegExp('[-./]'), '_');
|
| printer.add(codegen.header(info.declaringFile.path, libraryName));
|
|
|
| - // Add exisitng import, export, and part directives.
|
| + // Add existing import, export, and part directives.
|
| for (var directive in codeInfo.directives) {
|
| printer.add(codegen.directiveText(directive, info, pathInfo));
|
| }
|
| @@ -421,7 +421,7 @@ class MainPageEmitter extends RecursiveEmitter {
|
| ? codeInfo.libraryName : _fileInfo.libraryName;
|
| printer.add(codegen.header(_fileInfo.path, libraryName));
|
|
|
| - // Add exisitng import, export, and part directives.
|
| + // Add existing import, export, and part directives.
|
| for (var directive in codeInfo.directives) {
|
| printer.add(codegen.directiveText(directive, _fileInfo, pathInfo));
|
| }
|
| @@ -437,6 +437,23 @@ class MainPageEmitter extends RecursiveEmitter {
|
| }
|
| }
|
|
|
| +/** Emits a .dart file using the [DartCodeInfo]. */
|
| +String emitDartFile(FileInfo fileInfo, PathInfo pathInfo) {
|
| + var printer = new CodePrinter();
|
| +
|
| + // Inject library name if not pressent.
|
| + var codeInfo = fileInfo.userCode;
|
| + var libraryName = codeInfo.libraryName;
|
| + printer.add(codegen.header(fileInfo.path, codeInfo.libraryName));
|
| +
|
| + // Add existing import, export, and part directives.
|
| + for (var directive in codeInfo.directives) {
|
| + printer.add(codegen.directiveText(directive, fileInfo, pathInfo));
|
| + }
|
| + printer.addRaw(codeInfo.code);
|
| + return printer.formatString();
|
| +}
|
| +
|
| /** Clears all fields in [declarations]. */
|
| String _clearFields(Declarations declarations) {
|
| if (declarations.declarations.isEmpty) return '';
|
|
|