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

Unified Diff: lib/src/hex/encoder.dart

Issue 1393003003: Add a percent-encoding converter. (Closed) Base URL: git@github.com:dart-lang/convert.git@master
Patch Set: Code review changes Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/hex/decoder.dart ('k') | lib/src/percent.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/hex/encoder.dart
diff --git a/lib/src/hex/encoder.dart b/lib/src/hex/encoder.dart
index 7a974e3df16a09df4bb13edfe694e0ec88b66b9b..a9c66a5a255cb4401de03655001a0bfb2aea6501 100644
--- a/lib/src/hex/encoder.dart
+++ b/lib/src/hex/encoder.dart
@@ -75,7 +75,8 @@ String _convert(List<int> bytes, int start, int end) {
for (var i = start; i < end; i++) {
var byte = bytes[i];
if (byte >= 0 && byte <= 0xff) continue;
- throw new FormatException("Invalid byte 0x${byte.toRadixString(16)}.",
+ throw new FormatException(
+ "Invalid byte ${byte < 0 ? "-" : ""}0x${byte.abs().toRadixString(16)}.",
bytes, i);
}
« no previous file with comments | « lib/src/hex/decoder.dart ('k') | lib/src/percent.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698