V4 IR: only mark blocks after iterator calculation as loop blocks.

When the iterator calculation contains a condition, newly created
basic-blocks were marked as loop blocks. However, their parent was not
the loop header.

Task-number: QTBUG-38187
Change-Id: I9ee7a3e0bd536c2a005b91f8333931ce929245af
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Fix assignments of null strings in QML and JavaScript

Assigning "" to a string based property would exhibit inconsistent behavior:

  * When assigned as a literal, it would assign an empty string
  * When assigned from JavaScript, it would assign a null string

When the assignment was done _to_ a QByteArray property, it would hit
the case of calling QVariant::convert where the incoming variant is
either an empty or a null string and the target is a QByteArray. For historical
reasons - as documented - QVariant::convert will return false when the
incoming variant is a null variant.

In V8 assignment from JavaScript would produce an empty string and thus
hit the "succesfull" conversion code path in QVariant to convert to a
seemingly empty QByteArray. With v4 a null string would result in a failed
conversion and spurious warnings as seen in the reported task.

This patch ensures that we consistently map "" to a null string, when it comes
from JavaScript or QML as a literal string. We now also detect the situation of
trying to convert a (valid) null variant to another target type.

Task-number: QTBUG-37197
Change-Id: I68f9031262fdd287d69a38d5468fb38a20441d7b
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>