include variables from outer scopes#271
Conversation
src/agent/state.js
Outdated
| assert(allScopes[count - 2].scopeType() == ScopeType.Script); | ||
|
|
||
| // We find the top-level (module global) variable pollute the local variables | ||
| // we we omit them by default, unless the breakpoint itself is top-level. The |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
test/test-v8debugapi.js
Outdated
| process.nextTick(run); | ||
| api.wait(bp, (err) => { | ||
| assert.ifError(err); | ||
| // console.log(require('util').inspect(bp.stackFrames, {depth: null})); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| // There will always be at least 3 scopes. | ||
| // For top-level breakpoints: [local, script, global] | ||
| // Other: [..., closure (module IIFE), script, global] | ||
| assert(count >= 3); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/agent/state.js
Outdated
| // Other: [..., closure (module IIFE), script, global] | ||
| assert(count >= 3); | ||
| assert(allScopes[count - 1].scopeType() == ScopeType.Global); | ||
| assert(allScopes[count - 2].scopeType() == ScopeType.Script); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
We were previously omitting variables from closure scopes. This can be problematic specifically in transpiled async functions as most actual variables end up in a closure.
test/test-v8debugapi.js
Outdated
| const run = require('./fixtures/ts/async.js'); | ||
| api.set(bp, (err) => { | ||
| assert.ifError(err); | ||
| process.nextTick(run); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
We were previously omitting variables from closure scopes. This can be
problematic specifically in transpiled async functions as most actual
variables end up in a closure.