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

Unified Diff: sdk/lib/core/uri.dart

Issue 532273002: Fix scheme's toLowerCase detection. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: More test. Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/corelib/uri_scheme_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/core/uri.dart
diff --git a/sdk/lib/core/uri.dart b/sdk/lib/core/uri.dart
index 4b601a78a5cbd8556faf8cc7a3d38ef692d01451..eb17262421909c560c8c4cdf47f1f533bb54e36c 100644
--- a/sdk/lib/core/uri.dart
+++ b/sdk/lib/core/uri.dart
@@ -1102,17 +1102,17 @@ class Uri {
*/
static String _makeScheme(String scheme, int end) {
if (end == 0) return "";
- int char = scheme.codeUnitAt(0);
- if (!_isAlphabeticCharacter(char)) {
+ final int firstCodeUnit = scheme.codeUnitAt(0);
+ if (!_isAlphabeticCharacter(firstCodeUnit)) {
_fail(scheme, 0, "Scheme not starting with alphabetic character");
}
- bool allLowercase = char >= _LOWER_CASE_A;
+ bool allLowercase = firstCodeUnit >= _LOWER_CASE_A;
for (int i = 0; i < end; i++) {
- int codeUnit = scheme.codeUnitAt(i);
+ final int codeUnit = scheme.codeUnitAt(i);
if (!_isSchemeCharacter(codeUnit)) {
_fail(scheme, i, "Illegal scheme character");
}
- if (_LOWER_CASE_A <= char && _LOWER_CASE_Z >= char) {
+ if (codeUnit < _LOWER_CASE_A || codeUnit > _LOWER_CASE_Z) {
allLowercase = false;
}
}
« no previous file with comments | « no previous file | tests/corelib/uri_scheme_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698