Changeset 11527 in webkit for trunk/JavaScriptCore/kjs/object_object.cpp
- Timestamp:
- Dec 10, 2005, 6:06:17 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/object_object.cpp
r11525 r11527 33 33 using namespace KJS; 34 34 35 // ------------------------------ ObjectPrototype Imp--------------------------------35 // ------------------------------ ObjectPrototype -------------------------------- 36 36 37 ObjectPrototype Imp::ObjectPrototypeImp(ExecState *exec,38 FunctionPrototype Imp*funcProto)39 : ObjectImp() // [[Prototype]] is null37 ObjectPrototype::ObjectPrototype(ExecState *exec, 38 FunctionPrototype *funcProto) 39 : JSObject() // [[Prototype]] is null 40 40 { 41 putDirect(toStringPropertyName, new ObjectProtoFunc Imp(exec, funcProto, ObjectProtoFuncImp::ToString, 0), DontEnum);42 putDirect(toLocaleStringPropertyName, new ObjectProtoFunc Imp(exec, funcProto, ObjectProtoFuncImp::ToLocaleString, 0), DontEnum);43 putDirect(valueOfPropertyName, new ObjectProtoFunc Imp(exec, funcProto, ObjectProtoFuncImp::ValueOf, 0), DontEnum);44 putDirect("hasOwnProperty", new ObjectProtoFunc Imp(exec, funcProto, ObjectProtoFuncImp::HasOwnProperty, 1), DontEnum);45 putDirect("propertyIsEnumerable", new ObjectProtoFunc Imp(exec, funcProto, ObjectProtoFuncImp::PropertyIsEnumerable, 1), DontEnum);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 46 } 47 47 48 48 49 // ------------------------------ ObjectProtoFunc Imp--------------------------------49 // ------------------------------ ObjectProtoFunc -------------------------------- 50 50 51 ObjectProtoFunc Imp::ObjectProtoFuncImp(ExecState *exec,52 FunctionPrototype Imp*funcProto,51 ObjectProtoFunc::ObjectProtoFunc(ExecState *exec, 52 FunctionPrototype *funcProto, 53 53 int i, int len) 54 54 : InternalFunctionImp(funcProto), id(i) … … 58 58 59 59 60 bool ObjectProtoFunc Imp::implementsCall() const60 bool ObjectProtoFunc::implementsCall() const 61 61 { 62 62 return true; … … 65 65 // ECMA 15.2.4.2, 15.2.4.4, 15.2.4.5, 15.2.4.7 66 66 67 ValueImp *ObjectProtoFuncImp::callAsFunction(ExecState *exec, ObjectImp*thisObj, const List &args)67 JSValue *ObjectProtoFunc::callAsFunction(ExecState *exec, JSObject *thisObj, const List &args) 68 68 { 69 69 switch (id) { … … 87 87 88 88 ObjectObjectImp::ObjectObjectImp(ExecState *exec, 89 ObjectPrototype Imp*objProto,90 FunctionPrototype Imp*funcProto)89 ObjectPrototype *objProto, 90 FunctionPrototype *funcProto) 91 91 : InternalFunctionImp(funcProto) 92 92 { … … 105 105 106 106 // ECMA 15.2.2 107 ObjectImp*ObjectObjectImp::construct(ExecState *exec, const List &args)107 JSObject *ObjectObjectImp::construct(ExecState *exec, const List &args) 108 108 { 109 109 // if no arguments have been passed ... 110 110 if (args.isEmpty()) { 111 ObjectImp*proto = exec->lexicalInterpreter()->builtinObjectPrototype();112 ObjectImp *result(new ObjectImp(proto));111 JSObject *proto = exec->lexicalInterpreter()->builtinObjectPrototype(); 112 JSObject *result(new JSObject(proto)); 113 113 return result; 114 114 } 115 115 116 ValueImp*arg = *(args.begin());117 if ( ObjectImp*obj = arg->getObject())116 JSValue *arg = *(args.begin()); 117 if (JSObject *obj = arg->getObject()) 118 118 return obj; 119 119 … … 127 127 case NullType: 128 128 case UndefinedType: 129 return new ObjectImp(exec->lexicalInterpreter()->builtinObjectPrototype());129 return new JSObject(exec->lexicalInterpreter()->builtinObjectPrototype()); 130 130 } 131 131 } … … 136 136 } 137 137 138 ValueImp *ObjectObjectImp::callAsFunction(ExecState *exec, ObjectImp*/*thisObj*/, const List &args)138 JSValue *ObjectObjectImp::callAsFunction(ExecState *exec, JSObject */*thisObj*/, const List &args) 139 139 { 140 ValueImp*result;140 JSValue *result; 141 141 142 142 List argList; … … 145 145 result = construct(exec,argList); 146 146 } else { 147 ValueImp*arg = args[0];147 JSValue *arg = args[0]; 148 148 if (arg->isUndefinedOrNull()) { 149 149 argList.append(arg);
Note:
See TracChangeset
for help on using the changeset viewer.