heapgraph icon indicating copy to clipboard operation
heapgraph copied to clipboard

stringy: string length is computed incorrectly for escaped strings

Open amccreight opened this issue 11 years ago • 0 comments

A string in the GC log like 'foo\n' gets recorded as having a length of 5, but the last character is actually '\n', not 'n', so the length should be 4. The main effect of this is that the string count can be wrong, sometimes showing up as 0. What needs to be done here is to figure out how the JS engine is escaping these strings, then unescape them and use that to compute string length.

amccreight avatar Aug 11 '14 17:08 amccreight