-
Notifications
You must be signed in to change notification settings - Fork 362
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
feat: Increase webcrypto compatibility #767
base: main
Are you sure you want to change the base?
Conversation
44ca60f
to
f6a8dad
Compare
@@ -250,6 +251,8 @@ impl ModuleDef for CryptoModule { | |||
default.set(class_name, ctor)?; | |||
} | |||
|
|||
let crypto: Object = ctx.globals().get("crypto")?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets stop doing that, it is very annoying that the user of a given module is required to call the init function just because the module eval expect a global.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be addressed in all places. I will create a PR fixing this where we'll try getting from globals first and if not existing create a new object. This requires refactoring the object created in init to be moved to a method.
d2a3686
to
fb713c0
Compare
Issue # (if available)
#184
Description of changes
Increase compatibility. More supported algorithms and methods.
TODO:
Checklist
tests/unit
and/or in Rust for my feature if neededmake fix
to format JS and apply Clippy auto fixesmake check
types/
directoryBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.