diff options
| author | David Sherret <dsherret@users.noreply.github.com> | 2022-08-25 20:24:18 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-25 20:24:18 -0400 |
| commit | 376665d1154501660e7b20f760a0482509cff8b0 (patch) | |
| tree | 0a979722c66f8ede48f1dff21c8ceb335521a94a /ext | |
| parent | 0fe590bbcbf270b50abd8d73db1c5e0be69591f1 (diff) | |
fix: avoid global declaration collisions in cjs (#15608)
* Use a default stack size * 2 in debug for Windows because swc using so much stack size. We should look into this more later though.
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/node/02_require.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/node/02_require.js b/ext/node/02_require.js index f2b42da53..6f06d3269 100644 --- a/ext/node/02_require.js +++ b/ext/node/02_require.js @@ -656,11 +656,10 @@ }; Module.wrapper = [ - // TODO: - // We provide non standard timer APIs in the CommonJS wrapper + // We provide the non-standard APIs in the CommonJS wrapper // to avoid exposing them in global namespace. - "(function (exports, require, module, __filename, __dirname, globalThis) { (function (exports, require, module, __filename, __dirname, globalThis, Buffer, clearImmediate, clearInterval, clearTimeout, global, process, setImmediate, setInterval, setTimeout) {", - "\n}).call(this, exports, require, module, __filename, __dirname, globalThis, globalThis.Buffer, globalThis.clearImmediate, globalThis.clearInterval, globalThis.clearTimeout, globalThis.global, globalThis.process, globalThis.setImmediate, globalThis.setInterval, globalThis.setTimeout); })", + "(function (exports, require, module, __filename, __dirname, globalThis) { const { Buffer, clearImmediate, clearInterval, clearTimeout, global, process, setImmediate, setInterval, setTimeout} = globalThis; (function () {", + "\n}).call(this); })", ]; Module.wrap = function (script) { script = script.replace(/^#!.*?\n/, ""); |
