summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2018-05-09 19:00:57 +0200
committerAnna Henningsen <anna@addaleax.net>2018-05-14 18:15:26 +0200
commit7b39503b4a620f2703564fcefb82d98df78dd039 (patch)
tree6e1f50da225b699393da3e177a6b0dd7b59eda9b /tools
parentf8fc2f89549113d870c143a98f4f622228b0cae0 (diff)
downloadnode-new-7b39503b4a620f2703564fcefb82d98df78dd039.tar.gz
tools: hide symbols for builtin JS files in binary
Do not expose symbols like `node::internal_process_next_tick_value`, `node::internal_process_next_tick_key` in the created `node` binary by wrapping them in an anonymous namespace. PR-URL: https://github.com/nodejs/node/pull/20634 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/js2c.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/js2c.py b/tools/js2c.py
index bcfc4764a9..8685722c13 100755
--- a/tools/js2c.py
+++ b/tools/js2c.py
@@ -183,8 +183,12 @@ TEMPLATE = """
namespace node {{
+namespace {{
+
{definitions}
+}} // anonymous namespace
+
v8::Local<v8::String> LoadersBootstrapperSource(Environment* env) {{
return internal_bootstrap_loaders_value.ToStringChecked(env->isolate());
}}