[Development] [Interest] QJSEngine and error line

Simon Hausmann simon.hausmann at theqtcompany.com
Thu Apr 9 11:52:31 CEST 2015


On Wednesday 8. April 2015 23.45.29 Sze Howe Koh wrote:
[...]
> Going off on a slight tangent:
> https://doc.qt.io/qt-5/qjsvalue.html#toVariant says that an Object "is
> converted to a QVariantMap. Each property is converted to a QVariant,
> recursively". However, calling toVariant() on an Error object
> (isError() == isObject() == true) produces an empty QVariantMap event
> though QJSValueIterator gets the properties just fine (using Qt
> 5.4.1). Is this expected?

That could be a bug. You should see the enumerable properties, which I think 
include message and name. If a strack trace was producible at constructor 
time, then you should also see the fileName and lineNumber properties. "stack" 
however will not be visible.


Simon



More information about the Development mailing list