-
Notifications
You must be signed in to change notification settings - Fork 16.2k
refactor: avoid deprecated v8::Context::GetIsolate()
calls (pt 1)
#47760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@@ -1856,8 +1856,8 @@ void Initialize(v8::Local<v8::Object> exports, | |||
v8::Local<v8::Value> unused, | |||
v8::Local<v8::Context> context, | |||
void* priv) { | |||
v8::Isolate* isolate = context->GetIsolate(); | |||
gin_helper::Dictionary dict(isolate, exports); | |||
v8::Isolate* const isolate = v8::Isolate::GetCurrent(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For browser layer usages it would be better to replace with JavascriptEnvironment::GetIsolate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 4c442a4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! can you also adopt it for other shell/browser
files that have been touched in this PR.
7c9ee3f
to
ba655bc
Compare
Description of Change
Part 1 of a very short series to remove calls to
v8::Context::GetIsolate()
which is being deprecated.Even though the individual changes are pretty straightforward, the overall diff is pretty heavy due to the number of places where we are using that method. So I'm breaking into a couple of smaller PRs to make review easier.
This PR:
GetIsolate()
inNodeBindings::CreateEnvironment()
by adding av8::Isolate*
arg to that method.GetIsolate()
in the Node.js moduleInitialize()
methods by usingv8::Isolate::GetCurrent()
instead.Checklist
npm test
passesRelease Notes
Notes: none.