aboutsummaryrefslogtreecommitdiffstats
path: root/qmljs_environment.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qmljs_environment.cpp')
-rw-r--r--qmljs_environment.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/qmljs_environment.cpp b/qmljs_environment.cpp
index ce1bf9da82..94a877586a 100644
--- a/qmljs_environment.cpp
+++ b/qmljs_environment.cpp
@@ -39,6 +39,7 @@
**
****************************************************************************/
+#include <QString>
#include "debugging.h"
#include <qmljs_environment.h>
#include <qmljs_objects.h>
@@ -48,27 +49,30 @@ namespace QQmlJS {
namespace VM {
DiagnosticMessage::DiagnosticMessage()
- : fileName(0)
- , offset(0)
+ : offset(0)
, length(0)
, startLine(0)
, startColumn(0)
, type(0)
- , message(0)
, next(0)
{}
+DiagnosticMessage::~DiagnosticMessage()
+{
+ delete next;
+}
+
String *DiagnosticMessage::buildFullMessage(ExecutionContext *ctx) const
{
QString msg;
- if (fileName)
- msg = fileName->toQString() + QLatin1Char(':');
+ if (!fileName.isEmpty())
+ msg = fileName + QLatin1Char(':');
msg += QString::number(startLine) + QLatin1Char(':') + QString::number(startColumn) + QLatin1String(": ");
if (type == QQmlJS::VM::DiagnosticMessage::Error)
msg += QLatin1String("error");
else
msg += QLatin1String("warning");
- msg += ": " + message->toQString();
+ msg += ": " + message;
return ctx->engine->newString(msg);
}