aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/v8/qjsvalue_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-06-13 14:36:32 +0200
committerLars Knoll <lars.knoll@digia.com>2013-06-13 17:47:44 +0200
commite06676db83483d83260f7e04bd1ae2024d8b5030 (patch)
treea2db41a709eb0afabdf6a97feaff34947186bf2a /src/qml/qml/v8/qjsvalue_p.h
parent91a835a1731a10e73546057196855b3fa685f95a (diff)
Don't allow for a QJSValue to be taken from one engine to another through QVariant
Change-Id: I21127d22f595b0ff88f6073bddf617423ad17867 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/v8/qjsvalue_p.h')
-rw-r--r--src/qml/qml/v8/qjsvalue_p.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/qml/v8/qjsvalue_p.h b/src/qml/qml/v8/qjsvalue_p.h
index bb92010796..3b05af21e8 100644
--- a/src/qml/qml/v8/qjsvalue_p.h
+++ b/src/qml/qml/v8/qjsvalue_p.h
@@ -92,6 +92,10 @@ public:
QV4::Value getValue(QV4::ExecutionEngine *e) {
if (!this->e)
this->e = e;
+ else if (this->e != e) {
+ qWarning("JSValue can't be reassigned to another engine.");
+ return QV4::Value::emptyValue();
+ }
if (value.asString() == &string)
value = QV4::Value::fromString(e->newString(string.toQString()));
return value;