From: Ryan Date: Tue, 19 May 2009 14:19:47 +0000 (+0200) Subject: Bug fix: need to return readyState symbol from scope. X-Git-Tag: v0.0.1~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a5d50563273943a0747ec376f4ef2e7fe197a851;p=platform%2Fupstream%2Fnodejs.git Bug fix: need to return readyState symbol from scope. --- diff --git a/src/net.cc b/src/net.cc index 4a81a6f..5fd2f49 100644 --- a/src/net.cc +++ b/src/net.cc @@ -67,12 +67,12 @@ Connection::Initialize (v8::Handle target) NODE_SET_PROTOTYPE_METHOD(constructor_template, "fullClose", FullClose); NODE_SET_PROTOTYPE_METHOD(constructor_template, "forceClose", ForceClose); - constructor_template->InstanceTemplate()->SetAccessor( + constructor_template->PrototypeTemplate()->SetAccessor( ENCODING_SYMBOL, EncodingGetter, EncodingSetter); - constructor_template->InstanceTemplate()->SetAccessor( + constructor_template->PrototypeTemplate()->SetAccessor( READY_STATE_SYMBOL, ReadyStateGetter); @@ -88,10 +88,10 @@ Connection::ReadyStateGetter (Local _, const AccessorInfo& info) HandleScope scope; switch(connection->ReadyState()) { - case OPEN: return OPEN_SYMBOL; - case CLOSED: return CLOSED_SYMBOL; - case READ_ONLY: return READ_ONLY_SYMBOL; - case WRITE_ONLY: return WRITE_ONLY_SYMBOL; + case OPEN: return scope.Close(OPEN_SYMBOL); + case CLOSED: return scope.Close(CLOSED_SYMBOL); + case READ_ONLY: return scope.Close(READ_ONLY_SYMBOL); + case WRITE_ONLY: return scope.Close(WRITE_ONLY_SYMBOL); } assert(0 && "This shouldnt happen");