mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 14:58:37 +09:00
Issue #2690 - Replace SyntaxError with TypeError for derive_bits_keys.
This commit is contained in:
parent
4da1b56b6a
commit
7039b5a95d
1 changed files with 10 additions and 5 deletions
|
|
@ -170,7 +170,7 @@ Coerce(JSContext* aCx, T& aTarget, const OOS& aAlgorithm)
|
|||
|
||||
JS::RootedValue value(aCx, JS::ObjectValue(*aAlgorithm.GetAsObject()));
|
||||
if (!aTarget.Init(aCx, value)) {
|
||||
return NS_ERROR_DOM_SYNTAX_ERR;
|
||||
return NS_ERROR_DOM_TYPE_MISMATCH_ERR;
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
|
@ -401,9 +401,14 @@ WebCryptoTask::FailWithError(nsresult aRv)
|
|||
{
|
||||
MOZ_ASSERT(IsOnOriginalThread());
|
||||
|
||||
// Blindly convert nsresult to DOMException
|
||||
// Individual tasks must ensure they pass the right values
|
||||
mResultPromise->MaybeReject(aRv);
|
||||
if (aRv == NS_ERROR_DOM_TYPE_MISMATCH_ERR) {
|
||||
mResultPromise->MaybeRejectWithTypeError(
|
||||
"The operation could not be performed.");
|
||||
} else {
|
||||
// Blindly convert nsresult to DOMException
|
||||
// Individual tasks must ensure they pass the right values
|
||||
mResultPromise->MaybeReject(aRv);
|
||||
}
|
||||
// Manually release mResultPromise while we're on the main thread
|
||||
mResultPromise = nullptr;
|
||||
mWorkerHolder = nullptr;
|
||||
|
|
@ -2927,7 +2932,7 @@ public:
|
|||
RootedDictionary<EcdhKeyDeriveParams> params(aCx);
|
||||
mEarlyRv = Coerce(aCx, params, aAlgorithm);
|
||||
if (NS_FAILED(mEarlyRv)) {
|
||||
mEarlyRv = NS_ERROR_DOM_SYNTAX_ERR;
|
||||
/* The returned code is installed by Coerce function. */
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue