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

Unified Diff: pkg/webdriver/lib/webdriver.dart

Issue 12282038: Remove deprecated string features. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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
Index: pkg/webdriver/lib/webdriver.dart
diff --git a/pkg/webdriver/lib/webdriver.dart b/pkg/webdriver/lib/webdriver.dart
index 837836bd4c49944df5e550f69392d0864bd773d6..17b095304bbe24c16fcb0699b5393af2bf1992d5 100644
--- a/pkg/webdriver/lib/webdriver.dart
+++ b/pkg/webdriver/lib/webdriver.dart
@@ -282,15 +282,14 @@ class WebDriverBase {
results = sbuf.toString().trim();
// For some reason we get a bunch of NULs on the end
// of the text and the json.parse blows up on these, so
- // strip them. We have to do this the hard way as
- // replaceAll('\0', '') does not work.
+ // strip them.
// These NULs can be seen in the TCP packet, so it is not
// an issue with character encoding; it seems to be a bug
// in WebDriver stack.
for (var i = results.length; --i >= 0;) {
- var code = results.charCodeAt(i);
+ var code = results.codeUnitAt(i);
if (code != 0) {
- results = results.substring(0, i+1);
+ results = results.substring(0, i + 1);
break;
}
}

Powered by Google App Engine
This is Rietveld 408576698