Skip to content

Commit 02afe58

Browse files
danbevtargos
authored andcommitted
src: use using declarations consistently
PR-URL: #36365 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 3341b2c commit 02afe58

File tree

1 file changed

+24
-17
lines changed

1 file changed

+24
-17
lines changed

src/node_process_methods.cc

+24-17
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,27 @@ typedef int mode_t;
3434

3535
namespace node {
3636

37+
using v8::ApiObject;
3738
using v8::Array;
3839
using v8::ArrayBuffer;
3940
using v8::BackingStore;
41+
using v8::CFunction;
42+
using v8::ConstructorBehavior;
4043
using v8::Context;
4144
using v8::Float64Array;
4245
using v8::FunctionCallbackInfo;
46+
using v8::FunctionTemplate;
47+
using v8::Global;
4348
using v8::HeapStatistics;
4449
using v8::Integer;
4550
using v8::Isolate;
4651
using v8::Local;
4752
using v8::NewStringType;
4853
using v8::Number;
4954
using v8::Object;
55+
using v8::ObjectTemplate;
56+
using v8::SideEffectType;
57+
using v8::Signature;
5058
using v8::String;
5159
using v8::Uint32;
5260
using v8::Value;
@@ -406,22 +414,21 @@ static void ReallyExit(const FunctionCallbackInfo<Value>& args) {
406414
class FastHrtime : public BaseObject {
407415
public:
408416
static Local<Object> New(Environment* env) {
409-
Local<v8::FunctionTemplate> ctor =
410-
v8::FunctionTemplate::New(env->isolate());
417+
Local<FunctionTemplate> ctor = FunctionTemplate::New(env->isolate());
411418
ctor->Inherit(BaseObject::GetConstructorTemplate(env));
412-
Local<v8::ObjectTemplate> otmpl = ctor->InstanceTemplate();
419+
Local<ObjectTemplate> otmpl = ctor->InstanceTemplate();
413420
otmpl->SetInternalFieldCount(FastHrtime::kInternalFieldCount);
414421

415422
auto create_func = [env](auto fast_func, auto slow_func) {
416-
auto cfunc = v8::CFunction::Make(fast_func);
417-
return v8::FunctionTemplate::New(env->isolate(),
418-
slow_func,
419-
Local<Value>(),
420-
Local<v8::Signature>(),
421-
0,
422-
v8::ConstructorBehavior::kThrow,
423-
v8::SideEffectType::kHasNoSideEffect,
424-
&cfunc);
423+
auto cfunc = CFunction::Make(fast_func);
424+
return FunctionTemplate::New(env->isolate(),
425+
slow_func,
426+
Local<Value>(),
427+
Local<Signature>(),
428+
0,
429+
ConstructorBehavior::kThrow,
430+
SideEffectType::kHasNoSideEffect,
431+
&cfunc);
425432
};
426433

427434
otmpl->Set(FIXED_ONE_BYTE_STRING(env->isolate(), "hrtime"),
@@ -458,8 +465,8 @@ class FastHrtime : public BaseObject {
458465
SET_MEMORY_INFO_NAME(FastHrtime)
459466
SET_SELF_SIZE(FastHrtime)
460467

461-
static FastHrtime* FromV8ApiObject(v8::ApiObject api_object) {
462-
v8::Object* v8_object = reinterpret_cast<v8::Object*>(&api_object);
468+
static FastHrtime* FromV8ApiObject(ApiObject api_object) {
469+
Object* v8_object = reinterpret_cast<Object*>(&api_object);
463470
return static_cast<FastHrtime*>(
464471
v8_object->GetAlignedPointerFromInternalField(BaseObject::kSlot));
465472
}
@@ -481,7 +488,7 @@ class FastHrtime : public BaseObject {
481488
fields[2] = t % NANOS_PER_SEC;
482489
}
483490

484-
static void FastNumber(v8::ApiObject receiver) {
491+
static void FastNumber(ApiObject receiver) {
485492
NumberImpl(FromV8ApiObject(receiver));
486493
}
487494

@@ -495,15 +502,15 @@ class FastHrtime : public BaseObject {
495502
fields[0] = t;
496503
}
497504

498-
static void FastBigInt(v8::ApiObject receiver) {
505+
static void FastBigInt(ApiObject receiver) {
499506
BigIntImpl(FromV8ApiObject(receiver));
500507
}
501508

502509
static void SlowBigInt(const FunctionCallbackInfo<Value>& args) {
503510
BigIntImpl(FromJSObject<FastHrtime>(args.Holder()));
504511
}
505512

506-
v8::Global<ArrayBuffer> array_buffer_;
513+
Global<ArrayBuffer> array_buffer_;
507514
std::shared_ptr<BackingStore> backing_store_;
508515
};
509516

0 commit comments

Comments
 (0)