LibJS: Remove ByteString internals from PrimitiveString

PrimitiveString is now internally either UTF-8, UTF-16, or both.
We no longer convert them to/from ByteString anywhere, nor does VM have
a ByteString cache.
This commit is contained in:
Andreas Kling 2025-03-28 13:55:39 +00:00 committed by Tim Flynn
commit c71772126f
Notes: github-actions[bot] 2025-03-28 16:32:54 +00:00
14 changed files with 49 additions and 118 deletions

View file

@ -17,10 +17,8 @@ struct ValueTraits : public Traits<Value> {
static unsigned hash(Value value)
{
VERIFY(!value.is_empty());
if (value.is_string()) {
// FIXME: Propagate this error.
return value.as_string().byte_string().hash();
}
if (value.is_string())
return value.as_string().utf8_string().hash();
if (value.is_bigint())
return value.as_bigint().big_integer().hash();