Ignore:
Timestamp:
Dec 10, 2005, 6:06:17 PM (19 years ago)
Author:
darin
Message:

JavaScriptCore:

Rubber stamped by Maciej.

  • did long-promised KJS renaming:

ValueImp -> JSValue
ObjectImp -> JSObject
AllocatedValueImp -> JSCell

A renaming to get a class out of the way

KJS::Bindings::JSObject -> JavaJSObject

and some other "imp-reduction" renaming

*InstanceImp -> *Instance
*ProtoFuncImp -> *ProtoFunc
*PrototypeImp -> *Prototype
ArgumentsImp -> Arguments
RuntimeArrayImp -> RuntimeArray
RuntimeMethodImp -> RuntimeMethod

  • most files and functions

WebCore:

Rubber stamped by Maciej.

  • updated for KJS class renaming
  • many files and functions
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/date_object.cpp

    r11331 r11527  
    7070 * Date.prototype object
    7171 */
    72 class DateProtoFuncImp : public InternalFunctionImp {
     72class DateProtoFunc : public InternalFunctionImp {
    7373public:
    74     DateProtoFuncImp(ExecState *, int i, int len);
     74    DateProtoFunc(ExecState *, int i, int len);
    7575
    7676    virtual bool implementsCall() const;
    77     virtual ValueImp *callAsFunction(ExecState *, ObjectImp *thisObj, const List &args);
     77    virtual JSValue *callAsFunction(ExecState *, JSObject *thisObj, const List &args);
    7878
    7979    Completion execute(const List &);
     
    9999class DateObjectFuncImp : public InternalFunctionImp {
    100100public:
    101     DateObjectFuncImp(ExecState *, FunctionPrototypeImp *, int i, int len);
     101    DateObjectFuncImp(ExecState *, FunctionPrototype *, int i, int len);
    102102
    103103    virtual bool implementsCall() const;
    104     virtual ValueImp *callAsFunction(ExecState *, ObjectImp *thisObj, const List &args);
     104    virtual JSValue *callAsFunction(ExecState *, JSObject *thisObj, const List &args);
    105105
    106106    enum { Parse, UTC };
     
    379379}
    380380
    381 // ------------------------------ DateInstanceImp ------------------------------
    382 
    383 const ClassInfo DateInstanceImp::info = {"Date", 0, 0, 0};
    384 
    385 DateInstanceImp::DateInstanceImp(ObjectImp *proto)
    386   : ObjectImp(proto)
    387 {
    388 }
    389 
    390 // ------------------------------ DatePrototypeImp -----------------------------
    391 
    392 const ClassInfo DatePrototypeImp::info = {"Date", &DateInstanceImp::info, &dateTable, 0};
     381// ------------------------------ DateInstance ------------------------------
     382
     383const ClassInfo DateInstance::info = {"Date", 0, 0, 0};
     384
     385DateInstance::DateInstance(JSObject *proto)
     386  : JSObject(proto)
     387{
     388}
     389
     390// ------------------------------ DatePrototype -----------------------------
     391
     392const ClassInfo DatePrototype::info = {"Date", &DateInstance::info, &dateTable, 0};
    393393
    394394/* Source for date_object.lut.h
    395395   We use a negative ID to denote the "UTC" variant.
    396396@begin dateTable 61
    397   toString              DateProtoFuncImp::ToString              DontEnum|Function       0
    398   toUTCString           -DateProtoFuncImp::ToUTCString          DontEnum|Function       0
    399   toDateString          DateProtoFuncImp::ToDateString          DontEnum|Function       0
    400   toTimeString          DateProtoFuncImp::ToTimeString          DontEnum|Function       0
    401   toLocaleString        DateProtoFuncImp::ToLocaleString        DontEnum|Function       0
    402   toLocaleDateString    DateProtoFuncImp::ToLocaleDateString    DontEnum|Function       0
    403   toLocaleTimeString    DateProtoFuncImp::ToLocaleTimeString    DontEnum|Function       0
    404   valueOf               DateProtoFuncImp::ValueOf               DontEnum|Function       0
    405   getTime               DateProtoFuncImp::GetTime               DontEnum|Function       0
    406   getFullYear           DateProtoFuncImp::GetFullYear           DontEnum|Function       0
    407   getUTCFullYear        -DateProtoFuncImp::GetFullYear          DontEnum|Function       0
    408   toGMTString           -DateProtoFuncImp::ToGMTString          DontEnum|Function       0
    409   getMonth              DateProtoFuncImp::GetMonth              DontEnum|Function       0
    410   getUTCMonth           -DateProtoFuncImp::GetMonth             DontEnum|Function       0
    411   getDate               DateProtoFuncImp::GetDate               DontEnum|Function       0
    412   getUTCDate            -DateProtoFuncImp::GetDate              DontEnum|Function       0
    413   getDay                DateProtoFuncImp::GetDay                DontEnum|Function       0
    414   getUTCDay             -DateProtoFuncImp::GetDay               DontEnum|Function       0
    415   getHours              DateProtoFuncImp::GetHours              DontEnum|Function       0
    416   getUTCHours           -DateProtoFuncImp::GetHours             DontEnum|Function       0
    417   getMinutes            DateProtoFuncImp::GetMinutes            DontEnum|Function       0
    418   getUTCMinutes         -DateProtoFuncImp::GetMinutes           DontEnum|Function       0
    419   getSeconds            DateProtoFuncImp::GetSeconds            DontEnum|Function       0
    420   getUTCSeconds         -DateProtoFuncImp::GetSeconds           DontEnum|Function       0
    421   getMilliseconds       DateProtoFuncImp::GetMilliSeconds       DontEnum|Function       0
    422   getUTCMilliseconds    -DateProtoFuncImp::GetMilliSeconds      DontEnum|Function       0
    423   getTimezoneOffset     DateProtoFuncImp::GetTimezoneOffset     DontEnum|Function       0
    424   setTime               DateProtoFuncImp::SetTime               DontEnum|Function       1
    425   setMilliseconds       DateProtoFuncImp::SetMilliSeconds       DontEnum|Function       1
    426   setUTCMilliseconds    -DateProtoFuncImp::SetMilliSeconds      DontEnum|Function       1
    427   setSeconds            DateProtoFuncImp::SetSeconds            DontEnum|Function       2
    428   setUTCSeconds         -DateProtoFuncImp::SetSeconds           DontEnum|Function       2
    429   setMinutes            DateProtoFuncImp::SetMinutes            DontEnum|Function       3
    430   setUTCMinutes         -DateProtoFuncImp::SetMinutes           DontEnum|Function       3
    431   setHours              DateProtoFuncImp::SetHours              DontEnum|Function       4
    432   setUTCHours           -DateProtoFuncImp::SetHours             DontEnum|Function       4
    433   setDate               DateProtoFuncImp::SetDate               DontEnum|Function       1
    434   setUTCDate            -DateProtoFuncImp::SetDate              DontEnum|Function       1
    435   setMonth              DateProtoFuncImp::SetMonth              DontEnum|Function       2
    436   setUTCMonth           -DateProtoFuncImp::SetMonth             DontEnum|Function       2
    437   setFullYear           DateProtoFuncImp::SetFullYear           DontEnum|Function       3
    438   setUTCFullYear        -DateProtoFuncImp::SetFullYear          DontEnum|Function       3
    439   setYear               DateProtoFuncImp::SetYear               DontEnum|Function       1
    440   getYear               DateProtoFuncImp::GetYear               DontEnum|Function       0
     397  toString              DateProtoFunc::ToString         DontEnum|Function       0
     398  toUTCString           -DateProtoFunc::ToUTCString             DontEnum|Function       0
     399  toDateString          DateProtoFunc::ToDateString             DontEnum|Function       0
     400  toTimeString          DateProtoFunc::ToTimeString             DontEnum|Function       0
     401  toLocaleString        DateProtoFunc::ToLocaleString   DontEnum|Function       0
     402  toLocaleDateString    DateProtoFunc::ToLocaleDateString       DontEnum|Function       0
     403  toLocaleTimeString    DateProtoFunc::ToLocaleTimeString       DontEnum|Function       0
     404  valueOf               DateProtoFunc::ValueOf          DontEnum|Function       0
     405  getTime               DateProtoFunc::GetTime          DontEnum|Function       0
     406  getFullYear           DateProtoFunc::GetFullYear              DontEnum|Function       0
     407  getUTCFullYear        -DateProtoFunc::GetFullYear             DontEnum|Function       0
     408  toGMTString           -DateProtoFunc::ToGMTString             DontEnum|Function       0
     409  getMonth              DateProtoFunc::GetMonth         DontEnum|Function       0
     410  getUTCMonth           -DateProtoFunc::GetMonth                DontEnum|Function       0
     411  getDate               DateProtoFunc::GetDate          DontEnum|Function       0
     412  getUTCDate            -DateProtoFunc::GetDate         DontEnum|Function       0
     413  getDay                DateProtoFunc::GetDay           DontEnum|Function       0
     414  getUTCDay             -DateProtoFunc::GetDay          DontEnum|Function       0
     415  getHours              DateProtoFunc::GetHours         DontEnum|Function       0
     416  getUTCHours           -DateProtoFunc::GetHours                DontEnum|Function       0
     417  getMinutes            DateProtoFunc::GetMinutes               DontEnum|Function       0
     418  getUTCMinutes         -DateProtoFunc::GetMinutes              DontEnum|Function       0
     419  getSeconds            DateProtoFunc::GetSeconds               DontEnum|Function       0
     420  getUTCSeconds         -DateProtoFunc::GetSeconds              DontEnum|Function       0
     421  getMilliseconds       DateProtoFunc::GetMilliSeconds  DontEnum|Function       0
     422  getUTCMilliseconds    -DateProtoFunc::GetMilliSeconds DontEnum|Function       0
     423  getTimezoneOffset     DateProtoFunc::GetTimezoneOffset        DontEnum|Function       0
     424  setTime               DateProtoFunc::SetTime          DontEnum|Function       1
     425  setMilliseconds       DateProtoFunc::SetMilliSeconds  DontEnum|Function       1
     426  setUTCMilliseconds    -DateProtoFunc::SetMilliSeconds DontEnum|Function       1
     427  setSeconds            DateProtoFunc::SetSeconds               DontEnum|Function       2
     428  setUTCSeconds         -DateProtoFunc::SetSeconds              DontEnum|Function       2
     429  setMinutes            DateProtoFunc::SetMinutes               DontEnum|Function       3
     430  setUTCMinutes         -DateProtoFunc::SetMinutes              DontEnum|Function       3
     431  setHours              DateProtoFunc::SetHours         DontEnum|Function       4
     432  setUTCHours           -DateProtoFunc::SetHours                DontEnum|Function       4
     433  setDate               DateProtoFunc::SetDate          DontEnum|Function       1
     434  setUTCDate            -DateProtoFunc::SetDate         DontEnum|Function       1
     435  setMonth              DateProtoFunc::SetMonth         DontEnum|Function       2
     436  setUTCMonth           -DateProtoFunc::SetMonth                DontEnum|Function       2
     437  setFullYear           DateProtoFunc::SetFullYear              DontEnum|Function       3
     438  setUTCFullYear        -DateProtoFunc::SetFullYear             DontEnum|Function       3
     439  setYear               DateProtoFunc::SetYear          DontEnum|Function       1
     440  getYear               DateProtoFunc::GetYear          DontEnum|Function       0
    441441@end
    442442*/
    443443// ECMA 15.9.4
    444444
    445 DatePrototypeImp::DatePrototypeImp(ExecState *, ObjectPrototypeImp *objectProto)
    446   : DateInstanceImp(objectProto)
     445DatePrototype::DatePrototype(ExecState *, ObjectPrototype *objectProto)
     446  : DateInstance(objectProto)
    447447{
    448448    setInternalValue(jsNaN());
     
    450450}
    451451
    452 bool DatePrototypeImp::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
    453 {
    454     return getStaticFunctionSlot<DateProtoFuncImp, ObjectImp>(exec, &dateTable, this, propertyName, slot);
    455 }
    456 
    457 // ------------------------------ DateProtoFuncImp -----------------------------
    458 
    459 DateProtoFuncImp::DateProtoFuncImp(ExecState *exec, int i, int len)
    460   : InternalFunctionImp(static_cast<FunctionPrototypeImp*>(exec->lexicalInterpreter()->builtinFunctionPrototype())),
     452bool DatePrototype::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot)
     453{
     454    return getStaticFunctionSlot<DateProtoFunc, JSObject>(exec, &dateTable, this, propertyName, slot);
     455}
     456
     457// ------------------------------ DateProtoFunc -----------------------------
     458
     459DateProtoFunc::DateProtoFunc(ExecState *exec, int i, int len)
     460  : InternalFunctionImp(static_cast<FunctionPrototype*>(exec->lexicalInterpreter()->builtinFunctionPrototype())),
    461461    id(abs(i)), utc(i<0)
    462462  // We use a negative ID to denote the "UTC" variant.
     
    465465}
    466466
    467 bool DateProtoFuncImp::implementsCall() const
     467bool DateProtoFunc::implementsCall() const
    468468{
    469469    return true;
     
    476476}
    477477
    478 ValueImp *DateProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
     478JSValue *DateProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
    479479{
    480480  if ((id == ToString || id == ValueOf || id == GetTime || id == SetTime) &&
    481       !thisObj->inherits(&DateInstanceImp::info)) {
     481      !thisObj->inherits(&DateInstance::info)) {
    482482    // non-generic function called on non-date object
    483483
     
    488488
    489489
    490   ValueImp *result = 0;
     490  JSValue *result = 0;
    491491  UString s;
    492492#if !__APPLE__
     
    498498  // FIXME: Where's the code to set the locale back to oldlocale?
    499499#endif
    500   ValueImp *v = thisObj->internalValue();
     500  JSValue *v = thisObj->internalValue();
    501501  double milli = v->toNumber(exec);
    502502  if (isNaN(milli)) {
     
    682682
    683683DateObjectImp::DateObjectImp(ExecState *exec,
    684                              FunctionPrototypeImp *funcProto,
    685                              DatePrototypeImp *dateProto)
     684                             FunctionPrototype *funcProto,
     685                             DatePrototype *dateProto)
    686686  : InternalFunctionImp(funcProto)
    687687{
     
    704704
    705705// ECMA 15.9.3
    706 ObjectImp *DateObjectImp::construct(ExecState *exec, const List &args)
     706JSObject *DateObjectImp::construct(ExecState *exec, const List &args)
    707707{
    708708  int numArgs = args.size();
     
    756756  }
    757757 
    758   DateInstanceImp *ret = new DateInstanceImp(exec->lexicalInterpreter()->builtinDatePrototype());
     758  DateInstance *ret = new DateInstance(exec->lexicalInterpreter()->builtinDatePrototype());
    759759  ret->setInternalValue(jsNumber(timeClip(value)));
    760760  return ret;
     
    767767
    768768// ECMA 15.9.2
    769 ValueImp *DateObjectImp::callAsFunction(ExecState * /*exec*/, ObjectImp * /*thisObj*/, const List &/*args*/)
     769JSValue *DateObjectImp::callAsFunction(ExecState * /*exec*/, JSObject * /*thisObj*/, const List &/*args*/)
    770770{
    771771    time_t t = time(0);
     
    777777// ------------------------------ DateObjectFuncImp ----------------------------
    778778
    779 DateObjectFuncImp::DateObjectFuncImp(ExecState *exec, FunctionPrototypeImp *funcProto, int i, int len)
     779DateObjectFuncImp::DateObjectFuncImp(ExecState *exec, FunctionPrototype *funcProto, int i, int len)
    780780    : InternalFunctionImp(funcProto), id(i)
    781781{
     
    789789
    790790// ECMA 15.9.4.2 - 3
    791 ValueImp *DateObjectFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
     791JSValue *DateObjectFuncImp::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
    792792{
    793793  if (id == Parse) {
Note: See TracChangeset for help on using the changeset viewer.