From 636add246ca78be5c374cfd951c76de7f1010fb9 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Fri, 27 Apr 2012 18:58:30 +0200 Subject: req_wrap: share process_symbol, domain_symbol Share persistent strings process_symbol and domain_symbol across compilation units. Avoids redefinition errors when src/node.cc includes src/req_wrap.h. --- src/req_wrap.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/req_wrap.h') diff --git a/src/req_wrap.h b/src/req_wrap.h index c478ce0cdb..11c7d12044 100644 --- a/src/req_wrap.h +++ b/src/req_wrap.h @@ -24,8 +24,9 @@ namespace node { -static v8::Persistent process_symbol; -static v8::Persistent domain_symbol; +// defined in node.cc +extern v8::Persistent process_symbol; +extern v8::Persistent domain_symbol; template class ReqWrap { @@ -34,12 +35,6 @@ class ReqWrap { v8::HandleScope scope; object_ = v8::Persistent::New(v8::Object::New()); - // TODO: grab a handle to the current process.domain - if (process_symbol.IsEmpty()) { - process_symbol = NODE_PSYMBOL("process"); - domain_symbol = NODE_PSYMBOL("domain"); - } - v8::Local domain = v8::Context::GetCurrent() ->Global() ->Get(process_symbol) -- cgit v1.2.3