summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptengine.cpp
diff options
context:
space:
mode:
authorAlan Alpert <alan.alpert@nokia.com>2010-04-12 07:38:46 (GMT)
committerAlan Alpert <alan.alpert@nokia.com>2010-04-12 07:38:46 (GMT)
commitee958684bd1273a5140e1f6d1264bf8bb7d62ef1 (patch)
treec3b95bb906483b14dd9a58098b18b82b9d9010c2 /src/script/api/qscriptengine.cpp
parentefc80209fb5e6ac9d0343b3c9f6d5a1548cf5556 (diff)
parent9753f6098e0e5b3d80ac748559aecc2e66dcfc7a (diff)
downloadQt-ee958684bd1273a5140e1f6d1264bf8bb7d62ef1.zip
Qt-ee958684bd1273a5140e1f6d1264bf8bb7d62ef1.tar.gz
Qt-ee958684bd1273a5140e1f6d1264bf8bb7d62ef1.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Conflicts: src/declarative/graphicsitems/qdeclarativetextinput.cpp src/declarative/graphicsitems/qdeclarativetextinput_p.h
Diffstat (limited to 'src/script/api/qscriptengine.cpp')
-rw-r--r--src/script/api/qscriptengine.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index 13b8e7c..2417d80 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -1067,11 +1067,15 @@ void QScriptEnginePrivate::setGlobalObject(JSC::JSObject *object)
if (object == globalObject())
return;
QScript::GlobalObject *glob = static_cast<QScript::GlobalObject*>(originalGlobalObject());
- if (object == originalGlobalObjectProxy)
+ if (object == originalGlobalObjectProxy) {
glob->customGlobalObject = 0;
- else {
+ // Sync the internal prototype, since JSObject::prototype() is not virtual.
+ glob->setPrototype(originalGlobalObjectProxy->prototype());
+ } else {
Q_ASSERT(object != originalGlobalObject());
glob->customGlobalObject = object;
+ // Sync the internal prototype, since JSObject::prototype() is not virtual.
+ glob->setPrototype(object->prototype());
}
}