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.
This commit is contained in:
Zoka authored and Ryan Dahl committed 2010-02-16 09:04:19 -08:00
1 parent 490cac0d7e
commit fbef11b679
2 files changed
+3 -3

No files matched your search

+2 -2
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);
+1 -1
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());