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

    r11525 r11527  
    3737using namespace KJS;
    3838
    39 // ------------------------------ FunctionPrototypeImp -------------------------
    40 
    41 FunctionPrototypeImp::FunctionPrototypeImp(ExecState *exec)
     39// ------------------------------ FunctionPrototype -------------------------
     40
     41FunctionPrototype::FunctionPrototype(ExecState *exec)
    4242{
    4343  putDirect(lengthPropertyName,   jsNumber(0),                                                       DontDelete|ReadOnly|DontEnum);
    44   putDirect(toStringPropertyName, new FunctionProtoFuncImp(exec, this, FunctionProtoFuncImp::ToString, 0), DontEnum);
     44  putDirect(toStringPropertyName, new FunctionProtoFunc(exec, this, FunctionProtoFunc::ToString, 0), DontEnum);
    4545  static const Identifier applyPropertyName("apply");
    46   putDirect(applyPropertyName,    new FunctionProtoFuncImp(exec, this, FunctionProtoFuncImp::Apply,    2), DontEnum);
     46  putDirect(applyPropertyName,    new FunctionProtoFunc(exec, this, FunctionProtoFunc::Apply,    2), DontEnum);
    4747  static const Identifier callPropertyName("call");
    48   putDirect(callPropertyName,     new FunctionProtoFuncImp(exec, this, FunctionProtoFuncImp::Call,     1), DontEnum);
    49 }
    50 
    51 FunctionPrototypeImp::~FunctionPrototypeImp()
    52 {
    53 }
    54 
    55 bool FunctionPrototypeImp::implementsCall() const
     48  putDirect(callPropertyName,     new FunctionProtoFunc(exec, this, FunctionProtoFunc::Call,     1), DontEnum);
     49}
     50
     51FunctionPrototype::~FunctionPrototype()
     52{
     53}
     54
     55bool FunctionPrototype::implementsCall() const
    5656{
    5757  return true;
     
    5959
    6060// ECMA 15.3.4
    61 ValueImp *FunctionPrototypeImp::callAsFunction(ExecState */*exec*/, ObjectImp */*thisObj*/, const List &/*args*/)
     61JSValue *FunctionPrototype::callAsFunction(ExecState */*exec*/, JSObject */*thisObj*/, const List &/*args*/)
    6262{
    6363  return jsUndefined();
    6464}
    6565
    66 // ------------------------------ FunctionProtoFuncImp -------------------------
    67 
    68 FunctionProtoFuncImp::FunctionProtoFuncImp(ExecState *exec,
    69                                          FunctionPrototypeImp *funcProto, int i, int len)
     66// ------------------------------ FunctionProtoFunc -------------------------
     67
     68FunctionProtoFunc::FunctionProtoFunc(ExecState *exec,
     69                                         FunctionPrototype *funcProto, int i, int len)
    7070  : InternalFunctionImp(funcProto), id(i)
    7171{
     
    7474
    7575
    76 bool FunctionProtoFuncImp::implementsCall() const
    77 {
    78   return true;
    79 }
    80 
    81 ValueImp *FunctionProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
    82 {
    83   ValueImp *result = NULL;
     76bool FunctionProtoFunc::implementsCall() const
     77{
     78  return true;
     79}
     80
     81JSValue *FunctionProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args)
     82{
     83  JSValue *result = NULL;
    8484
    8585  switch (id) {
     
    107107    break;
    108108  case Apply: {
    109     ValueImp *thisArg = args[0];
    110     ValueImp *argArray = args[1];
    111     ObjectImp *func = thisObj;
     109    JSValue *thisArg = args[0];
     110    JSValue *argArray = args[1];
     111    JSObject *func = thisObj;
    112112
    113113    if (!func->implementsCall())
    114114      return throwError(exec, TypeError);
    115115
    116     ObjectImp *applyThis;
     116    JSObject *applyThis;
    117117    if (thisArg->isUndefinedOrNull())
    118118      applyThis = exec->dynamicInterpreter()->globalObject();
     
    123123    if (!argArray->isUndefinedOrNull()) {
    124124      if (argArray->isObject() &&
    125            (static_cast<ObjectImp *>(argArray)->inherits(&ArrayInstanceImp::info) ||
    126             static_cast<ObjectImp *>(argArray)->inherits(&ArgumentsImp::info))) {
    127 
    128         ObjectImp *argArrayObj = static_cast<ObjectImp *>(argArray);
     125           (static_cast<JSObject *>(argArray)->inherits(&ArrayInstance::info) ||
     126            static_cast<JSObject *>(argArray)->inherits(&Arguments::info))) {
     127
     128        JSObject *argArrayObj = static_cast<JSObject *>(argArray);
    129129        unsigned int length = argArrayObj->get(exec,lengthPropertyName)->toUInt32(exec);
    130130        for (unsigned int i = 0; i < length; i++)
     
    138138    break;
    139139  case Call: {
    140     ValueImp *thisArg = args[0];
    141     ObjectImp *func = thisObj;
     140    JSValue *thisArg = args[0];
     141    JSObject *func = thisObj;
    142142
    143143    if (!func->implementsCall())
    144144      return throwError(exec, TypeError);
    145145
    146     ObjectImp *callThis;
     146    JSObject *callThis;
    147147    if (thisArg->isUndefinedOrNull())
    148148      callThis = exec->dynamicInterpreter()->globalObject();
     
    160160// ------------------------------ FunctionObjectImp ----------------------------
    161161
    162 FunctionObjectImp::FunctionObjectImp(ExecState *exec, FunctionPrototypeImp *funcProto)
     162FunctionObjectImp::FunctionObjectImp(ExecState *exec, FunctionPrototype *funcProto)
    163163  : InternalFunctionImp(funcProto)
    164164{
     
    179179
    180180// ECMA 15.3.2 The Function Constructor
    181 ObjectImp *FunctionObjectImp::construct(ExecState *exec, const List &args, const UString &sourceURL, int lineNumber)
     181JSObject *FunctionObjectImp::construct(ExecState *exec, const List &args, const UString &sourceURL, int lineNumber)
    182182{
    183183  UString p("");
     
    208208    if (!cont) {
    209209      dbg->imp()->abort();
    210       return new ObjectImp();
     210      return new JSObject();
    211211    }
    212212  }
     
    259259  List consArgs;
    260260
    261   ObjectImp *objCons = exec->lexicalInterpreter()->builtinObject();
    262   ObjectImp *prototype = objCons->construct(exec,List::empty());
     261  JSObject *objCons = exec->lexicalInterpreter()->builtinObject();
     262  JSObject *prototype = objCons->construct(exec,List::empty());
    263263  prototype->put(exec, constructorPropertyName, fimp, DontEnum|DontDelete|ReadOnly);
    264264  fimp->put(exec, prototypePropertyName, prototype, DontEnum|DontDelete|ReadOnly);
     
    267267
    268268// ECMA 15.3.2 The Function Constructor
    269 ObjectImp *FunctionObjectImp::construct(ExecState *exec, const List &args)
     269JSObject *FunctionObjectImp::construct(ExecState *exec, const List &args)
    270270{
    271271  return FunctionObjectImp::construct(exec, args, UString(), 0);
     
    279279
    280280// ECMA 15.3.1 The Function Constructor Called as a Function
    281 ValueImp *FunctionObjectImp::callAsFunction(ExecState *exec, ObjectImp */*thisObj*/, const List &args)
     281JSValue *FunctionObjectImp::callAsFunction(ExecState *exec, JSObject */*thisObj*/, const List &args)
    282282{
    283283  return construct(exec,args);
Note: See TracChangeset for help on using the changeset viewer.