build: remove context-aware patch (#44862)

This commit is contained in:
Shelley Vohr 2024-11-29 18:45:33 +01:00 committed by GitHub
parent f7e823ac80
commit 8f00cc9c0e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 0 additions and 36 deletions

View file

@ -6,7 +6,6 @@ pass_all_globals_through_require.patch
build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch build_modify_js2c_py_to_allow_injection_of_original-fs_and_custom_embedder_js.patch
refactor_allow_embedder_overriding_of_internal_fs_calls.patch refactor_allow_embedder_overriding_of_internal_fs_calls.patch
chore_allow_the_node_entrypoint_to_be_a_builtin_module.patch chore_allow_the_node_entrypoint_to_be_a_builtin_module.patch
chore_add_context_to_context_aware_module_prevention.patch
fix_handle_boringssl_and_openssl_incompatibilities.patch fix_handle_boringssl_and_openssl_incompatibilities.patch
fix_crypto_tests_to_run_with_bssl.patch fix_crypto_tests_to_run_with_bssl.patch
fix_account_for_debugger_agent_race_condition.patch fix_account_for_debugger_agent_race_condition.patch

View file

@ -1,35 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Samuel Attard <sattard@slack-corp.com>
Date: Wed, 22 May 2019 13:34:18 -0700
Subject: chore: add context to context aware module prevention
This patch adds extra context to why we prevent non-context-aware Node.js
modules from being used in the renderer process. This should be upstreamed as
a customizable error message.
diff --git a/src/node_binding.cc b/src/node_binding.cc
index b5c0a93d83ab4d4f6792d0eb648e7198de874bcf..0fd01987c29b06b91944d18266ba67994c1fac45 100644
--- a/src/node_binding.cc
+++ b/src/node_binding.cc
@@ -4,6 +4,7 @@
#include "node_builtins.h"
#include "node_errors.h"
#include "node_external_reference.h"
+#include "node_process.h"
#include "util.h"
#include <string>
@@ -495,7 +496,12 @@ void DLOpen(const FunctionCallbackInfo<Value>& args) {
if (mp->nm_context_register_func == nullptr) {
if (env->force_context_aware()) {
dlib->Close();
- THROW_ERR_NON_CONTEXT_AWARE_DISABLED(env);
+ char errmsg[1024];
+ snprintf(errmsg,
+ sizeof(errmsg),
+ "Loading non-context-aware native module in renderer: '%s'. See https://github.com/electron/electron/issues/18397.",
+ *filename);
+ env->ThrowError(errmsg);
return false;
}
}