Cleanup header file dependencies
authorLars Knoll <lars.knoll@digia.com>
Fri, 25 Jul 2014 15:44:14 +0000 (17:44 +0200)
committerSimon Hausmann <simon.hausmann@digia.com>
Tue, 4 Nov 2014 19:17:23 +0000 (20:17 +0100)
Change-Id: Ibb4658576a98b53de2eac2474ce4d5b9eb83b6ae
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
35 files changed:
src/imports/localstorage/plugin.cpp
src/qml/jsapi/qjsvalueiterator.cpp
src/qml/jsruntime/qv4arraydata.cpp
src/qml/jsruntime/qv4arrayobject.cpp
src/qml/jsruntime/qv4context_p.h
src/qml/jsruntime/qv4dateobject.cpp
src/qml/jsruntime/qv4debugging.cpp
src/qml/jsruntime/qv4engine.cpp
src/qml/jsruntime/qv4engine_p.h
src/qml/jsruntime/qv4function_p.h
src/qml/jsruntime/qv4functionobject.cpp
src/qml/jsruntime/qv4functionobject_p.h
src/qml/jsruntime/qv4global_p.h
src/qml/jsruntime/qv4internalclass_p.h
src/qml/jsruntime/qv4jsonobject.cpp
src/qml/jsruntime/qv4managed_p.h
src/qml/jsruntime/qv4mm_p.h
src/qml/jsruntime/qv4numberobject.cpp
src/qml/jsruntime/qv4object.cpp
src/qml/jsruntime/qv4object_p.h
src/qml/jsruntime/qv4objectiterator_p.h
src/qml/jsruntime/qv4objectproto.cpp
src/qml/jsruntime/qv4property_p.h
src/qml/jsruntime/qv4runtime.cpp
src/qml/jsruntime/qv4runtime_p.h
src/qml/jsruntime/qv4scopedvalue_p.h
src/qml/jsruntime/qv4sequenceobject.cpp
src/qml/jsruntime/qv4sequenceobject_p.h
src/qml/jsruntime/qv4string_p.h
src/qml/jsruntime/qv4value.cpp
src/qml/jsruntime/qv4value_inl_p.h
src/qml/jsruntime/qv4value_p.h
src/qml/qml/qqmllistwrapper.cpp
src/qml/types/qqmldelegatemodel.cpp
tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp

index 78c1905..02dc1a5 100644 (file)
@@ -52,6 +52,7 @@
 #include <private/qv4functionobject_p.h>
 #include <private/qv4objectproto_p.h>
 #include <private/qv4scopedvalue_p.h>
+#include <private/qv4objectiterator_p.h>
 
 using namespace QV4;
 
index f7976e7..cc6953c 100644 (file)
@@ -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<QV4::ForEachIteratorObject> it(scope, d_ptr->iterator.value());
     it->d()->it.flags =  QV4::ObjectIterator::NoFlags;
     QV4::String *nm = 0;
index 35bd6e5..4c8c172 100644 (file)
@@ -34,6 +34,7 @@
 #include "qv4object_p.h"
 #include "qv4functionobject_p.h"
 #include "qv4mm_p.h"
+#include "qv4runtime_p.h"
 
 using namespace QV4;
 
index 011279a..1d17672 100644 (file)
@@ -35,6 +35,7 @@
 #include "qv4sparsearray_p.h"
 #include "qv4objectproto_p.h"
 #include "qv4scopedvalue_p.h"
+#include "qv4runtime_p.h"
 
 using namespace QV4;
 
index b4c78c3..5235b65 100644 (file)
@@ -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;
 
index e00a705..c8bd73d 100644 (file)
@@ -35,6 +35,8 @@
 #include "qv4dateobject_p.h"
 #include "qv4objectproto_p.h"
 #include "qv4scopedvalue_p.h"
+#include "qv4runtime_p.h"
+
 #include <QtCore/qnumeric.h>
 #include <QtCore/qmath.h>
 #include <QtCore/QDateTime>
index bcf0d07..c001b60 100644 (file)
@@ -38,6 +38,7 @@
 #include "qv4instr_moth_p.h"
 #include "qv4runtime_p.h"
 #include "qv4script_p.h"
+#include "qv4objectiterator_p.h"
 #include <iostream>
 
 #include <algorithm>
index 3e7421a..42cd860 100644 (file)
@@ -700,10 +700,10 @@ Returned<Object> *ExecutionEngine::newVariantObject(const QVariant &v)
     return o->asReturned<Object>();
 }
 
-Returned<Object> *ExecutionEngine::newForEachIteratorObject(ExecutionContext *ctx, Object *o)
+Returned<Object> *ExecutionEngine::newForEachIteratorObject(Object *o)
 {
     Scope scope(this);
-    ScopedObject obj(scope, memoryManager->alloc<ForEachIteratorObject>(ctx, o));
+    ScopedObject obj(scope, memoryManager->alloc<ForEachIteratorObject>(this, o));
     return obj->asReturned<Object>();
 }
 
index c77c5b1..6c9b90c 100644 (file)
@@ -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 <private/qintrusivelist_p.h>
 
 namespace WTF {
@@ -341,7 +340,7 @@ public:
 
     Returned<Object> *newVariantObject(const QVariant &v);
 
-    Returned<Object> *newForEachIteratorObject(ExecutionContext *ctx, Object *o);
+    Returned<Object> *newForEachIteratorObject(Object *o);
 
     Returned<Object> *qmlContextObject() const;
 
index b2c4d2e..63bbb01 100644 (file)
 #define QV4FUNCTION_H
 
 #include "qv4global_p.h"
-
-#include <QtCore/QVector>
-#include <QtCore/QByteArray>
-#include <QtCore/qurl.h>
-
-#include "qv4value_p.h"
 #include <private/qv4compileddata_p.h>
-#include <private/qv4engine_p.h>
 
 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;
index 275b1c0..49a560d 100644 (file)
 #include <private/qqmljsast_p.h>
 #include <private/qqmlcontextwrapper_p.h>
 #include <private/qqmlengine_p.h>
-#include <qv4jsir_p.h>
 #include <qv4codegen_p.h>
 #include "private/qlocale_tools_p.h"
 
 #include <QtCore/qmath.h>
 #include <QtCore/QDebug>
-#include <cassert>
-#include <typeinfo>
-#include <iostream>
 #include <algorithm>
 #include "qv4alloca_p.h"
 #include "qv4profiling_p.h"
index 2d57f6c..32fa2e0 100644 (file)
 #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 <QtCore/QString>
-#include <QtCore/QHash>
-#include <QtCore/QScopedPointer>
-#include <cstdio>
-#include <cassert>
-
 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);
index 81f1240..f265ed5 100644 (file)
@@ -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<typename T> struct Scoped;
index 06feea1..972c341 100644 (file)
@@ -33,9 +33,9 @@
 #ifndef QV4INTERNALCLASS_H
 #define QV4INTERNALCLASS_H
 
-#include <QHash>
-#include <QVector>
 #include "qv4global_p.h"
+
+#include <QHash>
 #include <private/qqmljsmemorypool_p.h>
 
 QT_BEGIN_NAMESPACE
index 268559d..fc5fb6a 100644 (file)
@@ -37,6 +37,8 @@
 #include <qv4booleanobject_p.h>
 #include <qv4objectiterator_p.h>
 #include <qv4scopedvalue_p.h>
+#include <qv4runtime_p.h>
+
 #include <qjsondocument.h>
 #include <qstack.h>
 #include <qstringlist.h>
index c69eace..e382ad2 100644 (file)
@@ -33,9 +33,6 @@
 #ifndef QMLJS_MANAGED_H
 #define QMLJS_MANAGED_H
 
-#include <QtCore/QString>
-#include <QtCore/QVector>
-#include <QtCore/QDebug>
 #include "qv4global_p.h"
 #include "qv4value_p.h"
 #include "qv4internalclass_p.h"
index cf9a148..f2267e5 100644 (file)
 #define QV4GC_H
 
 #include "qv4global_p.h"
-#include "qv4context_p.h"
 #include "qv4value_inl_p.h"
-
-#include <QScopedPointer>
+#include "qv4scopedvalue_p.h"
 
 //#define DETAILED_MM_STATS
 
index 227ff14..9f9c55d 100644 (file)
@@ -32,6 +32,8 @@
 ****************************************************************************/
 
 #include "qv4numberobject_p.h"
+#include "qv4runtime_p.h"
+
 #include <QtCore/qnumeric.h>
 #include <QtCore/qmath.h>
 #include <QtCore/QDebug>
index 0c61d66..b70a18f 100644 (file)
 #include "qv4lookup_p.h"
 #include "qv4scopedvalue_p.h"
 #include "qv4memberdata_p.h"
+#include "qv4objectiterator_p.h"
 
-#include <private/qqmljsengine_p.h>
-#include <private/qqmljslexer_p.h>
-#include <private/qqmljsparser_p.h>
-#include <private/qqmljsast_p.h>
-#include <qv4jsir_p.h>
-#include <qv4codegen_p.h>
-#include "private/qlocale_tools_p.h"
-
-#include <QtCore/qmath.h>
-#include <QtCore/QDebug>
-#include <cassert>
-#include <typeinfo>
-#include <iostream>
 #include <stdint.h>
-#include "qv4alloca_p.h"
 
 using namespace QV4;
 
index 4e9d152..d57d1bf 100644 (file)
 ** $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 <QtCore/QString>
-#include <QtCore/QHash>
-#include <QtCore/QScopedPointer>
-#include <cstdio>
-#include <cassert>
-
-#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)
index 3ed73b5..24efd7e 100644 (file)
 #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());
         }
index 9cbf4b2..d448d21 100644 (file)
 #include "qv4argumentsobject_p.h"
 #include "qv4mm_p.h"
 #include "qv4scopedvalue_p.h"
+#include "qv4runtime_p.h"
+#include "qv4objectiterator_p.h"
+
 #include <QtCore/qnumeric.h>
 #include <QtCore/qmath.h>
 #include <QtCore/QDateTime>
 #include <QtCore/QStringList>
-#include <QtCore/QDebug>
-#include <cassert>
-
-#include <private/qqmljsengine_p.h>
-#include <private/qqmljslexer_p.h>
-#include <private/qqmljsparser_p.h>
-#include <private/qqmljsast_p.h>
-#include <qv4jsir_p.h>
-#include <qv4codegen_p.h>
-
-#ifndef Q_OS_WIN
-#  include <time.h>
-#  ifndef Q_OS_VXWORKS
-#    include <sys/time.h>
-#  else
-#    include "qplatformdefs.h"
-#  endif
-#else
-#  include <windows.h>
-#endif
 
 using namespace QV4;
 
index f9b3159..601e344 100644 (file)
@@ -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
index 54b42c5..fbf5ba1 100644 (file)
 #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<Object> o(scope, (Object *)0);
     if (!in->isNullOrUndefined())
         o = in->toObject(ctx);
-    Scoped<Object> 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);
index 52a345f..f69ea16 100644 (file)
 
 #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 <QtCore/QString>
 #include <QtCore/qnumeric.h>
-#include <QtCore/QDebug>
-#include <QtCore/qurl.h>
 
-#include <cmath>
-#include <cassert>
-#include <limits>
-
-//#include <wtf/MathExtras.h>
 
 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();
index f62dfea..90a3bf1 100644 (file)
@@ -36,6 +36,7 @@
 #include "qv4engine_p.h"
 #include "qv4value_p.h"
 #include "qv4persistent_p.h"
+#include "qv4property_p.h"
 
 QT_BEGIN_NAMESPACE
 
index 7a0a643..462c4b4 100644 (file)
@@ -39,7 +39,8 @@
 #include <private/qv4arrayobject_p.h>
 #include <private/qqmlengine_p.h>
 #include <private/qv4scopedvalue_p.h>
-#include <private/qv4internalclass_p.h>
+#include "qv4runtime_p.h"
+#include "qv4objectiterator_p.h"
 
 #include <algorithm>
 
index be348e5..c0848ec 100644 (file)
@@ -50,6 +50,7 @@
 
 #include "qv4value_inl_p.h"
 #include "qv4object_p.h"
+#include "qv4context_p.h"
 
 QT_BEGIN_NAMESPACE
 
index ce0e1f9..901a12c 100644 (file)
@@ -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<String>(ExecutionEngine *e, const Value &v)
-{
-    return v.toString(e)->asReturnedValue();
-}
-
-#endif
-
 }
 
 QT_END_NAMESPACE
index 0293054..a80cc40 100644 (file)
@@ -31,6 +31,7 @@
 **
 ****************************************************************************/
 #include <qv4engine_p.h>
+#include <qv4runtime_p.h>
 #ifndef V4_BOOTSTRAP
 #include <qv4object_p.h>
 #include <qv4objectproto_p.h>
index 7a6cdb4..2600148 100644 (file)
 
 #include <cmath> // this HAS to come
 
-#include <QtCore/QString>
-#include <QtCore/qnumeric.h>
-#include "qv4global_p.h"
+#include "qv4value_p.h"
+
 #include "qv4string_p.h"
-#include <QtCore/QDebug>
 #include "qv4managed_p.h"
 #include "qv4engine_p.h"
-#include <private/qtqmlglobal_p.h>
-
-//#include <wtf/MathExtras.h>
-
-#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<typename T>
 inline T *Value::as() const { Managed *m = isObject() ? managed() : 0; return m ? m->as<T>() : 0; }
 
+#ifndef V4_BOOTSTRAP
+
+template<>
+inline String *value_cast(const Value &v) {
+    return v.asString();
+}
+
+template<>
+inline ReturnedValue value_convert<String>(ExecutionEngine *e, const Value &v)
+{
+    return v.toString(e)->asReturnedValue();
+}
+
+#endif
+
 #endif
 
 } // namespace QV4
index 2180fbc..bf8367c 100644 (file)
@@ -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();
index 13e5e49..b62689c 100644 (file)
@@ -35,6 +35,7 @@
 #include <private/qv8engine_p.h>
 #include <private/qqmllist_p.h>
 #include <private/qv4objectproto_p.h>
+#include <qv4objectiterator_p.h>
 
 #include <private/qv4functionobject_p.h>
 
index b26557e..fee1392 100644 (file)
@@ -46,6 +46,7 @@
 
 #include <private/qv4value_inl_p.h>
 #include <private/qv4functionobject_p.h>
+#include <qv4objectiterator_p.h>
 
 QT_BEGIN_NAMESPACE
 
index 019d679..30a0118 100644 (file)
@@ -48,6 +48,7 @@
 #include <private/qv4functionobject_p.h>
 #include <private/qv4scopedvalue_p.h>
 #include <private/qv4alloca_p.h>
+#include <private/qv4runtime_p.h>
 
 #ifdef Q_CC_MSVC
 #define NO_INLINE __declspec(noinline)