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

Issue 23116007: Make Error.safeToString convert control codes in strings to escapes. (Closed)

Created:
7 years, 4 months ago by Lasse Reichstein Nielsen
Modified:
7 years ago
Reviewers:
Søren Gjesse, srdjan
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Make Error.safeToString convert control codes in strings to escapes. Converts values in the range 0x00 to 0x1f to escapes. Escapes are either \xhh for most values, or \n, \r and \t for NL, CR and TAB. BUG= http://dartbug.com/11250 R=sgjesse@google.com Committed: https://code.google.com/p/dart/source/detail?r=26269

Patch Set 1 #

Total comments: 3

Patch Set 2 : Addressed review comments. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -8 lines) Patch
M sdk/lib/core/errors.dart View 1 1 chunk +41 lines, -8 lines 2 comments Download
M tests/corelib/safe_to_string_test.dart View 1 chunk +10 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Lasse Reichstein Nielsen
7 years, 4 months ago (2013-08-16 11:19:37 UTC) #1
Søren Gjesse
lgtm https://codereview.chromium.org/23116007/diff/1/sdk/lib/core/errors.dart File sdk/lib/core/errors.dart (right): https://codereview.chromium.org/23116007/diff/1/sdk/lib/core/errors.dart#newcode48 sdk/lib/core/errors.dart:48: buffer.writeCharCode(codeUnit < 10 ? DIGIT_ZERO + codeUnit Align ...
7 years, 4 months ago (2013-08-16 11:24:57 UTC) #2
Lasse Reichstein Nielsen
https://codereview.chromium.org/23116007/diff/1/sdk/lib/core/errors.dart File sdk/lib/core/errors.dart (right): https://codereview.chromium.org/23116007/diff/1/sdk/lib/core/errors.dart#newcode53 sdk/lib/core/errors.dart:53: } else if (codeUnit == DOUBLE_QUOTE) { Readability - ...
7 years, 4 months ago (2013-08-16 11:27:41 UTC) #3
Lasse Reichstein Nielsen
Committed patchset #2 manually as r26269 (presubmit successful).
7 years, 4 months ago (2013-08-16 11:36:01 UTC) #4
srdjan
https://codereview.chromium.org/23116007/diff/7001/sdk/lib/core/errors.dart File sdk/lib/core/errors.dart (right): https://codereview.chromium.org/23116007/diff/7001/sdk/lib/core/errors.dart#newcode23 sdk/lib/core/errors.dart:23: const int CARRIGE_RETURN = 0x0d; Any reason why CARRIAGE_RETURN ...
7 years ago (2013-12-03 00:18:35 UTC) #5
Lasse Reichstein Nielsen
7 years ago (2013-12-03 08:50:27 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/23116007/diff/7001/sdk/lib/core/errors.dart
File sdk/lib/core/errors.dart (right):

https://codereview.chromium.org/23116007/diff/7001/sdk/lib/core/errors.dart#n...
sdk/lib/core/errors.dart:23: const int CARRIGE_RETURN = 0x0d;
It's ... shorter?
It's spelled like it's pronounced?
Or are you looking for a *good* reason, in which case I can't help you :)

We REALLY should have character constants. Then we could avoid this silly
spelling stuff and just write #'\n'.

Powered by Google App Engine
This is Rietveld 408576698