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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Associated Issue: #5252
Summary of Changes
this
andarguments
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
andarguments
😬Note the successful inclusion of the correct
this
in this case, even though the user is inside of a transformed arrow function.Here note that
this
can only be transformed if there is athis
reference in the same function scope as the breakpoint itself, as the debugger server does not send us binding information aboutthis
in other scopes.arguments
still works because the parent scope has a reference toarguments
. If neither location referenced either one, they would be excluded from the scope list entirely.