2019-07-16 17:23:04 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Thiago de Arruda <tpadilha84@gmail.com>
|
|
|
|
Date: Mon, 6 Mar 2017 10:42:34 -0300
|
2020-02-24 21:02:04 +00:00
|
|
|
Subject: Expose `get_linked_module` function
|
2019-07-16 17:23:04 +00:00
|
|
|
|
2020-02-24 21:02:04 +00:00
|
|
|
This is a requirement for electron/electron#8815, which exposes some linked
|
2020-03-03 21:35:05 +00:00
|
|
|
modules to sandboxed renderers.
|
2019-07-16 17:23:04 +00:00
|
|
|
|
2020-02-24 21:02:04 +00:00
|
|
|
TODO(codebytere): remove and replace with a public facing API.
|
2019-07-16 17:23:04 +00:00
|
|
|
|
2020-02-24 21:02:04 +00:00
|
|
|
diff --git a/src/node_binding.cc b/src/node_binding.cc
|
2023-04-18 20:23:11 +00:00
|
|
|
index 60b5eea61cf05344de9862a028165fecdb63fd35..5093c3e53cee6d0ad9a9100b487549c3b4e7ae46 100644
|
2020-02-24 21:02:04 +00:00
|
|
|
--- a/src/node_binding.cc
|
|
|
|
+++ b/src/node_binding.cc
|
2023-04-18 20:23:11 +00:00
|
|
|
@@ -609,6 +609,10 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) {
|
2020-02-24 21:02:04 +00:00
|
|
|
args.GetReturnValue().Set(exports);
|
|
|
|
}
|
|
|
|
|
|
|
|
+node_module* get_linked_module(const char* name) {
|
|
|
|
+ return FindModule(modlist_linked, name, NM_F_LINKED);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
void GetLinkedBinding(const FunctionCallbackInfo<Value>& args) {
|
|
|
|
Environment* env = Environment::GetCurrent(args);
|
|
|
|
|
2019-07-16 17:23:04 +00:00
|
|
|
diff --git a/src/node_binding.h b/src/node_binding.h
|
2023-02-07 20:51:07 +00:00
|
|
|
index 13681bac67c64f5b9c81a034f0be1eeb2b346bb1..76898adc448c48715d8b9dc4aa782217a4fc7e05 100644
|
2019-07-16 17:23:04 +00:00
|
|
|
--- a/src/node_binding.h
|
|
|
|
+++ b/src/node_binding.h
|
2020-04-14 16:59:03 +00:00
|
|
|
@@ -91,6 +91,8 @@ void GetInternalBinding(const v8::FunctionCallbackInfo<v8::Value>& args);
|
2019-07-16 17:23:04 +00:00
|
|
|
void GetLinkedBinding(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
|
|
void DLOpen(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
|
|
|
|
|
|
+NODE_EXTERN node_module* get_linked_module(const char *name);
|
|
|
|
+
|
|
|
|
} // namespace binding
|
|
|
|
|
|
|
|
} // namespace node
|