diff options
| author | Richard Weickelt <richard@weickelt.de> | 2018-06-26 17:35:06 +0200 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@qt.io> | 2018-07-02 10:43:28 +0000 |
| commit | 65b831c21afa8540bf5414191988f41bedfcb409 (patch) | |
| tree | c0febd17f408c5b4bc3bc315869f7f3f438ca366 /src/qml/jsruntime/qv4arrayobject.cpp | |
| parent | e6d19ae5cf697087bbecce9d6f702afef7c29253 (diff) | |
Add QJSEngine::throwError() method to report run-time errors
It is quite common in JavaScript to use exceptions for error handling, but
there was no way to generate an exception from C++ context, i.e. when
the JS run-time invoked a C++ method or a slot.
This patch adds an naive way to report run-time errors to QJSEngine from
CPP context. The user may set a custom error message, but the location
points always to the caller context in JavaScript.
[ChangeLog][QtQml][QJSEngine] Added API to throw run-time errors.
Task-number: QTBUG-39041
Change-Id: If59627b83d50351eb225adde63187fc251aa349e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4arrayobject.cpp')
0 files changed, 0 insertions, 0 deletions
