mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02:00
AK+Everywhere: Add Vector::contains(predicate) and use it
No functional changes.
This commit is contained in:
committed by
Sam Atkins
parent
d84a0d411c
commit
ae20ecf857
Notes:
github-actions[bot]
2026-01-08 15:28:34 +00:00
Author: https://github.com/gmta Commit: https://github.com/LadybirdBrowser/ladybird/commit/ae20ecf8578 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7345 Reviewed-by: https://github.com/AtkinsSJ ✅
@@ -8717,10 +8717,8 @@ WebIDL::ExceptionOr<GC::Ref<CryptoKey>> MLDSA::import_key(AlgorithmParams const&
|
||||
|
||||
// 2. If the priv field is present and usages contains a value which is not "sign", or, if the priv field is
|
||||
// not present and usages contains a value which is not "verify" then throw a SyntaxError.
|
||||
if ((jwk->priv.has_value()
|
||||
&& usages.first_matching([](auto usage) { return usage != Bindings::KeyUsage::Sign; }).has_value())
|
||||
|| (!jwk->priv.has_value()
|
||||
&& usages.first_matching([](auto usage) { return usage != Bindings::KeyUsage::Verify; }).has_value())) {
|
||||
if ((jwk->priv.has_value() && usages.contains([](auto usage) { return usage != Bindings::KeyUsage::Sign; }))
|
||||
|| (!jwk->priv.has_value() && usages.contains([](auto usage) { return usage != Bindings::KeyUsage::Verify; }))) {
|
||||
return WebIDL::SyntaxError::create(m_realm, "Invalid usage"_utf16);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user