mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-04 00:27:47 +00:00
LibWeb: Throw TypeError if WebCrypto algorithm doesn't have "name" field
This commit is contained in:
parent
fe98cbcae1
commit
7b678d3e1f
Notes:
github-actions[bot]
2024-11-24 22:29:24 +00:00
Author: https://github.com/awesomekling
Commit: 7b678d3e1f
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
2 changed files with 42 additions and 38 deletions
|
@ -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));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue