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.
pull/5370/head
Zoka 2010-02-17 02:33:36 +11:00 committed by Ryan Dahl
parent 490cac0d7e
commit fbef11b679
2 changed files with 3 additions and 3 deletions

View File

@ -112,12 +112,12 @@ void Connection::Initialize(v8::Handle<v8::Object> 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);

View File

@ -27,7 +27,7 @@ Timer::Initialize (Handle<Object> 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());