@@ -34,19 +34,27 @@ typedef int mode_t;
3434
3535namespace node {
3636
37+ using v8::ApiObject;
3738using v8::Array;
3839using v8::ArrayBuffer;
3940using v8::BackingStore;
41+ using v8::CFunction;
42+ using v8::ConstructorBehavior;
4043using v8::Context;
4144using v8::Float64Array;
4245using v8::FunctionCallbackInfo;
46+ using v8::FunctionTemplate;
47+ using v8::Global;
4348using v8::HeapStatistics;
4449using v8::Integer;
4550using v8::Isolate;
4651using v8::Local;
4752using v8::NewStringType;
4853using v8::Number;
4954using v8::Object;
55+ using v8::ObjectTemplate;
56+ using v8::SideEffectType;
57+ using v8::Signature;
5058using v8::String;
5159using v8::Uint32;
5260using v8::Value;
@@ -406,22 +414,21 @@ static void ReallyExit(const FunctionCallbackInfo<Value>& args) {
406414class 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