src: make cross-context MakeCallback() calls work · nodejs/node@7aa5a99 · GitHub
Skip to content

Commit 7aa5a99

Browse files
bnoordhuisMylesBorins
authored andcommitted
src: make cross-context MakeCallback() calls work
Check that invoking a callback on a receiver from a different context works. It ran afoul of an `env->context() == isolate->GetCurrentContext()` assertion so retrieve the environment from the callback context and the context to enter from the environment's context() method. We could also have retrieved the environment from the receiver's context and that would have made little practical difference. It just seemed more correct to get it from the callback context because that is the actual execution context. PR-URL: #9221 Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent b1dc2d4 commit 7aa5a99

2 files changed

Lines changed: 34 additions & 27 deletions

File tree

src/node.cc

Lines changed: 30 additions & 27 deletions

test/addons/make-callback/test.js

Lines changed: 4 additions & 0 deletions

0 commit comments

Comments
 (0)