V4: fix ArrayPrototype::method_isArray() build break
authorJ-P Nurmi <jpnurmi@digia.com>
Tue, 1 Oct 2013 07:55:50 +0000 (09:55 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Tue, 1 Oct 2013 09:54:18 +0000 (11:54 +0200)
With a recent Clang in C++11 mode:
error: incompatible operand types ('QV4::ArrayObject *' and 'bool')

Task-number: QTBUG-33706
Change-Id: I7bd4fe01176745fb6f8dbdf8f271edb7121eb35e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/qml/jsruntime/qv4arrayobject.cpp

index 8687ca4..6f19597 100644 (file)
@@ -133,7 +133,7 @@ uint ArrayPrototype::getLength(ExecutionContext *ctx, ObjectRef o)
 
 ReturnedValue ArrayPrototype::method_isArray(SimpleCallContext *ctx)
 {
-    bool isArray = ctx->callData->argc ? ctx->callData->args[0].asArrayObject() : false;
+    bool isArray = ctx->callData->argc && ctx->callData->args[0].asArrayObject();
     return Encode(isArray);
 }