Skip to content

Commit

Permalink
src: move symbols binding into node_symbols.cc
Browse files Browse the repository at this point in the history
PR-URL: nodejs#25163
Refs: nodejs#24961
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
  • Loading branch information
joyeecheung authored and BridgeAR committed Jan 17, 2019
1 parent d7bc03e commit fa74cd3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 18 deletions.
1 change: 1 addition & 0 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
18 changes: 0 additions & 18 deletions src/bootstrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
29 changes: 29 additions & 0 deletions src/node_symbols.cc
Original file line number Diff line number Diff line change
@@ -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.