diff options
author | Kevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com> | 2019-08-05 04:23:41 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-08-05 07:23:41 -0400 |
commit | ddee2dff14772ade16e282ad18eda6f5054ce94e (patch) | |
tree | 473cdf935b8d0254a7ab8e0c89fd407201793ac6 /core/shared_queue.js | |
parent | aaa7a3eac4df0de9a93dc8fc4717d38212a3de5b (diff) |
Provide option to delete Deno namespace in worker (#2717)
Diffstat (limited to 'core/shared_queue.js')
-rw-r--r-- | core/shared_queue.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/shared_queue.js b/core/shared_queue.js index 75f370ce4..d7ab382d6 100644 --- a/core/shared_queue.js +++ b/core/shared_queue.js @@ -29,8 +29,12 @@ SharedQueue Binary Layout const INDEX_RECORDS = 3 + MAX_RECORDS; const HEAD_INIT = 4 * INDEX_RECORDS; + // Available on start due to bindings. const Deno = window[GLOBAL_NAMESPACE]; const core = Deno[CORE_NAMESPACE]; + // Warning: DO NOT use window.Deno after this point. + // It is possible that the Deno namespace has been deleted. + // Use the above local Deno and core variable instead. let sharedBytes; let shared32; @@ -165,7 +169,7 @@ SharedQueue Binary Layout const success = push(control); // If successful, don't use first argument of core.send. const arg0 = success ? null : control; - return window.Deno.core.send(arg0, zeroCopy); + return Deno.core.send(arg0, zeroCopy); } const denoCore = { |