@@ -34,19 +34,27 @@ typedef int mode_t;
34
34
35
35
namespace node {
36
36
37
+ using v8::ApiObject;
37
38
using v8::Array;
38
39
using v8::ArrayBuffer;
39
40
using v8::BackingStore;
41
+ using v8::CFunction;
42
+ using v8::ConstructorBehavior;
40
43
using v8::Context;
41
44
using v8::Float64Array;
42
45
using v8::FunctionCallbackInfo;
46
+ using v8::FunctionTemplate;
47
+ using v8::Global;
43
48
using v8::HeapStatistics;
44
49
using v8::Integer;
45
50
using v8::Isolate;
46
51
using v8::Local;
47
52
using v8::NewStringType;
48
53
using v8::Number;
49
54
using v8::Object;
55
+ using v8::ObjectTemplate;
56
+ using v8::SideEffectType;
57
+ using v8::Signature;
50
58
using v8::String;
51
59
using v8::Uint32;
52
60
using v8::Value;
@@ -406,22 +414,21 @@ static void ReallyExit(const FunctionCallbackInfo<Value>& args) {
406
414
class FastHrtime : public BaseObject {
407
415
public:
408
416
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 ());
411
418
ctor->Inherit (BaseObject::GetConstructorTemplate (env));
412
- Local<v8:: ObjectTemplate> otmpl = ctor->InstanceTemplate ();
419
+ Local<ObjectTemplate> otmpl = ctor->InstanceTemplate ();
413
420
otmpl->SetInternalFieldCount (FastHrtime::kInternalFieldCount );
414
421
415
422
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);
425
432
};
426
433
427
434
otmpl->Set (FIXED_ONE_BYTE_STRING (env->isolate (), " hrtime" ),
@@ -458,8 +465,8 @@ class FastHrtime : public BaseObject {
458
465
SET_MEMORY_INFO_NAME (FastHrtime)
459
466
SET_SELF_SIZE(FastHrtime)
460
467
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);
463
470
return static_cast <FastHrtime*>(
464
471
v8_object->GetAlignedPointerFromInternalField (BaseObject::kSlot ));
465
472
}
@@ -481,7 +488,7 @@ class FastHrtime : public BaseObject {
481
488
fields[2 ] = t % NANOS_PER_SEC;
482
489
}
483
490
484
- static void FastNumber (v8:: ApiObject receiver) {
491
+ static void FastNumber (ApiObject receiver) {
485
492
NumberImpl (FromV8ApiObject (receiver));
486
493
}
487
494
@@ -495,15 +502,15 @@ class FastHrtime : public BaseObject {
495
502
fields[0 ] = t;
496
503
}
497
504
498
- static void FastBigInt (v8:: ApiObject receiver) {
505
+ static void FastBigInt (ApiObject receiver) {
499
506
BigIntImpl (FromV8ApiObject (receiver));
500
507
}
501
508
502
509
static void SlowBigInt (const FunctionCallbackInfo<Value>& args) {
503
510
BigIntImpl (FromJSObject<FastHrtime>(args.Holder ()));
504
511
}
505
512
506
- v8:: Global<ArrayBuffer> array_buffer_;
513
+ Global<ArrayBuffer> array_buffer_;
507
514
std::shared_ptr<BackingStore> backing_store_;
508
515
};
509
516
0 commit comments