LibWeb: Correctly transform EncapsulatedKey into an ECMAScript object

The spec prefers camel case, but we internally use snake case.
This commit is contained in:
Tete17
2025-11-28 23:07:27 +01:00
committed by Shannon Booth
parent ec67f0ae8d
commit 26a9551db2

View File

@@ -280,7 +280,7 @@ JS::ThrowCompletionOr<GC::Ref<JS::Object>> EncapsulatedKey::to_object(JS::Realm&
auto object = JS::Object::create(realm, realm.intrinsics().object_prototype());
if (shared_key.has_value())
TRY(object->create_data_property("shared_key"_utf16_fly_string, shared_key.value()));
TRY(object->create_data_property("sharedKey"_utf16_fly_string, shared_key.value()));
if (ciphertext.has_value())
TRY(object->create_data_property("ciphertext"_utf16_fly_string, JS::ArrayBuffer::create(realm, ciphertext.value())));
@@ -293,7 +293,7 @@ JS::ThrowCompletionOr<GC::Ref<JS::Object>> EncapsulatedBits::to_object(JS::Realm
auto object = JS::Object::create(realm, realm.intrinsics().object_prototype());
if (shared_key.has_value())
TRY(object->create_data_property("shared_key"_utf16_fly_string, JS::ArrayBuffer::create(realm, shared_key.value())));
TRY(object->create_data_property("sharedKey"_utf16_fly_string, JS::ArrayBuffer::create(realm, shared_key.value())));
if (ciphertext.has_value())
TRY(object->create_data_property("ciphertext"_utf16_fly_string, JS::ArrayBuffer::create(realm, ciphertext.value())));