Skip to content

Commit ed767a1

Browse files
committed
Do not serialize fields unknown to BaseObject
1 parent cb31fb2 commit ed767a1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/node_snapshotable.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,6 +1504,11 @@ StartupData SerializeNodeContextInternalFields(Local<Object> holder,
15041504
return StartupData{data, size};
15051505
}
15061506

1507+
// Do not serialize fields unknown to BaseObject.
1508+
if (index >= BaseObject::kInternalFieldCount) {
1509+
return StartupData{nullptr, 0};
1510+
}
1511+
15071512
// To serialize the slot field, invoke Serialize() method on the object.
15081513
DCHECK_IS_SNAPSHOT_SLOT(index);
15091514

0 commit comments

Comments
 (0)