KJS::Object Class Reference
Represents an Object. More...
#include <object.h>
Inheritance diagram for KJS::Object:


Public Member Functions | |
Object (ObjectImp *v) | |
Object (const Object &v) | |
Object & | operator= (const Object &v) |
virtual const ClassInfo * | classInfo () const |
bool | inherits (const ClassInfo *cinfo) const |
Value | prototype () const |
Returns the prototype of this object. | |
UString | className () const |
Returns the class name of the object. | |
Value | get (ExecState *exec, const UString &propertyName) const |
Retrieves the specified property from the object. | |
void | put (ExecState *exec, const UString &propertyName, const Value &value, int attr=None) |
Sets the specified property. | |
bool | canPut (ExecState *exec, const UString &propertyName) const |
Used to check whether or not a particular property is allowed to be set on an object. | |
bool | hasProperty (ExecState *exec, const UString &propertyName) const |
Checks to see whether the object (or any object in it's prototype chain) has a property with the specified name. | |
bool | deleteProperty (ExecState *exec, const UString &propertyName) |
Removes the specified property from the object. | |
Value | defaultValue (ExecState *exec, Type hint) const |
Converts the object into a primitive value. | |
bool | implementsConstruct () const |
Whether or not the object implements the construct() method. | |
Object | construct (ExecState *exec, const List &args) |
Creates a new object based on this object. | |
bool | implementsCall () const |
Whether or not the object implements the call() method. | |
Value | call (ExecState *exec, Object &thisObj, const List &args) |
Calls this object as if it is a function. | |
bool | implementsHasInstance () const |
Whether or not the object implements the hasInstance() method. | |
Boolean | hasInstance (ExecState *exec, const Value &value) |
Checks whether value delegates behaviour to this object. | |
const List | scope () const |
Returns the scope of this object. | |
void | setScope (const List &s) |
List | propList (ExecState *exec, bool recursive=true) |
Returns a List of References to all the properties of the object. | |
Value | internalValue () const |
Returns the internal value of the object. | |
void | setInternalValue (const Value &v) |
Sets the internal value of the object. | |
Static Public Member Functions | |
Object | dynamicCast (const Value &v) |
Converts a Value into an Object. |
Detailed Description
Represents an Object.This is a wrapper for ObjectImp
Definition at line 76 of file object.h.
Member Function Documentation
|
Converts a Value into an Object. If the value's type is not ObjectType, a null object will be returned (i.e. one with it's internal pointer set to 0). If you do not know for sure whether the value is of type ObjectType, you should check the isNull() methods afterwards before calling any methods on the Object.
Definition at line 77 of file object.cpp. References KJS::Value::imp(), KJS::Value::isNull(), and KJS::Value::type(). |
|
Returns the prototype of this object. Note that this is not the same as the "prototype" property. See ECMA 8.6.2
Definition at line 85 of file object.cpp. |
|
Returns the class name of the object. See ECMA 8.6.2
Definition at line 90 of file object.cpp. |
|
Retrieves the specified property from the object. If neither the object or any other object in it's prototype chain have the property, this function will return Undefined. See ECMA 8.6.2.1
Definition at line 95 of file object.cpp. |
|
Sets the specified property. See ECMA 8.6.2.2
Definition at line 100 of file object.cpp. Referenced by KJS::Error::create(). |
|
Used to check whether or not a particular property is allowed to be set on an object. See ECMA 8.6.2.3
Definition at line 105 of file object.cpp. |
|
Checks to see whether the object (or any object in it's prototype chain) has a property with the specified name. See ECMA 8.6.2.4
Definition at line 110 of file object.cpp. |
|
Removes the specified property from the object. See ECMA 8.6.2.5
Definition at line 115 of file object.cpp. |
|
Converts the object into a primitive value. The value return may differ depending on the supplied hint See ECMA 8.6.2.6
Definition at line 120 of file object.cpp. |
|
Whether or not the object implements the construct() method. If this returns false you should not call the construct() method on this object (typically, an assertion will fail to indicate this).
Definition at line 125 of file object.cpp. |
|
Creates a new object based on this object. Typically this means the following: 1. A new object is created 2. The prototype of the new object is set to the value of this object's "prototype" property 3. The call() method of this object is called, with the new object passed as the this value 4. The new object is returned In some cases, Host objects may differ from these semantics, although this is discouraged. If an error occurs during construction, the execution state's exception will be set. This can be tested for with ExecState::hadException(). Under some circumstances, the exception object may also be returned. Note: This function should not be called if implementsConstruct() returns false, in which case it will result in an assertion failure.
Definition at line 130 of file object.cpp. Referenced by KJS::Error::create(). |
|
Whether or not the object implements the call() method. If this returns false you should not call the call() method on this object (typically, an assertion will fail to indicate this).
Definition at line 135 of file object.cpp. |
|
Calls this object as if it is a function. Note: This function should not be called if implementsCall() returns false, in which case it will result in an assertion failure. See ECMA 8.6.2.3
Definition at line 140 of file object.cpp. References KJS::ExecState::setException(). |
|
Whether or not the object implements the hasInstance() method. If this returns false you should not call the hasInstance() method on this object (typically, an assertion will fail to indicate this).
Definition at line 164 of file object.cpp. |
|
Checks whether value delegates behaviour to this object. Used by the instanceof operator.
Definition at line 169 of file object.cpp. |
|
Returns the scope of this object. This is used when execution declared functions - the execution context for the function is initialized with extra object in it's scope. An example of this is functions declared inside other functions: function f() { function b() { return prototype; } var x = 4; // do some stuff } f.prototype = new String(); When the function f.b is executed, its scope will include properties of f. So in the example above the return value of f.b() would be the new String object that was assigned to f.prototype.
Definition at line 174 of file object.cpp. |
|
Returns a List of References to all the properties of the object. Used in "for x in y" statements. The list is created new, so it can be freely modified without affecting the object's properties. It should be deleted by the caller. Subclasses can override this method in ObjectImpl to provide the appearance of having extra properties other than those set specifically with put().
Definition at line 184 of file object.cpp. |
|
Returns the internal value of the object. This is used for objects such as String and Boolean which are wrappers for native types. The interal value is the actual value represented by the wrapper objects.
Definition at line 189 of file object.cpp. |
|
Sets the internal value of the object.
Definition at line 194 of file object.cpp. |
The documentation for this class was generated from the following files: