Uh oh!
There was an error while loading. Please reload this page.
src: use Isolate::TryGetCurrent where appropriate - #39954
Closed
addaleax wants to merge 2 commits into
Closed
Conversation
In two places, we call `Isolate::GetCurrent()` even though that is technically invalid usage of the function. Now that V8 exposes `Isolate::TryGetCurrent()`, we can do this in a proper way.
targos
approved these changes
Aug 31, 2021
tniessen
approved these changes
Aug 31, 2021
danbev
commented
Aug 31, 2021
Contributor
We should be able to revert 1fc4d43 after this commit. I can open a pull request after this one has landed, or if you like you can include the revert in this pr. |
This reverts commit 1fc4d43.
addaleax
commented
Aug 31, 2021
MemberAuthor
@danbev Sure, done! |
RaisinTen
approved these changes
Aug 31, 2021
jasnell
approved these changes
Aug 31, 2021
cjihrig
approved these changes
Aug 31, 2021
This comment has been minimized.
This comment has been minimized.
nodejs-github-bot
commented
Sep 5, 2021
Collaborator
| // Tells whether the per-process V8::Initialize() is called and | ||
| // if it is safe to call v8::Isolate::GetCurrent(). | ||
| // if it is safe to call v8::Isolate::TryGetCurrent(). | ||
| externbool v8_initialized; |
Member
There was a problem hiding this comment.
Do we still need this as it claiming that it tells "if it is safe to call v8::Isolate::GetCurrent"?
MemberAuthor
There was a problem hiding this comment.
Yeah … I don’t know why, but v8::Isolate::TryGetCurrent() is not something you can call without V8 being initialized first.
Contributor
Landed in 9f6fed7...9f7412a |
nodejs-github-bot pushed a commit
that referenced
this pull request
Sep 8, 2021
In two places, we call `Isolate::GetCurrent()` even though that is technically invalid usage of the function. Now that V8 exposes `Isolate::TryGetCurrent()`, we can do this in a proper way. PR-URL: #39954 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
BethGriggs pushed a commit
that referenced
this pull request
Sep 21, 2021
In two places, we call `Isolate::GetCurrent()` even though that is technically invalid usage of the function. Now that V8 exposes `Isolate::TryGetCurrent()`, we can do this in a proper way. PR-URL: #39954 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
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 freeto 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.
In two places, we call
Isolate::GetCurrent()even though that istechnically invalid usage of the function.
Now that V8 exposes
Isolate::TryGetCurrent(), we can do thisin a proper way.