diff options
author | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2010-04-12 06:31:55 (GMT) |
---|---|---|
committer | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2010-04-12 06:31:55 (GMT) |
commit | f710d57af1cc03af143573135390e6c68eecbfe8 (patch) | |
tree | 2b4f317509b101e2aa08d69225818054310e4d09 /src/script/api/qscriptengine.cpp | |
parent | d22c8c60ffd986cc46d1f1cab878d60b03b5d4ea (diff) | |
parent | f64ad3687c428644139690d565fe555ed2199aea (diff) | |
download | Qt-f710d57af1cc03af143573135390e6c68eecbfe8.zip Qt-f710d57af1cc03af143573135390e6c68eecbfe8.tar.gz Qt-f710d57af1cc03af143573135390e6c68eecbfe8.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7
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()); } } |