Changeset 14672


Ignore:
Timestamp:
11/20/12 17:55:35 (12 years ago)
Author:
tbretz
Message:
This shadowed the This member of the class - replaced by self.
File:
1 edited

Legend:

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

    r14665 r14672  
    188188    }
    189189
    190     Handle<Object> This = args.This();
    191 
    192     This->SetInternalField(0, Integer::New(id));
    193     This->Set(String::New("kill"), FunctionTemplate::New(WrapKill)->GetFunction(), ReadOnly);
     190    Handle<Object> self = args.This();
     191
     192    self->SetInternalField(0, Integer::New(id));
     193    self->Set(String::New("kill"), FunctionTemplate::New(WrapKill)->GetFunction(), ReadOnly);
    194194
    195195    return Undefined();
     
    731731        fDatabases.push_back(db);
    732732
    733         Handle<Object> This = args.This();
    734         This->Set(String::New("user"),     String::New(db->user.c_str()), ReadOnly);
    735         This->Set(String::New("server"),   String::New(db->server.c_str()), ReadOnly);
    736         This->Set(String::New("database"), String::New(db->db.c_str()), ReadOnly);
    737         This->Set(String::New("port"),     db->port==0?Undefined():Integer::NewFromUnsigned(db->port), ReadOnly);
    738         This->Set(String::New("query"),    FunctionTemplate::New(WrapDbQuery)->GetFunction(), ReadOnly);
    739         This->Set(String::New("close"),    FunctionTemplate::New(WrapDbClose)->GetFunction(),   ReadOnly);
    740         This->SetInternalField(0, External::New(db));
    741 
    742         return handle_scope.Close(This);
     733        Handle<Object> self = args.This();
     734        self->Set(String::New("user"),     String::New(db->user.c_str()), ReadOnly);
     735        self->Set(String::New("server"),   String::New(db->server.c_str()), ReadOnly);
     736        self->Set(String::New("database"), String::New(db->db.c_str()), ReadOnly);
     737        self->Set(String::New("port"),     db->port==0?Undefined():Integer::NewFromUnsigned(db->port), ReadOnly);
     738        self->Set(String::New("query"),    FunctionTemplate::New(WrapDbQuery)->GetFunction(), ReadOnly);
     739        self->Set(String::New("close"),    FunctionTemplate::New(WrapDbClose)->GetFunction(),   ReadOnly);
     740        self->SetInternalField(0, External::New(db));
     741
     742        return handle_scope.Close(self);
    743743    }
    744744    catch (const exception &e)
     
    11761176    const HandleScope handle_scope;
    11771177
    1178     Handle<Object> This = args.This();
    1179     This->Set(String::New("get"),    FunctionTemplate::New(WrapGetData)->GetFunction(),  ReadOnly);
    1180     This->Set(String::New("close"),  FunctionTemplate::New(WrapClose)->GetFunction(),    ReadOnly);
    1181     This->Set(String::New("name"),   String::New(*str), ReadOnly);
    1182     This->Set(String::New("isOpen"), Boolean::New(true));
     1178    Handle<Object> self = args.This();
     1179    self->Set(String::New("get"),    FunctionTemplate::New(WrapGetData)->GetFunction(),  ReadOnly);
     1180    self->Set(String::New("close"),  FunctionTemplate::New(WrapClose)->GetFunction(),    ReadOnly);
     1181    self->Set(String::New("name"),   String::New(*str), ReadOnly);
     1182    self->Set(String::New("isOpen"), Boolean::New(true));
    11831183
    11841184    if (args.Length()==2)
    1185         This->Set(String::New("onchange"), args[1]);
    1186 
    1187     fReverseMap[*str] = Persistent<Object>::New(This);
     1185        self->Set(String::New("onchange"), args[1]);
     1186
     1187    fReverseMap[*str] = Persistent<Object>::New(self);
    11881188
    11891189    void *ptr = JsSubscribe(*str);
     
    11911191        return ThrowException(String::New(("Subscription to '"+string(*str)+"' already exists.").c_str()));
    11921192
    1193     This->SetInternalField(0, External::New(ptr));
     1193    self->SetInternalField(0, External::New(ptr));
    11941194
    11951195    return Undefined();
     
    13981398        return Undefined();
    13991399
    1400     Handle<Object> This = args.This();
    1401     This->Set(String::New("ra"),      Number::New(equ.ra/15),  ReadOnly);
    1402     This->Set(String::New("dec"),     Number::New(equ.dec),    ReadOnly);
    1403     This->Set(String::New("toLocal"), function,                ReadOnly);
    1404     This->Set(String::New("time"),    date,                    ReadOnly);
    1405 
    1406     return handle_scope.Close(This);
     1400    Handle<Object> self = args.This();
     1401    self->Set(String::New("ra"),      Number::New(equ.ra/15),  ReadOnly);
     1402    self->Set(String::New("dec"),     Number::New(equ.dec),    ReadOnly);
     1403    self->Set(String::New("toLocal"), function,                ReadOnly);
     1404    self->Set(String::New("time"),    date,                    ReadOnly);
     1405
     1406    return handle_scope.Close(self);
    14071407}
    14081408
     
    14331433        return Undefined();
    14341434
    1435     Handle<Object> This = args.This();
    1436     This->Set(String::New("ra"),      Number::New(ra),  ReadOnly);
    1437     This->Set(String::New("dec"),     Number::New(dec), ReadOnly);
    1438     This->Set(String::New("toLocal"), function,         ReadOnly);
     1435    Handle<Object> self = args.This();
     1436    self->Set(String::New("ra"),      Number::New(ra),  ReadOnly);
     1437    self->Set(String::New("dec"),     Number::New(dec), ReadOnly);
     1438    self->Set(String::New("toLocal"), function,         ReadOnly);
    14391439    if (args.Length()==3)
    1440         This->Set(String::New("time"), args[2], ReadOnly);
    1441 
    1442     return handle_scope.Close(This);
     1440        self->Set(String::New("time"), args[2], ReadOnly);
     1441
     1442    return handle_scope.Close(self);
    14431443}
    14441444
     
    14691469        return Undefined();
    14701470
    1471     Handle<Object> This = args.This();
    1472     This->Set(String::New("zd"),    Number::New(zd), ReadOnly);
    1473     This->Set(String::New("az"),    Number::New(az), ReadOnly);
    1474     This->Set(String::New("toSky"), function,        ReadOnly);
     1471    Handle<Object> self = args.This();
     1472    self->Set(String::New("zd"),    Number::New(zd), ReadOnly);
     1473    self->Set(String::New("az"),    Number::New(az), ReadOnly);
     1474    self->Set(String::New("toSky"), function,        ReadOnly);
    14751475    if (args.Length()==3)
    1476         This->Set(String::New("time"), args[2], ReadOnly);
    1477 
    1478     return handle_scope.Close(This);
     1476        self->Set(String::New("time"), args[2], ReadOnly);
     1477
     1478    return handle_scope.Close(self);
    14791479}
    14801480#endif
Note: See TracChangeset for help on using the changeset viewer.