refactor: use v8::True(isolate) and v8::False(isolate) (#46544)

This commit is contained in:
Charles Kerr 2025-04-08 12:58:39 -05:00 committed by GitHub
parent 9069542d0b
commit ab23758e51
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 4 deletions

View file

@ -54,8 +54,7 @@ void CallTranslator(v8::Local<v8::External> external,
args->ThrowTypeError("One-time callback was called more than once");
return;
} else {
state->Set(context, called_symbol, v8::Boolean::New(isolate, true))
.ToChecked();
state->Set(context, called_symbol, v8::True(isolate)).ToChecked();
}
}

View file

@ -18,7 +18,7 @@ v8::Local<v8::Value> CallMethodWithArgs(
// CallbackScope and MakeCallback both require an active node::Environment
if (!node::Environment::GetCurrent(isolate))
return handle_scope.Escape(v8::Boolean::New(isolate, false));
return handle_scope.Escape(v8::False(isolate));
node::CallbackScope callback_scope{isolate, v8::Object::New(isolate),
node::async_context{0, 0}};
@ -39,7 +39,7 @@ v8::Local<v8::Value> CallMethodWithArgs(
if (v8::Local<v8::Value> localRet; ret.ToLocal(&localRet))
return handle_scope.Escape(localRet);
return handle_scope.Escape(v8::Boolean::New(isolate, false));
return handle_scope.Escape(v8::False(isolate));
}
} // namespace gin_helper::internal