From fbef11b679de92edb2d4b9fc69914a0c8e9ab8ee Mon Sep 17 00:00:00 2001 From: Zoka Date: Wed, 17 Feb 2010 02:33:36 +1100 Subject: [PATCH] Use InstanceTemplate() instead of PrototypeTemplate() for accessor methods This fixes crash that used to happen when Eclipse debugging session hits the breakpoint that is set either in timer or connection callback. --- src/node_net.cc | 4 ++-- src/node_timer.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/node_net.cc b/src/node_net.cc index 4704c73093..44eded0d69 100644 --- a/src/node_net.cc +++ b/src/node_net.cc @@ -112,12 +112,12 @@ void Connection::Initialize(v8::Handle target) { #endif // Getter for connection.readyState - constructor_template->PrototypeTemplate()->SetAccessor( + constructor_template->InstanceTemplate()->SetAccessor( ready_state_symbol, ReadyStateGetter); // Getter for connection.readyState - constructor_template->PrototypeTemplate()->SetAccessor( + constructor_template->InstanceTemplate()->SetAccessor( fd_symbol, FDGetter); diff --git a/src/node_timer.cc b/src/node_timer.cc index ac7dc267b2..5d60126c8a 100644 --- a/src/node_timer.cc +++ b/src/node_timer.cc @@ -27,7 +27,7 @@ Timer::Initialize (Handle target) NODE_SET_PROTOTYPE_METHOD(constructor_template, "start", Timer::Start); NODE_SET_PROTOTYPE_METHOD(constructor_template, "stop", Timer::Stop); - constructor_template->PrototypeTemplate()->SetAccessor(repeat_symbol, + constructor_template->InstanceTemplate()->SetAccessor(repeat_symbol, RepeatGetter, RepeatSetter); target->Set(String::NewSymbol("Timer"), constructor_template->GetFunction());