namespace KJS

# namespace KJS | Array of error names corresponding to ErrorType More...
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Types

- class Value
- class ValueImp
- class Undefined
- class Null
- class Boolean
- class String
- class Number
- class Object
- class ObjectImp
- class Reference
- class List
- class Completion
- class ExecState
- enum Type { UnspecifiedType = 0, UndefinedType = 1, NullType = 2, BooleanType = 3, StringType = 4, NumberType = 5, ObjectType = 6, ReferenceType = 7, ListType = 8, CompletionType = 9 }
- class ListIterator
- enum ComplType { Normal, Break, Continue, ReturnValue, Throw }
- enum Attribute { None = 0, ReadOnly = 1 << 1, DontEnum = 1 << 2, DontDelete = 1 << 3, Internal = 1 << 4, Function = 1 << 5 }
- struct ClassInfo
- enum ErrorType { GeneralError = 0, EvalError = 1, RangeError = 2, ReferenceError = 3, SyntaxError = 4, TypeError = 5, URIError = 6}
- class Error
- class Context
- class Interpreter
- class UCharReference
- class UString
- struct UChar
- class CString

#### Public Methods

- bool operator== (const Value &v1, const Value &v2)
- bool operator!= (const Value &v1, const Value &v2)
- bool isNaN (double d)
- bool isInf (double d)
- bool isPosInf (double d)
- bool isNegInf (double d)
- bool equal (ExecState *exec, const Value& v1, const Value& v2)
- bool strictEqual (ExecState *exec, const Value &v1, const Value &v2)
- int relation (ExecState *exec, const Value& v1, const Value& v2)
- int maxInt (int d1, int d2)
- int minInt (int d1, int d2)
- Value add (ExecState *exec, const Value &v1, const Value &v2, char oper)
- Value mult (ExecState *exec, const Value &v1, const Value &v2, char oper)
- inline bool operator== (const UChar &c1, const UChar &c2)
- bool operator== (const UString& s1, const UString& s2)
- inline bool operator!= (const UString& s1, const UString& s2)
- bool operator< (const UString& s1, const UString& s2)
- bool operator== (const UString& s1, const char *s2)
- inline bool operator!= (const UString& s1, const char *s2)
- inline bool operator== (const char *s1, const UString& s2)
- inline bool operator!= (const char *s1, const UString& s2)
- bool operator== (const CString& s1, const CString& s2)
- UString operator+ (const UString& s1, const UString& s2)

#### Public Members

- Forward ValueImpPrivate
- Forward UndefinedImp
- Forward NullImp
- Forward BooleanImp
- Forward StringImp
- Forward NumberImp
- Forward ReferenceImp
- Forward ListImp
- Forward CompletionImp
- extern const double NaN
- extern const double Inf
- Forward ListNode
- Forward ObjectImpPrivate
- Forward PropertyMap
- Forward HashTable
- Forward HashEntry
- Forward ContextImp
- Forward ExecStateImp
- Forward InterpreterImp

## Detailed Description

Array of error names corresponding to ErrorType

Value (class) | ### Value

Value objects are act as wrappers ("smart pointers") around ValueImp objects and their descendents. Instead of using ValueImps (and derivatives) during normal program execution, you should use a Value-derived class.

Value maintains a pointer to a ValueImp object and uses a reference counting scheme to ensure that the ValueImp object is not deleted or garbage collected.

Note: The conversion operations all return values of various types - if an error occurs during conversion, an error object will instead be returned (where possible), and the execution state's exception will be set appropriately.

ValueImp (class) | ### ValueImp

ValueImp is the base type for all primitives (Undefined, Null, Boolean, String, Number) and objects in ECMAScript.

Note: you should never inherit from ValueImp as it is for primitive types only (all of which are provided internally by KJS). Instead, inherit from ObjectImp.

Undefined (class) | ### Undefined

Represents an primitive Undefined value. All instances of this class share the same implementation object, so == will always return true for any comparison between two Undefined objects.

Null (class) | ### Null

Represents an primitive Null value. All instances of this class share the same implementation object, so == will always return true for any comparison between two Null objects.

Boolean (class) | ### Boolean

Represents an primitive Null value

String (class) | ### String

Represents an primitive Null value

Number (class) | ### Number

Represents an primitive Number value

Object (class) | ### Object

Represents an Object. This is a wrapper for ObjectImp

ObjectImp (class) | ### ObjectImp

Reference (class) | ### Reference

List (class) | ### List

List is a native ECMAScript type. List values are only used for intermediate results of expression evaluation and cannot be stored as properties of objects.

The list is explicitly shared. Note that while copy() returns a deep copy of the list the referenced objects are still shared.

Completion (class) | ### Completion

Completion objects are used to convey the return status and value from functions.

See FunctionImp::execute()

See also: FunctionImp

ExecState (class) | ### ExecState

Represents the current state of script execution. This object allows you obtain a handle the interpreter that is currently executing the script, and also the current execution state context.

enum Type { UnspecifiedType = 0, UndefinedType = 1, NullType = 2, BooleanType = 3, StringType = 4, NumberType = 5, ObjectType = 6, ReferenceType = 7, ListType = 8, CompletionType = 9 } | ### Type

Primitive types

bool operator== (const Value &v1, const Value &v2) | ### operator==

bool operator!= (const Value &v1, const Value &v2) | ### operator!=

extern const double NaN | ### NaN

extern const double Inf | ### Inf

ListIterator (class) | ### ListIterator

enum ComplType { Normal, Break, Continue, ReturnValue, Throw } | ### ComplType

Completion types.

enum Attribute { None = 0, ReadOnly = 1 << 1, DontEnum = 1 << 2, DontDelete = 1 << 3, Internal = 1 << 4, Function = 1 << 5 } | ### Attribute

ClassInfo (struct) | ### ClassInfo

Class Information

enum ErrorType { GeneralError = 0, EvalError = 1, RangeError = 2, ReferenceError = 3, SyntaxError = 4, TypeError = 5, URIError = 6} | ### ErrorType

Types of Native Errors available. For custom errors, GeneralError should be used.

Error (class) | ### Error

Context (class) | ### Context

Represents an execution context, as specified by section 10 of the ECMA spec.

An execution context contains information about the current state of the script - the scope for variable lookup, the value of "this", etc. A new execution context is entered whenever global code is executed (e.g. with Interpreter::evaluate()), a function is called (see Object::call()), or the builtin "eval" function is executed.

Most inheritable functions in the KJS api take a ExecState pointer as their first parameter. This can be used to obtain a handle to the current execution context.

Note: Context objects are wrapper classes/smart pointers for the internal KJS ContextImp type. When one context variable is assigned to another, it is still referencing the same internal object.

Interpreter (class) | ### Interpreter

Interpreter objects can be used to evaluate ECMAScript code. Each interpreter has a global object which is used for the purposes of code evaluation, and also provides access to built-in properties such as " Object" and "Number".

bool isNaN (double d) | ### isNaN

Returns: True if d is not a number (platform support required).

bool isInf (double d) | ### isInf

Returns: True if d is infinite (platform support required).

bool isPosInf (double d) | ### isPosInf

bool isNegInf (double d) | ### isNegInf

bool equal (ExecState *exec, const Value& v1, const Value& v2) | ### equal

bool strictEqual (ExecState *exec, const Value &v1, const Value &v2) | ### strictEqual

int relation (ExecState *exec, const Value& v1, const Value& v2) | ### relation

This operator performs an abstract relational comparision of the two arguments that can be of arbitrary type. If possible, conversions to the string or number type will take place before the comparison.

Returns: 1 if v1 is "less-than" v2, 0 if the relation is "greater-than-or- equal". -1 if the result is undefined.

int maxInt (int d1, int d2) | ### maxInt

int minInt (int d1, int d2) | ### minInt

Value add (ExecState *exec, const Value &v1, const Value &v2, char oper) | ### add

Additive operator. Either performs an addition or substraction of v1 and v2.

Parameters:

oper | '+' or '-' for an addition or substraction, respectively.

Returns: The result of the operation.

Value mult (ExecState *exec, const Value &v1, const Value &v2, char oper) | ### mult

Multiplicative operator. Either multiplies/divides v1 and v2 or calculates the remainder from an division.

Parameters:

oper | '*', '/' or '%' for a multiplication, division or modulo operation.

Returns: The result of the operation.

UCharReference (class) | ### UCharReference

UCharReference is the dynamic counterpart of UChar. It's used when characters retrieved via index from a UString are used in an assignment expression (and therefore can't be treated as being const):

     UString s("hello world");
     s[0] = 'H';

If that sounds confusing your best bet is to simply forget about the existance of this class and treat is as being identical to UChar.

UString (class) | ### UString

UChar (struct) | ### UChar

UChar represents a 16 bit Unicode character. It's internal data representation is compatible to XChar2b and QChar. It's therefore possible to exchange data with X and Qt with shallow copies.

CString (class) | ### CString

inline bool operator== (const UChar &c1, const UChar &c2) | ### operator==

bool operator== (const UString& s1, const UString& s2) | ### operator==

inline bool operator!= (const UString& s1, const UString& s2) | ### operator!=

bool operator< (const UString& s1, const UString& s2) | ### operator<

bool operator== (const UString& s1, const char *s2) | ### operator==

inline bool operator!= (const UString& s1, const char *s2) | ### operator!=

inline bool operator== (const char *s1, const UString& s2) | ### operator==

inline bool operator!= (const char *s1, const UString& s2) | ### operator!=

bool operator== (const CString& s1, const CString& s2) | ### operator==

UString operator+ (const UString& s1, const UString& s2) | ### operator+

Generated by: root on macppc.ports.openbsd.org on Sat Sep 6 10:37:28 2003, using kdoc 2.0a54.