Skip to content
This repository was archived by the owner on Sep 21, 2021. It is now read-only.

Conversation

@yurydelendik
Copy link
Contributor

Associated Issue: firefox-devtools/debugger#4521

Summary of Changes

  • Adds remapScopes utility function to the devtools-map-bindings package.

// Moving to the function bounary (in generated scopes).
while (
foundInMax + 1 < searchIn.length &&
searchIn[foundInMax].type !== "function"
Copy link
Contributor Author

@yurydelendik yurydelendik Nov 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

runtime Scope.type property is not reliable

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to fall back on block as well while we fix this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

property reliable after all

({ isLast, result }, scope) => {
if (isLast) {
result.push([]);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chunk is a pretty strange term...

I think i would prefer functionScopes, perhaps we move this into a small helper function:

const functionScopes = rollupFunctionScopes(scopes)

const names = summarizedScopes.reduce(
(acc, { bindingsNames }) => acc.concat(bindingsNames),
[]
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be nice to have a small helper function: getBindingNames that can take our function scopes and return a list of names...

const names = getBindingNames(scopeChunk)

// Moving to the function bounary (in generated scopes).
while (
foundInMax + 1 < searchIn.length &&
searchIn[foundInMax].type !== "function"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to fall back on block as well while we fix this?

}

// We found chunk of the function(s) that matches the scopeChunk names.
result.push({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm a bit lost here

Copy link
Contributor

@jasonLaster jasonLaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@jasonLaster jasonLaster merged commit b2909f2 into firefox-devtools:master Nov 6, 2017
nchevobbe pushed a commit that referenced this pull request Nov 21, 2017
nchevobbe pushed a commit that referenced this pull request Nov 21, 2017
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.

2 participants