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

Issue 10943027: Handle backslashes and newlines when escaping strings. (Closed)

Created:
8 years, 3 months ago by ahe
Modified:
8 years, 3 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Handle backslashes and newlines when escaping strings. Committed: https://code.google.com/p/dart/source/detail?r=12568

Patch Set 1 #

Total comments: 5

Patch Set 2 : Address review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -19 lines) Patch
M dart/lib/compiler/implementation/lib/core_patch.dart View 1 chunk +1 line, -8 lines 0 comments Download
M dart/lib/core/errors.dart View 1 1 chunk +18 lines, -1 line 0 comments Download
M dart/runtime/lib/errors_patch.dart View 1 chunk +1 line, -10 lines 0 comments Download
M dart/tests/corelib/safe_to_string_test.dart View 1 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
ahe
8 years, 3 months ago (2012-09-19 12:06:06 UTC) #1
Lasse Reichstein Nielsen
LGTM https://chromiumcodereview.appspot.com/10943027/diff/1/dart/lib/core/errors.dart File dart/lib/core/errors.dart (right): https://chromiumcodereview.appspot.com/10943027/diff/1/dart/lib/core/errors.dart#newcode85 dart/lib/core/errors.dart:85: if (object is int || object is double ...
8 years, 3 months ago (2012-09-19 12:14:53 UTC) #2
Mads Ager (google)
lgtm
8 years, 3 months ago (2012-09-19 12:36:06 UTC) #3
ahe
8 years, 3 months ago (2012-09-19 15:59:44 UTC) #4
Thank you, Mads and Lasse!

https://chromiumcodereview.appspot.com/10943027/diff/1/dart/lib/core/errors.dart
File dart/lib/core/errors.dart (right):

https://chromiumcodereview.appspot.com/10943027/diff/1/dart/lib/core/errors.d...
dart/lib/core/errors.dart:85: if (object is int || object is double || object is
bool || null == object) {
On 2012/09/19 12:14:53, Lasse Reichstein Nielsen wrote:
> The first two can be condensed to 'object is num'.

No. I'll leave it as an exercise to the reader to prove why. Hint: sqrt(-1).

https://chromiumcodereview.appspot.com/10943027/diff/1/dart/lib/core/errors.d...
dart/lib/core/errors.dart:93: .replaceAll('\n', '${backslash}n')
On 2012/09/19 12:14:53, Lasse Reichstein Nielsen wrote:
> Ditto for "\r", which is also a "newline" in Dart. (Good thing you don't need
to
> handle U+2028 and U+2029 too).

Done. Also extended the test.

Powered by Google App Engine
This is Rietveld 408576698