refactor: use v8::True(isolate) and v8::False(isolate) (#46571)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
parent
33964528e1
commit
ffb4f0f812
2 changed files with 3 additions and 4 deletions
|
@ -54,8 +54,7 @@ void CallTranslator(v8::Local<v8::External> external,
|
||||||
args->ThrowTypeError("One-time callback was called more than once");
|
args->ThrowTypeError("One-time callback was called more than once");
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
state->Set(context, called_symbol, v8::Boolean::New(isolate, true))
|
state->Set(context, called_symbol, v8::True(isolate)).ToChecked();
|
||||||
.ToChecked();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ v8::Local<v8::Value> CallMethodWithArgs(
|
||||||
|
|
||||||
// CallbackScope and MakeCallback both require an active node::Environment
|
// CallbackScope and MakeCallback both require an active node::Environment
|
||||||
if (!node::Environment::GetCurrent(isolate))
|
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::CallbackScope callback_scope{isolate, v8::Object::New(isolate),
|
||||||
node::async_context{0, 0}};
|
node::async_context{0, 0}};
|
||||||
|
@ -39,7 +39,7 @@ v8::Local<v8::Value> CallMethodWithArgs(
|
||||||
if (v8::Local<v8::Value> localRet; ret.ToLocal(&localRet))
|
if (v8::Local<v8::Value> localRet; ret.ToLocal(&localRet))
|
||||||
return handle_scope.Escape(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
|
} // namespace gin_helper::internal
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue