Changeset 14665 for trunk


Ignore:
Timestamp:
11/20/12 10:25:03 (12 years ago)
Author:
tbretz
Message:
Return undefined when a state is requested for a server which is not connected; added server property to state.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/InterpreterV8.cc

    r14663 r14665  
    306306    const State rc = JsState(*str);
    307307    if (rc.index<=-256)
    308         return Object::New();
     308        return Undefined();
    309309
    310310    HandleScope handle_scope;
    311311
    312     Handle<ObjectTemplate> obj = ObjectTemplate::New();
    313     obj->Set(String::New("index"), Integer::New(rc.index),       ReadOnly);
    314     obj->Set(String::New("name"),  String::New(rc.name.c_str()), ReadOnly);
     312    Handle<Object> obj = Object::New();
     313
     314    obj->Set(String::New("server"), String::New(*str),            ReadOnly);
     315    obj->Set(String::New("index"),  Integer::New(rc.index),       ReadOnly);
     316    obj->Set(String::New("name"),   String::New(rc.name.c_str()), ReadOnly);
    315317
    316318    const Local<Value> date = Date::New(rc.time.JavaDate());
     
    318320        obj->Set(String::New("time"),  date);
    319321
    320     return handle_scope.Close(obj->NewInstance());
     322    return handle_scope.Close(obj);
    321323}
    322324
Note: See TracChangeset for help on using the changeset viewer.