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/number_object.cpp

    r11525 r11527  
    3737
    3838
    39 // ------------------------------ NumberInstanceImp ----------------------------
    40 
    41 const ClassInfo NumberInstanceImp::info = {"Number", 0, 0, 0};
    42 
    43 NumberInstanceImp::NumberInstanceImp(ObjectImp *proto)
    44   : ObjectImp(proto)
    45 {
    46 }
    47 // ------------------------------ NumberPrototypeImp ---------------------------
     39// ------------------------------ NumberInstance ----------------------------
     40
     41const ClassInfo NumberInstance::info = {"Number", 0, 0, 0};
     42
     43NumberInstance::NumberInstance(JSObject *proto)
     44  : JSObject(proto)
     45{
     46}
     47// ------------------------------ NumberPrototype ---------------------------
    4848
    4949// ECMA 15.7.4
    5050
    51 NumberPrototypeImp::NumberPrototypeImp(ExecState *exec,
    52                                        ObjectPrototypeImp *objProto,
    53                                        FunctionPrototypeImp *funcProto)
    54   : NumberInstanceImp(objProto)
     51NumberPrototype::NumberPrototype(ExecState *exec,
     52                                       ObjectPrototype *objProto,
     53                                       FunctionPrototype *funcProto)
     54  : NumberInstance(objProto)
    5555{
    5656  setInternalValue(jsNumber(0));
     
    5858  // The constructor will be added later, after NumberObjectImp has been constructed
    5959
    60   putDirect(toStringPropertyName,       new NumberProtoFuncImp(exec,funcProto,NumberProtoFuncImp::ToString,       1), DontEnum);
    61   putDirect(toLocaleStringPropertyName, new NumberProtoFuncImp(exec,funcProto,NumberProtoFuncImp::ToLocaleString, 0), DontEnum);
    62   putDirect(valueOfPropertyName,        new NumberProtoFuncImp(exec,funcProto,NumberProtoFuncImp::ValueOf,        0), DontEnum);
    63   putDirect(toFixedPropertyName,        new NumberProtoFuncImp(exec,funcProto,NumberProtoFuncImp::ToFixed,        1), DontEnum);
    64   putDirect(toExponentialPropertyName,  new NumberProtoFuncImp(exec,funcProto,NumberProtoFuncImp::ToExponential,  1), DontEnum);
    65   putDirect(toPrecisionPropertyName,    new NumberProtoFuncImp(exec,funcProto,NumberProtoFuncImp::ToPrecision,    1), DontEnum);
    66 }
    67 
    68 
    69 // ------------------------------ NumberProtoFuncImp ---------------------------
    70 
    71 NumberProtoFuncImp::NumberProtoFuncImp(ExecState *exec,
    72                                        FunctionPrototypeImp *funcProto, int i, int len)
     60  putDirect(toStringPropertyName,       new NumberProtoFunc(exec,funcProto,NumberProtoFunc::ToString,       1), DontEnum);
     61  putDirect(toLocaleStringPropertyName, new NumberProtoFunc(exec,funcProto,NumberProtoFunc::ToLocaleString, 0), DontEnum);
     62  putDirect(valueOfPropertyName,        new NumberProtoFunc(exec,funcProto,NumberProtoFunc::ValueOf,        0), DontEnum);
     63  putDirect(toFixedPropertyName,        new NumberProtoFunc(exec,funcProto,NumberProtoFunc::ToFixed,        1), DontEnum);
     64  putDirect(toExponentialPropertyName,  new NumberProtoFunc(exec,funcProto,NumberProtoFunc::ToExponential,  1), DontEnum);
     65  putDirect(toPrecisionPropertyName,    new NumberProtoFunc(exec,funcProto,NumberProtoFunc::ToPrecision,    1), DontEnum);
     66}
     67
     68
     69// ------------------------------ NumberProtoFunc ---------------------------
     70
     71NumberProtoFunc::NumberProtoFunc(ExecState *exec,
     72                                       FunctionPrototype *funcProto, int i, int len)
    7373  : InternalFunctionImp(funcProto), id(i)
    7474{
     
    7777
    7878
    79 bool NumberProtoFuncImp::implementsCall() const
     79bool NumberProtoFunc::implementsCall() const
    8080{
    8181  return true;
     
    127127
    128128// ECMA 15.7.4.2 - 15.7.4.7
    129 ValueImp *NumberProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
     129JSValue *NumberProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
    130130{
    131131  // no generic function. "this" has to be a Number object
    132   if (!thisObj->inherits(&NumberInstanceImp::info))
     132  if (!thisObj->inherits(&NumberInstance::info))
    133133    return throwError(exec, TypeError);
    134134
    135   ValueImp *v = thisObj->internalValue();
     135  JSValue *v = thisObj->internalValue();
    136136  switch (id) {
    137137  case ToString: {
     
    159159  case ToFixed:
    160160  {
    161       ValueImp *fractionDigits = args[0];
     161      JSValue *fractionDigits = args[0];
    162162      double df = fractionDigits->toInteger(exec);
    163163      if (!(df >= 0 && df <= 20)) // true for NaN
     
    204204          return jsString(UString::from(x));
    205205     
    206       ValueImp *fractionDigits = args[0];
     206      JSValue *fractionDigits = args[0];
    207207      double df = fractionDigits->toInteger(exec);
    208208      if (!(df >= 0 && df <= 20)) // true for NaN
     
    368368*/
    369369NumberObjectImp::NumberObjectImp(ExecState *exec,
    370                                  FunctionPrototypeImp *funcProto,
    371                                  NumberPrototypeImp *numberProto)
     370                                 FunctionPrototype *funcProto,
     371                                 NumberPrototype *numberProto)
    372372  : InternalFunctionImp(funcProto)
    373373{
     
    384384}
    385385
    386 ValueImp *NumberObjectImp::getValueProperty(ExecState *, int token) const
     386JSValue *NumberObjectImp::getValueProperty(ExecState *, int token) const
    387387{
    388388  // ECMA 15.7.3
     
    409409
    410410// ECMA 15.7.1
    411 ObjectImp *NumberObjectImp::construct(ExecState *exec, const List &args)
    412 {
    413   ObjectImp *proto = exec->lexicalInterpreter()->builtinNumberPrototype();
    414   ObjectImp *obj(new NumberInstanceImp(proto));
     411JSObject *NumberObjectImp::construct(ExecState *exec, const List &args)
     412{
     413  JSObject *proto = exec->lexicalInterpreter()->builtinNumberPrototype();
     414  JSObject *obj(new NumberInstance(proto));
    415415
    416416  double n;
     
    431431
    432432// ECMA 15.7.2
    433 ValueImp *NumberObjectImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/, const List &args)
     433JSValue *NumberObjectImp::callAsFunction(ExecState *exec, JSObject */*thisObj*/, const List &args)
    434434{
    435435  if (args.isEmpty())
Note: See TracChangeset for help on using the changeset viewer.