0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-03 09:31:22 -05:00

fix(runtime): do not require deno namespace in workers for crypto (#9784)

This commit is contained in:
Casper Beyer 2021-03-15 03:01:55 +08:00 committed by GitHub
parent c8fbf6d38a
commit 7286eea75c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -1,3 +1,5 @@
self.crypto.getRandomValues(new Uint8Array(16));
onmessage = function () {
postMessage(!!self.crypto);
};

View file

@ -239,6 +239,7 @@ impl WebWorker {
options.user_agent.clone(),
options.ca_data.clone(),
);
ops::crypto::init(js_runtime, options.seed);
if options.use_deno_namespace {
ops::fs_events::init(js_runtime);
@ -248,7 +249,6 @@ impl WebWorker {
ops::permissions::init(js_runtime);
ops::plugin::init(js_runtime);
ops::process::init(js_runtime);
ops::crypto::init(js_runtime, options.seed);
ops::signal::init(js_runtime);
ops::tls::init(js_runtime);
ops::tty::init(js_runtime);