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

Side by Side Diff: sdk/lib/_internal/dartdoc/lib/dartdoc.dart

Issue 14070010: Refactor Future constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added co19 issue number. Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 /** 5 /**
6 * To generate docs for a library, run this script with the path to an 6 * To generate docs for a library, run this script with the path to an
7 * entrypoint .dart file, like: 7 * entrypoint .dart file, like:
8 * 8 *
9 * $ dart dartdoc.dart foo.dart 9 * $ dart dartdoc.dart foo.dart
10 * 10 *
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 'outputDir': outputDir.toNativePath(), 142 'outputDir': outputDir.toNativePath(),
143 'libPath': libPath.toNativePath() 143 'libPath': libPath.toNativePath()
144 }).then((result) { 144 }).then((result) {
145 if (result.first == 'success') return; 145 if (result.first == 'success') return;
146 throw new AsyncError(result[1], result[2]); 146 throw new AsyncError(result[1], result[2]);
147 }); 147 });
148 } 148 }
149 149
150 void _compileScript() { 150 void _compileScript() {
151 port.receive((message, replyTo) { 151 port.receive((message, replyTo) {
152 new Future.of(() { 152 new Future.sync(() {
153 var clientScript = (message['mode'] == MODE_STATIC) ? 153 var clientScript = (message['mode'] == MODE_STATIC) ?
154 'static' : 'live-nav'; 154 'static' : 'live-nav';
155 var dartPath = pathos.join(message['libPath'], 'lib', '_internal', 155 var dartPath = pathos.join(message['libPath'], 'lib', '_internal',
156 'dartdoc', 'lib', 'src', 'client', 'client-$clientScript.dart'); 156 'dartdoc', 'lib', 'src', 'client', 'client-$clientScript.dart');
157 var jsPath = pathos.join(message['outputDir'], 'client-$clientScript.js'); 157 var jsPath = pathos.join(message['outputDir'], 'client-$clientScript.js');
158 158
159 return dart2js.compile( 159 return dart2js.compile(
160 new Path(dartPath), new Path(message['libPath']), 160 new Path(dartPath), new Path(message['libPath']),
161 options: const <String>['--categories=Client,Server']).then((jsCode) { 161 options: const <String>['--categories=Client,Server']).then((jsCode) {
162 writeString(new File(jsPath), jsCode); 162 writeString(new File(jsPath), jsCode);
(...skipping 2152 matching lines...) Expand 10 before | Expand all | Expand 10 after
2315 return ''' 2315 return '''
2316 <div class="mdn"> 2316 <div class="mdn">
2317 $mdnComment 2317 $mdnComment
2318 <div class="mdn-note"><a href="$mdnUrl">from MDN</a></div> 2318 <div class="mdn-note"><a href="$mdnUrl">from MDN</a></div>
2319 </div> 2319 </div>
2320 '''; 2320 ''';
2321 } 2321 }
2322 2322
2323 String toString() => mdnComment; 2323 String toString() => mdnComment;
2324 } 2324 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/source_file_provider.dart ('k') | sdk/lib/async/future.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698