Chromium Code Reviews
DescriptionFix interpretation of string contents after interpolation expressions.
Previously, the logic for skipping the opening quote(s) (and optional
'r') of a string were erroneously being invoked after string
interpolations. As a result, a string like '${x}"y' was being
interpreted as '${x}y'. Usually, this had no visible user effect,
because analyzer's interpretation of strings is currently only used
for constant evaluation, and string interpolation is rare in constant
expressions. However, it was triggering an internal error in the case
where the interpolation is at the end of a multiline string, since it
caused analyzer to compute that the number of characters following the
interpolation was negative.
In addition to fixing the bug, I've modified the logic for logging the
internal error so that it also asserts; this allows the error to be
detected by unit tests. I've also fixed an off-by-one error in the
internal error logic which had prevented the bug from being noticed on
single-line strings.
BUG=dartbug.com/23046
R=brianwilkerson@google.com
Committed: https://code.google.com/p/dart/source/detail?r=44880
Patch Set 1 #
Messages
Total messages: 4 (1 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||