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

Issue 8773021: Fixed escaping of const values (Closed)

Created:
9 years ago by Jennifer Messerly
Modified:
9 years ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Patch Set 1 #

Patch Set 2 : safer escaping #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+22 lines, -4 lines) Patch
M frog/frogsh View 3 chunks +5 lines, -2 lines 0 comments Download
M frog/value.dart View 1 3 chunks +6 lines, -2 lines 2 comments Download
A tests/language/src/ConstEscapeFrogTest.dart View 1 chunk +11 lines, -0 lines 1 comment Download

Messages

Total messages: 4 (0 generated)
Jennifer Messerly
tbr
9 years ago (2011-12-01 22:54:34 UTC) #1
Siggi Cherem (dart-lang)
lgtm
9 years ago (2011-12-01 23:05:08 UTC) #2
jimhug
I hate to be nit picking, but I think there are some minor holes in ...
9 years ago (2011-12-02 00:16:00 UTC) #3
Jennifer Messerly
9 years ago (2011-12-02 00:24:22 UTC) #4
http://codereview.chromium.org/8773021/diff/2002/frog/value.dart
File frog/value.dart (right):

http://codereview.chromium.org/8773021/diff/2002/frog/value.dart#newcode743
frog/value.dart:743: return text.replaceAll('/*', '/ *').replaceAll('*/', '*
/');
On 2011/12/02 00:16:00, jimhug wrote:
> I think you need two more spaces to make this bullet proof.  I'd strongly
> suggest just using ' * ' as the replacement.  With your current version, I
think
> these would break in the right/wrong positions:
> /*/   */*
> 

with the double replace,
> "/*/".replace('/*', '/ *').replace('*/', '* /')
"/ * /"
> "*/*".replace('/*', '/ *').replace('*/', '* /')
"* / *"

I don't feel 100% confident though with any of these, short of killing all / and
* from the string. (Maybe we should just get rid of the const-comments. I'm not
sure they're really worth it. Some complexity in GlobalValue/EvaluatedValue
would go away too)

Powered by Google App Engine
This is Rietveld 408576698