From 6f181768a3147bbfa9a33cf2c05453365693f5b9 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 11 Dec 2020 13:35:53 +0100 Subject: Add a QJSManagedValue A QJSManagedValue is a view on a QJSValue which always knows the engine the value belongs to. This allows us to implement the JavaScript semantics of the various QJSValue methods in a much more rigorous way. [ChangeLog][QtQml] The new QJSManagedValue should be used instead of QJSValue for manipulating properties and prototypes of JavaScript values, as well as for calling JavaScript functions. Change-Id: I9d445ffcf68dfa72dba9bae0818e83c80665ad66 Reviewed-by: Fabian Kosmale --- src/qml/jsruntime/qv4value_p.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/qml/jsruntime/qv4value_p.h') diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h index 44383689b4..6941c11f44 100644 --- a/src/qml/jsruntime/qv4value_p.h +++ b/src/qml/jsruntime/qv4value_p.h @@ -190,8 +190,11 @@ struct Q_QML_PRIVATE_EXPORT Value : public StaticValue inline double toNumber() const; static double toNumberImpl(Value v); double toNumberImpl() const { return toNumberImpl(*this); } + QString toQStringNoThrow() const; QString toQString() const; + QString toQString(bool *ok) const; + Heap::String *toString(ExecutionEngine *e) const { if (isString()) return reinterpret_cast(m()); -- cgit v1.2.3