summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas Senyk <thomas.senyk@nokia.com>2010-11-25 12:16:42 (GMT)
committerThomas Senyk <thomas.senyk@nokia.com>2010-11-25 14:42:53 (GMT)
commit985832eaf110d3decb32e7f984429e09e6bd6271 (patch)
treed15faa82e525d5f26f66b1c7df1c800c345080b8 /src
parentd9e6d9ca595c3ec1f1c2b66b365e51ee34d29bf3 (diff)
downloadQt-985832eaf110d3decb32e7f984429e09e6bd6271.zip
Qt-985832eaf110d3decb32e7f984429e09e6bd6271.tar.gz
Qt-985832eaf110d3decb32e7f984429e09e6bd6271.tar.bz2
QtScript variant conversion: Convert numbers to (u)int if applicable (reviewed by khansen)
Diffstat (limited to 'src')
-rw-r--r--src/script/api/qscriptengine.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index 69abcad..1fcbd73 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -1744,7 +1744,9 @@ QVariant QScriptEnginePrivate::toVariant(JSC::ExecState *exec, JSC::JSValue valu
else if (QScriptDeclarativeClass *dc = declarativeClass(value))
return dc->toVariant(declarativeObject(value));
return variantMapFromObject(exec, JSC::asObject(value));
- } else if (value.isNumber()) {
+ } else if (value.isInt32()) {
+ return QVariant(toInt32(exec, value));
+ } else if (value.isDouble()) {
return QVariant(toNumber(exec, value));
} else if (value.isString()) {
return QVariant(toString(exec, value));