You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The node:crypto.subtle.* surface (perry-stdlib/src/webcrypto.rs) currently resolves to undefined on invalid inputs, missing keys, or unsupported algorithms. Node returns a rejected Promise with a DOMException("OperationError" | "NotSupportedError" | ...) in those cases.
Impact
Code using .catch(e => e.name === "OperationError") diverges from Node — Perry runs the then branch with undefined.
Parity tests that exercise error paths cannot be written against the current surface.
Surfaced during the Expand crypto parity coverage #1419 review; deferred as out-of-scope (157 sites, no rejection-path test coverage to validate behavior changes).
Scope
Add a reject_with_dom_exception(name: &str, message: &str) -> *mut Promise helper in webcrypto.rs.
Audit each resolve_undefined() site in webcrypto.rs (~157) and convert those that signal an error to use the new helper. Legitimate "resolve undefined" cases (e.g. void returns) stay as-is.
Add a parity suite for rejection behavior: test-parity/node-suite/crypto/webcrypto/errors/*.
Background
The
node:crypto.subtle.*surface (perry-stdlib/src/webcrypto.rs) currently resolves toundefinedon invalid inputs, missing keys, or unsupported algorithms. Node returns a rejected Promise with aDOMException("OperationError" | "NotSupportedError" | ...)in those cases.Impact
.catch(e => e.name === "OperationError")diverges from Node — Perry runs thethenbranch withundefined.Scope
reject_with_dom_exception(name: &str, message: &str) -> *mut Promisehelper inwebcrypto.rs.resolve_undefined()site inwebcrypto.rs(~157) and convert those that signal an error to use the new helper. Legitimate "resolve undefined" cases (e.g. void returns) stay as-is.test-parity/node-suite/crypto/webcrypto/errors/*.Tracked under #793.