mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 13:02:09 +02:00
LibWeb: Throw TypeError if WebCrypto algorithm doesn't have "name" field
This commit is contained in:
committed by
Andreas Kling
parent
fe98cbcae1
commit
7b678d3e1f
Notes:
github-actions[bot]
2024-11-24 22:29:24 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/7b678d3e1f2 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2555 Reviewed-by: https://github.com/alimpfard ✅ Reviewed-by: https://github.com/gmta ✅ Reviewed-by: https://github.com/stelar7
@@ -88,6 +88,10 @@ WebIDL::ExceptionOr<NormalizedAlgorithmAndParameter> normalize_an_algorithm(JS::
|
||||
// fetch the actual algorithm factory from the registeredAlgorithms map.
|
||||
auto initial_algorithm = TRY(algorithm.get<GC::Root<JS::Object>>()->get("name"));
|
||||
|
||||
if (initial_algorithm.is_undefined()) {
|
||||
return vm.throw_completion<JS::TypeError>(JS::ErrorType::NotAnObjectOfType, "Algorithm");
|
||||
}
|
||||
|
||||
// 4. Let algName be the value of the name attribute of initialAlg.
|
||||
auto algorithm_name = TRY(initial_algorithm.to_string(vm));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user