From 9730574818c80b956946dc26458c839915855196 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Tue, 27 Oct 2015 12:21:00 +0100 Subject: QML: Fix typeof context property. This was missing from f21e8c641af6b2d10f0d7e7e0fc6a755dab3673c. Task-number: QTBUG-48524 Change-Id: I5cc6a979d965a1ef6b7fbc916a7ca9df868b459a Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4runtime.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/qml/jsruntime/qv4runtime.cpp') diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index 0d7a1851b8..0e90a3d021 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -1146,6 +1146,28 @@ QV4::ReturnedValue Runtime::typeofName(ExecutionEngine *engine, int nameIndex) return Runtime::typeofValue(engine, prop); } +#ifndef V4_BOOTSTRAP +ReturnedValue Runtime::typeofScopeObjectProperty(ExecutionEngine *engine, const Value &context, + int propertyIndex) +{ + Scope scope(engine); + ScopedValue prop(scope, getQmlScopeObjectProperty(engine, context, propertyIndex)); + if (scope.engine->hasException) + return Encode::undefined(); + return Runtime::typeofValue(engine, prop); +} + +ReturnedValue Runtime::typeofContextObjectProperty(ExecutionEngine *engine, const Value &context, + int propertyIndex) +{ + Scope scope(engine); + ScopedValue prop(scope, getQmlContextObjectProperty(engine, context, propertyIndex)); + if (scope.engine->hasException) + return Encode::undefined(); + return Runtime::typeofValue(engine, prop); +} +#endif // V4_BOOTSTRAP + QV4::ReturnedValue Runtime::typeofMember(ExecutionEngine *engine, const Value &base, int nameIndex) { Scope scope(engine); -- cgit v1.2.3