diff options
author | Rich Trott <rtrott@gmail.com> | 2021-08-01 04:22:51 +0300 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2021-09-04 16:14:45 +0300 |
commit | ea5f2047a26f7c1773cd906ba78077a34e942bb3 (patch) | |
tree | 947c72afb5b58df55a7f4de89446f6f8d421ad86 /tools | |
parent | 60f41c34dd5f28092060f33ab5324254c129b342 (diff) |
inspector: update inspector_protocol to 8ec18cf
Apply 8ec18cf: "Support STRING16 in the template when converting CBOR
map keys"
Refs: https://chromium.googlesource.com/deps/inspector_protocol/+/8ec18cf0885bef0b5c2a922c5dc3813cbf63e962
We're over 2 years out of date in the tools/inspector_protocol directory
and I have to imagine this will come back to bite us at some point. But
I also don't want to do a huge update all at once, so starting with a
single commit. I might bundle commits together a bit more if this goes
well.
PR-URL: https://github.com/nodejs/node/pull/39614
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/inspector_protocol/lib/Values_cpp.template | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/inspector_protocol/lib/Values_cpp.template b/tools/inspector_protocol/lib/Values_cpp.template index be3149d5035..17c69255851 100644 --- a/tools/inspector_protocol/lib/Values_cpp.template +++ b/tools/inspector_protocol/lib/Values_cpp.template @@ -178,7 +178,12 @@ std::unique_ptr<DictionaryValue> parseMap( key = StringUtil::fromUTF8(key_span.data(), key_span.size()); tokenizer->Next(); } else if (tokenizer->TokenTag() == cbor::CBORTokenTag::STRING16) { - return nullptr; // STRING16 not supported yet. + span<uint8_t> key_span = tokenizer->GetString16WireRep(); + if (key_span.size() & 1) return nullptr; // UTF16 is 2 byte multiple. + key = StringUtil::fromUTF16( + reinterpret_cast<const uint16_t*>(key_span.data()), + key_span.size() / 2); + tokenizer->Next(); } else { // Error::CBOR_INVALID_MAP_KEY return nullptr; |