src: cache necessary isolate & context in api/*#38366
src: cache necessary isolate & context in api/*#38366XadillaX wants to merge 1 commit intonodejs:masterfrom
Conversation
| } | ||
|
|
||
| HandleScope handle_scope(env_->isolate()); | ||
| HandleScope handle_scope(isolate); |
There was a problem hiding this comment.
hm, I know this exists before this PR, but why do we create a handle scope here? May be it should just be deleted, AFAICT this is meant to be invoked when there is already a HandleScope
There was a problem hiding this comment.
There was a problem hiding this comment.
I mean, just because there’s an outer handle scope doesn’t mean that it’s pointless to have an inner one, e.g. when InternalCallbackScope is used in a loop
addaleax
left a comment
There was a problem hiding this comment.
@XadillaX The code LGTM, but neither this nor the PR it references have any explanation why we would want to do this…? For contexts I can see the argument that eventually we might have multi-context readiness, but for the Isolate pointer this seems like a fairly pointless change
| } | ||
|
|
||
| HandleScope handle_scope(env_->isolate()); | ||
| HandleScope handle_scope(isolate); |
There was a problem hiding this comment.
I mean, just because there’s an outer handle scope doesn’t mean that it’s pointless to have an inner one, e.g. when InternalCallbackScope is used in a loop
Yeah, the |
If you’re saying that this has a performance impact: We use I’m not really minding the code change, but I do think that the project should a) have a common code style for these questions and b) enforce that through a linter, otherwise changes will just happen back and forth forever (#38172 literally did the reverse of this only a week ago). |
I see. I think we may create an issue about both a and b but not in this one. Shall we change the CPPLINT rule? |
|
Landed in f52dc17 |
|
This doesn't land cleanly on v14.x-staging. |
Refs: #37473