From 7b39503b4a620f2703564fcefb82d98df78dd039 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 9 May 2018 19:00:57 +0200 Subject: [PATCH] tools: hide symbols for builtin JS files in binary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Gus Caplan Reviewed-By: Colin Ihrig Reviewed-By: Ben Noordhuis Reviewed-By: Tobias Nießen Reviewed-By: Daniel Bevenius Reviewed-By: Tiancheng "Timothy" Gu --- tools/js2c.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/js2c.py b/tools/js2c.py index bcfc4764a97..8685722c13c 100755 --- a/tools/js2c.py +++ b/tools/js2c.py @@ -183,8 +183,12 @@ TEMPLATE = """ namespace node {{ +namespace {{ + {definitions} +}} // anonymous namespace + v8::Local LoadersBootstrapperSource(Environment* env) {{ return internal_bootstrap_loaders_value.ToStringChecked(env->isolate()); }}