Clean up data format for V4 debug connection
This changes the type announced for functions to the actual JavaScript
type "function".
The type for null is also wrong: it should be "object". However, older
QtCreators cannot distinguish between null and {} if null gets the
correct type, unless you explicitly compare x === null in an expression
evaluator. For this reason the fake "null" type is kept for now.
Also, the value field of undefined is now set as QJsonValue::Undefined
which causes it to be omitted when sent over the wire. This is the
logical thing to do.
In addition we add type and value fields for all data members mentioned
in a response, not only the ones specifically asked for. The value
field is the actual value for any primitives (including strings), or the
number of properties for composite types: objects, arrays, functions. In
turn, the "ref" members are omitted for primitive types, so that we
don't have to hold references to them in the debug service anymore. Even
old QtCreators can deal with verbatim data members without "ref".
Task-number: QTBUG-47746
Task-number: QTBUG-47747
Change-Id: I773e6418c39cd9814aadb5fb5ef7e109f9a4e618
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>