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

Public Member Functions | |
Object () | |
Object (ObjectImp *v) | |
ObjectImp * | imp () const |
const ClassInfo * | classInfo () const |
bool | inherits (const ClassInfo *cinfo) const |
Value | prototype () const |
UString | className () const |
Value | get (ExecState *exec, const Identifier &propertyName) const |
Value | get (ExecState *exec, unsigned propertyName) const |
void | put (ExecState *exec, const Identifier &propertyName, const Value &value, int attr=None) |
void | put (ExecState *exec, unsigned propertyName, const Value &value, int attr=None) |
bool | canPut (ExecState *exec, const Identifier &propertyName) const |
bool | hasProperty (ExecState *exec, const Identifier &propertyName) const |
bool | hasProperty (ExecState *exec, unsigned propertyName) const |
bool | deleteProperty (ExecState *exec, const Identifier &propertyName) |
bool | deleteProperty (ExecState *exec, unsigned propertyName) |
Value | defaultValue (ExecState *exec, Type hint) const |
bool | implementsConstruct () const |
Object | construct (ExecState *exec, const List &args) |
bool | implementsCall () const |
Value | call (ExecState *exec, Object &thisObj, const List &args) |
bool | implementsHasInstance () const |
Boolean | hasInstance (ExecState *exec, const Value &value) |
const ScopeChain & | scope () const |
void | setScope (const ScopeChain &s) |
ReferenceList | propList (ExecState *exec, bool recursive=true) |
Value | internalValue () const |
void | setInternalValue (const Value &v) |
Static Public Member Functions | |
static Object | dynamicCast (const Value &v) |
Detailed Description
Represents an Object.This is a wrapper for ObjectImp
Definition at line 81 of file object.h.
Member Function Documentation
|
|
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 656 of file object.h. References imp(), and KJS::Value::Value(). Referenced by KJS::ObjectProtoFuncImp::call(), and KJS::InternalFunctionImp::hasInstance(). |
|
Returns the class name of the object. See ECMA 8.6.2
Definition at line 659 of file object.h. References KJS::ObjectImp::className(), and imp(). Referenced by KJS::ObjectProtoFuncImp::call(), and KJS::printInfo(). |
|
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 662 of file object.h. References KJS::ObjectImp::get(), and imp(). Referenced by KJS::StringProtoFuncImp::call(), KJS::RegExpProtoFuncImp::call(), KJS::FunctionProtoFuncImp::call(), KJS::ErrorProtoFuncImp::call(), KJS::ArrayProtoFuncImp::call(), KJS::ArrayNode::evaluate(), KJS::ObjectImp::get(), and KJS::printInfo(). |
|
Sets the specified property. See ECMA 8.6.2.2
Definition at line 668 of file object.h. References imp(), and KJS::ObjectImp::put(). Referenced by KJS::RegExpObjectImp::arrayOfMatches(), KJS::StringProtoFuncImp::call(), KJS::RegExpProtoFuncImp::call(), KJS::GlobalFuncImp::call(), KJS::ArrayProtoFuncImp::call(), KJS::FunctionObjectImp::construct(), KJS::Error::create(), KJS::VarDeclNode::evaluate(), KJS::PropertyValueNode::evaluate(), KJS::ArrayNode::evaluate(), KJS::ElementNode::evaluate(), KJS::InterpreterImp::evaluate(), KJS::CatchNode::execute(), KJS::InterpreterImp::initGlobalObject(), KJS::FuncDeclNode::processFuncDecl(), and KJS::VarDeclNode::processVarDecls(). |
|
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 674 of file object.h. References KJS::ObjectImp::canPut(), and imp(). |
|
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 677 of file object.h. References KJS::ObjectImp::hasProperty(), and imp(). Referenced by KJS::ObjectProtoFuncImp::call(), KJS::ArrayProtoFuncImp::call(), KJS::VarDeclNode::evaluate(), KJS::RelationalNode::evaluate(), KJS::ForInNode::execute(), KJS::ObjectImp::hasProperty(), and KJS::VarDeclNode::processVarDecls(). |
|
Removes the specified property from the object. See ECMA 8.6.2.5
Definition at line 683 of file object.h. References KJS::ObjectImp::deleteProperty(), and imp(). Referenced by KJS::ArrayProtoFuncImp::call(). |
|
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 689 of file object.h. References KJS::ObjectImp::defaultValue(), and imp(). |
|
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 692 of file object.h. References imp(), and KJS::ObjectImp::implementsConstruct(). Referenced by KJS::NewExprNode::evaluate(). |
|
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 695 of file object.h. References KJS::ObjectImp::construct(), and imp(). Referenced by KJS::RegExpObjectImp::arrayOfMatches(), KJS::StringProtoFuncImp::call(), KJS::FunctionObjectImp::construct(), KJS::Error::create(), KJS::FuncExprNode::evaluate(), KJS::NewExprNode::evaluate(), KJS::PropertyValueNode::evaluate(), KJS::ArrayNode::evaluate(), KJS::ElementNode::evaluate(), KJS::RegExpNode::evaluate(), KJS::FuncDeclNode::processFuncDecl(), KJS::NumberImp::toObject(), KJS::StringImp::toObject(), and KJS::BooleanImp::toObject(). |
|
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 698 of file object.h. References imp(), and KJS::ObjectImp::implementsCall(). Referenced by KJS::StringProtoFuncImp::call(), KJS::FunctionProtoFuncImp::call(), KJS::ArrayProtoFuncImp::call(), KJS::ObjectImp::defaultValue(), and KJS::FunctionCallNode::evaluate(). |
|
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 54 of file object.cpp. References call(), KJS::Error::create(), KJS::Value::rep, and KJS::ExecState::setException(). Referenced by KJS::StringProtoFuncImp::call(), call(), KJS::FunctionProtoFuncImp::call(), KJS::ArrayProtoFuncImp::call(), KJS::ObjectImp::defaultValue(), and KJS::FunctionCallNode::evaluate(). |
|
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 701 of file object.h. References imp(), and KJS::ObjectImp::implementsHasInstance(). Referenced by KJS::RelationalNode::evaluate(). |
|
Checks whether value delegates behavior to this object. Used by the instanceof operator.
Definition at line 704 of file object.h. References KJS::ObjectImp::hasInstance(), and imp(). Referenced by KJS::RelationalNode::evaluate(). |
|
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 707 of file object.h. References imp(), and KJS::ObjectImp::scope(). |
|
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 713 of file object.h. References imp(), and KJS::ObjectImp::propList(). Referenced by KJS::ForInNode::execute(). |
|
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 716 of file object.h. References imp(), and KJS::ObjectImp::internalValue(). Referenced by KJS::StringProtoFuncImp::call(), KJS::NumberProtoFuncImp::call(), KJS::DateProtoFuncImp::call(), and KJS::BooleanProtoFuncImp::call(). |
|
Sets the internal value of the object.
Definition at line 719 of file object.h. References imp(), and KJS::ObjectImp::setInternalValue(). Referenced by KJS::DateProtoFuncImp::call(), KJS::NumberObjectImp::construct(), KJS::DateObjectImp::construct(), and KJS::BooleanObjectImp::construct(). |
The documentation for this class was generated from the following files: