diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2012-04-27 18:58:30 +0200 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2012-05-15 20:59:43 +0200 |
commit | 636add246ca78be5c374cfd951c76de7f1010fb9 (patch) | |
tree | 20613a7b9197d02011f71b9edfb4b5b70db71064 /src/req_wrap.h | |
parent | a3908f47f1524ca82ddb0ea08dd7d8a5ab4c10e2 (diff) | |
download | node-636add246ca78be5c374cfd951c76de7f1010fb9.tar.gz |
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.
Diffstat (limited to 'src/req_wrap.h')
-rw-r--r-- | src/req_wrap.h | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/req_wrap.h b/src/req_wrap.h index c478ce0cd..11c7d1204 100644 --- a/src/req_wrap.h +++ b/src/req_wrap.h @@ -24,8 +24,9 @@ namespace node { -static v8::Persistent<v8::String> process_symbol; -static v8::Persistent<v8::String> domain_symbol; +// defined in node.cc +extern v8::Persistent<v8::String> process_symbol; +extern v8::Persistent<v8::String> domain_symbol; template <typename T> class ReqWrap { @@ -34,12 +35,6 @@ class ReqWrap { v8::HandleScope scope; object_ = v8::Persistent<v8::Object>::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<v8::Value> domain = v8::Context::GetCurrent() ->Global() ->Get(process_symbol) |