Ignore:
Timestamp:
Feb 20, 2006, 11:54:55 PM (19 years ago)
Author:
mjs
Message:

Reviewed by Geoff and Darin.


Patch from Maks Orlovich, based on work by David Faure, hand-applied and
significantly reworked by me.


  • tests/mozilla/expected.html: Updated for newly fixed test.
  • kjs/array_object.cpp: (ArrayProtoFunc::ArrayProtoFunc):
  • kjs/array_object.h:
  • kjs/bool_object.cpp: (BooleanPrototype::BooleanPrototype): (BooleanProtoFunc::BooleanProtoFunc):
  • kjs/bool_object.h:
  • kjs/date_object.cpp: (KJS::DateProtoFunc::DateProtoFunc): (KJS::DateObjectImp::DateObjectImp): (KJS::DateObjectFuncImp::DateObjectFuncImp):
  • kjs/error_object.cpp: (ErrorPrototype::ErrorPrototype): (ErrorProtoFunc::ErrorProtoFunc):
  • kjs/error_object.h:
  • kjs/function.cpp: (KJS::FunctionImp::FunctionImp): (KJS::GlobalFuncImp::GlobalFuncImp):
  • kjs/function.h:
  • kjs/function_object.cpp: (FunctionPrototype::FunctionPrototype): (FunctionProtoFunc::FunctionProtoFunc): (FunctionProtoFunc::callAsFunction):
  • kjs/function_object.h:
  • kjs/internal.cpp: (KJS::InterpreterImp::initGlobalObject): (KJS::InternalFunctionImp::InternalFunctionImp):
  • kjs/internal.h: (KJS::InternalFunctionImp::functionName):
  • kjs/lookup.h: (KJS::staticFunctionGetter): (KJS::HashEntryFunction::HashEntryFunction): (KJS::HashEntryFunction::implementsCall): (KJS::HashEntryFunction::toBoolean): (KJS::HashEntryFunction::implementsHasInstance): (KJS::HashEntryFunction::hasInstance):
  • kjs/math_object.cpp: (MathFuncImp::MathFuncImp):
  • kjs/math_object.h:
  • kjs/number_object.cpp: (NumberPrototype::NumberPrototype): (NumberProtoFunc::NumberProtoFunc):
  • kjs/number_object.h:
  • kjs/object.cpp: (KJS::JSObject::putDirectFunction): (KJS::Error::create):
  • kjs/object.h:
  • kjs/object_object.cpp: (ObjectPrototype::ObjectPrototype): (ObjectProtoFunc::ObjectProtoFunc):
  • kjs/object_object.h:
  • kjs/regexp_object.cpp: (RegExpPrototype::RegExpPrototype): (RegExpProtoFunc::RegExpProtoFunc):
  • kjs/regexp_object.h:
  • kjs/string_object.cpp: (StringProtoFunc::StringProtoFunc): (StringObjectImp::StringObjectImp): (StringObjectFuncImp::StringObjectFuncImp):
  • kjs/string_object.h:
File:
1 edited

Legend:

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

    r12317 r12911  
    3535// ------------------------------ ObjectPrototype --------------------------------
    3636
    37 ObjectPrototype::ObjectPrototype(ExecState *exec,
    38                                        FunctionPrototype *funcProto)
     37ObjectPrototype::ObjectPrototype(ExecState* exec, FunctionPrototype* funcProto)
    3938  : JSObject() // [[Prototype]] is null
    4039{
    41     putDirect(toStringPropertyName, new ObjectProtoFunc(exec, funcProto, ObjectProtoFunc::ToString,               0), DontEnum);
    42     putDirect(toLocaleStringPropertyName, new ObjectProtoFunc(exec, funcProto, ObjectProtoFunc::ToLocaleString,   0), DontEnum);
    43     putDirect(valueOfPropertyName, new ObjectProtoFunc(exec, funcProto, ObjectProtoFunc::ValueOf,                 0), DontEnum);
    44     putDirect("hasOwnProperty", new ObjectProtoFunc(exec, funcProto, ObjectProtoFunc::HasOwnProperty,             1), DontEnum);
    45     putDirect("propertyIsEnumerable", new ObjectProtoFunc(exec, funcProto, ObjectProtoFunc::PropertyIsEnumerable, 1), DontEnum);
    46     putDirect("isPrototypeOf", new ObjectProtoFunc(exec, funcProto, ObjectProtoFunc::IsPrototypeOf,               1), DontEnum);
     40    putDirectFunction(new ObjectProtoFunc(exec, funcProto, ObjectProtoFunc::ToString, 0, toStringPropertyName), DontEnum);
     41    putDirectFunction(new ObjectProtoFunc(exec, funcProto, ObjectProtoFunc::ToLocaleString, 0, toLocaleStringPropertyName), DontEnum);
     42    putDirectFunction(new ObjectProtoFunc(exec, funcProto, ObjectProtoFunc::ValueOf, 0, valueOfPropertyName), DontEnum);
     43    static Identifier hasOwnPropertyPropertyName("hasOwnProperty");
     44    static Identifier propertyIsEnumerablePropertyName("propertyIsEnumerable");
     45    static Identifier isPrototypeOfPropertyName("isPrototypeOf");
     46    putDirectFunction(new ObjectProtoFunc(exec, funcProto, ObjectProtoFunc::HasOwnProperty, 1, hasOwnPropertyPropertyName), DontEnum);
     47    putDirectFunction(new ObjectProtoFunc(exec, funcProto, ObjectProtoFunc::PropertyIsEnumerable, 1, propertyIsEnumerablePropertyName), DontEnum);
     48    putDirectFunction(new ObjectProtoFunc(exec, funcProto, ObjectProtoFunc::IsPrototypeOf, 1, isPrototypeOfPropertyName), DontEnum);
     49
    4750    // Mozilla extensions
    48     putDirect("__defineGetter__", new ObjectProtoFunc(exec, funcProto, ObjectProtoFunc::DefineGetter,             2), DontEnum);
    49     putDirect("__defineSetter__", new ObjectProtoFunc(exec, funcProto, ObjectProtoFunc::DefineSetter,             2), DontEnum);
    50     putDirect("__lookupGetter__", new ObjectProtoFunc(exec, funcProto, ObjectProtoFunc::LookupGetter,             1), DontEnum);
    51     putDirect("__lookupSetter__", new ObjectProtoFunc(exec, funcProto, ObjectProtoFunc::LookupSetter,             1), DontEnum);
     51    static const Identifier defineGetterPropertyName("__defineGetter__");
     52    static const Identifier defineSetterPropertyName("__defineSetter__");
     53    static const Identifier lookupGetterPropertyName("__lookupGetter__");
     54    static const Identifier lookupSetterPropertyName("__lookupSetter__");
     55    putDirectFunction(new ObjectProtoFunc(exec, funcProto, ObjectProtoFunc::DefineGetter, 2, defineGetterPropertyName), DontEnum);
     56    putDirectFunction(new ObjectProtoFunc(exec, funcProto, ObjectProtoFunc::DefineSetter, 2, defineSetterPropertyName), DontEnum);
     57    putDirectFunction(new ObjectProtoFunc(exec, funcProto, ObjectProtoFunc::LookupGetter, 1, lookupGetterPropertyName), DontEnum);
     58    putDirectFunction(new ObjectProtoFunc(exec, funcProto, ObjectProtoFunc::LookupSetter, 1, lookupSetterPropertyName), DontEnum);
    5259}
    5360
     
    5562// ------------------------------ ObjectProtoFunc --------------------------------
    5663
    57 ObjectProtoFunc::ObjectProtoFunc(ExecState *exec,
    58                                        FunctionPrototype *funcProto,
    59                                        int i, int len)
    60   : InternalFunctionImp(funcProto), id(i)
     64ObjectProtoFunc::ObjectProtoFunc(ExecState*, FunctionPrototype* funcProto, int i, int len, const Identifier& name)
     65  : InternalFunctionImp(funcProto, name)
     66  , id(i)
    6167{
    6268  putDirect(lengthPropertyName, len, DontDelete|ReadOnly|DontEnum);
Note: See TracChangeset for help on using the changeset viewer.