class QScriptOriginalGlobalObject
{
public:
- inline QScriptOriginalGlobalObject(v8::Handle<v8::Context> context);
+ inline QScriptOriginalGlobalObject() {}
+ inline void init(v8::Handle<v8::Context> context);
inline void destroy();
inline QJSValue::PropertyFlags getPropertyFlags(v8::Handle<v8::Object> object, v8::Handle<v8::Value> property);
v8::Persistent<v8::Object> m_globalObject;
};
-QScriptOriginalGlobalObject::QScriptOriginalGlobalObject(v8::Handle<v8::Context> context)
+void QScriptOriginalGlobalObject::init(v8::Handle<v8::Context> context)
{
// Please notice that engine is not fully initialized at this point.
: q(qq)
, m_engine(0)
, m_ownsV8Context(ownership == QJSEngine::CreateNewContext)
- , m_context((ownership == QJSEngine::CreateNewContext) ? v8::Context::New() : v8::Persistent<v8::Context>::New(v8::Context::GetCurrent()))
- , m_originalGlobalObject(m_context)
, m_xmlHttpRequestData(0)
, m_sqlDatabaseData(0)
, m_listModelData(0)
v8::V8::SetFlagsFromString(v8args.constData(), v8args.length());
v8::HandleScope handle_scope;
+ m_context = (ownership == QJSEngine::CreateNewContext) ? v8::Context::New() : v8::Persistent<v8::Context>::New(v8::Context::GetCurrent());
qPersistentRegister(m_context);
+ m_originalGlobalObject.init(m_context);
v8::Context::Scope context_scope(m_context);
v8::V8::SetUserObjectComparisonCallbackFunction(ObjectComparisonCallback);