Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subtlecrypto: Don't throw exceptions twice when converting to Algorithm object #49141

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

servo-wpt-sync
Copy link
Collaborator

Removes match statements like

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.

Reviewed in servo/servo#34239

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Servo project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants