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

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

Issue 11238035: Make isEmpty a getter. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status file with co19 issue number. Created 8 years, 2 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/pub/pub.dart ('k') | utils/pub/version_solver.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 pubspec; 5 library pubspec;
6 6
7 import 'package.dart'; 7 import 'package.dart';
8 import 'source.dart'; 8 import 'source.dart';
9 import 'source_registry.dart'; 9 import 'source_registry.dart';
10 import 'utils.dart'; 10 import 'utils.dart';
(...skipping 21 matching lines...) Expand all
32 32
33 Pubspec(this.name, this.version, this.dependencies); 33 Pubspec(this.name, this.version, this.dependencies);
34 34
35 Pubspec.empty() 35 Pubspec.empty()
36 : name = null, 36 : name = null,
37 version = Version.none, 37 version = Version.none,
38 dependencies = <PackageRef>[]; 38 dependencies = <PackageRef>[];
39 39
40 /** Whether or not the pubspec has no contents. */ 40 /** Whether or not the pubspec has no contents. */
41 bool get isEmpty => 41 bool get isEmpty =>
42 name == null && version == Version.none && dependencies.isEmpty(); 42 name == null && version == Version.none && dependencies.isEmpty;
43 43
44 /** 44 /**
45 * Parses the pubspec whose text is [contents]. If the pubspec doesn't define 45 * Parses the pubspec whose text is [contents]. If the pubspec doesn't define
46 * version for itself, it defaults to [Version.none]. 46 * version for itself, it defaults to [Version.none].
47 */ 47 */
48 factory Pubspec.parse(String contents, SourceRegistry sources) { 48 factory Pubspec.parse(String contents, SourceRegistry sources) {
49 var name = null; 49 var name = null;
50 var version = Version.none; 50 var version = Version.none;
51 var dependencies = <PackageRef>[]; 51 var dependencies = <PackageRef>[];
52 52
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 156
157 if (parsedPubspec.containsKey('author')) { 157 if (parsedPubspec.containsKey('author')) {
158 throw new FormatException('A pubspec should not have both an "author" ' 158 throw new FormatException('A pubspec should not have both an "author" '
159 'and an "authors" field.'); 159 'and an "authors" field.');
160 } 160 }
161 } 161 }
162 162
163 return new Pubspec(name, version, dependencies); 163 return new Pubspec(name, version, dependencies);
164 } 164 }
165 } 165 }
OLDNEW
« no previous file with comments | « utils/pub/pub.dart ('k') | utils/pub/version_solver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698