summaryrefslogtreecommitdiffstats
path: root/src/script/api/qscriptvalue.cpp
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-08-24 14:07:35 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-08-24 14:08:17 (GMT)
commitba75712e86792730762677db5e53ec5e5aebca7f (patch)
tree66f5cd85f2839f8b2bd0ffdb033ac4973e3b75d0 /src/script/api/qscriptvalue.cpp
parentdc3e85a9c3dd45c23a84bcd8ee5ee1df6c4f4337 (diff)
downloadQt-ba75712e86792730762677db5e53ec5e5aebca7f.zip
Qt-ba75712e86792730762677db5e53ec5e5aebca7f.tar.gz
Qt-ba75712e86792730762677db5e53ec5e5aebca7f.tar.bz2
pass engine pointer to QScriptValuePrivate
Just a little cleanup.
Diffstat (limited to 'src/script/api/qscriptvalue.cpp')
-rw-r--r--src/script/api/qscriptvalue.cpp48
1 files changed, 17 insertions, 31 deletions
diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp
index 4b92049..21aebd0 100644
--- a/src/script/api/qscriptvalue.cpp
+++ b/src/script/api/qscriptvalue.cpp
@@ -276,7 +276,8 @@ qsreal ToInteger(qsreal n)
} // namespace QScript
-QScriptValuePrivate::QScriptValuePrivate() : engine(0), prev(0), next(0)
+QScriptValuePrivate::QScriptValuePrivate(QScriptEnginePrivate *e)
+ : engine(e), prev(0), next(0)
{
ref = 0;
}
@@ -456,9 +457,8 @@ QScriptValue::QScriptValue(const QScriptValue &other)
registers it with the script \a engine.
*/
QScriptValue::QScriptValue(QScriptEngine *engine, QScriptValue::SpecialValue value)
- : d_ptr(new (QScriptEnginePrivate::get(engine))QScriptValuePrivate)
+ : d_ptr(new (QScriptEnginePrivate::get(engine))QScriptValuePrivate(QScriptEnginePrivate::get(engine)))
{
- d_ptr->engine = QScriptEnginePrivate::get(engine);
switch (value) {
case NullValue:
d_ptr->initFrom(JSC::jsNull());
@@ -478,9 +478,8 @@ QScriptValue::QScriptValue(QScriptEngine *engine, QScriptValue::SpecialValue val
registers it with the script \a engine.
*/
QScriptValue::QScriptValue(QScriptEngine *engine, bool val)
- : d_ptr(new (QScriptEnginePrivate::get(engine))QScriptValuePrivate)
+ : d_ptr(new (QScriptEnginePrivate::get(engine))QScriptValuePrivate(QScriptEnginePrivate::get(engine)))
{
- d_ptr->engine = QScriptEnginePrivate::get(engine);
d_ptr->initFrom(JSC::jsBoolean(val));
}
@@ -492,9 +491,8 @@ QScriptValue::QScriptValue(QScriptEngine *engine, bool val)
registers it with the script \a engine.
*/
QScriptValue::QScriptValue(QScriptEngine *engine, int val)
- : d_ptr(new (QScriptEnginePrivate::get(engine))QScriptValuePrivate)
+ : d_ptr(new (QScriptEnginePrivate::get(engine))QScriptValuePrivate(QScriptEnginePrivate::get(engine)))
{
- d_ptr->engine = QScriptEnginePrivate::get(engine);
if (engine) {
JSC::ExecState *exec = d_ptr->engine->currentFrame;
d_ptr->initFrom(JSC::jsNumber(exec, val));
@@ -515,9 +513,8 @@ QScriptValue::QScriptValue(QScriptEngine *engine, int val)
registers it with the script \a engine.
*/
QScriptValue::QScriptValue(QScriptEngine *engine, uint val)
- : d_ptr(new (QScriptEnginePrivate::get(engine))QScriptValuePrivate)
+ : d_ptr(new (QScriptEnginePrivate::get(engine))QScriptValuePrivate(QScriptEnginePrivate::get(engine)))
{
- d_ptr->engine = QScriptEnginePrivate::get(engine);
if (engine) {
JSC::ExecState *exec = d_ptr->engine->currentFrame;
d_ptr->initFrom(JSC::jsNumber(exec, val));
@@ -538,9 +535,8 @@ QScriptValue::QScriptValue(QScriptEngine *engine, uint val)
registers it with the script \a engine.
*/
QScriptValue::QScriptValue(QScriptEngine *engine, qsreal val)
- : d_ptr(new (QScriptEnginePrivate::get(engine))QScriptValuePrivate)
+ : d_ptr(new (QScriptEnginePrivate::get(engine))QScriptValuePrivate(QScriptEnginePrivate::get(engine)))
{
- d_ptr->engine = QScriptEnginePrivate::get(engine);
if (engine) {
JSC::ExecState *exec = d_ptr->engine->currentFrame;
d_ptr->initFrom(JSC::jsNumber(exec, val));
@@ -561,9 +557,8 @@ QScriptValue::QScriptValue(QScriptEngine *engine, qsreal val)
registers it with the script \a engine.
*/
QScriptValue::QScriptValue(QScriptEngine *engine, const QString &val)
- : d_ptr(new (QScriptEnginePrivate::get(engine))QScriptValuePrivate)
+ : d_ptr(new (QScriptEnginePrivate::get(engine))QScriptValuePrivate(QScriptEnginePrivate::get(engine)))
{
- d_ptr->engine = QScriptEnginePrivate::get(engine);
if (engine) {
JSC::ExecState *exec = d_ptr->engine->currentFrame;
d_ptr->initFrom(JSC::jsString(exec, val));
@@ -582,9 +577,8 @@ QScriptValue::QScriptValue(QScriptEngine *engine, const QString &val)
#ifndef QT_NO_CAST_FROM_ASCII
QScriptValue::QScriptValue(QScriptEngine *engine, const char *val)
- : d_ptr(new (QScriptEnginePrivate::get(engine))QScriptValuePrivate)
+ : d_ptr(new (QScriptEnginePrivate::get(engine))QScriptValuePrivate(QScriptEnginePrivate::get(engine)))
{
- d_ptr->engine = QScriptEnginePrivate::get(engine);
if (engine) {
JSC::ExecState *exec = d_ptr->engine->currentFrame;
d_ptr->initFrom(JSC::jsString(exec, val));
@@ -600,9 +594,8 @@ QScriptValue::QScriptValue(QScriptEngine *engine, const char *val)
Constructs a new QScriptValue with a special \a value.
*/
QScriptValue::QScriptValue(SpecialValue value)
- : d_ptr(new (/*engine=*/0)QScriptValuePrivate)
+ : d_ptr(new (/*engine=*/0)QScriptValuePrivate(/*engine=*/0))
{
- d_ptr->engine = 0;
switch (value) {
case NullValue:
d_ptr->initFrom(JSC::jsNull());
@@ -619,9 +612,8 @@ QScriptValue::QScriptValue(SpecialValue value)
Constructs a new QScriptValue with a boolean \a value.
*/
QScriptValue::QScriptValue(bool value)
- : d_ptr(new (/*engine=*/0)QScriptValuePrivate)
+ : d_ptr(new (/*engine=*/0)QScriptValuePrivate(/*engine=*/0))
{
- d_ptr->engine = 0;
d_ptr->initFrom(JSC::jsBoolean(value));
}
@@ -631,9 +623,8 @@ QScriptValue::QScriptValue(bool value)
Constructs a new QScriptValue with a number \a value.
*/
QScriptValue::QScriptValue(int value)
- : d_ptr(new (/*engine=*/0)QScriptValuePrivate)
+ : d_ptr(new (/*engine=*/0)QScriptValuePrivate(/*engine=*/0))
{
- d_ptr->engine = 0;
JSC::JSValue immediate = JSC::JSImmediate::from(value);
if (immediate)
d_ptr->initFrom(immediate);
@@ -647,9 +638,8 @@ QScriptValue::QScriptValue(int value)
Constructs a new QScriptValue with a number \a value.
*/
QScriptValue::QScriptValue(uint value)
- : d_ptr(new (/*engine=*/0)QScriptValuePrivate)
+ : d_ptr(new (/*engine=*/0)QScriptValuePrivate(/*engine=*/0))
{
- d_ptr->engine = 0;
JSC::JSValue immediate = JSC::JSImmediate::from(value);
if (immediate)
d_ptr->initFrom(immediate);
@@ -663,9 +653,8 @@ QScriptValue::QScriptValue(uint value)
Constructs a new QScriptValue with a number \a value.
*/
QScriptValue::QScriptValue(qsreal value)
- : d_ptr(new (/*engine=*/0)QScriptValuePrivate)
+ : d_ptr(new (/*engine=*/0)QScriptValuePrivate(/*engine=*/0))
{
- d_ptr->engine = 0;
JSC::JSValue immediate = JSC::JSImmediate::from(value);
if (immediate)
d_ptr->initFrom(immediate);
@@ -679,9 +668,8 @@ QScriptValue::QScriptValue(qsreal value)
Constructs a new QScriptValue with a string \a value.
*/
QScriptValue::QScriptValue(const QString &value)
- : d_ptr(new (/*engine=*/0)QScriptValuePrivate)
+ : d_ptr(new (/*engine=*/0)QScriptValuePrivate(/*engine=*/0))
{
- d_ptr->engine = 0;
d_ptr->initFrom(value);
}
@@ -691,9 +679,8 @@ QScriptValue::QScriptValue(const QString &value)
Constructs a new QScriptValue with a string \a value.
*/
QScriptValue::QScriptValue(const QLatin1String &value)
- : d_ptr(new (/*engine=*/0)QScriptValuePrivate)
+ : d_ptr(new (/*engine=*/0)QScriptValuePrivate(/*engine=*/0))
{
- d_ptr->engine = 0;
d_ptr->initFrom(value);
}
@@ -705,9 +692,8 @@ QScriptValue::QScriptValue(const QLatin1String &value)
#ifndef QT_NO_CAST_FROM_ASCII
QScriptValue::QScriptValue(const char *value)
- : d_ptr(new (/*engine=*/0)QScriptValuePrivate)
+ : d_ptr(new (/*engine=*/0)QScriptValuePrivate(/*engine=*/0))
{
- d_ptr->engine = 0;
d_ptr->initFrom(QString::fromAscii(value));
}
#endif