Skip to content

Commit fbef11b

Browse files
zokary
authored andcommitted
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.
1 parent 490cac0 commit fbef11b

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/node_net.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ void Connection::Initialize(v8::Handle<v8::Object> target) {
112112
#endif
113113

114114
// Getter for connection.readyState
115-
constructor_template->PrototypeTemplate()->SetAccessor(
115+
constructor_template->InstanceTemplate()->SetAccessor(
116116
ready_state_symbol,
117117
ReadyStateGetter);
118118

119119
// Getter for connection.readyState
120-
constructor_template->PrototypeTemplate()->SetAccessor(
120+
constructor_template->InstanceTemplate()->SetAccessor(
121121
fd_symbol,
122122
FDGetter);
123123

src/node_timer.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Timer::Initialize (Handle<Object> target)
2727
NODE_SET_PROTOTYPE_METHOD(constructor_template, "start", Timer::Start);
2828
NODE_SET_PROTOTYPE_METHOD(constructor_template, "stop", Timer::Stop);
2929

30-
constructor_template->PrototypeTemplate()->SetAccessor(repeat_symbol,
30+
constructor_template->InstanceTemplate()->SetAccessor(repeat_symbol,
3131
RepeatGetter, RepeatSetter);
3232

3333
target->Set(String::NewSymbol("Timer"), constructor_template->GetFunction());

0 commit comments

Comments
 (0)