mirror of
https://github.com/servo/servo.git
synced 2025-09-30 08:39:16 +01:00
subtlecrypto: Don't throw exceptions twice when converting to Algorithm object (#34239)
* Don't throw exceptions twice when converting to Algorithm object Removes match statements like ```rust let Ok(ConversionResult::Success(algorithm)) = Algorithm::new(cx, value.handle()) else { return Err(Error::Syntax); }; ``` These don't cause issues if `Algorithm::new` returns `Ok(ConversionResult::Failure`, but in the case of `Err(())` the implementation already called `throw_type_error` and we must not throw an additional Syntax error, otherwise we'll crash. Luckily, this case is already handled elsewhere by the `value_from_js_object` macro. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Test that calling subtlecrypto methods with empty algorithm objects throws a TypeError The WebCryptoAPI spec does not tell us which error to throw exactly, but according to https://webidl.spec.whatwg.org/ it should be a TypeError. This previously crashed servo. Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
parent
7ae0459360
commit
ee63174d6f
5 changed files with 47 additions and 28 deletions
6
tests/wpt/meta/MANIFEST.json
vendored
6
tests/wpt/meta/MANIFEST.json
vendored
|
@ -358512,7 +358512,7 @@
|
|||
},
|
||||
"generateKey": {
|
||||
"failures.js": [
|
||||
"e0f0279a69bb885eb30cbe086796c281db0245bb",
|
||||
"deaac636a99be570b118d8e8f8096b36a4a0b28f",
|
||||
[]
|
||||
],
|
||||
"successes.js": [
|
||||
|
@ -358526,7 +358526,7 @@
|
|||
[]
|
||||
],
|
||||
"importKey_failures.js": [
|
||||
"bba48401e616a564200570dddb2fe06d762347fe",
|
||||
"077ae076c648b097977cdbc484eaf79db884f7b2",
|
||||
[]
|
||||
],
|
||||
"okp_importKey.js": [
|
||||
|
@ -516888,7 +516888,7 @@
|
|||
},
|
||||
"digest": {
|
||||
"digest.https.any.js": [
|
||||
"379d9311f30247b85e2e5ea8981d1d180fe783a1",
|
||||
"3b0972b1f2bf7d5a285765ab7cf2447acca21467",
|
||||
[
|
||||
"WebCryptoAPI/digest/digest.https.any.html",
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue