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

Side by Side Diff: utils/pub/repo_source.dart

Issue 10919024: - Change "static final" to "static const" in the (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « utils/css/tokenkind.dart ('k') | utils/pub/version.dart » ('j') | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #library('dartlang_source'); 5 #library('dartlang_source');
6 6
7 #import('dart:io'); 7 #import('dart:io');
8 #import('dart:json'); 8 #import('dart:json');
9 #import('dart:uri'); 9 #import('dart:uri');
10 #import('io.dart'); 10 #import('io.dart');
(...skipping 13 matching lines...) Expand all
24 24
25 final bool shouldCache = true; 25 final bool shouldCache = true;
26 26
27 // TODO(nweiz): update this comment once pub.dartlang.org is online 27 // TODO(nweiz): update this comment once pub.dartlang.org is online
28 /** 28 /**
29 * The URL of the default package repository. 29 * The URL of the default package repository.
30 * 30 *
31 * At time of writing, pub.dartlang.org is not yet online, but it should be 31 * At time of writing, pub.dartlang.org is not yet online, but it should be
32 * soon. 32 * soon.
33 */ 33 */
34 static final String defaultUrl = "http://pub.dartlang.org"; 34 static const String defaultUrl = "http://pub.dartlang.org";
35 35
36 RepoSource(); 36 RepoSource();
37 37
38 /** 38 /**
39 * Downloads a list of all versions of a package that have been uploaded to 39 * Downloads a list of all versions of a package that have been uploaded to
40 * pub.dartlang.org. 40 * pub.dartlang.org.
41 */ 41 */
42 Future<List<Version>> getVersions(description) { 42 Future<List<Version>> getVersions(description) {
43 var parsed = _parseDescription(description); 43 var parsed = _parseDescription(description);
44 var fullUrl = "${parsed.last}/packages/${parsed.first}.json"; 44 var fullUrl = "${parsed.last}/packages/${parsed.first}.json";
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 131
132 var name = description["name"]; 132 var name = description["name"];
133 if (name is! String) { 133 if (name is! String) {
134 throw new FormatException("The 'name' key must have a string value."); 134 throw new FormatException("The 'name' key must have a string value.");
135 } 135 }
136 136
137 var url = description.containsKey("url") ? description["url"] : defaultUrl; 137 var url = description.containsKey("url") ? description["url"] : defaultUrl;
138 return new Pair<String, String>(name, url); 138 return new Pair<String, String>(name, url);
139 } 139 }
140 } 140 }
OLDNEW
« no previous file with comments | « utils/css/tokenkind.dart ('k') | utils/pub/version.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698