src: make cross-context MakeCallback() calls work#9221
Merged
bnoordhuis merged 1 commit intonodejs:masterfrom Oct 25, 2016
Merged
src: make cross-context MakeCallback() calls work#9221bnoordhuis merged 1 commit intonodejs:masterfrom
bnoordhuis merged 1 commit intonodejs:masterfrom
Conversation
bnoordhuis
commented
Oct 21, 2016
src/node.cc
Outdated
Member
Author
There was a problem hiding this comment.
callback->CreationContext() seems a little more correct than recv->CreationContext() because the former is the context the actual callback takes place in but it's admittedly a mostly academic difference.
Member
Author
|
@addaleax Your thoughts, please? |
addaleax
approved these changes
Oct 24, 2016
Member
addaleax
left a comment
There was a problem hiding this comment.
LGTM
(sorry for not reviewing sooner, as mentioned I’ll be somewhat more busy now that classes have started again)
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: nodejs#9221 Reviewed-By: Anna Henningsen <anna@addaleax.net>
7201c08 to
921d2b0
Compare
Member
Author
|
No problem, thanks for reviewing. |
evanlucas
pushed a commit
that referenced
this pull request
Nov 3, 2016
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>
Contributor
|
@bnoordhuis should this be backported? |
3 tasks
Member
ping @bnoordhuis |
Member
|
@gibfahn I think this is good to be backported too. |
gibfahn
pushed a commit
that referenced
this pull request
Jun 18, 2017
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>
gibfahn
pushed a commit
that referenced
this pull request
Jun 20, 2017
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>
MylesBorins
pushed a commit
that referenced
this pull request
Jul 11, 2017
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>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
From #9213 (comment), cc @addaleax.
CI: https://ci.nodejs.org/job/node-test-pull-request/4607/