mirror of https://github.com/nodejs/node.git
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
parent
490cac0d7e
commit
fbef11b679
|
@ -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);
|
||||
|
||||
|
|
|
@ -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…
Reference in New Issue