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

Unified Diff: frog/leg/lib/uri_toremove.dart

Issue 9677019: Enable isolate tests with leg and legium. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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 | « no previous file | lib/isolate/frog/isolateimpl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/leg/lib/uri_toremove.dart
===================================================================
--- frog/leg/lib/uri_toremove.dart (revision 5351)
+++ frog/leg/lib/uri_toremove.dart (working copy)
@@ -8,6 +8,7 @@
* A parsed URI, inspired by:
* http://closure-library.googlecode.com/svn/docs/class_goog_Uri.html
*/
+// TODO(ngeoffray): Remove this file once Leg support compile-time constants.
class Uri {
final String scheme;
final String userInfo;
@@ -43,25 +44,31 @@
}
// NOTE: This code was ported from: closure-library/closure/goog/uri/utils.js
- static final RegExp _splitRe = const RegExp(
- '^' +
- '(?:' +
- '([^:/?#.]+)' + // scheme - ignore special characters
- // used by other URL parts such as :,
- // ?, /, #, and .
- ':)?' +
- '(?://' +
- '(?:([^/?#]*)@)?' + // userInfo
- '([\\w\\d\\-\\u0100-\\uffff.%]*)' +
- // domain - restrict to letters,
- // digits, dashes, dots, percent
- // escapes, and unicode characters.
- '(?::([0-9]+))?' + // port
- ')?' +
- '([^?#]+)?' + // path
- '(?:\\?([^#]*))?' + // query
- '(?:#(.*))?' + // fragment
- '\$');
+ static RegExp _regexp;
+ static RegExp get _splitRe() {
+ if (_regexp == null) {
+ _regexp = new RegExp(
+ '^' +
+ '(?:' +
+ '([^:/?#.]+)' + // scheme - ignore special characters
+ // used by other URL parts such as :,
+ // ?, /, #, and .
+ ':)?' +
+ '(?://' +
+ '(?:([^/?#]*)@)?' + // userInfo
+ '([\\w\\d\\-\\u0100-\\uffff.%]*)' +
+ // domain - restrict to letters,
+ // digits, dashes, dots, percent
+ // escapes, and unicode characters.
+ '(?::([0-9]+))?' + // port
+ ')?' +
+ '([^?#]+)?' + // path
+ '(?:\\?([^#]*))?' + // query
+ '(?:#(.*))?' + // fragment
+ '\$');
+ }
+ return _regexp;
+ }
static final _COMPONENT_SCHEME = 1;
static final _COMPONENT_USER_INFO = 2;
« no previous file with comments | « no previous file | lib/isolate/frog/isolateimpl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698