summaryrefslogtreecommitdiffstats
path: root/src/script
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2010-03-19 13:42:00 (GMT)
committerKent Hansen <kent.hansen@nokia.com>2010-03-19 14:05:26 (GMT)
commit2c466e4a198f2a21d296eee77d321f548931a3b3 (patch)
tree21c07360e60659f043cc1dfb96b765c0af48c54d /src/script
parent16f1618c62c9e292d9feaed7f967e360c1d27520 (diff)
downloadQt-2c466e4a198f2a21d296eee77d321f548931a3b3.zip
Qt-2c466e4a198f2a21d296eee77d321f548931a3b3.tar.gz
Qt-2c466e4a198f2a21d296eee77d321f548931a3b3.tar.bz2
installTranslatorFunctions doesn't work for custom global object
Regression against the old back-end. Don't set the translator properties on the original global object but rather on the active one (except for String.prototype.arg, which should always be added to the original String constructor to match 4.5 behavior). Task-number: QTBUG-6437 Reviewed-by: Jedrzej Nowacki
Diffstat (limited to 'src/script')
-rw-r--r--src/script/api/qscriptengine.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index 1199263..d6d1367 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -2921,7 +2921,7 @@ void QScriptEngine::installTranslatorFunctions(const QScriptValue &object)
JSC::JSValue jscObject = d->scriptValueToJSCValue(object);
JSC::JSGlobalObject *glob = d->originalGlobalObject();
if (!jscObject || !jscObject.isObject())
- jscObject = glob;
+ jscObject = d->globalObject();
// unsigned attribs = JSC::DontEnum;
JSC::asObject(jscObject)->putDirectFunction(exec, new (exec)JSC::NativeFunctionWrapper(exec, glob->prototypeFunctionStructure(), 5, JSC::Identifier(exec, "qsTranslate"), QScript::functionQsTranslate));
JSC::asObject(jscObject)->putDirectFunction(exec, new (exec)JSC::NativeFunctionWrapper(exec, glob->prototypeFunctionStructure(), 2, JSC::Identifier(exec, "QT_TRANSLATE_NOOP"), QScript::functionQsTranslateNoOp));