From: Lars Knoll Date: Fri, 25 Jul 2014 15:44:14 +0000 (+0200) Subject: Cleanup header file dependencies X-Git-Tag: v5.5.90+alpha1~775 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6f6b350976ccfe959223b1fbe8c21fe71efc45bd;p=platform%2Fupstream%2Fqtdeclarative.git Cleanup header file dependencies Change-Id: Ibb4658576a98b53de2eac2474ce4d5b9eb83b6ae Reviewed-by: Simon Hausmann --- diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp index 78c1905..02dc1a5 100644 --- a/src/imports/localstorage/plugin.cpp +++ b/src/imports/localstorage/plugin.cpp @@ -52,6 +52,7 @@ #include #include #include +#include using namespace QV4; diff --git a/src/qml/jsapi/qjsvalueiterator.cpp b/src/qml/jsapi/qjsvalueiterator.cpp index f7976e7..cc6953c 100644 --- a/src/qml/jsapi/qjsvalueiterator.cpp +++ b/src/qml/jsapi/qjsvalueiterator.cpp @@ -36,6 +36,7 @@ #include "qjsvalue_p.h" #include "private/qv4string_p.h" #include "private/qv4object_p.h" +#include "private/qv4context_p.h" QT_BEGIN_NAMESPACE @@ -51,7 +52,7 @@ QJSValueIteratorPrivate::QJSValueIteratorPrivate(const QJSValue &v) QV4::Scope scope(e); QV4::ScopedObject o(scope, jsp->value); - iterator = e->newForEachIteratorObject(e->currentContext(), o)->asReturnedValue(); + iterator = e->newForEachIteratorObject(o)->asReturnedValue(); currentName = (QV4::String *)0; nextName = (QV4::String *)0; @@ -223,7 +224,7 @@ QJSValueIterator& QJSValueIterator::operator=(QJSValue& object) QJSValuePrivate *jsp = QJSValuePrivate::get(object); QV4::Scope scope(v4); QV4::ScopedObject o(scope, jsp->value); - d_ptr->iterator = v4->newForEachIteratorObject(v4->currentContext(), o)->asReturnedValue(); + d_ptr->iterator = v4->newForEachIteratorObject(o)->asReturnedValue(); QV4::Scoped it(scope, d_ptr->iterator.value()); it->d()->it.flags = QV4::ObjectIterator::NoFlags; QV4::String *nm = 0; diff --git a/src/qml/jsruntime/qv4arraydata.cpp b/src/qml/jsruntime/qv4arraydata.cpp index 35bd6e5..4c8c172 100644 --- a/src/qml/jsruntime/qv4arraydata.cpp +++ b/src/qml/jsruntime/qv4arraydata.cpp @@ -34,6 +34,7 @@ #include "qv4object_p.h" #include "qv4functionobject_p.h" #include "qv4mm_p.h" +#include "qv4runtime_p.h" using namespace QV4; diff --git a/src/qml/jsruntime/qv4arrayobject.cpp b/src/qml/jsruntime/qv4arrayobject.cpp index 011279a..1d17672 100644 --- a/src/qml/jsruntime/qv4arrayobject.cpp +++ b/src/qml/jsruntime/qv4arrayobject.cpp @@ -35,6 +35,7 @@ #include "qv4sparsearray_p.h" #include "qv4objectproto_p.h" #include "qv4scopedvalue_p.h" +#include "qv4runtime_p.h" using namespace QV4; diff --git a/src/qml/jsruntime/qv4context_p.h b/src/qml/jsruntime/qv4context_p.h index b4c78c3..5235b65 100644 --- a/src/qml/jsruntime/qv4context_p.h +++ b/src/qml/jsruntime/qv4context_p.h @@ -42,20 +42,12 @@ QT_BEGIN_NAMESPACE namespace QV4 { -struct Object; -struct ExecutionEngine; -struct DeclarativeEnvironment; -struct Lookup; -struct Function; -struct ValueRef; - namespace CompiledData { struct CompilationUnit; struct Function; } struct CallContext; -struct CallContext; struct CatchContext; struct WithContext; diff --git a/src/qml/jsruntime/qv4dateobject.cpp b/src/qml/jsruntime/qv4dateobject.cpp index e00a705..c8bd73d 100644 --- a/src/qml/jsruntime/qv4dateobject.cpp +++ b/src/qml/jsruntime/qv4dateobject.cpp @@ -35,6 +35,8 @@ #include "qv4dateobject_p.h" #include "qv4objectproto_p.h" #include "qv4scopedvalue_p.h" +#include "qv4runtime_p.h" + #include #include #include diff --git a/src/qml/jsruntime/qv4debugging.cpp b/src/qml/jsruntime/qv4debugging.cpp index bcf0d07..c001b60 100644 --- a/src/qml/jsruntime/qv4debugging.cpp +++ b/src/qml/jsruntime/qv4debugging.cpp @@ -38,6 +38,7 @@ #include "qv4instr_moth_p.h" #include "qv4runtime_p.h" #include "qv4script_p.h" +#include "qv4objectiterator_p.h" #include #include diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp index 3e7421a..42cd860 100644 --- a/src/qml/jsruntime/qv4engine.cpp +++ b/src/qml/jsruntime/qv4engine.cpp @@ -700,10 +700,10 @@ Returned *ExecutionEngine::newVariantObject(const QVariant &v) return o->asReturned(); } -Returned *ExecutionEngine::newForEachIteratorObject(ExecutionContext *ctx, Object *o) +Returned *ExecutionEngine::newForEachIteratorObject(Object *o) { Scope scope(this); - ScopedObject obj(scope, memoryManager->alloc(ctx, o)); + ScopedObject obj(scope, memoryManager->alloc(this, o)); return obj->asReturned(); } diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h index c77c5b1c..6c9b90c 100644 --- a/src/qml/jsruntime/qv4engine_p.h +++ b/src/qml/jsruntime/qv4engine_p.h @@ -35,8 +35,7 @@ #include "qv4global_p.h" #include "private/qv4isel_p.h" -#include "qv4util_p.h" -#include "qv4property_p.h" +#include "qv4managed_p.h" #include namespace WTF { @@ -341,7 +340,7 @@ public: Returned *newVariantObject(const QVariant &v); - Returned *newForEachIteratorObject(ExecutionContext *ctx, Object *o); + Returned *newForEachIteratorObject(Object *o); Returned *qmlContextObject() const; diff --git a/src/qml/jsruntime/qv4function_p.h b/src/qml/jsruntime/qv4function_p.h index b2c4d2e..63bbb01 100644 --- a/src/qml/jsruntime/qv4function_p.h +++ b/src/qml/jsruntime/qv4function_p.h @@ -34,44 +34,12 @@ #define QV4FUNCTION_H #include "qv4global_p.h" - -#include -#include -#include - -#include "qv4value_p.h" #include -#include QT_BEGIN_NAMESPACE namespace QV4 { -struct String; -struct Function; -struct Object; -struct FunctionObject; -struct ExecutionContext; -struct ExecutionEngine; -class MemoryManager; - -struct ObjectPrototype; -struct StringPrototype; -struct NumberPrototype; -struct BooleanPrototype; -struct ArrayPrototype; -struct FunctionPrototype; -struct DatePrototype; -struct ErrorPrototype; -struct EvalErrorPrototype; -struct RangeErrorPrototype; -struct ReferenceErrorPrototype; -struct SyntaxErrorPrototype; -struct TypeErrorPrototype; -struct URIErrorPrototype; -struct InternalClass; -struct Lookup; - struct Q_QML_EXPORT Function { const CompiledData::Function *compiledFunction; CompiledData::CompilationUnit *compilationUnit; diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index 275b1c0..49a560d 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -48,15 +48,11 @@ #include #include #include -#include #include #include "private/qlocale_tools_p.h" #include #include -#include -#include -#include #include #include "qv4alloca_p.h" #include "qv4profiling_p.h" diff --git a/src/qml/jsruntime/qv4functionobject_p.h b/src/qml/jsruntime/qv4functionobject_p.h index 2d57f6c..32fa2e0 100644 --- a/src/qml/jsruntime/qv4functionobject_p.h +++ b/src/qml/jsruntime/qv4functionobject_p.h @@ -33,59 +33,15 @@ #ifndef QV4FUNCTIONOBJECT_H #define QV4FUNCTIONOBJECT_H -#include "qv4global_p.h" -#include "qv4runtime_p.h" -#include "qv4engine_p.h" -#include "qv4context_p.h" #include "qv4object_p.h" -#include "qv4string_p.h" -#include "qv4managed_p.h" -#include "qv4property_p.h" #include "qv4function_p.h" -#include "qv4objectiterator_p.h" +#include "qv4context_p.h" #include "qv4mm_p.h" -#include -#include -#include -#include -#include - QT_BEGIN_NAMESPACE namespace QV4 { -struct Function; -struct Object; -struct BooleanObject; -struct NumberObject; -struct StringObject; -struct ArrayObject; -struct DateObject; -struct FunctionObject; -struct ErrorObject; -struct ArgumentsObject; -struct ExecutionContext; -struct ExecutionEngine; -class MemoryManager; - -struct ObjectPrototype; -struct StringPrototype; -struct NumberPrototype; -struct BooleanPrototype; -struct ArrayPrototype; -struct FunctionPrototype; -struct DatePrototype; -struct ErrorPrototype; -struct EvalErrorPrototype; -struct RangeErrorPrototype; -struct ReferenceErrorPrototype; -struct SyntaxErrorPrototype; -struct TypeErrorPrototype; -struct URIErrorPrototype; -struct InternalClass; -struct Lookup; - struct Q_QML_EXPORT FunctionObject: Object { struct Q_QML_PRIVATE_EXPORT Data : Object::Data { Data(ExecutionContext *scope, String *name, bool createProto = false); diff --git a/src/qml/jsruntime/qv4global_p.h b/src/qml/jsruntime/qv4global_p.h index 81f1240..f265ed5 100644 --- a/src/qml/jsruntime/qv4global_p.h +++ b/src/qml/jsruntime/qv4global_p.h @@ -126,6 +126,9 @@ struct ScriptFunction; struct InternalClass; struct Property; struct Value; +struct Lookup; +struct HeapObject; +struct ArrayData; struct BooleanObject; struct NumberObject; @@ -146,6 +149,7 @@ struct QObjectWrapper; // It will be returned in rax on x64, [eax,edx] on x86 and [r0,r1] on arm typedef quint64 ReturnedValue; struct CallData; +struct Scope; struct ScopedValue; struct ValueRef; template struct Scoped; diff --git a/src/qml/jsruntime/qv4internalclass_p.h b/src/qml/jsruntime/qv4internalclass_p.h index 06feea1..972c341 100644 --- a/src/qml/jsruntime/qv4internalclass_p.h +++ b/src/qml/jsruntime/qv4internalclass_p.h @@ -33,9 +33,9 @@ #ifndef QV4INTERNALCLASS_H #define QV4INTERNALCLASS_H -#include -#include #include "qv4global_p.h" + +#include #include QT_BEGIN_NAMESPACE diff --git a/src/qml/jsruntime/qv4jsonobject.cpp b/src/qml/jsruntime/qv4jsonobject.cpp index 268559d..fc5fb6a 100644 --- a/src/qml/jsruntime/qv4jsonobject.cpp +++ b/src/qml/jsruntime/qv4jsonobject.cpp @@ -37,6 +37,8 @@ #include #include #include +#include + #include #include #include diff --git a/src/qml/jsruntime/qv4managed_p.h b/src/qml/jsruntime/qv4managed_p.h index c69eace..e382ad2 100644 --- a/src/qml/jsruntime/qv4managed_p.h +++ b/src/qml/jsruntime/qv4managed_p.h @@ -33,9 +33,6 @@ #ifndef QMLJS_MANAGED_H #define QMLJS_MANAGED_H -#include -#include -#include #include "qv4global_p.h" #include "qv4value_p.h" #include "qv4internalclass_p.h" diff --git a/src/qml/jsruntime/qv4mm_p.h b/src/qml/jsruntime/qv4mm_p.h index cf9a148..f2267e5 100644 --- a/src/qml/jsruntime/qv4mm_p.h +++ b/src/qml/jsruntime/qv4mm_p.h @@ -35,10 +35,8 @@ #define QV4GC_H #include "qv4global_p.h" -#include "qv4context_p.h" #include "qv4value_inl_p.h" - -#include +#include "qv4scopedvalue_p.h" //#define DETAILED_MM_STATS diff --git a/src/qml/jsruntime/qv4numberobject.cpp b/src/qml/jsruntime/qv4numberobject.cpp index 227ff14..9f9c55d 100644 --- a/src/qml/jsruntime/qv4numberobject.cpp +++ b/src/qml/jsruntime/qv4numberobject.cpp @@ -32,6 +32,8 @@ ****************************************************************************/ #include "qv4numberobject_p.h" +#include "qv4runtime_p.h" + #include #include #include diff --git a/src/qml/jsruntime/qv4object.cpp b/src/qml/jsruntime/qv4object.cpp index 0c61d66..b70a18f 100644 --- a/src/qml/jsruntime/qv4object.cpp +++ b/src/qml/jsruntime/qv4object.cpp @@ -41,22 +41,9 @@ #include "qv4lookup_p.h" #include "qv4scopedvalue_p.h" #include "qv4memberdata_p.h" +#include "qv4objectiterator_p.h" -#include -#include -#include -#include -#include -#include -#include "private/qlocale_tools_p.h" - -#include -#include -#include -#include -#include #include -#include "qv4alloca_p.h" using namespace QV4; diff --git a/src/qml/jsruntime/qv4object_p.h b/src/qml/jsruntime/qv4object_p.h index 4e9d152..d57d1bf 100644 --- a/src/qml/jsruntime/qv4object_p.h +++ b/src/qml/jsruntime/qv4object_p.h @@ -30,70 +30,17 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ -#ifndef QMLJS_OBJECTS_H -#define QMLJS_OBJECTS_H - -#include "qv4global_p.h" -#include "qv4runtime_p.h" -#include "qv4engine_p.h" -#include "qv4context_p.h" -#include "qv4string_p.h" +#ifndef QV4_OBJECT_H +#define QV4_OBJECT_H + #include "qv4managed_p.h" -#include "qv4property_p.h" -#include "qv4internalclass_p.h" -#include "qv4arraydata_p.h" #include "qv4memberdata_p.h" - -#include -#include -#include -#include -#include - -#ifdef _WIN32_WCE -#undef assert -#define assert(x) -#endif // _WIN32_WCE +#include "qv4arraydata_p.h" QT_BEGIN_NAMESPACE namespace QV4 { -struct Function; -struct Lookup; -struct Object; -struct ObjectIterator; -struct BooleanObject; -struct NumberObject; -struct StringObject; -struct ArrayObject; -struct DateObject; -struct FunctionObject; -struct RegExpObject; -struct ErrorObject; -struct ArgumentsObject; -struct ExecutionContext; -struct CallContext; -struct ExecutionEngine; -class MemoryManager; - -struct ObjectPrototype; -struct StringPrototype; -struct NumberPrototype; -struct BooleanPrototype; -struct ArrayPrototype; -struct FunctionPrototype; -struct DatePrototype; -struct RegExpPrototype; -struct ErrorPrototype; -struct EvalErrorPrototype; -struct RangeErrorPrototype; -struct ReferenceErrorPrototype; -struct SyntaxErrorPrototype; -struct TypeErrorPrototype; -struct URIErrorPrototype; - - struct Q_QML_EXPORT Object: Managed { struct Data : Managed::Data { Data(ExecutionEngine *engine) diff --git a/src/qml/jsruntime/qv4objectiterator_p.h b/src/qml/jsruntime/qv4objectiterator_p.h index 3ed73b5..24efd7e 100644 --- a/src/qml/jsruntime/qv4objectiterator_p.h +++ b/src/qml/jsruntime/qv4objectiterator_p.h @@ -34,24 +34,12 @@ #define QV4OBJECTITERATOR_H #include "qv4global_p.h" -#include "qv4property_p.h" -#include "qv4scopedvalue_p.h" #include "qv4object_p.h" QT_BEGIN_NAMESPACE namespace QV4 { -struct SparseArrayNode; -struct Object; -struct ArrayObject; -struct PropertyAttributes; -struct ExecutionContext; -struct Property; -struct String; -struct InternalClass; -struct ForEachIteratorObject; - struct Q_QML_EXPORT ObjectIterator { enum Flags { @@ -81,8 +69,8 @@ private: struct ForEachIteratorObject: Object { struct Data : Object::Data { - Data(ExecutionContext *ctx, Object *o) - : Object::Data(ctx->engine()) + Data(ExecutionEngine *engine, Object *o) + : Object::Data(engine) , it(workArea, workArea + 1, o, ObjectIterator::EnumerableOnly|ObjectIterator::WithProtoChain) { setVTable(staticVTable()); } diff --git a/src/qml/jsruntime/qv4objectproto.cpp b/src/qml/jsruntime/qv4objectproto.cpp index 9cbf4b2..d448d21 100644 --- a/src/qml/jsruntime/qv4objectproto.cpp +++ b/src/qml/jsruntime/qv4objectproto.cpp @@ -36,30 +36,13 @@ #include "qv4argumentsobject_p.h" #include "qv4mm_p.h" #include "qv4scopedvalue_p.h" +#include "qv4runtime_p.h" +#include "qv4objectiterator_p.h" + #include #include #include #include -#include -#include - -#include -#include -#include -#include -#include -#include - -#ifndef Q_OS_WIN -# include -# ifndef Q_OS_VXWORKS -# include -# else -# include "qplatformdefs.h" -# endif -#else -# include -#endif using namespace QV4; diff --git a/src/qml/jsruntime/qv4property_p.h b/src/qml/jsruntime/qv4property_p.h index f9b3159..601e344 100644 --- a/src/qml/jsruntime/qv4property_p.h +++ b/src/qml/jsruntime/qv4property_p.h @@ -34,7 +34,7 @@ #define QV4PROPERTYDESCRIPTOR_H #include "qv4global_p.h" -#include "qv4value_inl_p.h" +#include "qv4value_p.h" #include "qv4internalclass_p.h" QT_BEGIN_NAMESPACE diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index 54b42c5..fbf5ba1 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -35,11 +35,11 @@ #include "qv4runtime_p.h" #ifndef V4_BOOTSTRAP #include "qv4object_p.h" -#include "qv4jsir_p.h" #include "qv4objectproto_p.h" #include "qv4globalobject_p.h" #include "qv4stringobject_p.h" #include "qv4argumentsobject_p.h" +#include "qv4objectiterator_p.h" #include "qv4lookup_p.h" #include "qv4function_p.h" #include "private/qlocale_tools_p.h" @@ -625,8 +625,7 @@ ReturnedValue Runtime::foreachIterator(ExecutionContext *ctx, const ValueRef in) Scoped o(scope, (Object *)0); if (!in->isNullOrUndefined()) o = in->toObject(ctx); - Scoped it(scope, ctx->engine()->newForEachIteratorObject(ctx, o)); - return it.asReturnedValue(); + return ctx->engine()->newForEachIteratorObject(o)->asReturnedValue(); } ReturnedValue Runtime::foreachNextPropertyName(const ValueRef foreach_iterator) @@ -858,6 +857,25 @@ QV4::Bool Runtime::compareLessEqual(const QV4::ValueRef l, const QV4::ValueRef r } #ifndef V4_BOOTSTRAP +Bool Runtime::compareInstanceof(ExecutionContext *ctx, const ValueRef left, const ValueRef right) +{ + TRACE2(left, right); + + Scope scope(ctx); + ScopedValue v(scope, Runtime::instanceof(ctx, left, right)); + return v->booleanValue(); +} + +uint Runtime::compareIn(ExecutionContext *ctx, const ValueRef left, const ValueRef right) +{ + TRACE2(left, right); + + Scope scope(ctx); + ScopedValue v(scope, Runtime::in(ctx, left, right)); + return v->booleanValue(); +} + + ReturnedValue Runtime::callGlobalLookup(ExecutionContext *context, uint index, CallData *callData) { Scope scope(context); diff --git a/src/qml/jsruntime/qv4runtime_p.h b/src/qml/jsruntime/qv4runtime_p.h index 52a345f..f69ea16 100644 --- a/src/qml/jsruntime/qv4runtime_p.h +++ b/src/qml/jsruntime/qv4runtime_p.h @@ -35,20 +35,11 @@ #include "qv4global_p.h" #include "qv4value_inl_p.h" -#include "qv4math_p.h" -#include "qv4scopedvalue_p.h" #include "qv4context_p.h" +#include "qv4math_p.h" -#include #include -#include -#include -#include -#include -#include - -//#include QT_BEGIN_NAMESPACE @@ -529,27 +520,6 @@ inline Bool Runtime::compareStrictNotEqual(const ValueRef left, const ValueRef r return ! RuntimeHelpers::strictEqual(left, right); } -#ifndef V4_BOOTSTRAP -inline Bool Runtime::compareInstanceof(ExecutionContext *ctx, const ValueRef left, const ValueRef right) -{ - TRACE2(left, right); - - Scope scope(ctx); - ScopedValue v(scope, Runtime::instanceof(ctx, left, right)); - return v->booleanValue(); -} - -inline uint Runtime::compareIn(ExecutionContext *ctx, const ValueRef left, const ValueRef right) -{ - TRACE2(left, right); - - Scope scope(ctx); - ScopedValue v(scope, Runtime::in(ctx, left, right)); - return v->booleanValue(); -} - -#endif // V4_BOOTSTRAP - inline Bool Runtime::toBoolean(const ValueRef value) { return value->toBoolean(); diff --git a/src/qml/jsruntime/qv4scopedvalue_p.h b/src/qml/jsruntime/qv4scopedvalue_p.h index f62dfea..90a3bf1 100644 --- a/src/qml/jsruntime/qv4scopedvalue_p.h +++ b/src/qml/jsruntime/qv4scopedvalue_p.h @@ -36,6 +36,7 @@ #include "qv4engine_p.h" #include "qv4value_p.h" #include "qv4persistent_p.h" +#include "qv4property_p.h" QT_BEGIN_NAMESPACE diff --git a/src/qml/jsruntime/qv4sequenceobject.cpp b/src/qml/jsruntime/qv4sequenceobject.cpp index 7a0a643..462c4b4 100644 --- a/src/qml/jsruntime/qv4sequenceobject.cpp +++ b/src/qml/jsruntime/qv4sequenceobject.cpp @@ -39,7 +39,8 @@ #include #include #include -#include +#include "qv4runtime_p.h" +#include "qv4objectiterator_p.h" #include diff --git a/src/qml/jsruntime/qv4sequenceobject_p.h b/src/qml/jsruntime/qv4sequenceobject_p.h index be348e5..c0848ec 100644 --- a/src/qml/jsruntime/qv4sequenceobject_p.h +++ b/src/qml/jsruntime/qv4sequenceobject_p.h @@ -50,6 +50,7 @@ #include "qv4value_inl_p.h" #include "qv4object_p.h" +#include "qv4context_p.h" QT_BEGIN_NAMESPACE diff --git a/src/qml/jsruntime/qv4string_p.h b/src/qml/jsruntime/qv4string_p.h index ce0e1f9..901a12c 100644 --- a/src/qml/jsruntime/qv4string_p.h +++ b/src/qml/jsruntime/qv4string_p.h @@ -171,20 +171,6 @@ public: static uint toArrayIndex(const QString &str); }; -#ifndef V4_BOOTSTRAP -template<> -inline String *value_cast(const Value &v) { - return v.asString(); -} - -template<> -inline ReturnedValue value_convert(ExecutionEngine *e, const Value &v) -{ - return v.toString(e)->asReturnedValue(); -} - -#endif - } QT_END_NAMESPACE diff --git a/src/qml/jsruntime/qv4value.cpp b/src/qml/jsruntime/qv4value.cpp index 0293054..a80cc40 100644 --- a/src/qml/jsruntime/qv4value.cpp +++ b/src/qml/jsruntime/qv4value.cpp @@ -31,6 +31,7 @@ ** ****************************************************************************/ #include +#include #ifndef V4_BOOTSTRAP #include #include diff --git a/src/qml/jsruntime/qv4value_inl_p.h b/src/qml/jsruntime/qv4value_inl_p.h index 7a6cdb4..2600148 100644 --- a/src/qml/jsruntime/qv4value_inl_p.h +++ b/src/qml/jsruntime/qv4value_inl_p.h @@ -35,18 +35,11 @@ #include // this HAS to come -#include -#include -#include "qv4global_p.h" +#include "qv4value_p.h" + #include "qv4string_p.h" -#include #include "qv4managed_p.h" #include "qv4engine_p.h" -#include - -//#include - -#include "qv4value_p.h" QT_BEGIN_NAMESPACE @@ -70,6 +63,13 @@ inline bool Value::isPrimitive() const return !isObject(); } +inline String *Value::asString() const +{ + if (isString()) + return stringValue(); + return 0; +} + inline ExecutionEngine *Value::engine() const { Managed *m = asManaged(); @@ -275,6 +275,21 @@ inline ErrorObject *Value::asErrorObject() const template inline T *Value::as() const { Managed *m = isObject() ? managed() : 0; return m ? m->as() : 0; } +#ifndef V4_BOOTSTRAP + +template<> +inline String *value_cast(const Value &v) { + return v.asString(); +} + +template<> +inline ReturnedValue value_convert(ExecutionEngine *e, const Value &v) +{ + return v.toString(e)->asReturnedValue(); +} + +#endif + #endif } // namespace QV4 diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h index 2180fbc..bf8367c 100644 --- a/src/qml/jsruntime/qv4value_p.h +++ b/src/qml/jsruntime/qv4value_p.h @@ -381,13 +381,6 @@ inline Managed *Value::asManaged() const return 0; } -inline String *Value::asString() const -{ - if (isString()) - return stringValue(); - return 0; -} - struct Q_QML_PRIVATE_EXPORT Primitive : public Value { inline static Primitive emptyValue(); diff --git a/src/qml/qml/qqmllistwrapper.cpp b/src/qml/qml/qqmllistwrapper.cpp index 13e5e49..b62689c 100644 --- a/src/qml/qml/qqmllistwrapper.cpp +++ b/src/qml/qml/qqmllistwrapper.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp index b26557e..fee1392 100644 --- a/src/qml/types/qqmldelegatemodel.cpp +++ b/src/qml/types/qqmldelegatemodel.cpp @@ -46,6 +46,7 @@ #include #include +#include QT_BEGIN_NAMESPACE diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index 019d679..30a0118 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #ifdef Q_CC_MSVC #define NO_INLINE __declspec(noinline)