LibJS: Add all of the DataView.prototype.set* methods

This commit is contained in:
Idan Horowitz
2021-06-14 02:02:53 +03:00
committed by Linus Groh
parent c54b9a6920
commit d7a70eb77c
Notes: sideshowbarker 2024-07-18 12:17:02 +09:00
8 changed files with 203 additions and 0 deletions

View File

@@ -102,6 +102,17 @@ String UnsignedBigInteger::to_base10() const
return builder.to_string();
}
u64 UnsignedBigInteger::to_u64() const
{
VERIFY(sizeof(Word) == 4);
if (!length())
return 0;
u64 value = m_words[0];
if (length() > 1)
value |= static_cast<u64>(m_words[1]) << 32;
return value;
}
void UnsignedBigInteger::set_to_0()
{
m_words.clear_with_capacity();