aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qml/compiler/qv4isel_p.cpp1
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp13
2 files changed, 13 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4isel_p.cpp b/src/qml/compiler/qv4isel_p.cpp
index efcfb9bd77..753e8d9b8d 100644
--- a/src/qml/compiler/qv4isel_p.cpp
+++ b/src/qml/compiler/qv4isel_p.cpp
@@ -259,7 +259,6 @@ void IRDecoder::visitExp(IR::Exp *s)
} else if (c->base->asTemp() || c->base->asArgLocal() || c->base->asConst()) {
callValue(c->base, c->args, 0);
} else if (Member *member = c->base->asMember()) {
- Q_ASSERT(member->base->asTemp() || member->base->asArgLocal());
#ifndef V4_BOOTSTRAP
Q_ASSERT(member->kind != IR::Member::MemberOfIdObjectsArray);
if (member->kind == IR::Member::MemberOfQmlScopeObject || member->kind == IR::Member::MemberOfQmlContextObject) {
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 14447383c1..6318b12f9f 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -339,6 +339,7 @@ private slots:
void singleBlockLoops();
void qtbug_60547();
void anotherNaN();
+ void callPropertyOnUndefined();
private:
// static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter);
@@ -8281,6 +8282,18 @@ void tst_qqmlecmascript::anotherNaN()
object->setProperty("prop", d); // don't crash
}
+void tst_qqmlecmascript::callPropertyOnUndefined()
+{
+ QJSEngine engine;
+ QJSValue v = engine.evaluate(QString::fromLatin1(
+ "function f() {\n"
+ " var base;\n"
+ " base.push(1);"
+ "}\n"
+ ));
+ QVERIFY(!v.isError()); // well, more importantly: this shouldn't fail on an assert.
+}
+
QTEST_MAIN(tst_qqmlecmascript)
#include "tst_qqmlecmascript.moc"