Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
5.9.1
Description
My expectation is that in Javascript code, a URL will evaluate in a boolean context just like a string would, i.e. the empty URL would evaluate to false like the empty string does. I think there was some version of Qt where this was the case, but I tested back to 5.7 and did not find this to be true, so I'm not sure if it's a regression.
Reproduced as such:
import QtQuick 2.0 Rectangle { property url myUrl: "" function update() { if (myUrl) text.text = "evaluates to true"; else text.text = "evaluates to false"; } color: "white" onMyUrlChanged: update() Component.onCompleted: update() Text { id: text color: "black" } }