mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: remove unneeded handlescope from JS callbacks (#48318)
fix: remove handlescope from JS callbacks
This commit is contained in:
@@ -1700,14 +1700,11 @@ Session* Session::CreateFrom(v8::Isolate* isolate,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
{
|
||||
v8::HandleScope handle_scope(isolate);
|
||||
v8::Local<v8::Object> wrapper;
|
||||
if (!session->GetWrapper(isolate).ToLocal(&wrapper)) {
|
||||
return nullptr;
|
||||
}
|
||||
App::Get()->EmitWithoutEvent("session-created", wrapper);
|
||||
v8::Local<v8::Object> wrapper;
|
||||
if (!session->GetWrapper(isolate).ToLocal(&wrapper)) {
|
||||
return nullptr;
|
||||
}
|
||||
App::Get()->EmitWithoutEvent("session-created", wrapper);
|
||||
|
||||
return session;
|
||||
}
|
||||
@@ -1886,7 +1883,6 @@ v8::Local<v8::Value> FromPartition(const std::string& partition,
|
||||
Session::FromPartition(args->isolate(), partition, std::move(options));
|
||||
|
||||
if (session) {
|
||||
v8::HandleScope handle_scope(args->isolate());
|
||||
v8::Local<v8::Object> wrapper;
|
||||
if (!session->GetWrapper(args->isolate()).ToLocal(&wrapper)) {
|
||||
return v8::Null(args->isolate());
|
||||
@@ -1908,7 +1904,6 @@ v8::Local<v8::Value> FromPath(const base::FilePath& path,
|
||||
Session* session = Session::FromPath(args, path, std::move(options));
|
||||
|
||||
if (session) {
|
||||
v8::HandleScope handle_scope(args->isolate());
|
||||
v8::Local<v8::Object> wrapper;
|
||||
if (!session->GetWrapper(args->isolate()).ToLocal(&wrapper)) {
|
||||
return v8::Null(args->isolate());
|
||||
|
||||
@@ -3756,7 +3756,6 @@ v8::Local<v8::Value> WebContents::GetOwnerBrowserWindow(
|
||||
}
|
||||
|
||||
v8::Local<v8::Value> WebContents::Session(v8::Isolate* isolate) {
|
||||
v8::HandleScope handle_scope(isolate);
|
||||
v8::Local<v8::Object> wrapper;
|
||||
if (!session_->GetWrapper(isolate).ToLocal(&wrapper)) {
|
||||
return v8::Null(isolate);
|
||||
@@ -3806,7 +3805,6 @@ v8::Local<v8::Value> WebContents::Debugger(v8::Isolate* isolate) {
|
||||
debugger_ = electron::api::Debugger::Create(isolate, web_contents());
|
||||
}
|
||||
|
||||
v8::HandleScope handle_scope{isolate};
|
||||
v8::Local<v8::Object> wrapper;
|
||||
if (!debugger_->GetWrapper(isolate).ToLocal(&wrapper)) {
|
||||
return v8::Null(isolate);
|
||||
|
||||
Reference in New Issue
Block a user