Bug 1890905 - Avoid basic_string_view<unsigned char> from ever being picked as a possibility for NewStringCopy. r=spidermonkey-reviewers,dminor

It's not a valid type.

Differential Revision: https://phabricator.services.mozilla.com/D207231
This commit is contained in:
Mike Hommey 2024-04-16 01:05:19 +00:00
Родитель b6709d2608
Коммит 860f3e4aa7
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -1737,7 +1737,9 @@ inline JSLinearString* NewStringCopy(
}
/* Copy a counted string and GC-allocate a descriptor for it. */
template <js::AllowGC allowGC, typename CharT>
template <
js::AllowGC allowGC, typename CharT,
typename std::enable_if_t<!std::is_same_v<CharT, unsigned char>>* = nullptr>
inline JSLinearString* NewStringCopy(
JSContext* cx, std::basic_string_view<CharT> s,
js::gc::Heap heap = js::gc::Heap::Default) {