diff options
author | Matthew Vogt <matthew.vogt@nokia.com> | 2012-03-05 11:39:24 +1000 |
---|---|---|
committer | Matthew Vogt <matthew.vogt@nokia.com> | 2012-03-05 11:39:54 +1000 |
commit | 0284817d6cd7e17afa8da26ee6e9199100754446 (patch) | |
tree | c351d55d5a606c81c72e481f846b9b9e2603c883 /src/qml/qml/v8/qv8engine.cpp | |
parent | 377eb94eb19dafeca20d12bc6b624f1779fae514 (diff) | |
parent | 36bd7f616f37f5f60e59bce1f0d8970248d627de (diff) |
Merge master <-> api_changes
Change-Id: Iad2f07b989b25349fd2d4fff010e24dcd5a1688f
Diffstat (limited to 'src/qml/qml/v8/qv8engine.cpp')
-rw-r--r-- | src/qml/qml/v8/qv8engine.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/qml/qml/v8/qv8engine.cpp b/src/qml/qml/v8/qv8engine.cpp index 4c2cce1525..8e8223fea1 100644 --- a/src/qml/qml/v8/qv8engine.cpp +++ b/src/qml/qml/v8/qv8engine.cpp @@ -75,12 +75,14 @@ static bool ObjectComparisonCallback(v8::Local<v8::Object> lhs, v8::Local<v8::Ob if (lhs == rhs) return true; + if (lhs.IsEmpty() || rhs.IsEmpty()) + return false; + QV8ObjectResource *lhsr = static_cast<QV8ObjectResource*>(lhs->GetExternalResource()); QV8ObjectResource *rhsr = static_cast<QV8ObjectResource*>(rhs->GetExternalResource()); - Q_ASSERT(lhsr->engine == rhsr->engine); - if (lhsr && rhsr) { + Q_ASSERT(lhsr->engine == rhsr->engine); QV8ObjectResource::ResourceType lhst = lhsr->resourceType(); QV8ObjectResource::ResourceType rhst = rhsr->resourceType(); @@ -874,7 +876,7 @@ void QV8Engine::ensurePerThreadIsolate() perThreadEngineData.setLocalData(new ThreadData); } -void QV8Engine::initDeclarativeGlobalObject() +void QV8Engine::initQmlGlobalObject() { v8::HandleScope handels; v8::Context::Scope contextScope(m_context); @@ -885,7 +887,7 @@ void QV8Engine::initDeclarativeGlobalObject() void QV8Engine::setEngine(QQmlEngine *engine) { m_engine = engine; - initDeclarativeGlobalObject(); + initQmlGlobalObject(); } void QV8Engine::setException(v8::Handle<v8::Value> value, v8::Handle<v8::Message> msg) |