Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2012-04-27 20:58:30 +0400
committerBen Noordhuis <info@bnoordhuis.nl>2012-05-15 22:59:43 +0400
commit636add246ca78be5c374cfd951c76de7f1010fb9 (patch)
tree20613a7b9197d02011f71b9edfb4b5b70db71064 /src/req_wrap.h
parenta3908f47f1524ca82ddb0ea08dd7d8a5ab4c10e2 (diff)
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.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/req_wrap.h b/src/req_wrap.h
index c478ce0cdb7..11c7d12044b 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)