diff --git a/src/req_wrap.h b/src/req_wrap.h index 36e0fe56ce3..587111b415c 100644 --- a/src/req_wrap.h +++ b/src/req_wrap.h @@ -23,6 +23,7 @@ #define REQ_WRAP_H_ #include "ngx-queue.h" +#include "node_internals.h" namespace node { @@ -38,15 +39,16 @@ class ReqWrap { v8::HandleScope scope(node_isolate); object_ = v8::Persistent::New(node_isolate, v8::Object::New()); - v8::Local domain = v8::Context::GetCurrent() - ->Global() - ->Get(process_symbol) - ->ToObject() - ->Get(domain_symbol); + if (using_domains) { + v8::Local domain = v8::Context::GetCurrent() + ->Global() + ->Get(process_symbol) + ->ToObject() + ->Get(domain_symbol); - if (!domain->IsUndefined()) { - // fprintf(stderr, "setting domain on ReqWrap\n"); - object_->Set(domain_symbol, domain); + if (!domain->IsUndefined()) { + object_->Set(domain_symbol, domain); + } } ngx_queue_insert_tail(&req_wrap_queue, &req_wrap_queue_);