QScriptContext Class Reference |
Constant | Value | Description |
---|---|---|
QScriptContext::ReferenceError | 1 | A reference error. |
QScriptContext::SyntaxError | 2 | A syntax error. |
QScriptContext::TypeError | 3 | A type error. |
QScriptContext::RangeError | 4 | A range error. |
QScriptContext::URIError | 5 | A URI error. |
QScriptContext::UnknownError | 0 | An unknown error. |
This enum specifies the execution state of the context.
Constant | Value | Description |
---|---|---|
QScriptContext::NormalState | 0 | The context is in a normal state. |
QScriptContext::ExceptionState | 1 | The context is in an exceptional state. |
Destroys this QScriptContext.
Returns the activation object of this QScriptContext. The activation object provides access to the local variables associated with this context.
See also setActivationObject(), argument(), and argumentsObject().
Returns the function argument at the given index.
If index >= argumentCount(), a QScriptValue of the primitive type Undefined is returned.
See also argumentCount().
Returns the number of arguments passed to the function in this invocation.
Note that the argument count can be different from the formal number of arguments (the length property of callee()).
See also argument().
Returns the arguments object of this QScriptContext.
The arguments object has properties callee (equal to callee()) and length (equal to argumentCount()), and properties 0, 1, ..., argumentCount() - 1 that provide access to the argument values. Initially, property P (0 <= P < argumentCount()) has the same value as argument(P). In the case when P is less than the number of formal parameters of the function, P shares its value with the corresponding property of the activation object (activationObject()). This means that changing this property changes the corresponding property of the activation object and vice versa.
See also argument() and activationObject().
Returns a human-readable backtrace of this QScriptContext.
Each line is of the form <function-name>(<arguments>)@<file-name>:<line-number>.
To access individual pieces of debugging-related information (for example, to construct your own backtrace representation), use QScriptContextInfo.
See also QScriptEngine::uncaughtExceptionBacktrace(), QScriptContextInfo, and toString().
Returns the callee. The callee is the function object that this QScriptContext represents an invocation of.
Returns the QScriptEngine that this QScriptContext belongs to.
Returns true if the function was called as a constructor (e.g. "new foo()"); otherwise returns false.
When a function is called as constructor, the thisObject() contains the newly constructed object to be initialized.
Returns the parent context of this QScriptContext.
Sets the activation object of this QScriptContext to be the given activation.
See also activationObject().
Sets the `this' object associated with this QScriptContext to be thisObject.
See also thisObject().
Returns the execution state of this QScriptContext.
Returns the `this' object associated with this QScriptContext.
See also setThisObject().
Throws an error with the given text. Returns the created error object.
The text will be stored in the message property of the error object.
The error object will be initialized to contain information about the location where the error occurred; specifically, it will have properties lineNumber, fileName and stack. These properties are described in QtScript Extensions to ECMAScript.
See also throwValue() and state().
This is an overloaded member function, provided for convenience.
Throws an error with the given text. Returns the created error object.
See also throwValue() and state().
Throws an exception with the given value. Returns the value thrown (the same as the argument).
See also throwError() and state().
Returns a string representation of this context. This is useful for debugging.
This function was introduced in Qt 4.4.
See also backtrace().
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt 4.4 | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com