Skip to content
Permalink
Browse files

src: move symbols binding into node_symbols.cc

PR-URL: #25163
Refs: #24961
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
  • Loading branch information...
joyeecheung authored and BridgeAR committed Dec 19, 2018
1 parent d7bc03e commit fa74cd352fa323a5301e68aa4c1b3bb5750c5280
Showing with 30 additions and 18 deletions.
  1. +1 −0 node.gyp
  2. +0 −18 src/bootstrapper.cc
  3. +29 −0 src/node_symbols.cc
@@ -373,6 +373,7 @@
'src/node_process.cc',
'src/node_serdes.cc',
'src/node_stat_watcher.cc',
'src/node_symbols.cc',
'src/node_trace_events.cc',
'src/node_types.cc',
'src/node_url.cc',
@@ -135,22 +135,4 @@ void SetupBootstrapObject(Environment* env,
}
#undef BOOTSTRAP_METHOD

namespace symbols {

void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
#define V(PropertyName, StringValue) \
target->Set(env->context(), \
env->PropertyName()->Name(), \
env->PropertyName()).FromJust();
PER_ISOLATE_SYMBOL_PROPERTIES(V)
#undef V
}

} // namespace symbols
} // namespace node

NODE_MODULE_CONTEXT_AWARE_INTERNAL(symbols, node::symbols::Initialize)
@@ -0,0 +1,29 @@
#include "env-inl.h"
#include "node_binding.h"

namespace node {

using v8::Context;
using v8::Local;
using v8::Object;
using v8::Value;

namespace symbols {

static void Initialize(Local<Object> target,
Local<Value> unused,
Local<Context> context,
void* priv) {
Environment* env = Environment::GetCurrent(context);
#define V(PropertyName, StringValue) \
target \
->Set(env->context(), env->PropertyName()->Name(), env->PropertyName()) \
.FromJust();
PER_ISOLATE_SYMBOL_PROPERTIES(V)
#undef V
}

} // namespace symbols
} // namespace node

NODE_MODULE_CONTEXT_AWARE_INTERNAL(symbols, node::symbols::Initialize)

0 comments on commit fa74cd3

Please sign in to comment.
You can’t perform that action at this time.