|
| 1 | +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Jeremy Rose < [email protected]> |
| 3 | +Date: Thu, 16 May 2024 10:59:28 -0700 |
| 4 | +Subject: fix: accommodate v8#5403888 |
| 5 | + |
| 6 | +This fixes Node to accommodate a change in V8. It should be upstreamed (or |
| 7 | +discarded when Node handles this itself). |
| 8 | + |
| 9 | +Removal OK if Node builds without this :) |
| 10 | + |
| 11 | +diff --git a/src/memory_tracker-inl.h b/src/memory_tracker-inl.h |
| 12 | +index 0e4f2870a5aae5e469f14c5fdacdd6ea2855703d..abc18e96bdb73a30d1137472c14a2dfd1599d226 100644 |
| 13 | +--- a/src/memory_tracker-inl.h |
| 14 | ++++ b/src/memory_tracker-inl.h |
| 15 | +@@ -27,7 +27,7 @@ class MemoryRetainerNode : public v8::EmbedderGraph::Node { |
| 16 | + : retainer_(retainer) { |
| 17 | + CHECK_NOT_NULL(retainer_); |
| 18 | + v8::HandleScope handle_scope(tracker->isolate()); |
| 19 | +- v8::Local<v8::Object> obj = retainer_->WrappedObject(); |
| 20 | ++ v8::Local<v8::Value> obj = retainer_->WrappedObject().As<v8::Value>(); |
| 21 | + if (!obj.IsEmpty()) wrapper_node_ = tracker->graph()->V8Node(obj); |
| 22 | + |
| 23 | + name_ = retainer_->MemoryInfoName(); |
| 24 | +@@ -230,7 +230,7 @@ void MemoryTracker::TrackField(const char* edge_name, |
| 25 | + const v8::Local<T>& value, |
| 26 | + const char* node_name) { |
| 27 | + if (!value.IsEmpty()) |
| 28 | +- graph_->AddEdge(CurrentNode(), graph_->V8Node(value), edge_name); |
| 29 | ++ graph_->AddEdge(CurrentNode(), graph_->V8Node(value.template As<v8::Value>()), edge_name); |
| 30 | + } |
| 31 | + |
| 32 | + template <typename T> |
0 commit comments