• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KJS

KJS::DeclaredFunctionImp

KJS::DeclaredFunctionImp Class Reference

#include <scriptfunction.h>

Inheritance diagram for KJS::DeclaredFunctionImp:

Inheritance graph
[legend]

List of all members.


Detailed Description

Definition at line 101 of file scriptfunction.h.


Public Member Functions

 DeclaredFunctionImp (ExecState *exec, const Identifier &n, FunctionBodyNode *b, const ScopeChain &sc)
bool implementsConstruct () const
JSObject * construct (ExecState *exec, const List &args)
virtual Completion execute (ExecState *exec)
UString toSource () const
virtual const ClassInfo * classInfo () const

Static Public Attributes

static const ClassInfo info = {"Function", &FunctionImp::info, 0, 0}

Constructor & Destructor Documentation

KJS::DeclaredFunctionImp::DeclaredFunctionImp ( ExecState *  exec,
const Identifier &  n,
FunctionBodyNode *  b,
const ScopeChain &  sc 
)

Definition at line 339 of file function.cpp.


Member Function Documentation

bool KJS::DeclaredFunctionImp::implementsConstruct (  )  const [virtual]

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).

Returns:
true if this object implements the construct() method, otherwise false

Reimplemented from KJS::JSObject.

Definition at line 346 of file function.cpp.

JSObject * KJS::DeclaredFunctionImp::construct ( ExecState *  exec,
const List &  args 
) [virtual]

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.

Parameters:
exec The current execution state
args The arguments to be passed to call() once the new object has been created
Returns:
The newly created & initialized object Implementation of the [[Construct]] internal property

Reimplemented from KJS::JSObject.

Definition at line 352 of file function.cpp.

Completion KJS::DeclaredFunctionImp::execute ( ExecState *  exec  )  [virtual]

Implements KJS::FunctionImp.

Definition at line 371 of file function.cpp.

UString DeclaredFunctionImp::toSource (  )  const

Definition at line 233 of file nodes2string.cpp.

virtual const ClassInfo* KJS::DeclaredFunctionImp::classInfo (  )  const [inline, virtual]

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 JSObject {
     virtual const ClassInfo *classInfo() const { return &info; }
     static const ClassInfo info;
     // ...
   };

   class FooImp : public JSObject {
     virtual const ClassInfo *classInfo() const { return &info; }
     static const ClassInfo info;
     // ...
   };

And in your source file:

   const ClassInfo BarImp::info = {"Bar", 0, 0, 0}; // no parent class
   const ClassInfo FooImp::info = {"Foo", &BarImp::info, 0, 0};

See also:
inherits()

Reimplemented from KJS::FunctionImp.

Definition at line 112 of file scriptfunction.h.


Member Data Documentation

const ClassInfo KJS::DeclaredFunctionImp::info = {"Function", &FunctionImp::info, 0, 0} [static]

Reimplemented from KJS::FunctionImp.

Definition at line 113 of file scriptfunction.h.


The documentation for this class was generated from the following files:
  • scriptfunction.h
  • function.cpp
  • nodes2string.cpp

KJS

Skip menu "KJS"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   WTF
  • KJSEmbed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  •   core
  • Phonon
  •   Backend
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal