src: use more appropriate context-entered check
Make the context check in `MakeCallback` match what the comment says (and what actually makes sense). PR-URL: https://github.com/nodejs/node/pull/15691 Fixes: https://github.com/nodejs/node/issues/15672 Ref: https://github.com/nodejs/node/pull/15428 Ref: f27b5e4bdaafc73a830a0451ee3c641b8bcd08fe Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
This commit is contained in:
parent
b050c14d91
commit
037d9085f1
@ -1383,7 +1383,7 @@ InternalCallbackScope::InternalCallbackScope(Environment* env,
|
||||
|
||||
HandleScope handle_scope(env->isolate());
|
||||
// If you hit this assertion, you forgot to enter the v8::Context first.
|
||||
CHECK_EQ(env->context(), env->isolate()->GetCurrentContext());
|
||||
CHECK_EQ(Environment::GetCurrent(env->isolate()), env);
|
||||
|
||||
if (env->using_domains() && !object_.IsEmpty()) {
|
||||
DomainEnter(env, object_);
|
||||
|
@ -37,6 +37,8 @@ const script = `
|
||||
|
||||
vm.runInNewContext('Array', {});
|
||||
debugger;
|
||||
|
||||
vm.runInNewContext('debugger', {});
|
||||
`;
|
||||
|
||||
async function getContext(session) {
|
||||
@ -92,6 +94,12 @@ async function runTests() {
|
||||
await checkScriptContext(session, thirdContext);
|
||||
await session.waitForBreakOnLine(33, '[eval]');
|
||||
|
||||
console.error('[test]', 'vm.runInNewContext can contain debugger statements');
|
||||
await session.send({ 'method': 'Debugger.resume' });
|
||||
const fourthContext = await getContext(session);
|
||||
await checkScriptContext(session, fourthContext);
|
||||
await session.waitForBreakOnLine(0, 'evalmachine.<anonymous>');
|
||||
|
||||
await session.runToCompletion();
|
||||
assert.strictEqual(0, (await instance.expectShutdown()).exitCode);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user