diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-03-30 06:37:28 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-03-30 06:38:04 (GMT) |
commit | b9b305f6c7bc960101bfd883ca6e3df889483481 (patch) | |
tree | 2e7decae370a45b8c9123a2b48b47e3bb0ca232d /src/script | |
parent | 1190f901cbcc62ab50c66bf0a7c41bfba923da7f (diff) | |
download | Qt-b9b305f6c7bc960101bfd883ca6e3df889483481.zip Qt-b9b305f6c7bc960101bfd883ca6e3df889483481.tar.gz Qt-b9b305f6c7bc960101bfd883ca6e3df889483481.tar.bz2 |
Correctly construct boolean JSValue's
Task-number: QTBUG-9205
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/bridge/qscriptdeclarativeclass.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/script/bridge/qscriptdeclarativeclass.cpp b/src/script/bridge/qscriptdeclarativeclass.cpp index acfb2a4..0f450ca 100644 --- a/src/script/bridge/qscriptdeclarativeclass.cpp +++ b/src/script/bridge/qscriptdeclarativeclass.cpp @@ -70,9 +70,12 @@ QScriptDeclarativeClass::Value::Value(QScriptContext *ctxt, uint value) new (this) JSC::JSValue(QScriptEnginePrivate::frameForContext(ctxt), value); } -QScriptDeclarativeClass::Value::Value(QScriptContext *ctxt, bool value) +QScriptDeclarativeClass::Value::Value(QScriptContext *, bool value) { - new (this) JSC::JSValue(QScriptEnginePrivate::frameForContext(ctxt), value); + if (value) + new (this) JSC::JSValue(JSC::JSValue::JSTrue); + else + new (this) JSC::JSValue(JSC::JSValue::JSFalse); } QScriptDeclarativeClass::Value::Value(QScriptContext *ctxt, double value) @@ -107,7 +110,10 @@ QScriptDeclarativeClass::Value::Value(QScriptEngine *eng, uint value) QScriptDeclarativeClass::Value::Value(QScriptEngine *eng, bool value) { - new (this) JSC::JSValue(QScriptEnginePrivate::get(eng)->currentFrame, value); + if (value) + new (this) JSC::JSValue(JSC::JSValue::JSTrue); + else + new (this) JSC::JSValue(JSC::JSValue::JSFalse); } QScriptDeclarativeClass::Value::Value(QScriptEngine *eng, double value) |