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

Side by Side Diff: lib/uri/uri.dart

Issue 10913271: Move parseInt parseDouble to int/double classes as a static method. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Make int.parse directly native. 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 | « lib/uri/encode_decode.dart ('k') | pkg/fixnum/int32.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('dart:uri'); 5 #library('dart:uri');
6 6
7 #import('dart:math'); 7 #import('dart:math');
8 #import('dart:utf'); 8 #import('dart:utf');
9 9
10 #source('encode_decode.dart'); 10 #source('encode_decode.dart');
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 this.path: "", 42 this.path: "",
43 this.query: "", 43 this.query: "",
44 this.fragment: ""}); 44 this.fragment: ""});
45 45
46 Uri(String uri) : this.fromString(uri); 46 Uri(String uri) : this.fromString(uri);
47 47
48 static String _emptyIfNull(String val) => val != null ? val : ''; 48 static String _emptyIfNull(String val) => val != null ? val : '';
49 49
50 static int _parseIntOrZero(String val) { 50 static int _parseIntOrZero(String val) {
51 if (val !== null && val != '') { 51 if (val !== null && val != '') {
52 return parseInt(val); 52 return int.parse(val);
53 } else { 53 } else {
54 return 0; 54 return 0;
55 } 55 }
56 } 56 }
57 57
58 // NOTE: This code was ported from: closure-library/closure/goog/uri/utils.js 58 // NOTE: This code was ported from: closure-library/closure/goog/uri/utils.js
59 static const RegExp _splitRe = const RegExp( 59 static const RegExp _splitRe = const RegExp(
60 '^' 60 '^'
61 '(?:' 61 '(?:'
62 '([^:/?#.]+)' // scheme - ignore special characters 62 '([^:/?#.]+)' // scheme - ignore special characters
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 } 230 }
231 231
232 static void _addIfNonEmpty(StringBuffer sb, String test, 232 static void _addIfNonEmpty(StringBuffer sb, String test,
233 String first, String second) { 233 String first, String second) {
234 if ("" != test) { 234 if ("" != test) {
235 sb.add(first === null ? "null" : first); 235 sb.add(first === null ? "null" : first);
236 sb.add(second === null ? "null" : second); 236 sb.add(second === null ? "null" : second);
237 } 237 }
238 } 238 }
239 } 239 }
OLDNEW
« no previous file with comments | « lib/uri/encode_decode.dart ('k') | pkg/fixnum/int32.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698