Skip to content

Commit 45c2434

Browse files
committed
Fixup linked module patch
nodejs/node#30274
1 parent ca3eee6 commit 45c2434

1 file changed

Lines changed: 19 additions & 4 deletions

File tree

patches/node/expose_get_builtin_module_function.patch

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,28 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: Thiago de Arruda <tpadilha84@gmail.com>
33
Date: Mon, 6 Mar 2017 10:42:34 -0300
4-
Subject: Expose `get_builtin_module` function
4+
Subject: Expose `get_linked_module` function
55

6-
This is a requirement for electron/electron#8815, which exposes some builtin
7-
modules to sandboxed renderers.
6+
This is a requirement for electron/electron#8815, which exposes some linked
7+
modules to sandboxed renderers.
88

9-
(cherry picked from commit 4c058a6cb5331eef1c7f51c042dd074a2d4f9234)
9+
TODO(codebytere): removed and replace with a public facing API.
1010

11+
diff --git a/src/node_binding.cc b/src/node_binding.cc
12+
index 0facfc36cbcb784cd0a1802a7748dff3366710fd..db60617cebee83ac09371aa1e2200280e29bd772 100644
13+
--- a/src/node_binding.cc
14+
+++ b/src/node_binding.cc
15+
@@ -611,6 +611,10 @@ void GetInternalBinding(const FunctionCallbackInfo<Value>& args) {
16+
args.GetReturnValue().Set(exports);
17+
}
18+
19+
+node_module* get_linked_module(const char* name) {
20+
+ return FindModule(modlist_linked, name, NM_F_LINKED);
21+
+}
22+
+
23+
void GetLinkedBinding(const FunctionCallbackInfo<Value>& args) {
24+
Environment* env = Environment::GetCurrent(args);
25+
1126
diff --git a/src/node_binding.h b/src/node_binding.h
1227
index 42f3c5b8d00880588f442a4e724e080128c56dfe..cefb6419ebb7f5c5c79927d179eef0a790e234ad 100644
1328
--- a/src/node_binding.h

0 commit comments

Comments
 (0)