Chromium Code Reviews
DescriptionAdd Instance::ToUserCString.
-----
Often ToCString returns a representation which would be weighty or
unsightly to users. Instance::ToUserCString tries to return a
representation that will be more familiar to end users.
ToUserCString will be used in the vmservice to produce interesting
instance preview strings w/o calling toString. No doubt we will find
other uses for it too.
For example, strings are represented more as they would be in a user
program, with quotes and escapes: ("this\nis\ta\n\ntest") instead of (this
is a
test).
I intend to add better representations for short lists and maps
later, e.g. ([1,2]) instead of (Instance(length:2) of '_GrowableList').
I've added some tests to track current behavior.
Fix a problem where the vm internal names for private classes were
leaking out through ToCString. This is problematic because Dart's
default toString relies on ToCString (which surprised me). This fix
will be user-visible and, darn it, it's the right thing to do. For
example, before toString (in Dart) might yield:
Instance of '_MyPrivateClass@43df89GARBAGE4389'
Now it will yield:
Instance of '_MyPrivateClass'
(as an aside, do those single-quotes around the class name add any
meaning here?)
Massage the output of ToString for GrowableObjectArray to be more
consistent with other instance ToString output. This should not be user
visible, as lists define a reasonable toString.
R=johnmccutchan@google.com
Committed: https://code.google.com/p/dart/source/detail?r=30996
Patch Set 1 #Patch Set 2 : #
Total comments: 2
Patch Set 3 : #Patch Set 4 : #
Messages
Total messages: 5 (0 generated)
|
|||||||||||||||||||||||||||||||||||||