diff --git a/ext/node/global.rs b/ext/node/global.rs index a89a3f98304fca..92439773d6b329 100644 --- a/ext/node/global.rs +++ b/ext/node/global.rs @@ -54,6 +54,8 @@ const fn str_to_utf16(s: &str) -> [u16; N] { // - clearTimeout (both, but different implementation) // - global (node only) // - performance (both, but different implementation) +// - process (always available in Node, while the availability in Deno depends +// on project creation time in Deno Deploy) // - setImmediate (node only) // - setInterval (both, but different implementation) // - setTimeout (both, but different implementation) @@ -61,7 +63,7 @@ const fn str_to_utf16(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::<17>("WorkerGlobalScope"), &str_to_utf16::<14>("clearImmediate"), @@ -69,6 +71,7 @@ const MANAGED_GLOBALS: [&[u16]; 12] = [ &str_to_utf16::<12>("clearTimeout"), &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"), diff --git a/ext/node/polyfills/01_require.js b/ext/node/polyfills/01_require.js index 8f3201755fd04c..3e90750cd34f12 100644 --- a/ext/node/polyfills/01_require.js +++ b/ext/node/polyfills/01_require.js @@ -946,7 +946,7 @@ Module.prototype.require = function (id) { // wrapper function we run the users code in. The only observable difference is // that in Deno `arguments.callee` is not null. Module.wrapper = [ - "(function (exports, require, module, __filename, __dirname, Buffer, clearImmediate, clearInterval, clearTimeout, global, setImmediate, setInterval, setTimeout, performance) { (function (exports, require, module, __filename, __dirname) {", + "(function (exports, require, module, __filename, __dirname, Buffer, clearImmediate, clearInterval, clearTimeout, global, process, setImmediate, setInterval, setTimeout, performance) { (function (exports, require, module, __filename, __dirname) {", "\n}).call(this, exports, require, module, __filename, __dirname); })", ]; Module.wrap = function (script) { @@ -1031,6 +1031,7 @@ Module.prototype._compile = function (content, filename, format) { clearInterval, clearTimeout, global, + process, setImmediate, setInterval, setTimeout, @@ -1049,6 +1050,7 @@ Module.prototype._compile = function (content, filename, format) { clearInterval, clearTimeout, global, + process, setImmediate, setInterval, setTimeout,