summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/node/global.rs5
-rw-r--r--ext/node/polyfills/worker_threads.ts2
2 files changed, 4 insertions, 3 deletions
diff --git a/ext/node/global.rs b/ext/node/global.rs
index 2367814f9..7f901fd03 100644
--- a/ext/node/global.rs
+++ b/ext/node/global.rs
@@ -67,7 +67,7 @@ const fn str_to_utf16<const N: usize>(s: &str) -> [u16; N] {
// UTF-16 encodings of the managed globals. THIS LIST MUST BE SORTED.
#[rustfmt::skip]
-const MANAGED_GLOBALS: [&[u16]; 12] = [
+const MANAGED_GLOBALS: [&[u16]; 13] = [
&str_to_utf16::<6>("Buffer"),
&str_to_utf16::<14>("clearImmediate"),
&str_to_utf16::<13>("clearInterval"),
@@ -76,13 +76,14 @@ const MANAGED_GLOBALS: [&[u16]; 12] = [
&str_to_utf16::<6>("global"),
&str_to_utf16::<11>("performance"),
&str_to_utf16::<7>("process"),
+ &str_to_utf16::<4>("self"),
&str_to_utf16::<12>("setImmediate"),
&str_to_utf16::<11>("setInterval"),
&str_to_utf16::<10>("setTimeout"),
&str_to_utf16::<6>("window"),
];
-const SHORTEST_MANAGED_GLOBAL: usize = 6;
+const SHORTEST_MANAGED_GLOBAL: usize = 4;
const LONGEST_MANAGED_GLOBAL: usize = 14;
#[derive(Debug, Clone, Copy)]
diff --git a/ext/node/polyfills/worker_threads.ts b/ext/node/polyfills/worker_threads.ts
index 8bbd0e929..b51049af5 100644
--- a/ext/node/polyfills/worker_threads.ts
+++ b/ext/node/polyfills/worker_threads.ts
@@ -356,7 +356,7 @@ internals.__initWorkerThreads = (
(ev: any) => any
>();
- parentPort = self as ParentPort;
+ parentPort = globalThis as ParentPort;
threadId = workerId;
if (maybeWorkerMetadata) {
const { 0: metadata, 1: _ } = maybeWorkerMetadata;