aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2011-07-12 15:09:18 +1000
committerQt by Nokia <qt-info@nokia.com>2011-07-25 06:08:56 +0200
commitd9368b7bab1a44c78a035081e4f2ee0eb1df7c33 (patch)
tree451a409a75330622bde62217d9e119f22d8a34dd /src
parenteb5babdda9440a8a47187a3e01239ed15cd25a9d (diff)
Don't assert on incorrect file url
Exceptions thrown from within a QObject method have the same special origin "string" that we use to identify QObject function objects as QObject function objects. Until we can modify this, or switch to function objects in a later V8, we can't get correct source information for these exceptions. Task-number: QTBUG-20344 Change-Id: I02aa2d81ac78c2951d7ea714f33612160ded2476 Reviewed-on: http://codereview.qt.nokia.com/1475 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/declarative/qml/qdeclarativeexpression.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/declarative/qml/qdeclarativeexpression.cpp b/src/declarative/qml/qdeclarativeexpression.cpp
index 93f1b3b96b..ebbfb8cac8 100644
--- a/src/declarative/qml/qdeclarativeexpression.cpp
+++ b/src/declarative/qml/qdeclarativeexpression.cpp
@@ -407,10 +407,8 @@ void QDeclarativeExpressionPrivate::exceptionToError(v8::Handle<v8::Message> mes
v8::Handle<v8::String> description = message->Get();
int lineNumber = message->GetLineNumber();
- Q_ASSERT(name->IsString());
-
- v8::Local<v8::String> file = name->ToString();
- if (file->Length() == 0)
+ v8::Local<v8::String> file = name->IsString()?name->ToString():v8::Local<v8::String>();
+ if (file.IsEmpty() || file->Length() == 0)
error.setUrl(QUrl(QLatin1String("<Unknown File>")));
else
error.setUrl(QUrl(QV8Engine::toStringStatic(file)));