aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmljavascriptexpression_p.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Cleanup exception handlingSimon Hausmann2013-10-031-1/+0
| | | | | | | | | | The code in the Exception class operates entirely on the engine's data, so move it into ExecutionEngine instead. This eliminates the need for a QV4::Exception class and catches and old code that tries to still do catch (Exception &) instead of catch (...) Change-Id: Ie608bec6af652038aca6c9423c225a4d7eb13b39 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change exception handling APISimon Hausmann2013-10-021-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the exception handling API in the engine slightly, encapsulating any use of direct throw statements and catch blocks with concrete types. In the future we need to be able to change the way these are implemented, in order to ensure that the correct stack unwinding code is triggered for throw and re-throw. This patch separates the C++ exception object thrown from the V4 exception (that includes value, throwing context pointer) and stores the latter inside the engine. In order for that to compile, ExecutionEngine::StackTrace and StackFrame had to move into the QV4 namespace directly. In addition the syntax for catching exceptions changes from try { ... } catch (QV4::Exception &ex) { ex.accept(context); QV4::ScopedValue exceptionValue(scope, ex.value()); } to try { ... } catch (...) { QV4::ScopedValue exception(scope, context->catchException()); } Context::catchException() checks if there's a "current" exception in the engine, and if not assumes that we caught an unrelated exception and consequently re-throws. partiallyUnwind() is also gone and replaced with rethrowException(), in order to encapsulate the re-throw. Lastly, in the future nesting try/catch blocks isn't going to be possible due to limitations in the common C++ ABI with regards to foreign exceptions. Change-Id: Ic81c75b057a2147e3176d8e0b4d326c14278b47d Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove most uses of Value from qml/qmlLars Knoll2013-09-301-5/+2
| | | | | Change-Id: I409a8505a9e01f86d777bc694d24516d1c8f0c4d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix Persistent/WeakValue APILars Knoll2013-09-261-2/+2
| | | | | | | Don't use unprotected Values in the API anymore. Change-Id: I8851628227fca374de24701bc8ee0908b5ae3923 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Convert most remaining return values from Value to ReturnedValueLars Knoll2013-09-181-2/+2
| | | | | Change-Id: If8b0c3b91be50678693868c10fefc3678008834d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move QV4::Exception into a separate compilation unit with header fileSimon Hausmann2013-07-121-0/+1
| | | | | | | | This is in preparation for some platform specific code regarding throwing exceptions, as well as a general cleanup :) Change-Id: I23fb4f12fd09423a1f2cb225145780925002677b Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Merge branch 'dev' of ssh://codereview.qt-project.org/qt/qtdeclarative into ↵Simon Hausmann2013-06-241-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wip/v4 Conflicts: src/imports/qtquick2/plugins.qmltypes src/qml/debugger/qv8debugservice.cpp src/qml/qml/qml.pri src/qml/qml/qqmlcompiler.cpp src/qml/qml/qqmlcomponent.cpp src/qml/qml/qqmlcontext.cpp src/qml/qml/qqmldata_p.h src/qml/qml/qqmlengine_p.h src/qml/qml/qqmljavascriptexpression.cpp src/qml/qml/qqmlxmlhttprequest.cpp src/qml/qml/v4/qv4bindings.cpp src/qml/qml/v4/qv4irbuilder.cpp src/qml/qml/v4/qv4jsonobject_p.h src/qml/qml/v8/qqmlbuiltinfunctions.cpp src/qml/qml/v8/qv8bindings.cpp src/qml/qml/v8/qv8contextwrapper.cpp src/qml/qml/v8/qv8listwrapper.cpp src/qml/qml/v8/qv8qobjectwrapper.cpp src/qml/qml/v8/qv8qobjectwrapper_p.h src/qml/qml/v8/qv8sequencewrapper_p_p.h src/qml/qml/v8/qv8typewrapper.cpp src/qml/qml/v8/qv8valuetypewrapper.cpp src/qml/types/qqmldelegatemodel.cpp src/quick/items/context2d/qquickcanvasitem.cpp src/quick/items/context2d/qquickcontext2d.cpp sync.profile tests/auto/qml/qjsengine/tst_qjsengine.cpp tests/benchmarks/qml/animation/animation.pro tools/qmlprofiler/qmlprofiler.pro Change-Id: I18a76b8a81d87523247fa03a44ca334b1a2360c9
| * QQmlError.object now holds the scope object that caused exceptions.Mark Visser2013-05-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Exception errors sent via QQmlEngine::warnings lacked a pointer to the containing scope. I added an object property to QQmlError, and the necessary code to fill it with the QObject* scope from binding exception callbacks. Task-number: QTBUG-30930 Change-Id: I2a987e8cefc3a2a474d338893e9ebcb77c167adf Reviewed-by: Kai Koehne <kai.koehne@digia.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* | Remove last traces of v8 API and v8 compatibility layerSimon Hausmann2013-06-121-1/+0
| | | | | | | | | | | | | | | | The debugger and profiler service remain as bigger parts that need to be ported properly to v4. Change-Id: I68e72d6db66fe497eb58ed60df417ffe4662d115 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Remove some leftovers from the v8bindingsLars Knoll2013-05-291-12/+0
| | | | | | | | | | | | | | | | The shared context concept was only used there, so remove code that was referring to it. Change-Id: I5ae56049a83818c898ef1cc4e68a5333a9374656 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Small cleanupLars Knoll2013-05-261-4/+0
| | | | | | | | | | | | | | | | | | We don't do rewriting for bindings anymore. Remove a method overload that's not really needed anymore. Change-Id: I9d57d30dce4848cb06c88c3f042ccf30e6d41aab Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Add support for direct binding evaluation in QV4ScriptLars Knoll2013-05-241-0/+5
| | | | | | | | | | | | | | | | | | This way there is no need to rewrite the binding expressions anymore, instead we can directly compile them into a binding function. Change-Id: I91a0c540d066976e363590fe9ccde6a81ee92b1d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Get rid of v8::TryCatch and v8::MessageLars Knoll2013-05-211-1/+0
| | | | | | | | | | | | | | They are now unused, so let's remove them from the v8 API. Change-Id: I9c1b39632cb88785ae6fdda671580e0426ae97ba Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Fix return value for QQmlJavascriptExpression::evaluateLars Knoll2013-05-211-2/+2
| | | | | | | | | | Change-Id: Idf95ee51b7d50682476371c7f49537930fdf96f1 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Cleanup QQmlDelayedErrorLars Knoll2013-05-211-6/+6
| | | | | | | | | | | | | | | | Remove dependency onto v8::Message and simplify conversion from QV4::Exception to QQmlError. Change-Id: Icfdfd7a2749210b2df9fda6cd5de94114b8adcfa Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Move QQmlJavascriptExression::evaluate over to v4Lars Knoll2013-05-211-3/+3
| | | | | | | | | | Change-Id: Ic4093dc5413f43af55a74a0e0f8c316ac1c6d974 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Convert qqmljavascriptexpression to use QV4::PersistentValueLars Knoll2013-05-081-4/+4
| | | | | | | | | | Change-Id: Idd704b55be61dd78c59fffdf966fc8497af852d6 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Change some v8::Persistent to QV4::PersistentValueLars Knoll2013-05-071-4/+4
| | | | | | | | | | Change-Id: I2c4e98cf7e778de9aafabdbd68e6682106343d12 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Get rid of v8::LocalLars Knoll2013-05-061-2/+2
|/ | | | | | | | | The class was doing exactly the same thing as v8::Handle in our implementation. Removing it cleans up quite a bit of code. Change-Id: I37a3dcdef062fc388751e9ef0a158b5926ba2efb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-231-24/+24
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Avoid dynamic lookup of signal handler argumentsMichael Brasser2012-08-241-0/+3
| | | | | | | | | | | Rewrite signal handlers to include the parameters in the rewrite. Also check whether parameters are actually used when possible, and if not don't provide them to the expression. Change-Id: I7d65c05f4639979dd61035cf7478119ef7647c25 Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Make connectNotify() work with QMLThomas McGuire2012-08-221-2/+1
| | | | | | | | | Call connectNotify() and disconnectNotify() in QQmlNotifierEndPoint, which works for QML signal handlers and for QML bindings. Task-number: QTBUG-11284 Change-Id: Ic9a08ee6687e5c7e606f315c8fb30eec1493cd83 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Reduce memory consumption of source coordinatesMatthew Vogt2012-08-161-3/+3
| | | | | | | | | | Reduce memory consumption by storing source location coordinates as 16-bit variables (in run-time structures). Also modify qmlmin to restrict line lengths so that the column bound is not normally exceeded. Change-Id: I08605626ffbdf081b6da2aea1116bdfe24998572 Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
* Delay conversion of v8 exceptions to QQmlErrors.Michael Brasser2012-06-051-5/+16
| | | | | | | | | This conversion in relatively expensive, and not required for transient exceptions that occur during startup due to the order of binding evaluation. Change-Id: I29a16c075890c8966c0bad0a77412ad232c791bb Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
* Reduce size of QQmlNotifierEndpointAaron Kennedy2012-05-241-10/+2
| | | | | Change-Id: I4d4a22f5f3d88d4ad2fcd738753fd8da2d8a9263 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Support and use parameters in QQmlNotifierEndpoint.Michael Brasser2012-04-231-1/+1
| | | | | | | | | Allow QQmlNotifierEndpoint to support signals with parameters. Update QQmlBoundSignal to use this support. Change-Id: Ie2a245b39283b0b66d66bd2350e8bc85fe519bb5 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Remove binding dependency on QQmlExpressionAaron Kennedy2012-03-151-0/+9
| | | | | | | | This is the first step to creating much lighter weight bindings that are tuned for the specific scenario in which they're used. Change-Id: Ib985dcff25679b711b5c634bbc891aa7902bf405 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Move binding and expression classes to separate filesAaron Kennedy2012-03-131-0/+274
Change-Id: Ia9c6996a606e140f31681ecd26d93b1b0fdedf02 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>