KJS::ObjectImp Class Reference
Inheritance diagram for KJS::ObjectImp:

Detailed Description
Definition at line 361 of file object.h.
Public Member Functions | |
ObjectImp (const Object &proto) | |
ObjectImp (ObjectImp *proto) | |
ObjectImp () | |
virtual | ~ObjectImp () |
virtual void | mark () |
Type | type () const |
virtual const ClassInfo * | classInfo () const |
bool | inherits (const ClassInfo *cinfo) const |
Value | prototype () const |
void | setPrototype (const Value &proto) |
virtual UString | className () const |
virtual Value | get (ExecState *exec, const Identifier &propertyName) const |
virtual Value | getPropertyByIndex (ExecState *exec, unsigned propertyName) const |
virtual void | put (ExecState *exec, const Identifier &propertyName, const Value &value, int attr=None) |
virtual void | putPropertyByIndex (ExecState *exec, unsigned propertyName, const Value &value, int attr=None) |
virtual bool | canPut (ExecState *exec, const Identifier &propertyName) const |
virtual bool | hasProperty (ExecState *exec, const Identifier &propertyName) const |
virtual bool | hasPropertyByIndex (ExecState *exec, unsigned propertyName) const |
virtual bool | deleteProperty (ExecState *exec, const Identifier &propertyName) |
virtual bool | deletePropertyByIndex (ExecState *exec, unsigned propertyName) |
void | deleteAllProperties (ExecState *) |
virtual Value | defaultValue (ExecState *exec, Type hint) const |
virtual bool | implementsConstruct () const |
virtual Object | construct (ExecState *exec, const List &args) |
virtual bool | implementsCall () const |
virtual Value | call (ExecState *exec, Object &thisObj, const List &args) |
virtual bool | implementsHasInstance () const |
virtual Boolean | hasInstance (ExecState *exec, const Value &value) |
const ScopeChain & | scope () const |
void | setScope (const ScopeChain &s) |
virtual ReferenceList | propList (ExecState *exec, bool recursive=true) |
Value | internalValue () const |
void | setInternalValue (const Value &v) |
void | setInternalValue (ValueImp *v) |
Value | toPrimitive (ExecState *exec, Type preferredType=UnspecifiedType) const |
bool | toBoolean (ExecState *exec) const |
double | toNumber (ExecState *exec) const |
UString | toString (ExecState *exec) const |
Object | toObject (ExecState *exec) const |
ValueImp * | getDirect (const Identifier &propertyName) const |
void | putDirect (const Identifier &propertyName, ValueImp *value, int attr=0) |
void | putDirect (const Identifier &propertyName, int value, int attr=0) |
void | setFunctionName (const Identifier &propertyName) |
Protected Attributes | |
PropertyMap | _prop |
Friends | |
class | ObjectProtoFuncImp |
Constructor & Destructor Documentation
|
Creates a new ObjectImp with the specified prototype.
Definition at line 81 of file object.cpp. |
|
Creates a new ObjectImp with a prototype of Null() (that is, the ECMAScript "null" value, not a null Object).
Definition at line 92 of file object.cpp. |
Member Function Documentation
|
Implementation of the [[Call]] internal property.
Reimplemented in KJS::ArrayProtoFuncImp, KJS::ArrayObjectImp, KJS::BooleanProtoFuncImp, KJS::BooleanObjectImp, KJS::DateProtoFuncImp, KJS::DateObjectImp, KJS::DateObjectFuncImp, KJS::ErrorProtoFuncImp, KJS::ErrorObjectImp, KJS::NativeErrorImp, KJS::FunctionPrototypeImp, KJS::FunctionProtoFuncImp, KJS::FunctionObjectImp, KJS::FunctionImp, KJS::GlobalFuncImp, KJS::MathFuncImp, KJS::NumberProtoFuncImp, KJS::NumberObjectImp, KJS::ObjectProtoFuncImp, KJS::ObjectObjectImp, KJS::RegExpProtoFuncImp, KJS::RegExpObjectImp, KJS::StringProtoFuncImp, KJS::StringObjectImp, and KJS::StringObjectFuncImp. Definition at line 381 of file object.cpp. |
|
Implementation of the [[CanPut]] internal property (implemented by all Objects).
Definition at line 226 of file object.cpp. |
|
A pointer to a ClassInfo struct for this class. This provides a basic facility for run-time type information, and can be used to check an object's class an inheritance (see inherits()). This should always return a statically declared pointer, or 0 to indicate that there is no class information. This is primarily useful if you have application-defined classes that you wish to check against for casting purposes. For example, to specify the class info for classes FooImp and BarImp, where FooImp inherits from BarImp, you would add the following in your class declarations:
class BarImp : public ObjectImp { virtual const ClassInfo *classInfo() const { return &info; } static const ClassInfo info; // ... }; class FooImp : public ObjectImp { virtual const ClassInfo *classInfo() const { return &info; } static const ClassInfo info; // ... }; And in your source file:
const ClassInfo BarImp::info = {0, 0, 0}; // no parent class const ClassInfo FooImp::info = {&BarImp::info, 0, 0};
Reimplemented in KJS::ArrayInstanceImp, KJS::ArrayPrototypeImp, KJS::BooleanInstanceImp, KJS::DateInstanceImp, KJS::DatePrototypeImp, KJS::ErrorInstanceImp, KJS::NativeErrorImp, KJS::InternalFunctionImp, KJS::FunctionImp, KJS::DeclaredFunctionImp, KJS::ArgumentsImp, KJS::ActivationImp, KJS::MathObjectImp, KJS::NumberInstanceImp, KJS::NumberObjectImp, KJS::RegExpPrototypeImp, KJS::RegExpImp, KJS::StringInstanceImp, and KJS::StringPrototypeImp. Definition at line 120 of file object.cpp. |
|
Implementation of the [[Class]] internal property (implemented by all Objects). The default implementation uses classInfo(). You should either implement classInfo(), or if you simply need a classname, you can reimplement className() instead.
Definition at line 155 of file object.cpp. |
|
Implementation of the [[Construct]] internal property.
Reimplemented in KJS::ArrayObjectImp, KJS::BooleanObjectImp, KJS::DateObjectImp, KJS::ErrorObjectImp, KJS::NativeErrorImp, KJS::FunctionObjectImp, KJS::DeclaredFunctionImp, KJS::NumberObjectImp, KJS::ObjectObjectImp, KJS::RegExpObjectImp, and KJS::StringObjectImp. Definition at line 370 of file object.cpp. |
|
Implementation of the [[DefaultValue]] internal property (implemented by all Objects).
Definition at line 297 of file object.cpp. |
|
Remove all properties from this object. This doesn't take DontDelete into account, and isn't in the ECMA spec. It's simply a quick way to remove everything before destroying. Definition at line 291 of file object.cpp. |
|
Implementation of the [[Delete]] internal property (implemented by all Objects).
Reimplemented in KJS::ArrayInstanceImp, KJS::FunctionImp, KJS::ActivationImp, and KJS::StringInstanceImp. Definition at line 268 of file object.cpp. |
|
Implementation of the [[Get]] internal property (implemented by all Objects).
Reimplemented in KJS::ArrayInstanceImp, KJS::ArrayPrototypeImp, KJS::DatePrototypeImp, KJS::FunctionImp, KJS::ArgumentsImp, KJS::ActivationImp, KJS::MathObjectImp, KJS::NumberObjectImp, KJS::RegExpObjectImp, KJS::StringInstanceImp, and KJS::StringPrototypeImp. Definition at line 163 of file object.cpp. |
|
Implementation of the [[HasInstance]] internal property.
Reimplemented in KJS::InternalFunctionImp. Definition at line 392 of file object.cpp. |
|
Implementation of the [[HasProperty]] internal property (implemented by all Objects).
Reimplemented in KJS::ArrayInstanceImp, KJS::FunctionImp, KJS::ActivationImp, and KJS::StringInstanceImp. Definition at line 244 of file object.cpp. |
|
Checks whether this object inherits from the class with the specified classInfo() pointer. This requires that both this class and the other class return a non-NULL pointer for their classInfo() methods (otherwise it will return false). For example, for two ObjectImp pointers obj1 and obj2, you can check if obj1's class inherits from obj2's class using the following: if (obj1->inherits(obj2->classInfo())) { // ... } If you have a handle to a statically declared ClassInfo, such as in the classInfo() example, you can check for inheritance without needing an instance of the other class: if (obj1->inherits(FooImp::info)) { // ... }
Definition at line 125 of file object.cpp. |
|
######### check for duplicates with the propertymap Reimplemented in KJS::ArrayInstanceImp, and KJS::StringInstanceImp. Definition at line 398 of file object.cpp. |
|
Implementation of the [[Prototype]] internal property (implemented by all Objects).
Definition at line 145 of file object.cpp. |
|
Implementation of the [[Put]] internal property (implemented by all Objects).
Reimplemented in KJS::ArrayInstanceImp, KJS::FunctionImp, KJS::ArgumentsImp, and KJS::StringInstanceImp. Definition at line 192 of file object.cpp. |
|
Implementation of the [[Scope]] internal property.
|
|
Sets the name of the function, if this is an InternalFunctionImp object. (calling InternalFunctionImp::setName) Definition at line 481 of file object.cpp. |
The documentation for this class was generated from the following files: