Chromium Code Reviews| Index: tools/dom/docs/lib/docs.dart |
| diff --git a/tools/dom/docs/lib/docs.dart b/tools/dom/docs/lib/docs.dart |
| index e4606ff259e787af36fb5302b6fb2fc9042cf990..7495fcdfb5a89596e701fea66c6bf5331404fc8f 100644 |
| --- a/tools/dom/docs/lib/docs.dart |
| +++ b/tools/dom/docs/lib/docs.dart |
| @@ -1,3 +1,7 @@ |
| +// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| /** |
| * A library for extracting the documentation from the various HTML libraries |
| * ([dart:html], [dart:svg], [dart:web_audio], [dart:indexed_db]) and saving |
| @@ -55,18 +59,18 @@ Future<bool> convert(Path libPath, Path jsonPath) { |
| return analyze(paths, libPath, options: ['--preserve-comments']) |
| .then((MirrorSystem mirrors) { |
| var convertedJson = _generateJsonFromLibraries(mirrors); |
| - return new Future.immediate(_exportJsonToFile(convertedJson, jsonPath)); |
| + return _exportJsonToFile(convertedJson, jsonPath); |
| }); |
| } |
| -bool _exportJsonToFile(Map convertedJson, Path jsonPath) { |
| +Future<bool> _exportJsonToFile(Map convertedJson, Path jsonPath) { |
|
Bob Nystrom
2013/03/28 14:18:40
This method does both sync and async IO, which mea
Andrei Mouravski
2013/03/28 17:01:14
Done.
|
| final jsonFile = new File.fromPath(jsonPath); |
| var writeJson = prettySerialize(convertedJson); |
| var outputStream = jsonFile.openWrite(); |
| outputStream.writeln(writeJson); |
| - |
| - return false; |
| + outputStream.close(); |
| + return outputStream.done.then((_) => false); |
| } |
| Map _generateJsonFromLibraries(MirrorSystem mirrors) { |