| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
LGTM with a nit
Sorry, something went wrong.
| } | ||
|
|
||
| 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
Sorry, something went wrong.
There was a problem hiding this comment.
Sorry, something went wrong.
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
Sorry, something went wrong.
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
Sorry, something went wrong.
| } | ||
|
|
||
| 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
Sorry, something went wrong.
Yeah, the context changing is for avoiding multi-times PersistentToLocal. But Isolate is just a handy thing. Shall I change isolate back? |
Sorry, something went wrong.
If you’re saying that this has a performance impact: We use PersistentToLocal::Strong for env->context(), which is essentially just a pointer lookup. This patch is not going to have any significant performance benefits, so it really makes just sense to focus on what’s cleanest from a code readability point of view. 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). |
Sorry, something went wrong.
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? |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
|
This doesn't land cleanly on v14.x-staging. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Refs: #37473