summaryrefslogtreecommitdiffstats
path: root/src/script/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/api')
-rw-r--r--src/script/api/qscriptengine.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index e020c93..702851a 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -2210,6 +2210,7 @@ QScriptValue QScriptEngine::create(int type, const void *ptr)
QScriptValue QScriptEnginePrivate::create(int type, const void *ptr)
{
+ Q_Q(QScriptEngine);
Q_ASSERT(ptr != 0);
QScriptValue result;
QScriptTypeInfo *info = m_typeInfos.value(type);
@@ -2323,8 +2324,10 @@ QScriptValue QScriptEnginePrivate::create(int type, const void *ptr)
}
}
}
- if (result.isObject() && info && info->prototype)
+ if (result.isObject() && info && info->prototype
+ && result.prototype().strictlyEquals(q->globalObject().property(QLatin1String("prototype")))) {
result.setPrototype(scriptValueFromJSCValue(info->prototype));
+ }
return result;
}