Skip to content

Commit a8c5bde

Browse files
committed
Fixup context-aware nnm patch
nodejs/node#34519
1 parent 6163c47 commit a8c5bde

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

patches/node/chore_prevent_warn_non_context-aware_native_modules_being_loaded.patch

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,19 @@ diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pr
1111
index 0a7c4a47c11eb4bb360b6a46fccb4692241bd2dc..b4a0f71af5853f427a10449b52509052fbe3facd 100644
1212
--- a/lib/internal/bootstrap/pre_execution.js
1313
+++ b/lib/internal/bootstrap/pre_execution.js
14-
@@ -89,8 +89,10 @@ function patchProcessObject(expandArgv1) {
14+
@@ -92,10 +92,12 @@ function patchProcessObject(expandArgv1) {
1515

1616
if (expandArgv1 && process.argv[1] && !process.argv[1].startsWith('-')) {
1717
// Expand process.argv[1] into a full path.
18+
- const path = require('path');
19+
- try {
20+
- process.argv[1] = path.resolve(process.argv[1]);
21+
- } catch {}
1822
+ if (!process.argv[1] || !process.argv[1].startsWith('electron/js2c')) {
19-
const path = require('path');
20-
process.argv[1] = path.resolve(process.argv[1]);
23+
+ const path = require('path');
24+
+ try {
25+
+ process.argv[1] = path.resolve(process.argv[1]);
26+
+ } catch {}
2127
+ }
2228
}
2329

@@ -44,8 +50,8 @@ diff --git a/src/env.h b/src/env.h
4450
index d22b579b25ce4e6af8ec042e282e94248ea14162..67cefbe35f390ba25b49e422d10bca8b423a49a8 100644
4551
--- a/src/env.h
4652
+++ b/src/env.h
47-
@@ -890,6 +890,15 @@ class Environment : public MemoryRetainer {
48-
uint64_t thread_id = kNoThreadId);
53+
@@ -885,6 +885,15 @@ class Environment : public MemoryRetainer {
54+
ThreadId thread_id);
4955
~Environment() override;
5056

5157
+ void ForceOnlyContextAwareNativeModules() {
@@ -57,7 +63,7 @@ index d22b579b25ce4e6af8ec042e282e94248ea14162..67cefbe35f390ba25b49e422d10bca8b
5763
+ bool force_context_aware() { return force_context_aware_; }
5864
+ bool warn_non_context_aware() { return warn_non_context_aware_; }
5965
+
60-
void InitializeLibuv(bool start_profiler_idle_notifier);
66+
void InitializeLibuv();
6167
inline const std::vector<std::string>& exec_argv();
6268
inline const std::vector<std::string>& argv();
6369
@@ -1271,6 +1280,9 @@ class Environment : public MemoryRetainer {

0 commit comments

Comments
 (0)