1515namespace node {
1616
1717using v8::Context;
18+ using v8::EmbedderGraph;
19+ using v8::External;
1820using v8::Function;
1921using v8::FunctionTemplate;
2022using v8::HandleScope;
2123using v8::Integer;
2224using v8::Isolate;
2325using v8::Local;
2426using v8::Message;
27+ using v8::NewStringType;
2528using v8::Number;
29+ using v8::Object;
2630using v8::Private;
31+ using v8::Promise;
32+ using v8::PromiseHookType;
2733using v8::StackFrame;
2834using v8::StackTrace;
2935using v8::String;
3036using v8::Symbol;
37+ using v8::TracingController;
3138using v8::TryCatch;
39+ using v8::Undefined;
3240using v8::Value;
3341using worker::Worker;
3442
@@ -89,7 +97,7 @@ IsolateData::IsolateData(Isolate* isolate,
8997 String::NewFromOneByte ( \
9098 isolate, \
9199 reinterpret_cast <const uint8_t *>(StringValue), \
92- v8:: NewStringType::kInternalized , \
100+ NewStringType::kInternalized , \
93101 sizeof (StringValue) - 1 ).ToLocalChecked ()));
94102 PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES (V)
95103#undef V
@@ -101,7 +109,7 @@ IsolateData::IsolateData(Isolate* isolate,
101109 String::NewFromOneByte ( \
102110 isolate, \
103111 reinterpret_cast <const uint8_t *>(StringValue), \
104- v8:: NewStringType::kInternalized , \
112+ NewStringType::kInternalized , \
105113 sizeof (StringValue) - 1 ).ToLocalChecked ()));
106114 PER_ISOLATE_SYMBOL_PROPERTIES (V)
107115#undef V
@@ -111,7 +119,7 @@ IsolateData::IsolateData(Isolate* isolate,
111119 String::NewFromOneByte ( \
112120 isolate, \
113121 reinterpret_cast <const uint8_t *>(StringValue), \
114- v8:: NewStringType::kInternalized , \
122+ NewStringType::kInternalized , \
115123 sizeof (StringValue) - 1 ).ToLocalChecked ());
116124 PER_ISOLATE_STRING_PROPERTIES (V)
117125#undef V
@@ -149,7 +157,7 @@ void Environment::TrackingTraceStateObserver::UpdateTraceCategoryState() {
149157 return ;
150158 TryCatch try_catch (isolate);
151159 try_catch.SetVerbose (true );
152- cb->Call (env_->context (), v8:: Undefined (isolate),
160+ cb->Call (env_->context (), Undefined (isolate),
153161 0 , nullptr ).ToLocalChecked ();
154162}
155163
@@ -173,9 +181,9 @@ Environment::Environment(IsolateData* isolate_data,
173181 fs_stats_field_bigint_array_(isolate_, kFsStatsBufferLength ),
174182 context_(context->GetIsolate (), context) {
175183 // We'll be creating new objects so make sure we've entered the context.
176- v8:: HandleScope handle_scope (isolate ());
177- v8:: Context::Scope context_scope (context);
178- set_as_external (v8:: External::New (isolate (), this ));
184+ HandleScope handle_scope (isolate ());
185+ Context::Scope context_scope (context);
186+ set_as_external (External::New (isolate (), this ));
179187
180188 // We create new copies of the per-Environment option sets, so that it is
181189 // easier to modify them after Environment creation. The defaults are
@@ -194,7 +202,7 @@ Environment::Environment(IsolateData* isolate_data,
194202
195203 if (tracing::AgentWriterHandle* writer = GetTracingAgentWriter ()) {
196204 trace_state_observer_ = std::make_unique<TrackingTraceStateObserver>(this );
197- v8:: TracingController* tracing_controller = writer->GetTracingController ();
205+ TracingController* tracing_controller = writer->GetTracingController ();
198206 if (tracing_controller != nullptr )
199207 tracing_controller->AddTraceStateObserver (trace_state_observer_.get ());
200208 }
@@ -232,7 +240,7 @@ Environment::~Environment() {
232240 // CleanupHandles() should have removed all of them.
233241 CHECK (file_handle_read_wrap_freelist_.empty ());
234242
235- v8:: HandleScope handle_scope (isolate ());
243+ HandleScope handle_scope (isolate ());
236244
237245#if HAVE_INSPECTOR
238246 // Destroy inspector agent before erasing the context. The inspector
@@ -246,7 +254,7 @@ Environment::~Environment() {
246254 if (trace_state_observer_) {
247255 tracing::AgentWriterHandle* writer = GetTracingAgentWriter ();
248256 CHECK_NOT_NULL (writer);
249- v8:: TracingController* tracing_controller = writer->GetTracingController ();
257+ TracingController* tracing_controller = writer->GetTracingController ();
250258 if (tracing_controller != nullptr )
251259 tracing_controller->RemoveTraceStateObserver (trace_state_observer_.get ());
252260 }
@@ -410,7 +418,7 @@ void Environment::PrintSyncTrace() const {
410418 return ;
411419
412420 HandleScope handle_scope (isolate ());
413- Local<v8:: StackTrace> stack =
421+ Local<StackTrace> stack =
414422 StackTrace::CurrentStackTrace (isolate (), 10 , StackTrace::kDetailed );
415423
416424 fprintf (stderr, " (node:%d) WARNING: Detected use of sync API\n " ,
@@ -545,10 +553,10 @@ bool Environment::RemovePromiseHook(promise_hook_func fn, void* arg) {
545553 return true ;
546554}
547555
548- void Environment::EnvPromiseHook (v8:: PromiseHookType type,
549- v8:: Local<v8:: Promise> promise,
550- v8:: Local<v8:: Value> parent) {
551- Local<v8:: Context> context = promise->CreationContext ();
556+ void Environment::EnvPromiseHook (PromiseHookType type,
557+ Local<Promise> promise,
558+ Local<Value> parent) {
559+ Local<Context> context = promise->CreationContext ();
552560
553561 Environment* env = Environment::GetCurrent (context);
554562 if (env == nullptr ) return ;
@@ -568,7 +576,7 @@ void Environment::RunAndClearNativeImmediates() {
568576 std::vector<NativeImmediateCallback> list;
569577 native_immediate_callbacks_.swap (list);
570578 auto drain_list = [&]() {
571- v8:: TryCatch try_catch (isolate ());
579+ TryCatch try_catch (isolate ());
572580 for (auto it = list.begin (); it != list.end (); ++it) {
573581#ifdef DEBUG
574582 v8::SealHandleScope seal_handle_scope (isolate ());
@@ -748,7 +756,7 @@ void Environment::set_debug_categories(const std::string& cats, bool enabled) {
748756}
749757
750758void CollectExceptionInfo (Environment* env,
751- v8:: Local<v8:: Object> obj,
759+ Local<Object> obj,
752760 int errorno,
753761 const char * err_string,
754762 const char * syscall,
@@ -757,7 +765,7 @@ void CollectExceptionInfo(Environment* env,
757765 const char * dest) {
758766 obj->Set (env->context (),
759767 env->errno_string (),
760- v8:: Integer::New (env->isolate (), errorno)).FromJust ();
768+ Integer::New (env->isolate (), errorno)).FromJust ();
761769
762770 obj->Set (env->context (), env->code_string (),
763771 OneByteString (env->isolate (), err_string)).FromJust ();
@@ -767,14 +775,14 @@ void CollectExceptionInfo(Environment* env,
767775 OneByteString (env->isolate (), message)).FromJust ();
768776 }
769777
770- v8:: Local<v8:: Value> path_buffer;
778+ Local<Value> path_buffer;
771779 if (path != nullptr ) {
772780 path_buffer =
773781 Buffer::Copy (env->isolate (), path, strlen (path)).ToLocalChecked ();
774782 obj->Set (env->context (), env->path_string (), path_buffer).FromJust ();
775783 }
776784
777- v8:: Local<v8:: Value> dest_buffer;
785+ Local<Value> dest_buffer;
778786 if (dest != nullptr ) {
779787 dest_buffer =
780788 Buffer::Copy (env->isolate (), dest, strlen (dest)).ToLocalChecked ();
@@ -787,15 +795,15 @@ void CollectExceptionInfo(Environment* env,
787795 }
788796}
789797
790- void Environment::CollectExceptionInfo (v8:: Local<v8:: Value> object,
798+ void Environment::CollectExceptionInfo (Local<Value> object,
791799 int errorno,
792800 const char * syscall,
793801 const char * message,
794802 const char * path) {
795803 if (!object->IsObject () || errorno == 0 )
796804 return ;
797805
798- v8:: Local<v8:: Object> obj = object.As <v8:: Object>();
806+ Local<Object> obj = object.As <Object>();
799807 const char * err_string = node::errno_string (errorno);
800808
801809 if (message == nullptr || message[0 ] == ' \0 ' ) {
@@ -806,7 +814,7 @@ void Environment::CollectExceptionInfo(v8::Local<v8::Value> object,
806814 syscall, message, path, nullptr );
807815}
808816
809- void Environment::CollectUVExceptionInfo (v8:: Local<v8:: Value> object,
817+ void Environment::CollectUVExceptionInfo (Local<Value> object,
810818 int errorno,
811819 const char * syscall,
812820 const char * message,
@@ -815,7 +823,7 @@ void Environment::CollectUVExceptionInfo(v8::Local<v8::Value> object,
815823 if (!object->IsObject () || errorno == 0 )
816824 return ;
817825
818- v8:: Local<v8:: Object> obj = object.As <v8:: Object>();
826+ Local<Object> obj = object.As <Object>();
819827 const char * err_string = uv_err_name (errorno);
820828
821829 if (message == nullptr || message[0 ] == ' \0 ' ) {
@@ -854,8 +862,8 @@ void Environment::stop_sub_worker_contexts() {
854862 }
855863}
856864
857- void Environment::BuildEmbedderGraph (v8:: Isolate* isolate,
858- v8:: EmbedderGraph* graph,
865+ void Environment::BuildEmbedderGraph (Isolate* isolate,
866+ EmbedderGraph* graph,
859867 void * data) {
860868 MemoryTracker tracker (isolate, graph);
861869 static_cast <Environment*>(data)->ForEachBaseObject ([&](BaseObject* obj) {
0 commit comments