summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2009-11-10 06:39:00 (GMT)
committerBea Lam <bea.lam@nokia.com>2009-11-10 06:39:00 (GMT)
commit432d54d092414431e1e54daa2259384d83600bf2 (patch)
tree0ec7c9080b5dcdae1f411457f8b057145ef94366 /src/declarative/qml
parentc411c39557d31b94efb5813be9e9ef43c05a9093 (diff)
parent4459e18afd3e537c2155dadad0937e0a5cdd76c5 (diff)
downloadQt-432d54d092414431e1e54daa2259384d83600bf2.zip
Qt-432d54d092414431e1e54daa2259384d83600bf2.tar.gz
Qt-432d54d092414431e1e54daa2259384d83600bf2.tar.bz2
Merge branch 'kinetic-declarativeui' of scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/qml')
-rw-r--r--src/declarative/qml/qmlcontext.cpp3
-rw-r--r--src/declarative/qml/qmlexpression.cpp12
-rw-r--r--src/declarative/qml/qmlrewrite.cpp8
-rw-r--r--src/declarative/qml/qmlrewrite_p.h2
-rw-r--r--src/declarative/qml/qmlxmlhttprequest.cpp173
5 files changed, 154 insertions, 44 deletions
diff --git a/src/declarative/qml/qmlcontext.cpp b/src/declarative/qml/qmlcontext.cpp
index f8e685a..105c673 100644
--- a/src/declarative/qml/qmlcontext.cpp
+++ b/src/declarative/qml/qmlcontext.cpp
@@ -48,6 +48,7 @@
#include <QtCore/qvarlengtharray.h>
#include <QtCore/qdebug.h>
#include <private/qmlbindingoptimizations_p.h>
+#include <private/qscriptdeclarativeclass_p.h>
#include <QtDeclarative/qmlinfo.h>
QT_BEGIN_NAMESPACE
@@ -69,7 +70,7 @@ void QmlContextPrivate::addScript(const QString &script, QObject *scopeObject,
QmlEnginePrivate *enginePriv = QmlEnginePrivate::get(engine);
QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine);
- QScriptContext *scriptContext = scriptEngine->pushCleanContext();
+ QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(scriptEngine);
scriptContext->pushScope(enginePriv->contextClass->newContext(q, scopeObject));
QScriptValue scope = scriptEngine->newObject();
diff --git a/src/declarative/qml/qmlexpression.cpp b/src/declarative/qml/qmlexpression.cpp
index faf9f5a..d2d60ee 100644
--- a/src/declarative/qml/qmlexpression.cpp
+++ b/src/declarative/qml/qmlexpression.cpp
@@ -47,6 +47,7 @@
#include "QtCore/qdebug.h"
#include "qmlcompiler_p.h"
#include <QtScript/qscriptprogram.h>
+#include <private/qscriptdeclarativeclass_p.h>
Q_DECLARE_METATYPE(QList<QObject *>);
@@ -117,7 +118,7 @@ void QmlExpressionPrivate::init(QmlContext *ctxt, void *expr, QmlRefCount *rc,
}
#endif
- QScriptContext *scriptContext = scriptEngine->pushCleanContext();
+ QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(scriptEngine);
scriptContext->pushScope(ep->contextClass->newContext(ctxt, me));
#if !defined(Q_OS_SYMBIAN)
@@ -305,7 +306,7 @@ QVariant QmlExpressionPrivate::evalQtScript(QObject *secondaryScope, bool *isUnd
if (!data->expressionFunctionValid) {
- QScriptContext *scriptContext = scriptEngine->pushCleanContext();
+ QScriptContext *scriptContext = QScriptDeclarativeClass::pushCleanContext(scriptEngine);
scriptContext->pushScope(ep->contextClass->newContext(data->context(), data->me));
if (data->expressionRewritten) {
@@ -314,7 +315,12 @@ QVariant QmlExpressionPrivate::evalQtScript(QObject *secondaryScope, bool *isUnd
} else {
QmlRewrite::RewriteBinding rewriteBinding;
- const QString code = rewriteBinding(data->expression);
+ bool ok = true;
+ const QString code = rewriteBinding(data->expression, &ok);
+ if (!ok) {
+ scriptEngine->popContext();
+ return QVariant();
+ }
data->expressionFunction = scriptEngine->evaluate(code, data->url.toString(), data->line);
}
diff --git a/src/declarative/qml/qmlrewrite.cpp b/src/declarative/qml/qmlrewrite.cpp
index b86f2f2..32e2fef 100644
--- a/src/declarative/qml/qmlrewrite.cpp
+++ b/src/declarative/qml/qmlrewrite.cpp
@@ -49,7 +49,7 @@ DEFINE_BOOL_CONFIG_OPTION(rewriteDump, QML_REWRITE_DUMP);
namespace QmlRewrite {
-QString RewriteBinding::operator()(const QString &code)
+QString RewriteBinding::operator()(const QString &code, bool *ok)
{
Engine engine;
NodePool pool(QString(), &engine);
@@ -57,6 +57,12 @@ QString RewriteBinding::operator()(const QString &code)
Parser parser(&engine);
lexer.setCode(code, 0);
parser.parseStatement();
+ if (!parser.statement()) {
+ if (ok) *ok = false;
+ return QString();
+ } else {
+ if (ok) *ok = true;
+ }
return rewrite(code, 0, parser.statement());
}
diff --git a/src/declarative/qml/qmlrewrite_p.h b/src/declarative/qml/qmlrewrite_p.h
index 914f997..a5cb841 100644
--- a/src/declarative/qml/qmlrewrite_p.h
+++ b/src/declarative/qml/qmlrewrite_p.h
@@ -69,7 +69,7 @@ class RewriteBinding: protected AST::Visitor
TextWriter *_writer;
public:
- QString operator()(const QString &code);
+ QString operator()(const QString &code, bool *ok = 0);
protected:
using AST::Visitor::visit;
diff --git a/src/declarative/qml/qmlxmlhttprequest.cpp b/src/declarative/qml/qmlxmlhttprequest.cpp
index 0c0cd9c..6946e7a 100644
--- a/src/declarative/qml/qmlxmlhttprequest.cpp
+++ b/src/declarative/qml/qmlxmlhttprequest.cpp
@@ -54,8 +54,37 @@
#include <QtCore/qdebug.h>
-// ### Find real values
-#define INVALID_STATE_ERR ((QScriptContext::Error)15)
+// From DOM-Level-3-Core spec
+// http://www.w3.org/TR/DOM-Level-3-Core/core.html
+#define INDEX_SIZE_ERR 1
+#define DOMSTRING_SIZE_ERR 2
+#define HIERARCHY_REQUEST_ERR 3
+#define WRONG_DOCUMENT_ERR 4
+#define INVALID_CHARACTER_ERR 5
+#define NO_DATA_ALLOWED_ERR 6
+#define NO_MODIFICATION_ALLOWED_ERR 7
+#define NOT_FOUND_ERR 8
+#define NOT_SUPPORTED_ERR 9
+#define INUSE_ATTRIBUTE_ERR 10
+#define INVALID_STATE_ERR 11
+#define SYNTAX_ERR 12
+#define INVALID_MODIFICATION_ERR 13
+#define NAMESPACE_ERR 14
+#define INVALID_ACCESS_ERR 15
+#define VALIDATION_ERR 16
+#define TYPE_MISMATCH_ERR 17
+
+#define THROW_DOM(error, desc) \
+{ \
+ QScriptValue errorValue = context->throwError(QLatin1String(desc)); \
+ errorValue.setProperty(QLatin1String("code"), error); \
+ return errorValue; \
+}
+
+#define THROW_SYNTAX(desc) \
+ return context->throwError(QScriptContext::SyntaxError, QLatin1String(desc));
+#define THROW_REFERENCE(desc) \
+ return context->throwError(QScriptContext::ReferenceError, QLatin1String(desc));
#define D(arg) (arg)->release()
#define A(arg) (arg)->addref()
@@ -1063,15 +1092,44 @@ void QmlXMLHttpRequest::send(const QByteArray &data)
dispatchCallback();
m_request.setUrl(m_url);
+ QNetworkRequest request = m_request;
+ if(m_method == QLatin1String("POST") ||
+ m_method == QLatin1String("PUT")) {
+ QVariant var = request.header(QNetworkRequest::ContentTypeHeader);
+ if (var.isValid()) {
+ QString str = var.toString();
+ int charsetIdx = str.indexOf("charset=");
+ if (charsetIdx == -1) {
+ // No charset - append
+ if (!str.isEmpty()) str.append(QLatin1Char(';'));
+ str.append(QLatin1String("charset=UTF-8"));
+ } else {
+ charsetIdx += 8;
+ int n = 0;
+ int semiColon = str.indexOf(QLatin1Char(';'), charsetIdx);
+ if (semiColon == -1) {
+ n = str.length() - charsetIdx;
+ } else {
+ n = semiColon - charsetIdx;
+ }
+
+ str.replace(charsetIdx, n, QLatin1String("UTF-8"));
+ }
+ request.setHeader(QNetworkRequest::ContentTypeHeader, str);
+ } else {
+ request.setHeader(QNetworkRequest::ContentTypeHeader,
+ QLatin1String("text/plain;charset=UTF-8"));
+ }
+ }
if (m_method == QLatin1String("GET"))
- m_network = m_engine->networkAccessManager()->get(m_request);
+ m_network = m_engine->networkAccessManager()->get(request);
else if (m_method == QLatin1String("HEAD"))
- m_network = m_engine->networkAccessManager()->head(m_request);
+ m_network = m_engine->networkAccessManager()->head(request);
else if(m_method == QLatin1String("POST"))
- m_network = m_engine->networkAccessManager()->post(m_request, data);
+ m_network = m_engine->networkAccessManager()->post(request, data);
else if(m_method == QLatin1String("PUT"))
- m_network = m_engine->networkAccessManager()->put(m_request, data);
+ m_network = m_engine->networkAccessManager()->put(request, data);
QObject::connect(m_network, SIGNAL(downloadProgress(qint64,qint64)),
this, SLOT(downloadProgress(qint64)));
@@ -1189,10 +1247,11 @@ void QmlXMLHttpRequest::destroyNetwork()
static QScriptValue qmlxmlhttprequest_open(QScriptContext *context, QScriptEngine *engine)
{
QmlXMLHttpRequest *request = qobject_cast<QmlXMLHttpRequest *>(context->thisObject().data().toQObject());
- if (!request) return context->throwError(QScriptContext::ReferenceError, QLatin1String("Not an XMLHttpRequest object"));
+ if (!request)
+ THROW_REFERENCE("Not an XMLHttpRequest object");
if (context->argumentCount() < 2 || context->argumentCount() > 5)
- return context->throwError(QScriptContext::SyntaxError, QLatin1String("Incorrect argument count"));
+ THROW_DOM(SYNTAX_ERR, "Incorrect argument count");
// Argument 0 - Method
QString method = context->argument(0).toString().toUpper();
@@ -1200,23 +1259,21 @@ static QScriptValue qmlxmlhttprequest_open(QScriptContext *context, QScriptEngin
method != QLatin1String("PUT") &&
method != QLatin1String("HEAD") &&
method != QLatin1String("POST"))
- return context->throwError(QScriptContext::SyntaxError, QLatin1String("Unsupported method"));
+ THROW_DOM(SYNTAX_ERR, "Unsupported HTTP method type");
// Argument 1 - URL
- QUrl url(context->argument(1).toString()); // ### Need to resolve correctly
+ QUrl url(context->argument(1).toString());
if (url.isRelative()) {
- QmlContext *ctxt = QmlEnginePrivate::get(engine)->currentExpression?QmlEnginePrivate::get(engine)->currentExpression->context():0;
- if (ctxt)
- url = ctxt->resolvedUrl(url);
- else
- return context->throwError(QScriptContext::SyntaxError, QLatin1String("Relative URLs not supported"));
+ QmlContext *ctxt = QmlEnginePrivate::get(engine)->getContext(context);
+ Q_ASSERT(ctxt);
+ url = ctxt->resolvedUrl(url);
}
// Argument 2 - async (optional)
if (context->argumentCount() > 2 && !context->argument(2).toBoolean())
- return context->throwError(QScriptContext::SyntaxError, QLatin1String("Synchronous call not supported"));
+ THROW_DOM(NOT_SUPPORTED_ERR, "Synchronous XMLHttpRequest calls are not supported");
// Argument 3/4 - user/pass (optional)
@@ -1241,15 +1298,16 @@ static QScriptValue qmlxmlhttprequest_open(QScriptContext *context, QScriptEngin
static QScriptValue qmlxmlhttprequest_setRequestHeader(QScriptContext *context, QScriptEngine *engine)
{
QmlXMLHttpRequest *request = qobject_cast<QmlXMLHttpRequest *>(context->thisObject().data().toQObject());
- if (!request) return context->throwError(QScriptContext::ReferenceError, QLatin1String("Not an XMLHttpRequest object"));
+ if (!request)
+ THROW_REFERENCE("Not an XMLHttpRequest object");
if (context->argumentCount() != 2)
- return context->throwError(QScriptContext::SyntaxError, QLatin1String("Incorrect argument count"));
+ THROW_SYNTAX("Incorrect argument count");
if (request->readyState() != QmlXMLHttpRequest::Opened ||
request->sendFlag())
- return context->throwError(INVALID_STATE_ERR, QLatin1String("Invalid state"));
+ THROW_DOM(INVALID_STATE_ERR, "Invalid state");
QString name = context->argument(0).toString();
@@ -1288,13 +1346,14 @@ static QScriptValue qmlxmlhttprequest_setRequestHeader(QScriptContext *context,
static QScriptValue qmlxmlhttprequest_send(QScriptContext *context, QScriptEngine *engine)
{
QmlXMLHttpRequest *request = qobject_cast<QmlXMLHttpRequest *>(context->thisObject().data().toQObject());
- if (!request) return context->throwError(QScriptContext::ReferenceError, QLatin1String("Not an XMLHttpRequest object"));
+ if (!request)
+ THROW_REFERENCE("Not an XMLHttpRequest object");
if (request->readyState() != QmlXMLHttpRequest::Opened)
- return context->throwError(INVALID_STATE_ERR, QLatin1String("Invalid state"));
+ THROW_DOM(INVALID_STATE_ERR, "Invalid state");
if (request->sendFlag())
- return context->throwError(INVALID_STATE_ERR, QLatin1String("Invalid state"));
+ THROW_DOM(INVALID_STATE_ERR, "Invalid state");
QByteArray data;
if (context->argumentCount() > 0)
@@ -1308,7 +1367,8 @@ static QScriptValue qmlxmlhttprequest_send(QScriptContext *context, QScriptEngin
static QScriptValue qmlxmlhttprequest_abort(QScriptContext *context, QScriptEngine *engine)
{
QmlXMLHttpRequest *request = qobject_cast<QmlXMLHttpRequest *>(context->thisObject().data().toQObject());
- if (!request) return context->throwError(QScriptContext::ReferenceError, QLatin1String("Not an XMLHttpRequest object"));
+ if (!request)
+ THROW_REFERENCE("Not an XMLHttpRequest object");
request->abort();
@@ -1319,15 +1379,16 @@ static QScriptValue qmlxmlhttprequest_getResponseHeader(QScriptContext *context,
{
Q_UNUSED(engine)
QmlXMLHttpRequest *request = qobject_cast<QmlXMLHttpRequest *>(context->thisObject().data().toQObject());
- if (!request) return context->throwError(QScriptContext::ReferenceError, QLatin1String("Not an XMLHttpRequest object"));
+ if (!request)
+ THROW_REFERENCE("Not an XMLHttpRequest object");
if (context->argumentCount() != 1)
- return context->throwError(QScriptContext::SyntaxError, QLatin1String("Incorrect argument count"));
+ THROW_SYNTAX("Incorrect argument count");
if (request->readyState() != QmlXMLHttpRequest::Loading &&
request->readyState() != QmlXMLHttpRequest::Done &&
request->readyState() != QmlXMLHttpRequest::HeadersReceived)
- return context->throwError(INVALID_STATE_ERR, QLatin1String("Invalid state"));
+ THROW_DOM(INVALID_STATE_ERR, "Invalid state");
QString headerName = context->argument(0).toString();
@@ -1338,15 +1399,16 @@ static QScriptValue qmlxmlhttprequest_getAllResponseHeaders(QScriptContext *cont
{
Q_UNUSED(engine)
QmlXMLHttpRequest *request = qobject_cast<QmlXMLHttpRequest *>(context->thisObject().data().toQObject());
- if (!request) return context->throwError(QScriptContext::ReferenceError, QLatin1String("Not an XMLHttpRequest object"));
+ if (!request)
+ THROW_REFERENCE("Not an XMLHttpRequest object");
if (context->argumentCount() != 0)
- return context->throwError(QScriptContext::SyntaxError, QLatin1String("Incorrect argument count"));
+ THROW_SYNTAX("Incorrect argument count");
if (request->readyState() != QmlXMLHttpRequest::Loading &&
request->readyState() != QmlXMLHttpRequest::Done &&
request->readyState() != QmlXMLHttpRequest::HeadersReceived)
- return context->throwError(INVALID_STATE_ERR, QLatin1String("Invalid state"));
+ THROW_DOM(INVALID_STATE_ERR, "Invalid state");
return QScriptValue(request->headers());
}
@@ -1356,7 +1418,8 @@ static QScriptValue qmlxmlhttprequest_readyState(QScriptContext *context, QScrip
{
Q_UNUSED(engine)
QmlXMLHttpRequest *request = qobject_cast<QmlXMLHttpRequest *>(context->thisObject().data().toQObject());
- if (!request) return context->throwError(QScriptContext::ReferenceError, QLatin1String("Not an XMLHttpRequest object"));
+ if (!request)
+ THROW_REFERENCE("Not an XMLHttpRequest object");
return QScriptValue(request->readyState());
}
@@ -1365,11 +1428,12 @@ static QScriptValue qmlxmlhttprequest_status(QScriptContext *context, QScriptEng
{
Q_UNUSED(engine)
QmlXMLHttpRequest *request = qobject_cast<QmlXMLHttpRequest *>(context->thisObject().data().toQObject());
- if (!request) return context->throwError(QScriptContext::ReferenceError, QLatin1String("Not an XMLHttpRequest object"));
+ if (!request)
+ THROW_REFERENCE("Not an XMLHttpRequest object");
if (request->readyState() == QmlXMLHttpRequest::Unsent ||
request->readyState() == QmlXMLHttpRequest::Opened)
- return context->throwError(INVALID_STATE_ERR, QLatin1String("Invalid state"));
+ THROW_DOM(INVALID_STATE_ERR, "Invalid state");
if (request->errorFlag())
return QScriptValue(0);
@@ -1381,11 +1445,12 @@ static QScriptValue qmlxmlhttprequest_statusText(QScriptContext *context, QScrip
{
Q_UNUSED(engine)
QmlXMLHttpRequest *request = qobject_cast<QmlXMLHttpRequest *>(context->thisObject().data().toQObject());
- if (!request) return context->throwError(QScriptContext::ReferenceError, QLatin1String("Not an XMLHttpRequest object"));
+ if (!request)
+ THROW_REFERENCE("Not an XMLHttpRequest object");
if (request->readyState() == QmlXMLHttpRequest::Unsent ||
request->readyState() == QmlXMLHttpRequest::Opened)
- return context->throwError(INVALID_STATE_ERR, QLatin1String("Invalid state"));
+ THROW_DOM(INVALID_STATE_ERR, "Invalid state");
if (request->errorFlag())
return QScriptValue(0);
@@ -1397,19 +1462,21 @@ static QScriptValue qmlxmlhttprequest_responseText(QScriptContext *context, QScr
{
Q_UNUSED(engine)
QmlXMLHttpRequest *request = qobject_cast<QmlXMLHttpRequest *>(context->thisObject().data().toQObject());
- if (!request) return context->throwError(QScriptContext::ReferenceError, QLatin1String("Not an XMLHttpRequest object"));
+ if (!request)
+ THROW_REFERENCE("Not an XMLHttpRequest object");
if (request->readyState() != QmlXMLHttpRequest::Loading &&
request->readyState() != QmlXMLHttpRequest::Done)
return QScriptValue(QString());
- else
+ else
return QScriptValue(request->responseBody());
}
static QScriptValue qmlxmlhttprequest_responseXML(QScriptContext *context, QScriptEngine *engine)
{
QmlXMLHttpRequest *request = qobject_cast<QmlXMLHttpRequest *>(context->thisObject().data().toQObject());
- if (!request) return context->throwError(QScriptContext::ReferenceError, QLatin1String("Not an XMLHttpRequest object"));
+ if (!request)
+ THROW_REFERENCE("Not an XMLHttpRequest object");
if (request->readyState() != QmlXMLHttpRequest::Loading &&
request->readyState() != QmlXMLHttpRequest::Done)
@@ -1422,7 +1489,8 @@ static QScriptValue qmlxmlhttprequest_onreadystatechange(QScriptContext *context
{
Q_UNUSED(engine)
QmlXMLHttpRequest *request = qobject_cast<QmlXMLHttpRequest *>(context->thisObject().data().toQObject());
- if (!request) return context->throwError(QScriptContext::ReferenceError, QLatin1String("Not an XMLHttpRequest object"));
+ if (!request)
+ THROW_REFERENCE("Not an XMLHttpRequest object");
if (context->argumentCount())
request->setCallback(context->argument(0));
@@ -1459,6 +1527,13 @@ void qt_add_qmlxmlhttprequest(QScriptEngine *engine)
prototype.setProperty(QLatin1String("responseXML"), engine->newFunction(qmlxmlhttprequest_responseXML), QScriptValue::ReadOnly | QScriptValue::PropertyGetter);
prototype.setProperty(QLatin1String("onreadystatechange"), engine->newFunction(qmlxmlhttprequest_onreadystatechange), QScriptValue::PropertyGetter | QScriptValue::PropertySetter);
+ // State values
+ prototype.setProperty(QLatin1String("UNSENT"), 0, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ prototype.setProperty(QLatin1String("OPENED"), 1, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ prototype.setProperty(QLatin1String("HEADERS_RECEIVED"), 2, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ prototype.setProperty(QLatin1String("LOADING"), 3, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ prototype.setProperty(QLatin1String("DONE"), 4, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+
// Constructor
QScriptValue constructor = engine->newFunction(qmlxmlhttprequest_new, prototype);
constructor.setProperty(QLatin1String("UNSENT"), 0, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
@@ -1467,6 +1542,28 @@ void qt_add_qmlxmlhttprequest(QScriptEngine *engine)
constructor.setProperty(QLatin1String("LOADING"), 3, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
constructor.setProperty(QLatin1String("DONE"), 4, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
engine->globalObject().setProperty(QLatin1String("XMLHttpRequest"), constructor);
+
+ // DOM Exception
+ QScriptValue domExceptionPrototype = engine->newObject();
+ domExceptionPrototype.setProperty("INDEX_SIZE_ERR", INDEX_SIZE_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty("DOMSTRING_SIZE_ERR", DOMSTRING_SIZE_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty("HIERARCHY_REQUEST_ERR", HIERARCHY_REQUEST_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty("WRONG_DOCUMENT_ERR", WRONG_DOCUMENT_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty("INVALID_CHARACTER_ERR", INVALID_CHARACTER_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty("NO_DATA_ALLOWED_ERR", NO_DATA_ALLOWED_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty("NO_MODIFICATION_ALLOWED_ERR", NO_MODIFICATION_ALLOWED_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty("NOT_FOUND_ERR", NOT_FOUND_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty("NOT_SUPPORTED_ERR", NOT_SUPPORTED_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty("INUSE_ATTRIBUTE_ERR", INUSE_ATTRIBUTE_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty("INVALID_STATE_ERR", INVALID_STATE_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty("SYNTAX_ERR", SYNTAX_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty("INVALID_MODIFICATION_ERR", INVALID_MODIFICATION_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty("NAMESPACE_ERR", NAMESPACE_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty("INVALID_ACCESS_ERR", INVALID_ACCESS_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty("VALIDATION_ERR", VALIDATION_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+ domExceptionPrototype.setProperty("TYPE_MISMATCH_ERR", TYPE_MISMATCH_ERR, QScriptValue::ReadOnly | QScriptValue::Undeletable | QScriptValue::SkipInEnumeration);
+
+ engine->globalObject().setProperty(QLatin1String("DOMException"), domExceptionPrototype);
}
#include "qmlxmlhttprequest.moc"