vscodium/patches/linux/fix-reh-bootstrap.patch
2024-10-08 16:11:46 +02:00

27 lines
1.3 KiB
Diff

diff --git a/src/bootstrap-amd.js b/src/bootstrap-amd.js
index 9c8daf5..297e106 100644
--- a/src/bootstrap-amd.js
+++ b/src/bootstrap-amd.js
@@ -17,3 +17,3 @@ import * as fs from 'fs';
import { fileURLToPath } from 'url';
-import { createRequire, register } from 'node:module';
+import * as Module from 'node:module';
import { product, pkg } from './bootstrap-meta.js';
@@ -23,3 +23,3 @@ import * as performance from './vs/base/common/performance.js';
/** @ts-ignore */
-const require = createRequire(import.meta.url);
+const require = Module.createRequire(import.meta.url);
/** @type any */
@@ -29,3 +29,4 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));
// Install a hook to module resolution to map 'fs' to 'original-fs'
-if (process.env['ELECTRON_RUN_AS_NODE'] || process.versions['electron']) {
+// @ts-ignore
+if (Module.register && (process.env['ELECTRON_RUN_AS_NODE'] || process.versions['electron'])) {
const jsCode = `
@@ -44,3 +45,4 @@ if (process.env['ELECTRON_RUN_AS_NODE'] || process.versions['electron']) {
}`;
- register(`data:text/javascript;base64,${Buffer.from(jsCode).toString('base64')}`, import.meta.url);
+ // @ts-ignore
+ Module.register(`data:text/javascript;base64,${Buffer.from(jsCode).toString('base64')}`, import.meta.url);
}