Skip to content

Commit

Permalink
src: cast to v8::Value before using v8::EmbedderGraph::V8Node
Browse files Browse the repository at this point in the history
Pulled from nodejs#52638
  • Loading branch information
pthier committed Apr 29, 2024
1 parent a5fd9af commit c8ffbdd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/memory_tracker-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ class MemoryRetainerNode : public v8::EmbedderGraph::Node {
CHECK_NOT_NULL(retainer_);
v8::HandleScope handle_scope(tracker->isolate());
v8::Local<v8::Object> obj = retainer_->WrappedObject();
if (!obj.IsEmpty()) wrapper_node_ = tracker->graph()->V8Node(obj);
if (!obj.IsEmpty())
wrapper_node_ = tracker->graph()->V8Node(obj.As<v8::Value>());

name_ = retainer_->MemoryInfoName();
size_ = retainer_->SelfSize();
Expand Down Expand Up @@ -230,7 +231,9 @@ void MemoryTracker::TrackField(const char* edge_name,
const v8::Local<T>& value,
const char* node_name) {
if (!value.IsEmpty())
graph_->AddEdge(CurrentNode(), graph_->V8Node(value), edge_name);
graph_->AddEdge(CurrentNode(),
graph_->V8Node(value.template As<v8::Value>()),
edge_name);
}

template <typename T>
Expand Down

0 comments on commit c8ffbdd

Please sign in to comment.