• Benedikt Meurer's avatar
    [inspector] Fix positions for inline scripts with #sourceURL. · c2f30c2b
    Benedikt Meurer authored
    For inline scripts that have a `// #sourceURL=foo.js` annotation, the
    V8 inspector (and by extension `Error.stack`) currently operates in
    terms of the `foo.js`, i.e. doesn't give any hint about the actual
    source, except for the line/column offsets reported upon scriptParsed.
    However in case of stack frames (i.e. as part of `Error.stack` or as
    part of the call frames reported via CDP), the line/column offsets are
    relative to the actual source instead of relative to the `foo.js` part,
    which - besides other things - makes post-processing of recorded stack
    traces tricky (sometimes impossible).
    
    This change adjusts the source positions reported for (inline) scripts
    with sourceURL annotations to be relative to the (inline) script instead
    of the surrounding document.
    
    Bug: chromium:1183990
    Fixed: chromium:578269
    Change-Id: I74f2b93c22ec43ca796b6b51faa9df5b99cf03f9
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3069289
    Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
    Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
    Reviewed-by: 's avatarSimon Zünd <szuend@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#76097}
    c2f30c2b
console-methods-expected.txt 29.9 KB