DescriptionBetter DDC sourcemap generation for lambdas
This doesn't fix the entire problem, there's still a Chrome issue that it's not clear we can work around, but it helps some. https://bugs.chromium.org/p/chromium/issues/detail?id=676388
There are three distinct issues here affecting Chrome sourcemap usage for DDC programs with single-line lambdas.
1 - We may introduce a synthetic "as SomeType" in a parameter. The synthetic token ends up with a large negative length, from its offset to the beginning of the file, which can confuse sourcemaps.
2 - We have no entry for the blank line following the lambda. The devtools asks for the mapping from (selectedLine, 0) to (selectedLine +1, 0) and if there's no mapping for either it refuses to set the breakpoint. So this artificially forces the mapping from the last character on the line to be to the beginning of the next line instead.
3 - With a lambda we introduce a constructed Return JS node and make a block. Those nodes weren't getting annotated, so they had no source information.
BUG=
R=jmesserly@google.com
Committed: https://github.com/dart-lang/sdk/commit/04bb68bb09781f4c82f23f4941e4a461e66dfc28
Patch Set 1 #Patch Set 2 : Merged and formatted #
Total comments: 4
Patch Set 3 : Skip synthetic nodes and method declarations #
Total comments: 1
Patch Set 4 : Added comments #
Messages
Total messages: 14 (4 generated)
|