diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2010-04-09 17:02:00 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2010-04-09 17:02:00 (GMT) |
commit | 501a80b1dc9df816a3de25bd1af5b55cdc0fcbce (patch) | |
tree | 3015d651d56e78e20862a20353a6a8261b718563 /src/script/api/qscriptengine.cpp | |
parent | 7beb00f80967380b4d94af3f19af3f594ea40d1b (diff) | |
parent | e09c61235dab9de1111372ee05eb51004eda5569 (diff) | |
download | Qt-501a80b1dc9df816a3de25bd1af5b55cdc0fcbce.zip Qt-501a80b1dc9df816a3de25bd1af5b55cdc0fcbce.tar.gz Qt-501a80b1dc9df816a3de25bd1af5b55cdc0fcbce.tar.bz2 |
Merge remote branch 'origin/4.6' into qt-4.7-from-4.6
Diffstat (limited to 'src/script/api/qscriptengine.cpp')
-rw-r--r-- | src/script/api/qscriptengine.cpp | 8 |
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()); } } |