aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/v4/qv4compiler.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2012-03-13 16:24:49 +1000
committerQt by Nokia <qt-info@nokia.com>2012-03-20 05:37:59 +0100
commit89c57d2859a2bb2d64f876b3458e090eb6f77b8b (patch)
tree4ea0bb2cd1f108a4be09d4e861ed608021e20811 /src/qml/qml/v4/qv4compiler.cpp
parent47e0817973ed4e992d8cb537c49bdaa3c4fc2168 (diff)
Support null -> QObject and QObject -> bool conversions in v4.
Change-Id: I66602bf52986a388f9b6fe2bcd4630b862138906 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Diffstat (limited to 'src/qml/qml/v4/qv4compiler.cpp')
-rw-r--r--src/qml/qml/v4/qv4compiler.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/qml/qml/v4/qv4compiler.cpp b/src/qml/qml/v4/qv4compiler.cpp
index 09b0f3861b..467083a2c8 100644
--- a/src/qml/qml/v4/qv4compiler.cpp
+++ b/src/qml/qml/v4/qv4compiler.cpp
@@ -958,6 +958,7 @@ void QV4CompilerPrivate::visitMove(IR::Move *s)
case IR::StringType: opcode = V4Instr::ConvertStringToBool; break;
case IR::UrlType: opcode = V4Instr::ConvertUrlToBool; break;
case IR::ColorType: opcode = V4Instr::ConvertColorToBool; break;
+ case IR::ObjectType: opcode = V4Instr::ConvertObjectToBool; break;
default: break;
} // switch
} else if (targetTy == IR::IntType) {
@@ -1010,6 +1011,11 @@ void QV4CompilerPrivate::visitMove(IR::Move *s)
case IR::StringType: opcode = V4Instr::ConvertStringToColor; break;
default: break;
} // switch
+ } else if (targetTy == IR::ObjectType) {
+ switch (sourceTy) {
+ case IR::NullType: opcode = V4Instr::ConvertNullToObject; break;
+ default: break;
+ } // switch
}
if (opcode != V4Instr::Noop) {
V4Instr conv;