v8::TryCatch tc;
v8::Local<v8::Object> scopeobject = ep->v8engine()->qmlScope(ctxt, scope);
v8::Local<v8::Script> script = ep->v8engine()->qmlModeCompile(code, filename, line);
+ if (tc.HasCaught()) return v8::Persistent<v8::Function>();
v8::Local<v8::Value> result = script->Run(scopeobject);
if (tc.HasCaught()) return v8::Persistent<v8::Function>();
if (qmlscope) *qmlscope = qPersistentNew<v8::Object>(scopeobject);
private slots:
void scriptString();
+ void syntaxError();
};
class TestObject : public QObject
QCOMPARE(error.line(), 8);
}
+// QTBUG-21310 - crash test
+void tst_qdeclarativeexpression::syntaxError()
+{
+ QDeclarativeEngine engine;
+ QDeclarativeExpression expression(engine.rootContext(), 0, "asd asd");
+ QVariant v = expression.evaluate();
+ QCOMPARE(v, QVariant());
+}
+
QTEST_MAIN(tst_qdeclarativeexpression)
#include "tst_qdeclarativeexpression.moc"