summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptvalue.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/api/qscriptvalue.cpp')
-rw-r--r--src/script/api/qscriptvalue.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp
index 5ace14d..59e6729 100644
--- a/src/script/api/qscriptvalue.cpp
+++ b/src/script/api/qscriptvalue.cpp
@@ -276,19 +276,20 @@ QScriptValuePrivate::QScriptValueAutoRegister& QScriptValuePrivate::QScriptValue
return *this;
};
-
void QScriptValuePrivate::initFromJSCValue(JSC::JSValue value)
{
- type = JSC;
- jscValue = value;
if (value.isCell()) {
- JSC::JSCell *cell = value.asCell();
Q_ASSERT(engine != 0);
QScriptEnginePrivate *eng_p = QScriptEnginePrivate::get(engine);
+ value = eng_p->toUsableValue(value);
+ JSC::JSCell *cell = JSC::asCell(value);
+ Q_ASSERT(cell != eng_p->originalGlobalObject());
if (!eng_p->keepAliveValues.contains(cell))
eng_p->keepAliveValues[cell] = 0;
eng_p->keepAliveValues[cell].ref();
}
+ type = JSC;
+ jscValue = value;
}
void QScriptValuePrivate::initFromNumber(double value)