0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00

Bug fix: need to return readyState symbol from scope.

This commit is contained in:
Ryan 2009-05-19 16:19:47 +02:00
parent 536eceaa2d
commit a5d5056327

View File

@ -67,12 +67,12 @@ Connection::Initialize (v8::Handle<v8::Object> 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<String> _, 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");