Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Map original 'this' and 'arguments' to correct bindings where possible #5291

Merged

Conversation

loganfsmyth
Copy link
Contributor

Associated Issue: #5252

Summary of Changes

  • Fixes a few bugs in the visitor scope analysis
  • Uses scope information to try to map this and arguments

Test Plan

Kind of hard to test this one because Babel at least doesn't generate maps with good mappings for these. I'll make a PR for babel to map them properly.

Screenshots/Videos (OPTIONAL)

These shots are taken with a local copy of Babel that actually generates good maps for this and arguments 😬

  • Note the successful inclusion of the correct this in this case, even though the user is inside of a transformed arrow function.

    screen shot 2018-02-01 at 5 16 40 pm

  • Here note that this can only be transformed if there is a this reference in the same function scope as the breakpoint itself, as the debugger server does not send us binding information about this in other scopes. arguments still works because the parent scope has a reference to arguments. If neither location referenced either one, they would be excluded from the scope list entirely.

    screen shot 2018-02-01 at 5 33 57 pm

@loganfsmyth
Copy link
Contributor Author

I've submitted a PR for Babel so in the future these will map better. babel/babel#7312

@jasonLaster jasonLaster merged commit 6ade988 into firefox-devtools:master Feb 2, 2018
@loganfsmyth loganfsmyth deleted the original-implicit-bindings branch February 2, 2018 19:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants