diff options
Diffstat (limited to 'src/script/api/qscriptvalue.cpp')
-rw-r--r-- | src/script/api/qscriptvalue.cpp | 45 |
1 files changed, 9 insertions, 36 deletions
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp index 1d73a8f..a1f5878 100644 --- a/src/script/api/qscriptvalue.cpp +++ b/src/script/api/qscriptvalue.cpp @@ -560,13 +560,8 @@ QScriptValue::QScriptValue(QScriptEngine *engine, int val) if (engine) { JSC::ExecState *exec = d_ptr->engine->currentFrame; d_ptr->initFrom(JSC::jsNumber(exec, val)); - } else { - JSC::JSValue immediate = JSC::JSImmediate::from(val); - if (immediate) - d_ptr->initFrom(immediate); - else - d_ptr->initFrom(val); - } + } else + d_ptr->initFrom(val); } /*! @@ -582,13 +577,8 @@ QScriptValue::QScriptValue(QScriptEngine *engine, uint val) if (engine) { JSC::ExecState *exec = d_ptr->engine->currentFrame; d_ptr->initFrom(JSC::jsNumber(exec, val)); - } else { - JSC::JSValue immediate = JSC::JSImmediate::from(val); - if (immediate) - d_ptr->initFrom(immediate); - else - d_ptr->initFrom(val); - } + } else + d_ptr->initFrom(val); } /*! @@ -604,13 +594,8 @@ QScriptValue::QScriptValue(QScriptEngine *engine, qsreal val) if (engine) { JSC::ExecState *exec = d_ptr->engine->currentFrame; d_ptr->initFrom(JSC::jsNumber(exec, val)); - } else { - JSC::JSValue immediate = JSC::JSImmediate::from(val); - if (immediate) - d_ptr->initFrom(immediate); - else - d_ptr->initFrom(val); - } + } else + d_ptr->initFrom(val); } /*! @@ -689,11 +674,7 @@ QScriptValue::QScriptValue(bool value) QScriptValue::QScriptValue(int value) : d_ptr(new (/*engine=*/0)QScriptValuePrivate(/*engine=*/0)) { - JSC::JSValue immediate = JSC::JSImmediate::from(value); - if (immediate) - d_ptr->initFrom(immediate); - else - d_ptr->initFrom(value); + d_ptr->initFrom(value); } /*! @@ -704,11 +685,7 @@ QScriptValue::QScriptValue(int value) QScriptValue::QScriptValue(uint value) : d_ptr(new (/*engine=*/0)QScriptValuePrivate(/*engine=*/0)) { - JSC::JSValue immediate = JSC::JSImmediate::from(value); - if (immediate) - d_ptr->initFrom(immediate); - else - d_ptr->initFrom(value); + d_ptr->initFrom(value); } /*! @@ -719,11 +696,7 @@ QScriptValue::QScriptValue(uint value) QScriptValue::QScriptValue(qsreal value) : d_ptr(new (/*engine=*/0)QScriptValuePrivate(/*engine=*/0)) { - JSC::JSValue immediate = JSC::JSImmediate::from(value); - if (immediate) - d_ptr->initFrom(immediate); - else - d_ptr->initFrom(value); + d_ptr->initFrom(value); } /*! |