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

Unified Diff: utils/pub/version.dart

Issue 10829459: Deprecate Math object in corelib in favor of dart:math library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « utils/pub/pub.dart ('k') | utils/pub/version_solver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/version.dart
diff --git a/utils/pub/version.dart b/utils/pub/version.dart
index 9fe2bd00df601b945f1cc3edd82be01a5729bfe2..796dec0feb99200171e1d771813b2ce15f3966a2 100644
--- a/utils/pub/version.dart
+++ b/utils/pub/version.dart
@@ -9,6 +9,8 @@
*/
#library('version');
+#import('dart:math');
+
#import('utils.dart');
/** A parsed semantic version number. */
@@ -59,9 +61,9 @@ class Version implements Comparable, Hashable, VersionConstraint {
}
try {
- int major = Math.parseInt(match[1]);
- int minor = Math.parseInt(match[2]);
- int patch = Math.parseInt(match[3]);
+ int major = parseInt(match[1]);
+ int minor = parseInt(match[2]);
+ int patch = parseInt(match[3]);
String preRelease = match[5];
String build = match[8];
@@ -143,7 +145,7 @@ class Version implements Comparable, Hashable, VersionConstraint {
var aParts = _splitParts(a);
var bParts = _splitParts(b);
- for (int i = 0; i < Math.max(aParts.length, bParts.length); i++) {
+ for (int i = 0; i < max(aParts.length, bParts.length); i++) {
var aPart = (i < aParts.length) ? aParts[i] : null;
var bPart = (i < bParts.length) ? bParts[i] : null;
@@ -180,7 +182,7 @@ class Version implements Comparable, Hashable, VersionConstraint {
List _splitParts(String text) {
return text.split('.').map((part) {
try {
- return Math.parseInt(part);
+ return parseInt(part);
} catch (FormatException ex) {
// Not a number.
return part;
« 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