diff --git a/src/api.cc b/src/api.cc index 13b6e7b424..cfd51a30d2 100644 --- a/src/api.cc +++ b/src/api.cc @@ -3273,10 +3273,9 @@ Maybe ValueDeserializer::ReadHeader(Local context) { RETURN_ON_FAILED_EXECUTION_PRIMITIVE(bool); DCHECK(read_header); - // TODO(jbroman): Today, all wire formats are "legacy". When a more supported - // format is added, compare the version of the internal serializer to the - // minimum non-legacy version number. - if (!private_->supports_legacy_wire_format) { + static const uint32_t kMinimumNonLegacyVersion = 13; + if (GetWireFormatVersion() < kMinimumNonLegacyVersion && + !private_->supports_legacy_wire_format) { isolate->Throw(*isolate->factory()->NewError( i::MessageTemplate::kDataCloneDeserializationVersionError)); has_pending_exception = true;