Browse Source

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.
v0.7.4-release
Zoka 15 years ago
committed by Ryan Dahl
parent
commit
fbef11b679
  1. 4
      src/node_net.cc
  2. 2
      src/node_timer.cc

4
src/node_net.cc

@ -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);

2
src/node_timer.cc

@ -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());

Loading…
Cancel
Save